mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-16 03:57:27 +08:00
Merge b947b5a4a3 into 4f6018982d
This commit is contained in:
commit
22d9139c1e
@ -548,6 +548,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', ''):
|
||||
@ -573,6 +574,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))
|
||||
@ -588,6 +590,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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user