Skip to content

Commit a9f2d0c

Browse files
authored
GeoTiffReader Unknown tags skip fix (#3557)
* GeoTiffReader Unknown tags skip fix * CHANGELOG.md update
1 parent e67c2e5 commit a9f2d0c

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Update GDAL up to 3.9.x [#3540](https://github.com/locationtech/geotrellis/pull/3540)
1313
- 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)
1414
- ConstantTile with NoData: support idempotent CellType conversions [#3553](https://github.com/locationtech/geotrellis/pull/3553)
15+
- GeoTiffReader Unknown tags skip fix [#3557](https://github.com/locationtech/geotrellis/pull/3557)
1516

1617
## [3.7.1] - 2024-01-08
1718

6.49 MB
Binary file not shown.

raster/src/main/scala/geotrellis/raster/io/geotiff/tags/TiffTags.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ object TiffTags {
692692
readLongsTag(byteReader, tiffTags, tagMetadata)
693693
case (_, IFDOffset) =>
694694
readLongsTag(byteReader, tiffTags, tagMetadata)
695-
case _ => TiffTags() // skip unsupported tags
695+
case _ => tiffTags // skip unsupported tags
696696
}
697697
}
698698

raster/src/test/scala/geotrellis/raster/io/geotiff/reader/GeoTiffReaderSpec.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,12 @@ class GeoTiffReaderSpec extends AnyFunSpec with Matchers with BeforeAndAfterAll
508508

509509
geoTiff.options.subfileType should be (None)
510510
}
511+
512+
// https://github.com/locationtech/geotrellis/issues/3556
513+
it("should skip unknown tags") {
514+
val geotiff = GeoTiff.readMultiband(geoTiffPath("unsupported-tiff-tags.tif"))
515+
geotiff.tags.headTags.size should be (2)
516+
}
511517
}
512518

513519
describe("Reading and writing special metadata tags ") {

0 commit comments

Comments
 (0)