Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
c3341228
Commit
c3341228
authored
May 07, 2024
by
comfyanonymous
Browse files
Fix issue with loading some JPG: #3416
parent
d7fa417b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
nodes.py
nodes.py
+12
-2
No files found.
nodes.py
View file @
c3341228
...
@@ -10,7 +10,7 @@ import time
...
@@ -10,7 +10,7 @@ import time
import
random
import
random
import
logging
import
logging
from
PIL
import
Image
,
ImageOps
,
ImageSequence
from
PIL
import
Image
,
ImageOps
,
ImageSequence
,
ImageFile
from
PIL.PngImagePlugin
import
PngInfo
from
PIL.PngImagePlugin
import
PngInfo
import
numpy
as
np
import
numpy
as
np
...
@@ -1462,7 +1462,17 @@ class LoadImage:
...
@@ -1462,7 +1462,17 @@ class LoadImage:
output_images
=
[]
output_images
=
[]
output_masks
=
[]
output_masks
=
[]
for
i
in
ImageSequence
.
Iterator
(
img
):
for
i
in
ImageSequence
.
Iterator
(
img
):
prev_value
=
None
try
:
i
=
ImageOps
.
exif_transpose
(
i
)
except
OSError
:
prev_value
=
ImageFile
.
LOAD_TRUNCATED_IMAGES
ImageFile
.
LOAD_TRUNCATED_IMAGES
=
True
i
=
ImageOps
.
exif_transpose
(
i
)
i
=
ImageOps
.
exif_transpose
(
i
)
finally
:
if
prev_value
is
not
None
:
ImageFile
.
LOAD_TRUNCATED_IMAGES
=
prev_value
if
i
.
mode
==
'I'
:
if
i
.
mode
==
'I'
:
i
=
i
.
point
(
lambda
i
:
i
*
(
1
/
255
))
i
=
i
.
point
(
lambda
i
:
i
*
(
1
/
255
))
image
=
i
.
convert
(
"RGB"
)
image
=
i
.
convert
(
"RGB"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment