save code
This commit is contained in:
+8
-3
@@ -540,7 +540,10 @@ def process_change_cloth(human_filename, cloth_filename, output_format, img_url,
|
|||||||
if no2:
|
if no2:
|
||||||
out_human_https_url = human_url
|
out_human_https_url = human_url
|
||||||
else:
|
else:
|
||||||
out_human_image = Image.open(f'{APP_ROOT}/../output/{out_human_name}')
|
if os.path.exists(f'{APP_ROOT}/../output/{out_human_name}'):
|
||||||
|
out_human_image = Image.open(f'{APP_ROOT}/../output/{out_human_name}')
|
||||||
|
else:
|
||||||
|
out_human_image = Image.open(f'{APP_ROOT}/../input/{out_human_name}')
|
||||||
out_human_jpg_name = out_human_name.replace(".png", ".jpg")
|
out_human_jpg_name = out_human_name.replace(".png", ".jpg")
|
||||||
out_human_jpg_path_name = f'{APP_ROOT}/static/imgs/{out_human_jpg_name}'
|
out_human_jpg_path_name = f'{APP_ROOT}/static/imgs/{out_human_jpg_name}'
|
||||||
out_human_image.save(out_human_jpg_path_name, quality=90)
|
out_human_image.save(out_human_jpg_path_name, quality=90)
|
||||||
@@ -648,8 +651,10 @@ def do_change_cloth():
|
|||||||
tuodi = data['tuodi']
|
tuodi = data['tuodi']
|
||||||
print(f"tuodi:{tuodi}")
|
print(f"tuodi:{tuodi}")
|
||||||
|
|
||||||
kuzi = data['kuzi']
|
kuzi = False
|
||||||
print(f"kuzi:{kuzi}")
|
if 'kuzi' in data:
|
||||||
|
kuzi = data['kuzi']
|
||||||
|
print(f"kuzi:{kuzi}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return process_change_cloth(human_filename, cloth_filename, output_format, cloth_url, human_url, no2, tuodi, kuzi)
|
return process_change_cloth(human_filename, cloth_filename, output_format, cloth_url, human_url, no2, tuodi, kuzi)
|
||||||
|
|||||||
Reference in New Issue
Block a user