mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-18 21:17:23 +08:00
Merge b947b5a4a3 into f6d5068ac0
This commit is contained in:
commit
5437ad2e0f
@ -543,6 +543,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', ''):
|
||||
@ -568,6 +569,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))
|
||||
@ -583,6 +585,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