Skip to content

fix: decode a Cal colour space without its dictionary as the device space - #750

Closed
RavSinghChandan wants to merge 1 commit into
pikepdf:mainfrom
RavSinghChandan:fix-cal-colorspace-without-dict
Closed

RavSinghChandan wants to merge 1 commit into
pikepdf:mainfrom
RavSinghChandan:fix-cal-colorspace-without-dict

Conversation

@RavSinghChandan

@RavSinghChandan RavSinghChandan commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

synthesize_cal_icc() documents that it returns None for malformed Cal* colour spaces and catches several errors for that, but not IndexError. So an image with /ColorSpace [/CalRGB] (no parameter dictionary) failed in as_pil_image() with IndexError: list index out of range, while one missing only /WhitePoint already falls back to the device space. Catching IndexError too gives both the same fallback.

Added test_cal_missing_dictionary_falls_back next to test_cal_missing_whitepoint_falls_back, plus a release note.

AI-assisted (Claude Code); I reviewed and tested the change.

@RavSinghChandan RavSinghChandan changed the title fix: decode a Cal colour space without its dictionary as the device s… fix: decode a Cal colour space without its dictionary as the device space Oct 11, 2026
@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.58%. Comparing base (b8ee8f0) to head (f2b9cef).
⚠️ Report is 23 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #750   +/-   ##
=======================================
  Coverage   92.58%   92.58%           
=======================================
  Files         118      118           
  Lines       15637    15637           
  Branches      900      900           
=======================================
+ Hits        14477    14478    +1     
+ Misses       1160     1159    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RavSinghChandan
RavSinghChandan force-pushed the fix-cal-colorspace-without-dict branch from 65519f8 to f2b9cef Compare October 19, 2026 06:45
@jbarlow83

Copy link
Copy Markdown
Member

Thanks! This was merged to main as 65519f8 (merge commit ae2cfb9), so I'm closing the PR.

@jbarlow83 jbarlow83 closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants