瀏覽代碼

抠图图片不能是PNG

rambo 4 月之前
父節點
當前提交
03b8f3be3c
共有 1 個文件被更改,包括 1 次插入1 次删除
  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"]: