Forráskód Böngészése

抠图图片不能是PNG

rambo 4 hónapja
szülő
commit
03b8f3be3c
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      python/service/OnePicTest.py

+ 1 - 1
python/service/OnePicTest.py

@@ -91,7 +91,7 @@ class OnePicTest():
         if not os.path.exists(self.pic_path):
             raise UnicornException("图片不存在")
         image_pth = Image.open(self.pic_path)
-        if image_pth.mode != "RGB":
+        if image_pth.mode == "RGBA":
             raise UnicornException("抠图图片不能是PNG")
         return_data = self.deal_image(self.pic_path)
         # if return_data["message"]: