Skip to content

Commit

Permalink
Handle OME Tiff files with odd tile sizes.
Browse files Browse the repository at this point in the history
Have files where where lower levels report a tile size equal to the
image size instead of the regular tile size.
  • Loading branch information
manthey committed Apr 13, 2021
1 parent b12c7e6 commit 40bbd33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- More untiled tiff files are handles by the bioformats reader (#569)
- Expose a concurrent option on endpoints for converting images (#583)
- Better concurrency use in image conversion (#587)
- Handle more OME tiffs (#585)
- Handle more OME tiffs (#585, #591)

### Changes
- Exceptions on cached items are no longer within the KeyError context (#584)
Expand Down
3 changes: 2 additions & 1 deletion sources/ometiff/large_image_source_ometiff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ def getTile(self, x, y, z, pilImageAllowed=False, numpyAllowed=False,
if subdir:
scale = int(2 ** subdir)
if (dir is None or
dir.tileWidth != self.tileWidth or dir.tileHeight != self.tileHeight or
(dir.tileWidth != self.tileWidth and dir.tileWidth != dir.imageWidth) or
(dir.tileHeight != self.tileHeight and dir.tileHeight != dir.imageHeight) or
abs(dir.imageWidth * scale - self.sizeX) > scale or
abs(dir.imageHeight * scale - self.sizeY) > scale):
return super().getTile(
Expand Down

0 comments on commit 40bbd33

Please sign in to comment.