Skip to content

Commit

Permalink
fix: Fallback to format=1 if not format for sample index
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt authored Feb 20, 2024
1 parent da93668 commit 040d984
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/geotiffimage.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,7 @@ class GeoTIFFImage {
}

getReaderForSample(sampleIndex) {
const format = this.fileDirectory.SampleFormat
? this.fileDirectory.SampleFormat[sampleIndex] : 1;
const format = this.fileDirectory.SampleFormat?.[sampleIndex] ?? 1;
const bitsPerSample = this.fileDirectory.BitsPerSample[sampleIndex];
switch (format) {
case 1: // unsigned integer data
Expand Down

0 comments on commit 040d984

Please sign in to comment.