-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Overviews Read Incorrectly when Per Dataset Masks Present bug #3271
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to cover it with more types, see https://exiftool.org/TagNames/EXIF.html
64db3d0
to
d1ea372
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 after fixing that incorrect case match
raster/src/main/scala/geotrellis/raster/io/geotiff/NewSubfileType.scala
Outdated
Show resolved
Hide resolved
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 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".
@@ -18,9 +18,7 @@ package geotrellis.raster.io.geotiff.tags | |||
|
|||
import ProjectionTypesMap._ | |||
import geotrellis.raster.io.geotiff.reader.MalformedGeoTiffException | |||
import geotrellis.raster.io.geotiff.util._ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 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