diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-05-31 16:20:19 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-05-31 19:56:56 +0000 |
commit | 6427ffde4dc6bed5ade3584fcb2fe72528be193e (patch) | |
tree | d516b0c2d8c92bfaf2dfa04af6139f032fbb637f | |
parent | c63d46ceb8dd26d0ec3b27feedcffc3903358a0a (diff) | |
download | stable-diffusion-webui-gfx803-6427ffde4dc6bed5ade3584fcb2fe72528be193e.tar.gz stable-diffusion-webui-gfx803-6427ffde4dc6bed5ade3584fcb2fe72528be193e.tar.bz2 stable-diffusion-webui-gfx803-6427ffde4dc6bed5ade3584fcb2fe72528be193e.zip |
Merge pull request #10808 from AUTOMATIC1111/fix-disable-png-info
fix disable png info
-rw-r--r-- | modules/images.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/images.py b/modules/images.py index 4e8cd993..3f60e944 100644 --- a/modules/images.py +++ b/modules/images.py @@ -493,9 +493,12 @@ def save_image_with_geninfo(image, geninfo, filename, extension=None, existing_p existing_pnginfo['parameters'] = geninfo
if extension.lower() == '.png':
- pnginfo_data = PngImagePlugin.PngInfo()
- for k, v in (existing_pnginfo or {}).items():
- pnginfo_data.add_text(k, str(v))
+ if opts.enable_pnginfo:
+ pnginfo_data = PngImagePlugin.PngInfo()
+ for k, v in (existing_pnginfo or {}).items():
+ pnginfo_data.add_text(k, str(v))
+ else:
+ pnginfo_data = None
image.save(filename, format=image_format, quality=opts.jpeg_quality, pnginfo=pnginfo_data)
|