From 040d98458afd2ff80d1b14b7cd610e76e820f5fd Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Tue, 20 Feb 2024 12:29:00 -0500 Subject: [PATCH] fix: Fallback to format=1 if not format for sample index --- src/geotiffimage.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/geotiffimage.js b/src/geotiffimage.js index aff618ca..7ece4055 100644 --- a/src/geotiffimage.js +++ b/src/geotiffimage.js @@ -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