|
|
@@ -101,16 +101,17 @@ class DetailPicGet(DetailBase):
|
|
|
""" 制作主图 """
|
|
|
detailed_images = []
|
|
|
pp_0 = PictureProcessing(r"{}\1.png".format(self.root))
|
|
|
- bg_img = self.getSpecialImage(category="场景图", instead_category="正面",resize=pp_0.width)
|
|
|
+ image_path_scene = self.goods_no_value["货号资料"][0].get("场景图",None)
|
|
|
+ bg_img = self.getSpecialImage(path=image_path_scene, instead_category="正面",resize=pp_0.width)
|
|
|
bg_img.paste_img(top_img=pp_0, base="nc", value=(0, 0))
|
|
|
detailed_images.append(bg_img)
|
|
|
return PictureProcessing(im=self.add_pic(detailed_images))
|
|
|
|
|
|
- def getSpecialImage(self, category="模特图", instead_category="正面", resize=1200):
|
|
|
+ def getSpecialImage(self, path=None, instead_category="正面", resize=1200):
|
|
|
"""获取特殊图片"""
|
|
|
goods_art_no_list = list(self.data.keys())
|
|
|
- if self.get_text_value(category):
|
|
|
- mote_img = PictureProcessing(self.get_text_value(category))
|
|
|
+ if path:
|
|
|
+ mote_img = PictureProcessing(path)
|
|
|
mote_img = mote_img.resize(value=resize)
|
|
|
else:
|
|
|
pp_jpg, pp_png = self.image_one_pic_no_shandow(
|
|
|
@@ -129,8 +130,10 @@ class DetailPicGet(DetailBase):
|
|
|
detailed_images = []
|
|
|
# 尺码表
|
|
|
pp_1 = PictureProcessing(r"{}\2.jpg".format(self.root))
|
|
|
+ image_path = self.goods_no_value["货号资料"][0].get("模特图",None)
|
|
|
+ image_path_scene = self.goods_no_value["货号资料"][0].get("场景图",None)
|
|
|
bg_img = self.getSpecialImage(
|
|
|
- category="模特图", instead_category="正面", resize=pp_1.width
|
|
|
+ path=image_path, instead_category="正面", resize=pp_1.width
|
|
|
)
|
|
|
right_top_img = bg_img.resize(value=pp_1.width)
|
|
|
detail_2_bg = PictureProcessing(
|
|
|
@@ -139,7 +142,7 @@ class DetailPicGet(DetailBase):
|
|
|
detail_2_bg.paste_img(top_img=right_top_img, base="cc", value=(0, 0))
|
|
|
pp_1.paste_img(top_img=detail_2_bg, base="en", value=(30, 80))
|
|
|
bg_img2 = self.getSpecialImage(
|
|
|
- category="场景图", instead_category="背面", resize=pp_1.width
|
|
|
+ path=image_path_scene, instead_category="背面", resize=pp_1.width
|
|
|
)
|
|
|
left_bottom_img = bg_img2.resize(value=pp_1.width*1.3)
|
|
|
detail_3_bg = PictureProcessing(
|
|
|
@@ -155,8 +158,9 @@ class DetailPicGet(DetailBase):
|
|
|
detailed_images = []
|
|
|
pp_1 = PictureProcessing(r"{}\3.jpg".format(self.root))
|
|
|
# 细节展示
|
|
|
+ image_path = self.goods_no_value["货号资料"][0].get("模特图",None)
|
|
|
pp_jpg = self.getSpecialImage(
|
|
|
- category="模特图", instead_category="正面", resize=pp_1.width*1.5
|
|
|
+ path=image_path, instead_category="正面", resize=pp_1.width*1.5
|
|
|
)
|
|
|
detail_3_bg = PictureProcessing(
|
|
|
"RGB", (pp_1.width - 100, pp_1.width - 100), (255, 255, 255)
|
|
|
@@ -264,8 +268,9 @@ class DetailPicGet(DetailBase):
|
|
|
detailed_images = []
|
|
|
|
|
|
pp_10 = PictureProcessing(r"{}\8.jpg".format(self.root))
|
|
|
+ image_path = self.goods_no_value["货号资料"][0].get("模特图",None)
|
|
|
pp_jpg = self.getSpecialImage(
|
|
|
- category="模特图", instead_category="正面", resize=pp_10.width * 1.5
|
|
|
+ path=image_path, instead_category="正面", resize=pp_10.width * 1.5
|
|
|
)
|
|
|
bg_img = PictureProcessing("RGB", (pp_10.width, pp_10.width), (255, 255, 255))
|
|
|
bg_img = bg_img.paste_img(top_img=pp_jpg, base="nc", value=(0, -50))
|