From d0a78049593102f4ed4b75274335620d069c23ce Mon Sep 17 00:00:00 2001 From: David Manthey Date: Fri, 20 Jan 2023 14:38:35 -0500 Subject: [PATCH] Fix an issue with non-square tiles in the multi source When there was a background color, the axes were confused. --- CHANGELOG.md | 3 +++ sources/multi/large_image_source_multi/__init__.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f029fb541..6b3067d07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ ### Improvements - Speed up rendering Girder item page metadata in some instances ([#1031](../../pull/1031)) +### Bug Fixes +- Fix an issue with non-square tiles in the multi source ([#1032](../../pull/1032)) + ## 1.19.2 ### Improvements diff --git a/sources/multi/large_image_source_multi/__init__.py b/sources/multi/large_image_source_multi/__init__.py index 55245d3d2..000fe5207 100644 --- a/sources/multi/large_image_source_multi/__init__.py +++ b/sources/multi/large_image_source_multi/__init__.py @@ -1024,7 +1024,7 @@ def getTile(self, x, y, z, pilImageAllowed=False, numpyAllowed=False, **kwargs): if fill: colors = self._info.get('backgroundColor') if colors: - tile = numpy.full((self.tileWidth, self.tileHeight, len(colors)), colors) + tile = numpy.full((self.tileHeight, self.tileWidth, len(colors)), colors) # Add each source to the tile for sourceEntry in sourceList: tile = self._addSourceToTile(tile, sourceEntry, corners, scale) @@ -1032,7 +1032,7 @@ def getTile(self, x, y, z, pilImageAllowed=False, numpyAllowed=False, **kwargs): # TODO number of channels? colors = self._info.get('backgroundColor', [0]) if colors: - tile = numpy.full((self.tileWidth, self.tileHeight, len(colors)), colors) + tile = numpy.full((self.tileHeight, self.tileWidth, len(colors)), colors) # We should always have a tile return self._outputTile(tile, TILE_FORMAT_NUMPY, x, y, z, pilImageAllowed, numpyAllowed, **kwargs)