Repository navigation
Conversation
TIFF 6.0 defines a default of one bit for each sample when the BitsPerSample entry is absent, and bilevel fax and scanner files often omit it. The decoder assumed 8-bit RGB instead, so such files failed to decode or reported the wrong bit depth. The default now uses one bit for each of the SamplesPerPixel samples.
4 tasks done
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites
Description
Missing BitsPerSample
TiffFrameMetadata.Parsekept the 8-bit RGB default in this case. An uncompressed bilevel file without the entry then failed with "The number of samples in the TIFF BitsPerSample entry is not supported". A CCITT Group 4 file decoded, but its frame metadata reported no valid bits per pixel.TiffBitsPerSampleholds at most four samples). An entry that is present but invalid keeps its current handling.Testing
TiffDecoder_CanDecode_BilevelWithoutBitsPerSampleencodes a 16x8 bilevel image, uncompressed and with CCITT Group 4. It then moves the BitsPerSample entry to an unused private tag. The test checks that:Bit1;Image.Identifyreports 1 bit per pixel.All 812 tests in the Tiff area pass in Release on net10.0.
Fixes #3242