fix OSError: cannot write mode P as JPEG

This commit is contained in:
Andray
2024-07-11 23:54:25 +04:00
parent 1da4907927
commit 3d2dbefcde
2 changed files with 2 additions and 2 deletions

View File

@@ -162,7 +162,7 @@ class State:
errors.record_exception()
def assign_current_image(self, image):
if shared.opts.live_previews_image_format == 'jpeg' and image.mode == 'RGBA':
if shared.opts.live_previews_image_format == 'jpeg' and image.mode in ('RGBA', 'P'):
image = image.convert('RGB')
self.current_image = image
self.id_live_preview += 1