mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-06-02 01:22:11 +08:00
Merge b947b5a4a33162787c24f36c1fb699ba9829c6d7 into d8e5662822168101afb5e08a8ba75b6eefff6e02
This commit is contained in:
commit
bebc1ca26b
@ -418,6 +418,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', ''):
|
||||
@ -443,6 +444,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))
|
||||
@ -458,6 +460,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…
x
Reference in New Issue
Block a user