feat: Stage 2 - Target Image Layout & printtarg Integration #12

Merged
gronod merged 1 commits from feature/stage-2-printtarg into feature/stage-1-targen 2026-08-22 18:27:15 +01:00
Owner

Summary

Implements Issue #4 (Milestone 2: Target Generation Pipeline). After Stage 1 generates a .ti1 target definition, Stage 2 lets the user configure instrument type, page size, bit depth, and DPI, then spawns the ArgyllCMS printtarg binary to produce printable TIFF images and a .ti2 layout file.

Changes

Backend (Rust)

  • PrinttargConfig struct with instrument, page_size, bit_depth, dpi, basename, cwd fields
  • build_printtarg_args() — maps config to CLI flags including the custom -u flag for JSON manifest output
  • run_printtarg Tauri command — resolves the printtarg sidecar binary and spawns it via ProcessManager
  • read_file_base64 Tauri command — utility to load generated TIFF files as base64 for in-app preview
  • base64 = "0.22" dependency added to Cargo.toml
  • 3 new unit tests for build_printtarg_args (i1/A4/8-bit, ColorMunki/Letter/16-bit, custom page size)

Frontend (HTML/JS/CSS)

  • Stage 2 form (index.html): instrument dropdown (8 instruments), page size dropdown (9 presets + custom WxH), bit depth radio (8/16-bit), DPI selector (100/200/300/600)
  • Warning banner: Non-dismissable colour management warning with orange accent styling
  • printtarg.js: Process event listeners, JSON manifest parsing from -u stdout, base64 TIFF gallery rendering with fallback icons
  • Inter-stage wiring: targen.js passes basename/cwd to printtarg.js via setStage1Result() on Stage 1 success
  • CSS: Warning banner, responsive gallery grid with hover effects, fallback card styling

Testing

  • cargo test — all 5 tests pass (2 targen + 3 printtarg)
  • Manual end-to-end: Stage 1 → Stage 2 → .ti2 + .tif files created successfully

Closes #4

## Summary Implements Issue #4 (Milestone 2: Target Generation Pipeline). After Stage 1 generates a `.ti1` target definition, Stage 2 lets the user configure instrument type, page size, bit depth, and DPI, then spawns the ArgyllCMS `printtarg` binary to produce printable TIFF images and a `.ti2` layout file. ## Changes ### Backend (Rust) - **`PrinttargConfig` struct** with instrument, page_size, bit_depth, dpi, basename, cwd fields - **`build_printtarg_args()`** — maps config to CLI flags including the custom `-u` flag for JSON manifest output - **`run_printtarg` Tauri command** — resolves the `printtarg` sidecar binary and spawns it via `ProcessManager` - **`read_file_base64` Tauri command** — utility to load generated TIFF files as base64 for in-app preview - **`base64 = "0.22"` dependency** added to Cargo.toml - **3 new unit tests** for `build_printtarg_args` (i1/A4/8-bit, ColorMunki/Letter/16-bit, custom page size) ### Frontend (HTML/JS/CSS) - **Stage 2 form** (`index.html`): instrument dropdown (8 instruments), page size dropdown (9 presets + custom WxH), bit depth radio (8/16-bit), DPI selector (100/200/300/600) - **Warning banner**: Non-dismissable colour management warning with orange accent styling - **`printtarg.js`**: Process event listeners, JSON manifest parsing from `-u` stdout, base64 TIFF gallery rendering with fallback icons - **Inter-stage wiring**: `targen.js` passes basename/cwd to `printtarg.js` via `setStage1Result()` on Stage 1 success - **CSS**: Warning banner, responsive gallery grid with hover effects, fallback card styling ## Testing - `cargo test` — all 5 tests pass (2 targen + 3 printtarg) - Manual end-to-end: Stage 1 → Stage 2 → `.ti2` + `.tif` files created successfully Closes #4
gronod added 1 commit 2026-08-22 17:43:18 +01:00
gronod merged commit 29f89cf93a into feature/stage-1-targen 2026-08-22 18:27:15 +01:00
Sign in to join this conversation.