fix /view returning image with wrong orientation

This commit is contained in:
Ray Suhyun Lee 2023-09-28 17:49:35 +09:00
parent 26b7372805
commit 297757778d

View File

@ -302,6 +302,7 @@ class PromptServer():
if channel == 'rgb': if channel == 'rgb':
with Image.open(file) as img: with Image.open(file) as img:
img = ImageOps.exif_transpose(img)
if img.mode == "RGBA": if img.mode == "RGBA":
r, g, b, a = img.split() r, g, b, a = img.split()
new_img = Image.merge('RGB', (r, g, b)) new_img = Image.merge('RGB', (r, g, b))