Skip to content

Commit

Permalink
Band interpretation for high bands errored.
Browse files Browse the repository at this point in the history
If there were more than four bands and the band interpretation is not
known, an error was thrown instead of returning `unknown`.
  • Loading branch information
manthey committed Sep 9, 2021
1 parent 4e1bb5b commit 8db8a55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## Unreleased

### Bug Fixes
- getBandInformation could fail on high bands in some cases

## Version 1.8.0

### Features
Expand Down
2 changes: 1 addition & 1 deletion large_image/tilesource/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ def getBandInformation(self, statistics=False, **kwargs):
if not getattr(self, '_bandInfoNoStats', None):
tile = self.getSingleTile()['tile']
bands = tile.shape[2] if len(tile.shape) > 2 else 1
interp = bandInterp.get(bands, 3)
interp = bandInterp.get(bands, bandInterp[3])
bandInfo = [{'interpretation': interp[idx] if idx < len(interp) else 'unknown'}
for idx in range(bands)]
self._bandInfoNoStats = bandInfo
Expand Down

0 comments on commit 8db8a55

Please sign in to comment.