Skip to content

Commit

Permalink
Merge pull request #1382 from girder/icc-profile-key
Browse files Browse the repository at this point in the history
Fix an issue applying ICC profile adjustments to multiple image modes
  • Loading branch information
manthey authored Nov 21, 2023
2 parents 61ace0f + 4712080 commit 01b17a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
### Improvements
- Fix the DICOM limit to say "Series" instead of "Studies" ([#1379](../../pull/1379))

### Bug Fixes
- Fix an issue applying ICC profile adjustments to multiple image modes ([#1382](../../pull/1382))

## 1.26.1

### Improvements
Expand Down
16 changes: 8 additions & 8 deletions large_image/tilesource/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1408,14 +1408,14 @@ def _applyICCProfile(self, sc, frame):
self._iccprofilesObjects[profileIdx] = {
'profile': self.getICCProfiles(profileIdx),
}
if key not in self._iccprofilesObjects[profileIdx]:
self._iccprofilesObjects[profileIdx][key] = \
PIL.ImageCms.buildTransformFromOpenProfiles(
self._iccprofilesObjects[profileIdx]['profile'],
self._iccsrgbprofile, mode, mode,
renderingIntent=intent)
self.logger.debug(
'Created an ICC profile transform for mode %s, intent %s', mode, intent)
if key not in self._iccprofilesObjects[profileIdx]:
self._iccprofilesObjects[profileIdx][key] = \
PIL.ImageCms.buildTransformFromOpenProfiles(
self._iccprofilesObjects[profileIdx]['profile'],
self._iccsrgbprofile, mode, mode,
renderingIntent=intent)
self.logger.debug(
'Created an ICC profile transform for mode %s, intent %s', mode, intent)
transform = self._iccprofilesObjects[profileIdx][key]

PIL.ImageCms.applyTransform(image, transform, inPlace=True)
Expand Down

0 comments on commit 01b17a3

Please sign in to comment.