-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with loading some JPG: #3416
- Loading branch information
1 parent
d7fa417
commit c334122
Showing
1 changed file
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c334122
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be related to ICC profile error I committed the fix to, maybe a more generic function that does try except for all PIL functions that could handle meta-data would be useful? A lot of devices embed color related meta-data, and the errors are unlikely to ever be fixed in the Pillow library as they seem to expect color management things to be handled with their ImageCMS module, and PIL seems to throw a fit when using the regular Image module for different image types such as HDR images from phones, images with the ICC profiles etc, LOAD_TRUNCATED_IMAGES seems to fix a lot of the errors.
Maybe something where the operation is injected as a dependency and and the LOAD_TRUNCATED_IMAGES flag is toggled if the operation fails like
to be called like :
Then we have a generalized way to wrap functions in the try except to toggle the meta data truncation, and it wont need to be added for every Pil function that is discovered throwing errors because of meta data?
could go in node_helpers.py so that is easily accessible for use in nodes that use PIL also.