|
@@ -218,28 +218,34 @@ class DetailBase(object):
|
|
|
new_path,
|
|
new_path,
|
|
|
"NUM{}".format(i["number"]),
|
|
"NUM{}".format(i["number"]),
|
|
|
)
|
|
)
|
|
|
- # sendMessageAsync(
|
|
|
|
|
- # code=0,
|
|
|
|
|
- # msg="详情页生成完成",
|
|
|
|
|
- # msg_type="detail_progress",
|
|
|
|
|
- # data={
|
|
|
|
|
- # "goods_no": self.goods_no,
|
|
|
|
|
- # "temp_name": self.template_name,
|
|
|
|
|
- # "status": "已完成",
|
|
|
|
|
- # "goods_art_nos": self.goods_art_nos,
|
|
|
|
|
- # },
|
|
|
|
|
- # )
|
|
|
|
|
scp_path = "{out_put_dir}/{goods_no}".format(
|
|
scp_path = "{out_put_dir}/{goods_no}".format(
|
|
|
out_put_dir=self.out_put_dir, goods_no=self.goods_no
|
|
out_put_dir=self.out_put_dir, goods_no=self.goods_no
|
|
|
)
|
|
)
|
|
|
if self.get_text_value("模特图"):
|
|
if self.get_text_value("模特图"):
|
|
|
model_pic = self.get_text_value("模特图")
|
|
model_pic = self.get_text_value("模特图")
|
|
|
- shutil.copy(model_pic, f"{scp_path}/模特图.jpg")
|
|
|
|
|
|
|
+ self.copyImage(model_pic, f"{scp_path}/模特图.jpg")
|
|
|
if self.get_text_value("场景图"):
|
|
if self.get_text_value("场景图"):
|
|
|
scene_pic = self.get_text_value("场景图")
|
|
scene_pic = self.get_text_value("场景图")
|
|
|
- shutil.copy(scene_pic, f"{scp_path}/场景图.jpg")
|
|
|
|
|
|
|
+ self.copyImage(scene_pic, f"{scp_path}/场景图.jpg")
|
|
|
return True
|
|
return True
|
|
|
-
|
|
|
|
|
|
|
+ def copyImage(self,src_path,limit_path):
|
|
|
|
|
+ try:
|
|
|
|
|
+ shutil.copy(src_path, limit_path)
|
|
|
|
|
+ except Exception as e:
|
|
|
|
|
+ print(f'An exception occurred:{e}')
|
|
|
|
|
+ def concatAigcImage(image_path,resize=1600,bg_color=(255,255,255)):
|
|
|
|
|
+ """拼接模特图场景图"""
|
|
|
|
|
+ try:
|
|
|
|
|
+ mote_img = PictureProcessing(image_path)
|
|
|
|
|
+ mote_img = mote_img.resize(value=resize)
|
|
|
|
|
+ bg_img = PictureProcessing(
|
|
|
|
|
+ "RGB", (mote_img.width, mote_img.height), bg_color
|
|
|
|
|
+ )
|
|
|
|
|
+ bg_img = bg_img.paste_img(top_img=mote_img, base="nc", value=(0, 0))
|
|
|
|
|
+ return bg_img
|
|
|
|
|
+ except:
|
|
|
|
|
+ print('An exception occurred')
|
|
|
|
|
+ return
|
|
|
# 移动一张图片到新的文件夹
|
|
# 移动一张图片到新的文件夹
|
|
|
def move_one_pic(self, old_path, new_path, new_name):
|
|
def move_one_pic(self, old_path, new_path, new_name):
|
|
|
image_file = os.listdir(old_path)[0]
|
|
image_file = os.listdir(old_path)[0]
|
|
@@ -251,17 +257,6 @@ class DetailBase(object):
|
|
|
# 生成各个详情图切片
|
|
# 生成各个详情图切片
|
|
|
def deal_details(self):
|
|
def deal_details(self):
|
|
|
detailed_images = []
|
|
detailed_images = []
|
|
|
- # sendMessageAsync(
|
|
|
|
|
- # code=0,
|
|
|
|
|
- # msg="正在生成详情页切片",
|
|
|
|
|
- # msg_type="detail_progress",
|
|
|
|
|
- # data={
|
|
|
|
|
- # "goods_no": self.goods_no,
|
|
|
|
|
- # "temp_name": self.template_name,
|
|
|
|
|
- # "status": "进行中",
|
|
|
|
|
- # "goods_art_nos": self.goods_art_nos,
|
|
|
|
|
- # },
|
|
|
|
|
- # )
|
|
|
|
|
for index, func in enumerate(self.deal_pic_func_list):
|
|
for index, func in enumerate(self.deal_pic_func_list):
|
|
|
image_pp = func()
|
|
image_pp = func()
|
|
|
if not self.assigned_page_list:
|
|
if not self.assigned_page_list:
|