We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f15d770 commit e2aed8bCopy full SHA for e2aed8b
src/geotiffimage.js
@@ -295,8 +295,7 @@ class GeoTIFFImage {
295
}
296
297
getReaderForSample(sampleIndex) {
298
- const format = this.fileDirectory.SampleFormat
299
- ? this.fileDirectory.SampleFormat[sampleIndex] : 1;
+ const format = this.getSampleFormat(sampleIndex);
300
const bitsPerSample = this.fileDirectory.BitsPerSample[sampleIndex];
301
switch (format) {
302
case 1: // unsigned integer data
@@ -339,7 +338,8 @@ class GeoTIFFImage {
339
338
340
getSampleFormat(sampleIndex = 0) {
341
return this.fileDirectory.SampleFormat
342
+ ? (this.fileDirectory.SampleFormat[sampleIndex] ?? Math.max.apply(null, this.fileDirectory.SampleFormat))
+ : 1;
343
344
345
getBitsPerSample(sampleIndex = 0) {
0 commit comments