lp spool path — unmanaged raster jobs (#15) #46

Merged
gronod merged 1 commits from feat/15-lp-spool into milestone/m3-printing 2026-09-09 00:23:55 +01:00
Owner

build_lp_args per docs/11 — spools each gallery TIFF through /usr/bin/lp:

lp -d <queue> -t "ICCery Target - <file>"
   -o AP_ColorMatchingMode=AP_ApplicationColorMatching
   -o AP.ColorMatchingMode=AP_ApplicationColorMatching
   <captured cups_options>            ← replayed, lowercased-key dedup
   <media_type via detected key>      ← only if no media key captured
   <driver colour bypass>             ← only if no bypass key captured; never gated
   <orientation-requested=3|4>        ← unless captured
   <PageSize>                         ← unless captured
   <tiff>                             ← always last
  • Never -o raw (#92): raw is dropped by the capture filter and skipped again at build — -o raw bypasses the raster filter that honours AP_ApplicationColorMatching.
  • Captured options sanitised (;, newlines, shell metachars → LpArgsError); argv is a Process array, never a shell string.
  • CupsService.printTarget: TIFF existence check, optionKeys fetch for media/bypass detection, runCaptured spawn with ProcessID.lp(queue, page).

Tests: 9 argv-golden suites — both AP_* always first, captured wins, sanitise rejects ;, TIFF last.

Closes #15.

Generated with Devin

`build_lp_args` per docs/11 — spools each gallery TIFF through `/usr/bin/lp`: ``` lp -d <queue> -t "ICCery Target - <file>" -o AP_ColorMatchingMode=AP_ApplicationColorMatching -o AP.ColorMatchingMode=AP_ApplicationColorMatching <captured cups_options> ← replayed, lowercased-key dedup <media_type via detected key> ← only if no media key captured <driver colour bypass> ← only if no bypass key captured; never gated <orientation-requested=3|4> ← unless captured <PageSize> ← unless captured <tiff> ← always last ``` - **Never `-o raw`** (#92): `raw` is dropped by the capture filter and skipped again at build — `-o raw` bypasses the raster filter that honours `AP_ApplicationColorMatching`. - Captured options sanitised (`;`, newlines, shell metachars → `LpArgsError`); argv is a `Process` array, never a shell string. - `CupsService.printTarget`: TIFF existence check, `optionKeys` fetch for media/bypass detection, `runCaptured` spawn with `ProcessID.lp(queue, page)`. Tests: 9 argv-golden suites — both `AP_*` always first, captured wins, sanitise rejects `;`, TIFF last. Closes #15. Generated with [Devin](https://devin.ai)
gronod added the Kind/Feature
Priority
Critical
1
Project/ICCery-v2Feature/Backend
labels 2026-09-09 00:23:48 +01:00
gronod added 1 commit 2026-09-09 00:23:49 +01:00
- LpArgs.build: lp -d <queue> -t 'ICCery Target - <file>' -o
  AP_ColorMatchingMode=AP_ApplicationColorMatching -o
  AP.ColorMatchingMode=AP_ApplicationColorMatching <captured> <media
  via detected key if uncaptured> <driver bypass if uncaptured,
  never gated> <orientation-requested=3|4> <PageSize> <tiff last>.
- Never -o raw (#92): raw is dropped by the capture filter AND skipped
  at build time.
- Captured options win over derived fields (case-insensitive dedup);
  sanitise rejects ;, newlines, shell metachars — argv array only.
- CupsService.printTarget: TIFF existence check, optionKeys lookup for
  media/bypass detection, runCaptured spawn.
- ProcessID.lp(queue, page).

Tests: 9 argv golden suites — both AP_* always present, captured wins,
sanitise rejects ;, no raw.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
gronod merged commit 5d150f2aa9 into milestone/m3-printing 2026-09-09 00:23:55 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gronod/iccery-v2-mac#46