Repository navigation
fix: honor PDF color component ranges - #1162
Merged
Merged
Conversation
andiwand
force-pushed
the
review/143-release-validation
branch
from
October 6, 2026 18:49
e3bf9b1 to
4fd5f32
Compare
An invalid ICC Range, an invalid Lab WhitePoint or Range, or a Lab space without parameters rejected the whole colour space. scn then read the three Lab components as RGB. Main used the defaults in all these cases, and they stay valid: the white point and the ranges are only taken when they pass the checks that protect the conversion. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxyTMutqSUJRGfxA8CyzMc
andiwand
force-pushed
the
review/144-pdf-color-ranges
branch
from
October 6, 2026 18:57
7ddc641 to
32d0291
Compare
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.
🤖 Generated with Claude Code
PDF Lab palettes and image samples were decoded as 0–1 values, so even a white palette entry could render nearly black. ICC Range arrays were ignored, and direct Lab colors were not clipped to their declared ranges.
Share component ranges across direct conversion, initial colors, palette scaling and default image decoding. Validate Lab white points and Lab/ICC range arrays, keeping the defaults for invalid values as before, and use stable interpolation for sample decoding. Shorten the color-space contracts and document the shared conversion rule. ICC profiles still use the existing alternate-space approximation.
Validation: three regressions expose 16 parent failures. All 184 color/image/parser/shading/extraction tests and 50 PDF corpus HTML-generation tests pass. Both changed implementations pass LLVM 22 clang-tidy and object builds for NDK 28.1, emsdk 3.1.73 and iOS 15. Rules follow ISO 32000-1 §§8.6.5.4–5, 8.6.6.3 and Table 90.