Skip to content

Commit

Permalink
Merge pull request #1245 from girder/guard-bad-icc
Browse files Browse the repository at this point in the history
Guard against ICC profiles that won't parse
  • Loading branch information
manthey authored Jul 26, 2023
2 parents d46f9a9 + 1e6c25c commit 5be0651
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 1.23.3

### Improvements
- Frame selection presets ([#1237](../../pull/1237))

### Bug Fixes
- Guard against ICC profiles that won't parse ([#1245](../../pull/1245))

## 1.23.2

### Improvements
Expand Down
5 changes: 4 additions & 1 deletion large_image/tilesource/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,10 @@ def getICCProfiles(self, idx=None, onlyInfo=False):
if hasattr(self, '_iccprofilesObjects') and self._iccprofilesObjects[pidx] is not None:
prof = self._iccprofilesObjects[pidx]['profile']
elif not isinstance(prof, PIL.ImageCms.ImageCmsProfile):
prof = PIL.ImageCms.getOpenProfile(io.BytesIO(prof))
try:
prof = PIL.ImageCms.getOpenProfile(io.BytesIO(prof))
except PIL.ImageCms.PyCMSError:
continue
if idx == pidx:
return prof
results.append(prof)
Expand Down

0 comments on commit 5be0651

Please sign in to comment.