Compare commits

...

3 Commits

Author SHA1 Message Date
Ray Suhyun Lee
a6eefbf43e
Merge b947b5a4a3 into 25757a53c9 2026-05-07 18:54:32 +02:00
Ray Suhyun Lee
b947b5a4a3 fix other conditions as well 2023-09-28 18:23:58 +09:00
Ray Suhyun Lee
297757778d fix /view returning image with wrong orientation 2023-09-28 17:49:35 +09:00

View File

@ -544,6 +544,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', ''):
@ -569,6 +570,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))
@ -584,6 +586,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: