From a47257632de2cba4190098fbe5b54150ac4f0ac4 Mon Sep 17 00:00:00 2001 From: Anne Haley Date: Wed, 3 Apr 2024 19:22:47 +0000 Subject: [PATCH] fix: round up tile dimensions when dividing by 2 --- large_image/tilesource/resample.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/large_image/tilesource/resample.py b/large_image/tilesource/resample.py index e82379812..26b83cd92 100644 --- a/large_image/tilesource/resample.py +++ b/large_image/tilesource/resample.py @@ -99,8 +99,8 @@ def downsampleTileHalfRes( resample_method: ResampleMethod, ) -> np.ndarray: new_shape = { - 'height': int(tile.shape[0] / 2), - 'width': int(tile.shape[1] / 2), + 'height': (tile.shape[0] + 1) // 2, + 'width': (tile.shape[1] + 1) // 2, 'bands': 1, } if len(tile.shape) > 2: