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

Handle OME Tiff files with odd tile sizes. #591

Merged
merged 1 commit into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
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
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