Skip to content

Commit

Permalink
Merge pull request #1268 from girder/harden-bioformats
Browse files Browse the repository at this point in the history
Harden when the bioformats reader claims it has a zero sized image
  • Loading branch information
manthey authored Aug 18, 2023
2 parents cc40d70 + c244219 commit 8e643b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## 1.23.4

### Improvements
- Harden when the bioformats reader claims it has a zero sized image ([#1268](../../pull/1268))

### Changes
- Adjust tifffile log level ([#1265](../../pull/1265))
- Use a newer version of the hammerjs touch events library in Girder ([#1266](../../pull/1266))
Expand Down
4 changes: 3 additions & 1 deletion sources/bioformats/large_image_source_bioformats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ def __init__(self, path, **kwargs): # noqa
self._metadata[key] = 1
self.sizeX = self._metadata['sizeX']
self.sizeY = self._metadata['sizeY']
if self.sizeX <= 0 or self.sizeY <= 0:
msg = 'File cannot be opened with biofromats.'
raise TileSourceError(msg)
self._computeTiles()
self._computeLevels()
self._computeMagnification()
Expand All @@ -249,7 +252,6 @@ def __init__(self, path, **kwargs): # noqa
self.logger.debug('File cannot be opened via Bioformats. (%s)', es)
raise TileSourceError('File cannot be opened via Bioformats. (%s)' % es)
except (AttributeError, UnicodeDecodeError):
raise
self.logger.exception('The bioformats reader threw an unhandled exception.')
msg = 'The bioformats reader threw an unhandled exception.'
raise TileSourceError(msg)
Expand Down

0 comments on commit 8e643b3

Please sign in to comment.