ColorSync suppression engine #14

Open
opened 2026-09-08 17:41:11 +01:00 by gronod · 0 comments
Owner

Summary

Six layers. Private SPI is 2-arg only. This ticket is the #188 engine.

Spec refs

docs/11-print-macos.md, 25-rewrite-notes.md macOS musts.

Scope

In: layers ②–⑥ on top of issue 13 session binding. Option filter.
Out: lp argv (15), Quartz vocabulary (16).

Implementation notes

① Session binding (issue 13).
dlsym(RTLD_DEFAULT) try in order:
PMSessionSetColorMatchingModeLock,
PMSessionSetColorMatchingMode,
PMSessionSetColorMatchingModeNoLock.
Signature (PMPrintSession, CFStringRef) -> OSStatus.
Modes: AP_ApplicationColorMatching then ApplicationColorMatching.
First (symbol, mode) returning 0 wins.
NEVER pass integer 1. Forbidden: AP_ColorSyncMatching, AP_VendorColorMatching.
Make dlsym injectable for tests.
PMPrintSettingsSetValue both AP_ColorMatchingMode and AP.ColorMatchingMode = AP_ApplicationColorMatching, LOCKED.
④ Driver bypass from lpoptions -l, written UNLOCKED:
Canon CNIJIntent2=4 else CNIJIntent=4;
Epson EPIJ_CCor=0 if that key exists else EPIJ_CMat=3;
Gutenprint StpColorCorrection=Uncorrected;
generic ColorCorrection=Uncorrected;
EpsonColorMode=Off.
⑤ Mirror all keys into NSPrintInfo.printSettings (PDEs read this).
⑥ After OK: PMPrintSettingsToOptions → filter (drop com.apple.*, collate/copies/job-sheets, empty values, BOTH AP_* keys — issue 15 always re-adds them) → capturedCupsOptions + extracted media type.
Sanitise option keys/values: no ;, newlines, or shell metacharacters.

Rewrite invariants

#188 three layers off; SPI arity contractual; never mix Quartz APCustomColorMatching here.

Dependencies

Blocks-on: 12, 13.
Unblocks: 15.

Test

  • CI/mock: injectable dlsym order; filter fixtures keep EPIJ_CMat drop com.apple.*; sanitiser rejects ;.
  • Hardware: PDE colour matching off/grayed on Epson AND Canon.

Acceptance criteria

  • Unit tests for symbol-priority and option filter pass.
  • Hardware AC recorded in the PR even if signed “pending hardware”.
## Summary Six layers. Private SPI is 2-arg only. This ticket is the #188 engine. ## Spec refs docs/11-print-macos.md, 25-rewrite-notes.md macOS musts. ## Scope In: layers ②–⑥ on top of issue 13 session binding. Option filter. Out: lp argv (15), Quartz vocabulary (16). ## Implementation notes ① Session binding (issue 13). ② `dlsym(RTLD_DEFAULT)` try in order: `PMSessionSetColorMatchingModeLock`, `PMSessionSetColorMatchingMode`, `PMSessionSetColorMatchingModeNoLock`. Signature `(PMPrintSession, CFStringRef) -> OSStatus`. Modes: `AP_ApplicationColorMatching` then `ApplicationColorMatching`. First (symbol, mode) returning 0 wins. NEVER pass integer 1. Forbidden: `AP_ColorSyncMatching`, `AP_VendorColorMatching`. Make dlsym injectable for tests. ③ `PMPrintSettingsSetValue` both `AP_ColorMatchingMode` and `AP.ColorMatchingMode` = `AP_ApplicationColorMatching`, LOCKED. ④ Driver bypass from `lpoptions -l`, written UNLOCKED: Canon `CNIJIntent2=4` else `CNIJIntent=4`; Epson `EPIJ_CCor=0` if that key exists else `EPIJ_CMat=3`; Gutenprint `StpColorCorrection=Uncorrected`; generic `ColorCorrection=Uncorrected`; `EpsonColorMode=Off`. ⑤ Mirror all keys into `NSPrintInfo.printSettings` (PDEs read this). ⑥ After OK: `PMPrintSettingsToOptions` → filter (drop `com.apple.*`, collate/copies/job-sheets, empty values, BOTH AP_* keys — issue 15 always re-adds them) → `capturedCupsOptions` + extracted media type. Sanitise option keys/values: no `;`, newlines, or shell metacharacters. ## Rewrite invariants #188 three layers off; SPI arity contractual; never mix Quartz `APCustomColorMatching` here. ## Dependencies Blocks-on: 12, 13. Unblocks: 15. ## Test - CI/mock: injectable dlsym order; filter fixtures keep `EPIJ_CMat` drop `com.apple.*`; sanitiser rejects `;`. - Hardware: PDE colour matching off/grayed on Epson AND Canon. ## Acceptance criteria - [ ] Unit tests for symbol-priority and option filter pass. - [ ] Hardware AC recorded in the PR even if signed “pending hardware”.
gronod added this to the M3 — macOS unmanaged printing (lp) milestone 2026-09-08 17:41:11 +01:00
gronod added the
Priority
Critical
1
Project/ICCery-v2Feature/Backend
labels 2026-09-08 17:41:11 +01:00
gronod reopened this issue 2026-09-09 10:08:30 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gronod/iccery-v2-mac#14