forked from AcademySoftwareFoundation/OpenImageIO
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix broken TIFF reads of multi-subimage non-spectral files (AcademySo…
…ftwareFoundation#2692) For a few rare edge cases of photometric interpretation, we fall back on libtiff's ability to auto-translate to an RGBA image for us. It only does this for the whole image at once, so we do it for the first scanline we read (storing the whole image in a buffer, skipping the conversion for subsequent scanlines -- and it can tell it's the "first" scanline because the buffer isn't yet allocated). The bug was that for these cases (such as a photometric YCbCr), if the file was *multi-subimage*, we were not clearing the rgba buffer, so upon reading the second subimage, it thought its buffer was already filled, so it wasn't actually doing the read and convert, just using whatever was already living in the buffer. Oops. Also, I noticed that we should clear m_use_rgba_interface for each subimage -- it was previously just setting it when it found those edge cases. We never saw a symptom from this, but I realized it would be problematic for a file where the first subimage was YCbCr and the second subimage was regular RGB, it wouldn't know to fall back to our usual code path. Signed-off-by: Larry Gritz <lg@larrygritz.com>
- Loading branch information
Showing
5 changed files
with
10 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters