|
|
@@ -287,14 +287,16 @@ class BaseDealImage(object):
|
|
|
|
|
|
"""进行800image 生成"""
|
|
|
generate_pic = GeneratePic()
|
|
|
-
|
|
|
- if settings.OUT_PIC_MODE == ".jpg":
|
|
|
+ out_pci_mode = "." + settings.getSysConfigs(
|
|
|
+ "basic_configs", "image_out_format", "png"
|
|
|
+ )
|
|
|
+ if out_pci_mode == ".jpg":
|
|
|
out_path = "{}/800x800/{}{}".format(folder_path, file_name, ".jpg")
|
|
|
- elif settings.OUT_PIC_MODE == ".png":
|
|
|
+ elif out_pci_mode == ".png":
|
|
|
out_path = "{}/800x800/{}{}".format(folder_path, file_name, ".png")
|
|
|
else:
|
|
|
out_path = "{}/800x800/{}{}".format(
|
|
|
- folder_path, file_name, settings.OUT_PIC_MODE
|
|
|
+ folder_path, file_name, out_pci_mode
|
|
|
)
|
|
|
|
|
|
out_process_path_1 = "{}/阴影图处理/{}_{}_阴影{}".format(folder_path, file_name,
|
|
|
@@ -313,14 +315,19 @@ class BaseDealImage(object):
|
|
|
|
|
|
if settings.Mode == "皮具":
|
|
|
max_box = (1000, 1200)
|
|
|
-
|
|
|
+ out_pic_size = (
|
|
|
+ [1600]
|
|
|
+ if settings.getSysConfigs("basic_configs", "main_image_size", [1600])
|
|
|
+ == ""
|
|
|
+ else settings.getSysConfigs("basic_configs", "main_image_size", [1600])
|
|
|
+ ) # 主图大小
|
|
|
if resize_mode == 2:
|
|
|
print(
|
|
|
is_image_deal_mode,
|
|
|
resize_mode,
|
|
|
- settings.OUT_PIC_SIZE,
|
|
|
+ out_pic_size,
|
|
|
True if i_n == 1 else False,
|
|
|
- max_box
|
|
|
+ max_box,
|
|
|
)
|
|
|
|
|
|
# todo 主图生成处理,使用进程处理耗性能操作
|
|
|
@@ -354,19 +361,25 @@ class BaseDealImage(object):
|
|
|
# is_successful = False
|
|
|
# else:
|
|
|
# print("output_queue.get():", output_queue.get())
|
|
|
-
|
|
|
- if not generate_pic.run(image_path=original_image_path,
|
|
|
- cut_image_path=original_move_bg_image_path,
|
|
|
- out_path=out_path,
|
|
|
- image_deal_mode=is_image_deal_mode,
|
|
|
- resize_mode=resize_mode,
|
|
|
- out_pic_size=settings.OUT_PIC_SIZE,
|
|
|
- is_logo=True if i_n == 1 else False,
|
|
|
- out_process_path_1=out_process_path_1,
|
|
|
- out_process_path_2=out_process_path_2,
|
|
|
- max_box=max_box,
|
|
|
- logo_path=logo_path,
|
|
|
- ):
|
|
|
+ out_pic_size = (
|
|
|
+ [1600]
|
|
|
+ if settings.getSysConfigs("basic_configs", "main_image_size", [1600])
|
|
|
+ == ""
|
|
|
+ else settings.getSysConfigs("basic_configs", "main_image_size", [1600])
|
|
|
+ ) # 主图大小
|
|
|
+ if not generate_pic.run(
|
|
|
+ image_path=original_image_path,
|
|
|
+ cut_image_path=original_move_bg_image_path,
|
|
|
+ out_path=out_path,
|
|
|
+ image_deal_mode=is_image_deal_mode,
|
|
|
+ resize_mode=resize_mode,
|
|
|
+ out_pic_size=out_pic_size,
|
|
|
+ is_logo=True if i_n == 1 else False,
|
|
|
+ out_process_path_1=out_process_path_1,
|
|
|
+ out_process_path_2=out_process_path_2,
|
|
|
+ max_box=max_box,
|
|
|
+ logo_path=logo_path,
|
|
|
+ ):
|
|
|
is_successful = False
|
|
|
|
|
|
if is_successful:
|
|
|
@@ -821,13 +834,16 @@ class BaseDealImage(object):
|
|
|
|
|
|
"""进行800image 生成"""
|
|
|
generate_pic = GeneratePic()
|
|
|
- if settings.OUT_PIC_MODE == ".jpg":
|
|
|
+ out_pci_mode = "." + settings.getSysConfigs(
|
|
|
+ "basic_configs", "image_out_format", "png"
|
|
|
+ )
|
|
|
+ if out_pci_mode == ".jpg":
|
|
|
out_path = "{}/800x800/{}{}".format(goods_art_no_folder_path, file_name, ".jpg")
|
|
|
- elif settings.OUT_PIC_MODE == ".png":
|
|
|
+ elif out_pci_mode == ".png":
|
|
|
out_path = "{}/800x800/{}{}".format(goods_art_no_folder_path, file_name, ".png")
|
|
|
else:
|
|
|
out_path = "{}/800x800/{}{}".format(
|
|
|
- goods_art_no_folder_path, file_name, settings.OUT_PIC_MODE
|
|
|
+ goods_art_no_folder_path, file_name, out_pci_mode
|
|
|
)
|
|
|
|
|
|
out_process_path_1 = "{}/阴影图处理/{}_{}_阴影{}".format(goods_art_no_folder_path, file_name,
|
|
|
@@ -837,18 +853,29 @@ class BaseDealImage(object):
|
|
|
|
|
|
print("image_index", image_index)
|
|
|
image_index = 99
|
|
|
- if generate_pic.run(image_path=original_image_path,
|
|
|
- cut_image_path=original_move_bg_image_path,
|
|
|
- out_path=out_path,
|
|
|
- image_deal_mode=is_image_deal_mode,
|
|
|
- image_index=image_index,
|
|
|
- out_pic_size=settings.OUT_PIC_SIZE,
|
|
|
- is_logo=True if i_n == 1 else False,
|
|
|
- out_process_path_1=out_process_path_1,
|
|
|
- out_process_path_2=out_process_path_2,
|
|
|
- max_box=max_box,
|
|
|
- logo_path=logo_path,
|
|
|
- ):
|
|
|
+ out_pic_size = (
|
|
|
+ [1600]
|
|
|
+ if settings.getSysConfigs(
|
|
|
+ "basic_configs", "main_image_size", [1600]
|
|
|
+ )
|
|
|
+ == ""
|
|
|
+ else settings.getSysConfigs(
|
|
|
+ "basic_configs", "main_image_size", [1600]
|
|
|
+ )
|
|
|
+ ) # 主图大小
|
|
|
+ if generate_pic.run(
|
|
|
+ image_path=original_image_path,
|
|
|
+ cut_image_path=original_move_bg_image_path,
|
|
|
+ out_path=out_path,
|
|
|
+ image_deal_mode=is_image_deal_mode,
|
|
|
+ image_index=image_index,
|
|
|
+ out_pic_size=out_pic_size,
|
|
|
+ is_logo=True if i_n == 1 else False,
|
|
|
+ out_process_path_1=out_process_path_1,
|
|
|
+ out_process_path_2=out_process_path_2,
|
|
|
+ max_box=max_box,
|
|
|
+ logo_path=logo_path,
|
|
|
+ ):
|
|
|
# self.show_progress_detail("货号图{} _{} 已完成800*800图片制作~".format(image_index, file_name))
|
|
|
callback_func("货号图{} _{} 已完成800*800图片制作~".format(image_index, file_name))
|
|
|
else:
|