Allow both embedding metadata and saving metadata files (#1058)

* Allow both embedding metadata and saving metadata files

* Use the correct variable

* Descriptive variable

---------

Co-authored-by: cmdr2 <shashank.shekhar.global@gmail.com>
This commit is contained in:
Olivia Godone-Maresca 2023-03-28 23:49:05 -04:00 committed by GitHub
parent 044e3746ca
commit e5a47ac964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 9 deletions

View File

@ -47,14 +47,16 @@ def save_images_to_disk(images: list, filtered_images: list, req: GenerateImageR
output_quality=task_data.output_quality,
output_lossless=task_data.output_lossless,
)
if task_data.metadata_output_format.lower() in ["json", "txt", "embed"]:
save_dicts(
metadata_entries,
save_dir_path,
file_name=make_filename,
output_format=task_data.metadata_output_format,
file_format=task_data.output_format,
)
if task_data.metadata_output_format:
for metadata_output_format in task_data.metadata_output_format.split(','):
if metadata_output_format.lower() in ["json", "txt", "embed"]:
save_dicts(
metadata_entries,
save_dir_path,
file_name=make_filename,
output_format=metadata_output_format,
file_format=task_data.output_format,
)
else:
make_filter_filename = make_filename_callback(req, now=now, suffix="filtered")

View File

@ -76,7 +76,15 @@ var PARAMETERS = [
{
value: "embed",
label: "embed"
}
},
{
value: "embed,txt",
label: "embed & txt",
},
{
value: "embed,json",
label: "embed & json",
},
],
},
{