Skip to content

Commit

Permalink
Merge pull request #538 from NKI-AI/master
Browse files Browse the repository at this point in the history
After resampling the tile size needs to be rounded up in tileiterator
  • Loading branch information
manthey authored Jan 25, 2021
2 parents 7f21a9a + a7aebe1 commit 6f470dd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions large_image/tilesource/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,12 +925,12 @@ def _tileIteratorInfo(self, **kwargs):
False if round(requestedScale, 2) == 1.0 or
kwargs.get('resample') in (None, False) else kwargs.get('resample'))
# If we need to resample to make tiles at a non-native resolution,
# adjust the tile size and tile overlap paramters appropriately.
# adjust the tile size and tile overlap parameters appropriately.
if resample is not False:
tile_size['width'] = max(1, int(round(tile_size['width'] * requestedScale)))
tile_size['height'] = max(1, int(round(tile_size['height'] * requestedScale)))
tile_overlap['x'] = int(round(tile_overlap['x'] * requestedScale))
tile_overlap['y'] = int(round(tile_overlap['y'] * requestedScale))
tile_size['width'] = max(1, int(math.ceil(tile_size['width'] * requestedScale)))
tile_size['height'] = max(1, int(math.ceil(tile_size['height'] * requestedScale)))
tile_overlap['x'] = int(math.ceil(tile_overlap['x'] * requestedScale))
tile_overlap['y'] = int(math.ceil(tile_overlap['y'] * requestedScale))

# If the overlapped tiles don't run over the edge, then the functional
# size of the region is reduced by the overlap. This factor is stored
Expand Down

0 comments on commit 6f470dd

Please sign in to comment.