V4 TIFF : Allow additional and undefined extra samples #2941
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
See #2408
This PR removes explicit validation checks that disallow TIFF files with unspecified or multiple
TiffExtraSampleType
values. These checks are unnecessary and overly restrictive.Rationale
Decoder logic already defends against unsupported configurations
The decoding path only processes known and supported sample layouts (e.g., RGB + unassociated alpha). Unsupported layouts naturally fail at the point of use without requiring upfront rejection.
Unspecified extra samples cannot be meaningfully decoded
According to the TIFF specification,
TiffExtraSampleType.UnspecifiedData
provides no semantic meaning. There is no way to determine how such channels should be interpreted. Since these channels carry no defined role, the decoder either discards them or ignores them during processing. Explicit rejection is redundant.Improved compatibility with real-world files
TIFFs produced by some tools (e.g., legacy or proprietary software) may include extra channels with incomplete or non-standard metadata. Allowing the decoder to handle these cases gracefully increases format compatibility without compromising decoder integrity.
Notes
ExtraSamples
, such as the CorelDRAW-specific999
value.See libtiff 3.9.0beta release