Skip to content

Commit

Permalink
Fix an issue in applying icc color profiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Feb 2, 2023
1 parent 42eefe7 commit 60c8890
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## 1.20.0

### Features
- ICC color profile support ([#1037](../../pull/1037), [#1043](../../pull/1043))
- ICC color profile support ([#1037](../../pull/1037), [#1043](../../pull/1043), [#1046](../../pull/1046))

### Improvements
- Speed up generating tiles for some multi source files ([#1035](../../pull/1035))
Expand Down
11 changes: 6 additions & 5 deletions large_image/tilesource/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1463,15 +1463,16 @@ def _outputTile(self, tile, tileEncoding, x, y, z, pilImageAllowed=False,
maxX = (x + 1) * self.tileWidth
maxY = (y + 1) * self.tileHeight
isEdge = maxX > sizeX or maxY > sizeY
hasStyle = (
(getattr(self, 'style', None) or hasattr(self, '_iccprofiles')) and
getattr(self, 'style', None) != {'icc': False})
if (tileEncoding not in (TILE_FORMAT_PIL, TILE_FORMAT_NUMPY) and
numpyAllowed != 'always' and tileEncoding == self.encoding and
not isEdge and (not applyStyle or not getattr(self, 'style', None))):
not isEdge and (not applyStyle or not hasStyle)):
return tile
mode = None
if (numpyAllowed == 'always' or tileEncoding == TILE_FORMAT_NUMPY or (applyStyle and (
(getattr(self, 'style', None) or hasattr(self, '_iccprofiles')) and
getattr(self, 'style', None) != {'icc': False})) or
isEdge):
if (numpyAllowed == 'always' or tileEncoding == TILE_FORMAT_NUMPY or
(applyStyle and hasStyle) or isEdge):
tile, mode = self._outputTileNumpyStyle(
tile, applyStyle, x, y, z, self._getFrame(**kwargs))
if isEdge:
Expand Down

0 comments on commit 60c8890

Please sign in to comment.