Repository navigation
Fix Overviews Read Incorrectly when Per Dataset Masks Present bug - #3271
Conversation
69bcb2f to
7b0181c
Compare
| // TIFF Reader supports only overviews at this point | ||
| // Overview is a reduced-resolution IFD | ||
| val subfileType = ifdTiffTags.nonBasicTags.newSubfileType.flatMap(NewSubfileType.fromCode) | ||
| if(subfileType.contains(ReducedImage)) tiffTagsBuffer += ifdTiffTags |
There was a problem hiding this comment.
The idea is that we're skipping everything that is not a ReducedImage (anyway we can't work with anything else)
There was a problem hiding this comment.
👍 but also noting that this kind of comment is super helpful for a user to see in the method docstring. It would be helpful for the user to know at a glance something like "Only SubfileType.ReducedImage tiffs are supported".
| /** Reduced-resolution version of a transparency mask */ | ||
| case object MaskReducedImage extends NewSubfileType { val code = 5 } | ||
| /** Transparency mask of multi-page image */ | ||
| case object MaskMultiPage extends NewSubfileType { val code = 6 } | ||
| /** Transparency mask of reduced-resolution multi-page image */ | ||
| case object MaskMultiPageReducedImage extends NewSubfileType { val code = 7 } | ||
| /** Depth map */ | ||
| case object Depth extends NewSubfileType { val code = 8 } | ||
| /** Depth map of reduced-resolution image */ | ||
| case object DepthReducedImage extends NewSubfileType { val code = 9 } | ||
| /** Enhanced image data */ | ||
| case object Enhanced extends NewSubfileType { val code = 10 } |
There was a problem hiding this comment.
I decided to cover it with more types, see https://exiftool.org/TagNames/EXIF.html
64db3d0 to
d1ea372
Compare
CloudNiner
left a comment
There was a problem hiding this comment.
👍 after fixing that incorrect case match
| // TIFF Reader supports only overviews at this point | ||
| // Overview is a reduced-resolution IFD | ||
| val subfileType = ifdTiffTags.nonBasicTags.newSubfileType.flatMap(NewSubfileType.fromCode) | ||
| if(subfileType.contains(ReducedImage)) tiffTagsBuffer += ifdTiffTags |
There was a problem hiding this comment.
👍 but also noting that this kind of comment is super helpful for a user to see in the method docstring. It would be helpful for the user to know at a glance something like "Only SubfileType.ReducedImage tiffs are supported".
|
|
||
| import ProjectionTypesMap._ | ||
| import geotrellis.raster.io.geotiff.reader.MalformedGeoTiffException | ||
| import geotrellis.raster.io.geotiff.util._ |
There was a problem hiding this comment.
🎉 big fan of removal of unused imports whenever possible!
Overview
With this PR GeoTiff reader will skip all IFDs that are not a
ReducedImage.Checklist
Closes #3269