diff --git a/CHANGELOG.md b/CHANGELOG.md index 829811bf4..c7a2b5ea8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Improvements - Harden when the bioformats reader claims it has a zero sized image ([#1268](../../pull/1268)) +- Harden internal retiling. This sometimes affected histograms ([#1269](../../pull/1269)) ### Changes - Adjust tifffile log level ([#1265](../../pull/1265)) diff --git a/large_image/tilesource/tiledict.py b/large_image/tilesource/tiledict.py index fda723879..9c1c9afed 100644 --- a/large_image/tilesource/tiledict.py +++ b/large_image/tilesource/tiledict.py @@ -143,6 +143,8 @@ def _retileTile(self): y0 = 0 tileData = tileData[:min(tileData.shape[0], self.height - y0), :min(tileData.shape[1], self.width - x0)] + if tileData.shape[2] < retile.shape[2]: + retile = retile[:, :, :tileData.shape[2]] retile[y0:y0 + tileData.shape[0], x0:x0 + tileData.shape[1]] = tileData[ :, :, :retile.shape[2]] return retile