Files
photocraft/crates/ipp
David MannandClaude Opus 5.5 25270653b0 Pin craft-libs at craft-libs#4527's merge commit 0b064039 on main
Builds on #18404 (the port to craft-libs main 83fa9a5d: legacy preferences
import, the Type tool's editor host) and follows two more framework changes:

- FormDialog::extra_buttons no longer forces stays_open: an extra button
  without it now closes the dialog and accepts. The Fill script dialog's
  Reset, Color Table's Load/Save, Contact Sheet's Load/Save/Reset and
  "Stop syncing this Smart Object" all act and close themselves, so each
  keeps stays_open(true).
- A target change now withdraws only queued input aimed at a point; keys
  stay and go to the focus current when they run. The lifecycle test
  queues a click at a point instead of a key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 23:30:24 +01:00
..

photocraft-ipp

A small IPP (Internet Printing Protocol, RFC 8010/8011) client for the local CUPS server, in pure Rust with no dependencies. It does in-process what lp does from the command line, so PhotoCraft can print where there is no lp binary (a Flatpak sandbox with --socket=cups, a minimal container) and can read the printer list and the default printer first instead of handing CUPS's errors to the user.

let ep = photocraft_ipp::Endpoint::detect().ok_or("no CUPS server")?;   // socket, then localhost:631
let printers = photocraft_ipp::printers(&ep)?;                            // name, info, state, default
let id = photocraft_ipp::print_job(&ep, &photocraft_ipp::Job { printer: "Office", title: "photo", user: "me", copies: 2, document: &pdf, format: "application/pdf" })?;

Three operations: CUPS-Get-Printers, CUPS-Get-Default, Print-Job. HTTP/1.1 over the CUPS domain socket (/run/cups/cups.sock, or CUPS_SERVER as a path) or TCP (localhost:631, or CUPS_SERVER as host[:port]), chunked replies included. Replies are capped at 16 MiB and parsed with bounds checks; an IPP error status becomes Error::Status with the server's own message. Tests run against an in-process fake server over TCP and a Unix socket.

Standalone: it depends on no other PhotoCraft crate. Used by photocraft-engine's print commands on Unix; Windows printing lives in photocraft-winprint.