diff --git a/CHANGELOG.md b/CHANGELOG.md index 472b9d68f..8b172e994 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/large_image/tilesource/base.py b/large_image/tilesource/base.py index 9b327b3ce..49fa112c1 100644 --- a/large_image/tilesource/base.py +++ b/large_image/tilesource/base.py @@ -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: