|
|
@@ -142,8 +142,14 @@ class DetailPicGet(DetailBase):
|
|
|
pp_bg = PictureProcessing(r"{}\first_bg.png".format(self.root))
|
|
|
# -------粘贴文字-------
|
|
|
mainTitle = self.get_text_value("主标题")
|
|
|
+ if not mainTitle:
|
|
|
+ mainTitle = "未填写"
|
|
|
subTitle = self.get_text_value("副标题")
|
|
|
+ if not subTitle:
|
|
|
+ subTitle = "未填写"
|
|
|
signTitle = self.get_text_value("签名")
|
|
|
+ if not signTitle:
|
|
|
+ signTitle = "未填写"
|
|
|
fontMain = ImageFont.truetype(r"resources\ttf\DOUYINSANSBOLD.ttf", 200)
|
|
|
fontSub = ImageFont.truetype(r"resources\ttf\puhui\Regular.ttf", 40)
|
|
|
fontSign = ImageFont.truetype(r"resources\ttf\puhui\en\Bold.otf", 40)
|
|
|
@@ -213,8 +219,14 @@ class DetailPicGet(DetailBase):
|
|
|
temp_pp = PictureProcessing("RGB", (top_bg.width, 90), self.white_bg_color)
|
|
|
detailed_images.append(temp_pp)
|
|
|
designText1 = self.get_text_value("设计理念1")
|
|
|
+ if not designText1:
|
|
|
+ designText1 = "未填写"
|
|
|
designText2 = self.get_text_value("设计理念2")
|
|
|
+ if not designText2:
|
|
|
+ designText2 = "未填写"
|
|
|
designText3 = self.get_text_value("设计理念3")
|
|
|
+ if not designText3:
|
|
|
+ designText3 = "未填写"
|
|
|
fontSub = ImageFont.truetype(r"resources\ttf\puhui\Regular.ttf", 60)
|
|
|
centerDesign = ImageFont.truetype(r"resources\ttf\puhui\Bold.ttf", 65)
|
|
|
first_text_bg = PictureProcessing("RGB", (top_bg.width, 90), self.white_bg_color)
|
|
|
@@ -272,10 +284,13 @@ class DetailPicGet(DetailBase):
|
|
|
"position":(200, 0),"bottom":"Versatile Upper"}]
|
|
|
for index, item in enumerate(text_array):
|
|
|
text_bg = PictureProcessing("RGBA", (440, 200), (255, 255, 255,0))
|
|
|
+ text_title = item["title"]
|
|
|
+ if not text_title:
|
|
|
+ text_title = "未填写"
|
|
|
text_bg = text_bg.get_text_image_advanced(
|
|
|
value=(0, 0),
|
|
|
font=font,
|
|
|
- text="{}".format(item["title"]),
|
|
|
+ text="{}".format(text_title),
|
|
|
align="center",
|
|
|
spacing=15,
|
|
|
fill=(255, 255, 255),
|
|
|
@@ -379,7 +394,11 @@ class DetailPicGet(DetailBase):
|
|
|
top_bg = top_bg.to_overlay_pic_advance(top_img=pp_jpg, top_png_img=pp_png, base="cc",value=(0, 0))
|
|
|
#
|
|
|
textTitle1 = self.get_text_value("材质FAB1")
|
|
|
+ if not textTitle1:
|
|
|
+ textTitle1 = "未填写"
|
|
|
textTitle2 = self.get_text_value("材质FAB2")
|
|
|
+ if not textTitle2:
|
|
|
+ textTitle2 = "未填写"
|
|
|
font = ImageFont.truetype(r"resources\ttf\puhui\Medium.ttf", 100)
|
|
|
font2 = ImageFont.truetype(r"resources\ttf\puhui\Medium.ttf", 60)
|
|
|
font3 = ImageFont.truetype(r"resources\ttf\puhui\Medium.ttf", 50)
|
|
|
@@ -406,6 +425,8 @@ class DetailPicGet(DetailBase):
|
|
|
)
|
|
|
top_bg.paste_img(top_img=text_bg2, value=(0, 230),base='nc')
|
|
|
textTitle3 = self.get_text_value("材质FAB3")
|
|
|
+ if not textTitle3:
|
|
|
+ textTitle3 = "未填写"
|
|
|
text_bg3 = PictureProcessing("RGB", (top_bg.width, 200), (255, 255, 255))
|
|
|
text_bg3 = text_bg3.get_text_image_advanced(
|
|
|
value=(0, 0),
|
|
|
@@ -419,6 +440,8 @@ class DetailPicGet(DetailBase):
|
|
|
)
|
|
|
top_bg.paste_img(top_img=text_bg3, value=(154, 1325),base='nw')
|
|
|
textTitle4 = self.get_text_value("材质FAB4")
|
|
|
+ if not textTitle4:
|
|
|
+ textTitle4 = "未填写"
|
|
|
text_bg4 = PictureProcessing("RGB", (top_bg.width, 200), (255, 255, 255))
|
|
|
text_bg4 = text_bg4.get_text_image_advanced(
|
|
|
value=(0, 0),
|
|
|
@@ -432,6 +455,8 @@ class DetailPicGet(DetailBase):
|
|
|
)
|
|
|
top_bg.paste_img(top_img=text_bg4, value=(0, 1325),base='nc')
|
|
|
textTitle5 = self.get_text_value("材质FAB5")
|
|
|
+ if not textTitle5:
|
|
|
+ textTitle5 = "未填写"
|
|
|
text_bg5 = PictureProcessing("RGB", (top_bg.width, 200), (255, 255, 255))
|
|
|
text_bg5 = text_bg5.get_text_image_advanced(
|
|
|
value=(0, 0),
|
|
|
@@ -458,6 +483,8 @@ class DetailPicGet(DetailBase):
|
|
|
upper_footer_pp = PictureProcessing(upper_footer_image)
|
|
|
upper_footer_pp = upper_footer_pp.resize(value=round(top_bg.height*0.9),base='high')
|
|
|
gengao_fab = self.get_text_value("跟高FAB")
|
|
|
+ if not gengao_fab:
|
|
|
+ gengao_fab = "未填写"
|
|
|
size_font = ImageFont.truetype(r"resources\ttf\puhui\Bold.ttf", 50)
|
|
|
xiechang_bg = PictureProcessing("RGBA", (top_bg.width, 500), (255, 255, 255,0))
|
|
|
xiechang_bg = xiechang_bg.get_text_image_advanced(
|
|
|
@@ -512,9 +539,17 @@ class DetailPicGet(DetailBase):
|
|
|
shoesBg.paste_img(top_img=hengxian, value=(0, 80),base='cs')
|
|
|
shoesBg.paste_img(top_img=shuxian, value=((shoesBg.width/2- pp_png.width/2), 0),base='ec')
|
|
|
xiechang = self.get_text_value("鞋长")
|
|
|
+ if not xiechang:
|
|
|
+ xiechang = "未填写"
|
|
|
banggao = self.get_text_value("帮高")
|
|
|
+ if not banggao:
|
|
|
+ banggao = "未填写"
|
|
|
gen_gao = self.get_text_value("跟高")
|
|
|
+ if not gen_gao:
|
|
|
+ gen_gao = "未填写"
|
|
|
xiezhang_kuan = self.get_text_value("鞋掌宽")
|
|
|
+ if not xiezhang_kuan:
|
|
|
+ xiezhang_kuan = "未填写"
|
|
|
size_font = ImageFont.truetype(r"resources\ttf\puhui\Medium.ttf", 30)
|
|
|
|
|
|
xiechang_bg = PictureProcessing("RGBA", (shoesBg.width, 500), (255, 255, 255,0))
|