diff --git a/CHANGELOG.md b/CHANGELOG.md index c84835bb96..144bc671f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update GDAL up to 3.9.x [#3540](https://github.com/locationtech/geotrellis/pull/3540) - Fix reprojection with downsampling for GeotiffRasterSource and tile RDDs. Reprojection outside the valid projection bounds may now throw a GeoAttrsError. [#3541](https://github.com/locationtech/geotrellis/issues/3541) - ConstantTile with NoData: support idempotent CellType conversions [#3553](https://github.com/locationtech/geotrellis/pull/3553) +- GeoTiffReader Unknown tags skip fix [#3557](https://github.com/locationtech/geotrellis/pull/3557) ## [3.7.1] - 2024-01-08 diff --git a/raster/data/geotiff-test-files/unsupported-tiff-tags.tif b/raster/data/geotiff-test-files/unsupported-tiff-tags.tif new file mode 100644 index 0000000000..f9d2ef0bb5 Binary files /dev/null and b/raster/data/geotiff-test-files/unsupported-tiff-tags.tif differ diff --git a/raster/src/main/scala/geotrellis/raster/io/geotiff/tags/TiffTags.scala b/raster/src/main/scala/geotrellis/raster/io/geotiff/tags/TiffTags.scala index 88deba6aea..82f92733a4 100644 --- a/raster/src/main/scala/geotrellis/raster/io/geotiff/tags/TiffTags.scala +++ b/raster/src/main/scala/geotrellis/raster/io/geotiff/tags/TiffTags.scala @@ -692,7 +692,7 @@ object TiffTags { readLongsTag(byteReader, tiffTags, tagMetadata) case (_, IFDOffset) => readLongsTag(byteReader, tiffTags, tagMetadata) - case _ => TiffTags() // skip unsupported tags + case _ => tiffTags // skip unsupported tags } } diff --git a/raster/src/test/scala/geotrellis/raster/io/geotiff/reader/GeoTiffReaderSpec.scala b/raster/src/test/scala/geotrellis/raster/io/geotiff/reader/GeoTiffReaderSpec.scala index 86e7a2b5ab..fbc8c0a41f 100644 --- a/raster/src/test/scala/geotrellis/raster/io/geotiff/reader/GeoTiffReaderSpec.scala +++ b/raster/src/test/scala/geotrellis/raster/io/geotiff/reader/GeoTiffReaderSpec.scala @@ -508,6 +508,12 @@ class GeoTiffReaderSpec extends AnyFunSpec with Matchers with BeforeAndAfterAll geoTiff.options.subfileType should be (None) } + + // https://github.com/locationtech/geotrellis/issues/3556 + it("should skip unknown tags") { + val geotiff = GeoTiff.readMultiband(geoTiffPath("unsupported-tiff-tags.tif")) + geotiff.tags.headTags.size should be (2) + } } describe("Reading and writing special metadata tags ") {