This commit is contained in:
Ray Suhyun Lee 2025-12-13 12:52:36 +01:00 committed by GitHub
commit 10ce9f7702
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -495,6 +495,7 @@ class PromptServer():
if os.path.isfile(file):
if 'preview' in request.rel_url.query:
with Image.open(file) as img:
img = ImageOps.exif_transpose(img)
preview_info = request.rel_url.query['preview'].split(';')
image_format = preview_info[0]
if image_format not in ['webp', 'jpeg'] or 'a' in request.rel_url.query.get('channel', ''):
@ -520,6 +521,7 @@ class PromptServer():
if channel == 'rgb':
with Image.open(file) as img:
img = ImageOps.exif_transpose(img)
if img.mode == "RGBA":
r, g, b, a = img.split()
new_img = Image.merge('RGB', (r, g, b))
@ -535,6 +537,7 @@ class PromptServer():
elif channel == 'a':
with Image.open(file) as img:
img = ImageOps.exif_transpose(img)
if img.mode == "RGBA":
_, _, _, a = img.split()
else: