Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After resampling the tile size needs to be rounded up in tileiterator #538

Merged
merged 1 commit into from
Jan 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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