mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
Merge pull request #14958 from HTYISABUG/dev
Error handling for unsupported transparency
This commit is contained in:
commit
5625ce1b1a
@ -551,6 +551,12 @@ def save_image_with_geninfo(image, geninfo, filename, extension=None, existing_p
|
||||
else:
|
||||
pnginfo_data = None
|
||||
|
||||
# Error handling for unsupported transparency in RGB mode
|
||||
if (image.mode == "RGB" and
|
||||
"transparency" in image.info and
|
||||
isinstance(image.info["transparency"], bytes)):
|
||||
del image.info["transparency"]
|
||||
|
||||
image.save(filename, format=image_format, quality=opts.jpeg_quality, pnginfo=pnginfo_data)
|
||||
|
||||
elif extension.lower() in (".jpg", ".jpeg", ".webp"):
|
||||
|
Loading…
Reference in New Issue
Block a user