Repository navigation
Conversation
… components A JP2 declaring sRGB over four codestream components with no cdef box failed every Rgb8/Rgba8 decode under the default strict settings with "backend color space cannot be mapped to requested 8-bit pixel format". The component-count fallback in resolve_alpha_and_color_space replaced the declared sRGB with CMYK, which has no 8-bit RGB mapping. Kakadu 7 wrote such files from RGBA TIFFs unless -jp2_alpha was given. Without a channel definition, ISO/IEC 15444-1 I.5.3.6 leaves the components after those of the declared color space unspecified. When a JP2 declares an enumerated or ICC color space, has no cdef or palette, and has more components than that space (plus alpha), keep the color space and record the extras as Image::ignored_components. Decoded output omits them: finish_decoded_image, the native RawBitmap decodes, streamed region rows and the native planes sink keep only the color and alpha components. Device plane reuse is disabled for such images. Lenient decoding still infers alpha for exactly one extra component, and raw codestreams keep their component-count interpretation. Recode keeps every component, since it reuses the source JP2 metadata. The HTJ2K batch direct-plan builder now treats DirectPlanUnsupported as "not direct" and falls back instead of failing the job.
Choose bounded u8/u16 row layouts from resolved color and alpha metadata. Compare all codestream components during recode validation and cover row output and preservation with regression tests. Update the API inventories and review records for the original JP2 color-space change.
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.
JP2 files with unspecified extra components keep their declared color space and omit the extras from display output. Recoding preserves every codestream component. This branch retains Justin Coyne’s original commit from #323.
Bounded 8-bit and 16-bit row decoding now chooses its output format from the resolved color space and alpha state. Recode validation compares all components, avoiding a false mismatch between filtered JP2 display output and raw codestream output.
Adds regressions for two-component grayscale, four- and five-component sRGB bounded rows, and preservation of all four component samples during recoding. Updates the public and hidden API inventories and their semver review records.
Validation: Rust formatting and diff checks pass. GitHub Actions will validate this branch independently of other development work.