|
|
@@ -16,7 +16,7 @@ import math
|
|
|
|
|
|
def disposeWH(image: Image, base_size=1024):
|
|
|
width, height = image.size
|
|
|
- scale_width = int(width)
|
|
|
+ scale_width = int(width)
|
|
|
scale_height = int(height)
|
|
|
scale_rate = scale_width / scale_height
|
|
|
if scale_width > base_size:
|
|
|
@@ -199,7 +199,7 @@ class DealOneImage(Base):
|
|
|
),
|
|
|
)
|
|
|
if self.windows.output_type == 1:
|
|
|
- print("处理白底","ssssss")
|
|
|
+ print("处理白底", "ssssss")
|
|
|
background = Image.new("RGBA", _img_im.size, (255, 255, 255, 255))
|
|
|
_img_im = Image.alpha_composite(background, _img_im)
|
|
|
resize_width, resize_height = disposeWH(_img_im.convert("RGB"), 1024)
|
|
|
@@ -493,8 +493,10 @@ class DealOneImageBeforehand(Base):
|
|
|
image_deal_info = {}
|
|
|
image_deal_info["原始图片大小"] = (original_pic.x, original_pic.y)
|
|
|
self.add_log("开始预抠图处理")
|
|
|
- remaining_times = self.get_online_data.get_cutout_image_times().get("balance")
|
|
|
- print("remaining_times", remaining_times)
|
|
|
+ remaining_times_obj = self.get_online_data.get_cutout_image_times()
|
|
|
+ if remaining_times_obj == False:
|
|
|
+ raise UnicornException("获取可用次数失败,请检查是否登录")
|
|
|
+ remaining_times = remaining_times_obj.get("balance")
|
|
|
if remaining_times <= 0:
|
|
|
raise UnicornException("次数不足,处理失败")
|
|
|
self.get_online_data.dispose_point("sub")
|