diff --git a/.coderabbit.yaml b/.coderabbit.yaml
new file mode 100644
index 0000000000..2408084cf9
--- /dev/null
+++ b/.coderabbit.yaml
@@ -0,0 +1,6 @@
+# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
+reviews:
+ auto_review:
+ # Dependabot bumps are checked by CI; skip CodeRabbit reviews on them.
+ ignore_usernames:
+ - "dependabot[bot]"
diff --git a/.config/nextest.toml b/.config/nextest.toml
index 83ee9cd6f6..2ef6d6f215 100644
--- a/.config/nextest.toml
+++ b/.config/nextest.toml
@@ -1,3 +1,7 @@
+# Refuse to run under a nextest older than the fixed release: GHSA-vc25-qg58-w57c is fixed in
+# 0.9.150, and CI installs exactly that version (an older nextest exits 92 REQUIRED_VERSION_NOT_MET).
+nextest-version = "0.9.150"
+
# cargo-nextest (https://nexte.st): runs every test in its own process, in parallel across test
# binaries. CI runs it with the `ci` profile below (#6117); locally it is optional and `cargo test`
# keeps working (#2204).
@@ -15,10 +19,29 @@ gpu = { max-threads = 4 }
filter = 'package(photocraft-gpu) | (package(photocraft-ui-egui) & (kind(test) | test(/canvas|gpu|mip|type_tool|background_redraw::|floating_group_titles|swap_arrow::tests::rendered_glyph/)))'
test-group = 'gpu'
-# CI (`--profile ci`, .github/workflows/ci.yml). Stops at the first failure so a red PR frees its
-# runner, fails a test that hangs instead of letting it hold the runner, and repeats every failure
-# at the end of the log. The default profile's GPU override still applies.
+# CI (`--profile ci`, .github/workflows/ci.yml). Collect all failures in one integration run
+# instead of exposing one regression per rebuild. A hanging test still terminates, and every
+# failure is repeated at the end of the log. The default profile's GPU override still applies.
[profile.ci]
-fail-fast = true
+fail-fast = false
slow-timeout = { period = "60s", terminate-after = 10 }
failure-output = "immediate-final"
+
+# Keep phase timings for the remaining expensive Windows GPU regressions visible. This does
+# not relax their timeout, isolate failures differently or remove any test cases.
+# Page eviction and budget borrowing redraw multi-effect documents. On the Windows
+# CPU-backed adapter it uses all GPU slots, avoiding oversubscription without skipping work.
+[[profile.ci.overrides]]
+platform = 'cfg(target_os = "windows")'
+filter = 'package(photocraft-gpu) & test(/pages_are_evicted_under_the_budget|layer_pages_that_just_miss_borrow_the_effect_map_share/)'
+threads-required = 4
+success-output = "immediate"
+
+[[profile.ci.overrides]]
+platform = 'cfg(target_os = "windows")'
+filter = 'package(photocraft-gpu) & test(/documents_larger_than_the_texture_limit|layer_effects_update_incrementally|pages_are_evicted_under_the_budget|the_focused_view_stays_resident_after_a_full_refresh/)'
+success-output = "immediate"
+# These multi-page effect regressions saturate the Windows software GPU. Reserve two
+# scheduling slots so four independent devices do not compete for the same CPU renderer.
+# All cases and the 60-second warning remain unchanged.
+threads-required = 2
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000000..2c4b8cb1a4
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,30 @@
+version: 2
+updates:
+ # Maintain Rust / Cargo dependencies
+ - package-ecosystem: "cargo"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ time: "06:00"
+ timezone: "America/New_York"
+ # Consolidate updates into a single PR rather than one PR per crate
+ groups:
+ cargo-dependencies:
+ patterns:
+ - "*"
+ commit-message:
+ prefix: "chore(deps)"
+
+ # Maintain GitHub Actions workflows
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ time: "06:00"
+ timezone: "America/New_York"
+ groups:
+ actions:
+ patterns:
+ - "*"
+ commit-message:
+ prefix: "ci(deps)"
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4303f0aac4..c15bc9542b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,12 +1,40 @@
name: CI
+# Quality gates for every push to main and every pull request. The Linux gate runs through the
+# suite's shared gate workflow in craft-common-actions (`cargo xtask ci`); the Windows legs, the
+# test variant and the corpus, web and fuzz jobs are PhotoCraft's own.
on:
push:
branches: [main]
pull_request:
- types: [opened, synchronize, reopened, ready_for_review]
+ # `labeled` so that adding `full-ci` to an open PR starts a run with Windows in it.
+ types: [opened, synchronize, reopened, labeled]
workflow_dispatch:
inputs:
+ full_sweep:
+ description: "Run every testkit sweep case (runtime comparison and integration validation)"
+ type: boolean
+ default: false
+ color_range:
+ description: "Compare cropped Color Range on 24 MP (Linux, exact outputs)"
+ type: boolean
+ default: false
+ selection_combining:
+ description: "Compare direct GRAY8 selection combining on 36 MP (Linux, exact outputs)"
+ type: boolean
+ default: false
+ brush_tip:
+ description: "Compare cached round-tip rasterization on 24 MP"
+ type: boolean
+ default: false
+ brush_tip_base:
+ description: "Baseline commit for the round-tip comparison"
+ type: string
+ default: "main"
+ selection_morphology:
+ description: "Compare selection morphology on 36 MP (Linux, exact outputs)"
+ type: boolean
+ default: false
fuzz:
description: "Run the fuzz job"
type: boolean
@@ -14,59 +42,89 @@ on:
fuzz_seconds:
description: "Seconds per fuzz target"
default: "600"
+ dry_mixer:
+ description: "Compare the live Mixer Brush against the origin/main merge base on 24 MP (Linux)"
+ type: boolean
+ default: false
+
+# The token is only used to check out the code: no job writes to the repository.
+permissions:
+ contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
+ PHOTOCRAFT_FULL_SWEEP: ${{ inputs.full_sweep && '1' || '0' }}
# No test or fuzz run may print a page: the engine refuses to spool, and if something ever
# bypasses that, lp fails loudly on a printer that does not exist.
PHOTOCRAFT_NO_PRINT: "1"
LPDEST: photocraft-no-such-printer
- # Debug and test builds keep line tables (file:line in panic backtraces) but drop the rest of the
- # debug info: faster codegen and links, and a smaller target dir (the Linux test job ran out of
- # disk with full debug info). The Windows test legs drop debuginfo entirely (see the test job).
- CARGO_PROFILE_DEV_DEBUG: line-tables-only
-# A newer push to a PR branch cancels its older run. Runs on main are never cancelled: a merge
-# that lands while main's run is in progress waits for it, so every main state that gets a run is
-# checked to the end. (Cancelling here left main unverified whenever merges came close together.)
+# A newer push to a PR branch cancels its older run. Every push to main gets a run of its own that
+# is never cancelled, so each state of main is checked to the end. Adding any label but `full-ci`
+# gets a group of its own, so it neither runs anything nor cancels a run.
concurrency:
- group: ci-${{ github.ref }}
+ group: ci-${{ github.event_name == 'pull_request' && (github.event.action != 'labeled' || github.event.label.name == 'full-ci') && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
- # Which OSes the test job runs on. main, manual runs and PRs labelled `full-ci` get Linux and
- # Windows. Other PRs get Linux, plus Windows when they touch code whose behaviour differs by
- # platform: the app shell, UI, text and fonts, GPU, pen input, build scripts or the lockfile.
- # macOS is tested only by release.yml.
+ # Whether the Windows legs and the web build run. main, manual runs and PRs labelled `full-ci`
+ # get both. Other PRs get Windows when they touch code whose behaviour differs by platform: the
+ # app shell, UI, text and fonts, GPU, pen input, native saves, build scripts or the lockfile.
+ # Format changes must exercise the Windows-only publication barriers (#8034). macOS is tested
+ # only by release.yml.
platforms:
+ if: github.event.action != 'labeled' || github.event.label.name == 'full-ci'
timeout-minutes: 10
name: select platforms
runs-on: ubuntu-latest
outputs:
- legs: ${{ steps.pick.outputs.legs }}
+ windows: ${{ steps.pick.outputs.windows }}
web: ${{ steps.pick.outputs.web }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
+ persist-credentials: false
+ - name: Git dependencies come from storytold
+ run: |
+ set -euo pipefail
+ test -f Cargo.lock || { echo "Cargo.lock is missing"; exit 1; }
+ # Source replacement, patches and path overrides in cargo config never show up
+ # in Cargo.lock. Parsed rather than grepped: TOML has many spellings of one key.
+ # Cargo still reads the legacy .cargo/config.
+ python3 - <<'PY'
+ import os, sys, tomllib
+ for path in (".cargo/config", ".cargo/config.toml"):
+ if not os.path.exists(path):
+ continue
+ config = tomllib.load(open(path, "rb"))
+ replaced = [name for name, source in config.get("source", {}).items()
+ if isinstance(source, dict) and "replace-with" in source]
+ if replaced or "patch" in config or "paths" in config:
+ print(f"{path} replaces, patches or overrides a source")
+ sys.exit(1)
+ PY
+ # Fails when Cargo.lock is out of date with the manifests.
+ cargo metadata --locked --format-version 1 > /dev/null
+ python3 - <<'PY'
+ import sys, tomllib
+ lock = tomllib.load(open("Cargo.lock", "rb"))
+ bad = sorted({p["source"] for p in lock.get("package", [])
+ if p.get("source", "").startswith("git+")
+ and not p["source"].startswith("git+https://github.com/storytold/")})
+ if bad:
+ print("Git dependencies outside github.com/storytold:", *bad, sep="\n")
+ sys.exit(1)
+ PY
- id: pick
env:
EVENT: ${{ github.event_name }}
BASE: ${{ github.event.pull_request.base.sha }}
FULL: ${{ contains(github.event.pull_request.labels.*.name, 'full-ci') }}
run: |
- # No macOS on PRs or main: the org's 5 macOS slots are kept for release builds, and
- # release.yml builds and tests macOS (a failing release is fixed and rebuilt).
- # Windows tests run as two legs in parallel: the unit tests and the integration tests. As
- # one job they took ~28 min on the Windows runner; the legs take ~13 and ~15. Splitting
- # the integration tests over a third runner (nextest --partition) saved ~2 min of wall
- # time but cost ~7 runner-minutes and one more Windows slot per PR.
- linux='{"os":"ubuntu-latest","part":"all"}'
- win() { printf '{"os":"windows-latest","part":"%s"}' "$1"; }
- all="[$linux,$(win unit),$(win integration)]"
if [ "$EVENT" != pull_request ] || [ "$FULL" = true ]; then
- echo "legs=$all" >> "$GITHUB_OUTPUT"
+ echo "windows=true" >> "$GITHUB_OUTPUT"
echo "web=true" >> "$GITHUB_OUTPUT"
exit 0
fi
@@ -78,67 +136,101 @@ jobs:
else
echo "web=false" >> "$GITHUB_OUTPUT"
fi
- if git diff --name-only "$BASE" HEAD | grep -Eq '^(apps/|crates/(ui-egui|text|gpu|tablet|heif)/|Cargo\.lock$|(.*/)?build\.rs$|\.github/workflows/ci\.yml$)'; then
- echo "legs=$all" >> "$GITHUB_OUTPUT"
+ if git diff --name-only "$BASE" HEAD | grep -Eq '^(apps/|crates/(ui-egui|text|gpu|tablet|heif|format)/|Cargo\.lock$|(.*/)?build\.rs$|\.github/workflows/ci\.yml$)'; then
+ echo "windows=true" >> "$GITHUB_OUTPUT"
else
- echo "legs=[$linux]" >> "$GITHUB_OUTPUT"
+ echo "windows=false" >> "$GITHUB_OUTPUT"
fi
- test:
- timeout-minutes: 100
- name: test (${{ matrix.os }}${{ matrix.part != 'all' && format(', {0}', matrix.part) || '' }})
+ # The Linux gate. Its rust-cache entry is the one `test (without heif)` restores.
+ gate:
+ if: github.event.action != 'labeled' || github.event.label.name == 'full-ci'
+ # Tracks @main so suite-wide CI fixes reach every app without a PR in each repository.
+ uses: storytold/craft-common-actions/.github/workflows/gate.yml@main
+ with:
+ # egui/winit/rfd.
+ packages: >-
+ libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev
+ libgtk-3-dev
+ # The tests build with the optional craft-fonts input (crates/text/build.rs), so the
+ # Japanese font tests that skip without it run. Same commit as release.yml.
+ craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
+ # Cargo.toml's dev profile already keeps line tables only.
+ dev-debug: ""
+ env: |
+ PHOTOCRAFT_FULL_SWEEP=${{ inputs.full_sweep && '1' || '0' }}
+ PHOTOCRAFT_NO_PRINT=1
+ LPDEST=photocraft-no-such-printer
+ timeout-minutes: 100
+ # fmt, clippy, layers, scorecard, tests, panic_hunt, doctests and the wasm32 check, with
+ # `--locked --features heif`, then the missing-translations report (xtask/src/main.rs).
+ command: cargo xtask ci
+
+ # Windows tests run as two legs in parallel: the unit tests and the integration tests. As one job
+ # they took ~28 min on the Windows runner; the legs take ~13 and ~15. Splitting the integration
+ # tests over a third runner (nextest --partition) saved ~2 min of wall time but cost ~7
+ # runner-minutes and one more Windows slot per PR. They stay outside the shared gate for sccache,
+ # which needs its own action step.
+ windows:
needs: platforms
- runs-on: ${{ matrix.os }}
+ if: needs.platforms.outputs.windows == 'true'
+ timeout-minutes: 100
+ name: test (windows-latest, ${{ matrix.part }})
+ runs-on: windows-latest
strategy:
fail-fast: false
matrix:
- include: ${{ fromJSON(needs.platforms.outputs.legs) }}
+ part: [unit, integration]
env:
# No debuginfo on Windows: writing PDBs for ~200 test binaries cost 2.2 of ~21 build minutes.
# A panic still names its file and line; only backtrace frames lose theirs (Linux keeps
# line-tables-only, so a backtrace with lines is one OS away).
- CARGO_PROFILE_DEV_DEBUG: ${{ startsWith(matrix.os, 'windows') && '0' || 'line-tables-only' }}
+ CARGO_PROFILE_DEV_DEBUG: "0"
+ # The all-language UI tests shape real Japanese, Chinese, Korean and Devanagari labels
+ # with kittest's strict `MissingGlyphPolicy::Panic`. A hosted Windows image has no
+ # guaranteed Japanese or Simplified Chinese system font, and egui 0.37 panics on a
+ # missing glyph; the app's lazy system fallback runs after layout, too late for the
+ # first headless frame. Use the same pinned central fonts as Linux and release, so every
+ # language is drawn by a real embedded face rather than skipping. Same commit as the gate
+ # above and release.yml.
+ CRAFT_FONTS_DIR: ${{ github.workspace }}/craft-fonts
+ CRAFT_FONTS_REQUIRED: "1"
steps:
- - uses: actions/checkout@v4
-
- # Unused toolchains in the image (Android SDK, .NET, GHC, CodeQL) are deleted in the
- # background: the space is free before the craft-fonts build needs it, and nothing waits.
- - name: Install Linux system dependencies (egui/winit/rfd)
- if: runner.os == 'Linux'
- run: |
- nohup sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup \
- /opt/hostedtoolcache/CodeQL /dev/null 2>&1 &
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends \
- libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev \
- libgl1-mesa-dev libgtk-3-dev
-
- - uses: dtolnay/rust-toolchain@stable
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
- components: clippy, rustfmt
+ persist-credentials: false
- # Only main saves caches; PRs restore main's. Every PR used to save its own set (up to
- # 3.8 GB), usable by that PR only, so the repo's 10 GB cache budget kept evicting main's.
+ - name: Check out craft-fonts
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ repository: storytold/craft-fonts
+ ref: b076417b5880bd4154bd22f00695b1d28c6bea83
+ path: craft-fonts
+ persist-credentials: false
+
+ - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
+ with:
+ components: clippy
+
+ # Only main saves caches; PRs restore main's, so the repo's 10 GB cache budget keeps main's.
# A failing test still saves: the cache holds compiled dependencies, not test results.
- # The Windows legs share one key (same dependencies); the integration leg saves it,
- # because it also runs Clippy and so leaves Clippy's dependency metadata in it.
- - uses: Swatinem/rust-cache@v2
+ # Both legs share one key (same dependencies); the integration leg saves it, because it also
+ # runs Clippy and so leaves Clippy's dependency metadata in it.
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
- save-if: ${{ github.ref == 'refs/heads/main' && (matrix.part == 'all' || matrix.part == 'integration') }}
+ save-if: ${{ github.ref == 'refs/heads/main' && matrix.part == 'integration' }}
cache-on-failure: true
# sccache caches the workspace crates' compiled libraries, which rust-cache leaves out:
# warm, each Windows leg built 4.5 min faster. Like rust-cache, only main writes (PRs read
# main's entries); a full set is ~90 MB, so it barely touches the 10 GB budget (#2688).
# Test executables can't be cached, so a PR still links its tests.
- - name: Install sccache (Windows)
- if: runner.os == 'Windows'
+ - name: Install sccache
uses: Mozilla-Actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11
with:
version: v0.18.0
- - name: Use sccache (Windows)
- if: runner.os == 'Windows'
+ - name: Use sccache
env:
MAIN: ${{ github.ref == 'refs/heads/main' }}
run: |
@@ -147,139 +239,80 @@ jobs:
if [ "$MAIN" != true ]; then echo "SCCACHE_GHA_RW_MODE=READ_ONLY" >> "$GITHUB_ENV"; fi
shell: bash
- - name: Format
- if: runner.os == 'Linux'
- run: cargo fmt --all -- --check
-
- # Keep formatting, strict Clippy, layering and scorecard checks ahead of tests.
- name: Clippy
- if: matrix.part == 'all' || matrix.part == 'integration'
+ if: matrix.part == 'integration'
run: cargo clippy --workspace --all-targets --locked --features heif -- -D warnings
- name: Dependency layering
- if: matrix.part == 'all' || matrix.part == 'integration'
+ if: matrix.part == 'integration'
run: cargo xtask layers
- # docs/scorecard.md must match its sources (checklists, budgets, baseline, corpus floors,
- # prefs audit). Static: it reads committed files only, no benchmarks run here.
- - name: Scorecard up to date
- if: runner.os == 'Linux'
- run: cargo xtask scorecard --check
-
- # nextest runs the test binaries in parallel (cargo test runs them one at a time), with the
- # GPU tests capped by the `gpu` group in .config/nextest.toml (#2204).
- - uses: taiki-e/install-action@83ac0ad63c0167e6f06796fab0fce28db1bf3db0 # v2.87.22
+ - uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2.87.29
with:
- tool: cargo-nextest@0.9.146
+ tool: cargo-nextest@0.9.150
- # `--features heif`: official builds open HEIC photos via the optional photocraft-heif crate.
- # `--lib --bins --tests` leaves out the examples, which cargo test would build and link but
- # never run (Clippy's `--all-targets` still checks they compile). nextest skips doctests, so
- # they get their own step.
- #
- # On Windows the unit leg runs `--lib --bins` and the integration leg `--test '*'` (every
+ # The unit leg runs `--lib --bins` and the integration leg `--test '*'` (every
# integration-test target); the feature selection stays the same, so both legs share the
- # dependency cache. The `ci` profile fails fast and terminates hung tests
- # (.config/nextest.toml); assertion failures are not retried.
+ # dependency cache.
- name: Test
env:
PART: ${{ matrix.part }}
run: |
case "$PART" in
unit) targets=(--lib --bins) ;;
- integration) targets=(--test '*') ;;
- *) targets=(--lib --bins --tests) ;;
+ *) targets=(--test '*') ;;
esac
cargo nextest run --profile ci --workspace --locked --features heif "${targets[@]}"
shell: bash
- name: Doctests
- if: matrix.part == 'all' || matrix.part == 'unit'
+ if: matrix.part == 'unit'
run: cargo test --workspace --locked --features heif --doc
- # The Windows tests used to be one job named `test (windows-latest)`; they're now legs named
- # `test (windows-latest, unit)` and `test (windows-latest, integration)`. This job keeps the old
- # name reporting, so a required status check on it (none today) would keep working. It fails
- # unless the whole test matrix and both Linux variants passed. `needs` reports one result
- # for all matrix legs; when a PR runs no Windows legs it still checks every Linux result.
- windows-gate:
- timeout-minutes: 5
- name: test (windows-latest)
- needs: [platforms, test, test-variants]
- if: ${{ !cancelled() }}
- runs-on: ubuntu-latest
+ # The same codecs without the optional decoder: HEIC must stay a clear "not in this build" error
+ # for distributors who leave it out. Runs beside the gate and restores the gate's dependency
+ # cache without saving one: the dependencies are the same, and the 10 GB cache budget is tight
+ # (#2688).
+ test-without-heif:
+ if: github.event.action != 'labeled' || github.event.label.name == 'full-ci'
+ timeout-minutes: 60
+ name: test (without heif)
+ # The gate's runner: its cache entry is keyed on the OS.
+ runs-on: ubuntu-24.04
+ env:
+ # The gate sets these; rust-cache hashes CARGO_* and RUST* variables into its key.
+ CARGO_INCREMENTAL: 0
+ CARGO_NET_RETRY: 10
steps:
- - env:
- PLATFORMS: ${{ needs.platforms.result }}
- TEST: ${{ needs.test.result }}
- VARIANTS: ${{ needs.test-variants.result }}
- run: |
- echo "platforms: $PLATFORMS, test: $TEST, variants: $VARIANTS"
- [ "$PLATFORMS" = success ] && [ "$TEST" = success ] && [ "$VARIANTS" = success ]
-
- # The two other builds of the Linux tests, in parallel with the test job instead of after it (they
- # added ~10 min to its critical path). Each restores the test job's cache (`shared-key: test` is
- # that job's key) and saves none: the dependencies are the same, and the 10 GB cache budget is
- # tight (#2688).
- test-variants:
- timeout-minutes: 100
- name: test (${{ matrix.variant }})
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- variant: [without heif, with craft-fonts]
- steps:
- - uses: actions/checkout@v4
-
- - name: Install Linux system dependencies (egui/winit/rfd)
- run: |
- nohup sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup \
- /opt/hostedtoolcache/CodeQL /dev/null 2>&1 &
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends \
- libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev \
- libgl1-mesa-dev libgtk-3-dev
-
- - uses: dtolnay/rust-toolchain@stable
-
- - uses: Swatinem/rust-cache@v2
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
- shared-key: test
+ persist-credentials: false
+
+ - name: Install Linux build dependencies
+ uses: storytold/craft-common-actions/actions/install-apt-packages@main
+ with:
+ packages: >-
+ libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev
+ libgtk-3-dev
+
+ - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
+
+ # gate.yml keys its cache `-rust--gate`.
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
+ with:
+ prefix-key: v1-rust
+ shared-key: ${{ hashFiles('Cargo.toml') }}-gate
save-if: false
- - uses: taiki-e/install-action@83ac0ad63c0167e6f06796fab0fce28db1bf3db0 # v2.87.22
+ - uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2.87.29
with:
- tool: cargo-nextest@0.9.146
+ tool: cargo-nextest@0.9.150
- # The same codecs without the optional decoder: HEIC must stay a clear "not in this build"
- # error for distributors who leave it out.
- name: Test without heif
- if: matrix.variant == 'without heif'
run: cargo nextest run -p photocraft-heif -p photocraft-codecs -p photocraft-io --locked --profile ci
- # The tests built with the optional craft-fonts input (crates/text/build.rs), so the Japanese
- # font tests that skip without it run. Keep the test job's exact `--workspace --features heif
- # --lib --bins --tests`, so the restored dependencies match and only the workspace rebuilds.
- # Filter execution to the three crates that read the optional font input (#6127).
- - name: Check out craft-fonts
- if: matrix.variant == 'with craft-fonts'
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- with:
- repository: storytold/craft-fonts
- ref: abb83316d96aa59c1cf64784289e378fe9fa5695
- path: craft-fonts
-
- - name: Test with craft-fonts
- if: matrix.variant == 'with craft-fonts'
- env:
- CRAFT_FONTS_DIR: ${{ github.workspace }}/craft-fonts
- CRAFT_FONTS_REQUIRED: "1"
- run: >-
- cargo nextest run --profile ci --workspace --locked --features heif --lib --bins --tests
- -E 'package(photocraft-text) | package(photocraft-io) | package(photocraft-ui-egui)'
-
corpus:
+ if: github.event.action != 'labeled' || github.event.label.name == 'full-ci'
timeout-minutes: 30
# Real-file corpus tests (cargo feature `corpus`), on every PR and on main. The corpora are
# pinned in xtask/src/corpus_pins.rs and sha256-verified (xtask/*.sha256) after both a cache
@@ -295,15 +328,17 @@ jobs:
CARGO_PROFILE_RELEASE_LTO: "false"
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "16"
steps:
- - uses: actions/checkout@v4
- - uses: dtolnay/rust-toolchain@stable
- - uses: Swatinem/rust-cache@v2
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+ - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
key: corpus
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-on-failure: true
- name: Restore test corpora
- uses: actions/cache@v4
+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: corpus/
key: corpus-${{ hashFiles('xtask/src/corpus_pins.rs', 'xtask/*.sha256') }}
@@ -312,23 +347,6 @@ jobs:
- name: Corpus tests
run: cargo xtask test-corpus
- wasm:
- timeout-minutes: 30
- name: wasm32 check
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: dtolnay/rust-toolchain@stable
- with:
- targets: wasm32-unknown-unknown
- - uses: Swatinem/rust-cache@v2
- with:
- key: wasm32
- save-if: ${{ github.ref == 'refs/heads/main' }}
- cache-on-failure: true
- - name: Check wasm-safe crates
- run: cargo xtask wasm
-
web:
timeout-minutes: 60
name: web build and wasm size gate
@@ -340,18 +358,20 @@ jobs:
# Match release.yml so PR results reflect what would actually ship.
TRUNK_VERSION: 0.21.14
steps:
- - uses: actions/checkout@v4
- - uses: dtolnay/rust-toolchain@stable
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+ - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
with:
targets: wasm32-unknown-unknown
- - uses: Swatinem/rust-cache@v2
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
key: ci-web
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-on-failure: true
- name: Install trunk
run: |
- curl -fsSL "https://github.com/trunk-rs/trunk/releases/download/v${TRUNK_VERSION}/trunk-x86_64-unknown-linux-gnu.tar.gz" \
+ curl --proto '=https' -fsSL "https://github.com/trunk-rs/trunk/releases/download/v${TRUNK_VERSION}/trunk-x86_64-unknown-linux-gnu.tar.gz" \
| tar -xz -C "$HOME/.cargo/bin" trunk
trunk --version
# package.sh runs Trunk's release builds, validates relative URLs, cuts the wasm into
@@ -398,6 +418,7 @@ jobs:
- { crate: psd, name: metadata }
- { crate: psd, name: tagged }
- { crate: psd, name: resources }
+ - { crate: psd, name: asl }
- { crate: codecs, name: decode_any }
- { crate: codecs, name: decode_png }
- { crate: codecs, name: decode_jpeg }
@@ -408,19 +429,237 @@ jobs:
- { crate: affinity, name: import_preview, args: "--features io" }
- { crate: format, name: load }
steps:
- - uses: actions/checkout@v4
- - uses: dtolnay/rust-toolchain@nightly
- - uses: Swatinem/rust-cache@v2
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+ - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # nightly
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: crates/${{ matrix.target.crate }}/fuzz
- name: Install cargo-fuzz
run: cargo install cargo-fuzz --locked
- name: Fuzz
working-directory: crates/${{ matrix.target.crate }}
- run: cargo fuzz run ${{ matrix.target.name }} ${{ matrix.target.args }} -- -max_total_time=${{ inputs.fuzz_seconds }}
+ env:
+ FUZZ_SECONDS: ${{ inputs.fuzz_seconds }}
+ run: cargo fuzz run ${{ matrix.target.name }} ${{ matrix.target.args }} -- -max_total_time="$FUZZ_SECONDS"
- name: Upload crash artifacts
if: failure()
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: fuzz-${{ matrix.target.crate }}-${{ matrix.target.name }}
path: crates/${{ matrix.target.crate }}/fuzz/artifacts
+
+ color-range-performance:
+ if: inputs.color_range == true
+ runs-on: ubuntu-latest
+ timeout-minutes: 45
+ env:
+ RAYON_NUM_THREADS: "4"
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+ - name: Install Linux build dependencies
+ uses: storytold/craft-common-actions/actions/install-apt-packages@main
+ with:
+ packages: >-
+ libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev
+ libgtk-3-dev
+ - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
+ with:
+ key: color-range-perf
+ - name: Compare exact outputs and release timings on 24 MP
+ run: |
+ set -o pipefail
+ cargo test --release -p photocraft-engine --lib color_range_release_comparison -- --ignored --nocapture | tee color-range-perf.txt
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
+ if: always()
+ with:
+ name: color-range-performance
+ path: color-range-perf.txt
+
+ selection-morphology:
+ if: inputs.selection_morphology == true
+ runs-on: ubuntu-latest
+ timeout-minutes: 45
+ env:
+ RAYON_NUM_THREADS: "4"
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+ - name: Install Linux build dependencies
+ uses: storytold/craft-common-actions/actions/install-apt-packages@main
+ with:
+ packages: >-
+ libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev
+ libgtk-3-dev
+ - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
+ with:
+ key: selection-morphology-perf
+ - name: Compare exact outputs and release timings on 36 MP
+ run: |
+ set -o pipefail
+ cargo run --release -p photocraft-algo --example bench_selection_morphology | tee selection-morphology-perf.txt
+ - name: Compare cropped command reads and writeback on 36 MP
+ run: |
+ set -o pipefail
+ cargo test --release -p photocraft-engine --lib sparse_modify_release_comparison -- --ignored --nocapture | tee -a selection-morphology-perf.txt
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
+ if: always()
+ with:
+ name: selection-morphology-performance
+ path: selection-morphology-perf.txt
+
+ selection-morphology-quick-perf:
+ if: inputs.selection_morphology == true || inputs.color_range == true || inputs.selection_combining == true || inputs.brush_tip == true || inputs.dry_mixer == true
+ name: quick performance suite
+ # Match perf-nightly.yml: Linux llvmpipe lacks the float render targets needed by
+ # bevel_bench, so its required GPU rows cannot be measured there.
+ runs-on: macos-15
+ timeout-minutes: 60
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+ - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
+ with:
+ key: perf-release
+ - name: Quick performance suite
+ run: cargo xtask perf --quick
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
+ if: always()
+ with:
+ name: selection-morphology-quick-perf
+ path: |
+ target/perf/*.json
+ target/perf/summary.md
+
+ selection-combining:
+ if: inputs.selection_combining == true
+ runs-on: ubuntu-latest
+ timeout-minutes: 30
+ env:
+ RAYON_NUM_THREADS: "4"
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+ - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
+ with:
+ key: selection-combining-perf
+ - name: Compare exact outputs and release timings on 36 MP
+ run: |
+ set -o pipefail
+ cargo test --release -p photocraft-algo --lib gray8_combining_release_comparison -- --ignored --nocapture | tee selection-combining-perf.txt
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
+ if: always()
+ with:
+ name: selection-combining-performance
+ path: selection-combining-perf.txt
+
+ brush-tip:
+ if: inputs.brush_tip == true
+ runs-on: ubuntu-24.04
+ timeout-minutes: 30
+ env:
+ RAYON_NUM_THREADS: "4"
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ path: after
+ - uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ ref: ${{ inputs.brush_tip_base }}
+ path: before
+ - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
+ with:
+ workspaces: |
+ before -> target
+ after -> target
+ key: brush-tip-release
+ - name: Build the same benchmark against both versions
+ run: |
+ cp after/crates/paint/examples/big_dab_bench.rs before/crates/paint/examples/big_dab_bench.rs
+ cargo build --release --locked --manifest-path before/Cargo.toml -p photocraft-paint --example big_dab_bench
+ cargo build --release --locked --manifest-path after/Cargo.toml -p photocraft-paint --example big_dab_bench
+ - name: Compare round and transformed tips on 24 MP
+ run: |
+ set -o pipefail
+ for size in 200 2000; do
+ for angle in 0 0.7; do
+ for version in before after; do
+ echo "$version: size=$size angle=$angle" | tee -a brush-tip.txt
+ "$version/target/release/examples/big_dab_bench" "$size" 0.37 "$angle" | tee -a brush-tip.txt
+ done
+ done
+ done
+ - uses: actions/upload-artifact@v7
+ if: always()
+ with:
+ name: brush-tip-performance
+ path: brush-tip.txt
+ dry-mixer:
+ if: inputs.dry_mixer == true
+ runs-on: ubuntu-latest
+ timeout-minutes: 90
+ env:
+ RAYON_NUM_THREADS: "4"
+ CARGO_PROFILE_RELEASE_LTO: "false"
+ CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "16"
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - name: Pin baseline to the merge base with origin/main
+ id: baseline
+ run: |
+ git remote add upstream https://github.com/storytold/photocraft.git
+ git fetch --no-tags upstream main
+ base=$(git merge-base HEAD upstream/main)
+ echo "sha=$base" >> "$GITHUB_OUTPUT"
+ git worktree add --detach "$RUNNER_TEMP/photocraft-baseline" "$base"
+ mkdir -p "$RUNNER_TEMP/photocraft-baseline/crates/engine/examples"
+ cp crates/engine/examples/bench_dry_mixer.rs "$RUNNER_TEMP/photocraft-baseline/crates/engine/examples/bench_dry_mixer.rs"
+ - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
+ - name: Install Linux build dependencies
+ uses: storytold/craft-common-actions/actions/install-apt-packages@main
+ with:
+ packages: >-
+ libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev
+ libgtk-3-dev
+ - name: Benchmark baseline and candidate on this runner
+ run: |
+ set -o pipefail
+ echo "baseline=${{ steps.baseline.outputs.sha }}" | tee dry-mixer-perf.txt
+ echo "candidate=${GITHUB_SHA}" | tee -a dry-mixer-perf.txt
+ CARGO_TARGET_DIR="$RUNNER_TEMP/target-baseline" cargo run --release --manifest-path "$RUNNER_TEMP/photocraft-baseline/Cargo.toml" -p photocraft-engine --example bench_dry_mixer | tee baseline-mixer.txt
+ CARGO_TARGET_DIR="$RUNNER_TEMP/target-candidate" cargo run --release -p photocraft-engine --example bench_dry_mixer | tee candidate-mixer.txt
+ cat baseline-mixer.txt candidate-mixer.txt >> dry-mixer-perf.txt
+ python3 - <<'PY'
+ import re
+ def fingerprints(path):
+ rows = open(path).readlines()
+ result = {}
+ for row in rows:
+ match = re.search(r'wet=\s*(\d+)% sample_all=\s*(\w+)\s+size=\s*(\d+).*blake3=(\w+)', row)
+ if match:
+ result[match.group(1, 2, 3)] = match.group(4)
+ return result
+ before, after = fingerprints('baseline-mixer.txt'), fingerprints('candidate-mixer.txt')
+ assert len(before) == 12 and before == after, 'baseline/candidate mixer output or state differs'
+ PY
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
+ if: always()
+ with:
+ name: dry-mixer-performance
+ path: dry-mixer-perf.txt
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 67e6b31894..e93efc1018 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -31,8 +31,8 @@ jobs:
name: mdBook build
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
- - uses: dtolnay/rust-toolchain@stable
+ - uses: actions/checkout@v7
+ - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- name: Install mdBook
run: cargo install mdbook --version 0.4.52 --locked
- name: Build documentation
diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml
index 970c6577a4..2b98d8c11d 100644
--- a/.github/workflows/freebsd.yml
+++ b/.github/workflows/freebsd.yml
@@ -9,6 +9,8 @@ name: FreeBSD
# or dependency change: a drifted dependency still shows up within a day. PRs that change the
# FreeBSD packaging itself still run it.
on:
+ push:
+ branches: [release]
schedule:
- cron: "17 2 * * *"
pull_request:
@@ -30,7 +32,9 @@ jobs:
# Intentionally tracked at @main (not SHA-pinned) so org-wide CI improvements, security fixes, and build optimizations propagate without PR churn across all craftapp repos.
uses: storytold/craft-common-actions/.github/workflows/freebsd.yml@main
with:
- craft-fonts-ref: abb83316d96aa59c1cf64784289e378fe9fa5695
+ craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
cargo-build-extra-args: "--features heif"
- custom-test-command: "CARGO_PROFILE_DEV_DEBUG=0 cargo test --workspace --locked --features heif --exclude photocraft-ui-egui && CARGO_PROFILE_DEV_DEBUG=0 cargo test -p photocraft-ui-egui --locked --lib && CARGO_PROFILE_DEV_DEBUG=0 cargo test -p photocraft-ui-egui --locked --doc && CARGO_PROFILE_DEV_DEBUG=0 cargo test -p photocraft-ui-egui --locked --test '*' -- --test-threads=1"
+ # The VM's software Vulkan driver crashes (SIGSEGV) when several tests set up a device at
+ # once, so photocraft-gpu's tests run one at a time, like ui-egui's integration tests.
+ custom-test-command: "CARGO_PROFILE_DEV_DEBUG=0 cargo test --workspace --locked --features heif --exclude photocraft-ui-egui --exclude photocraft-gpu && CARGO_PROFILE_DEV_DEBUG=0 cargo test -p photocraft-gpu --locked -- --test-threads=1 && CARGO_PROFILE_DEV_DEBUG=0 cargo test -p photocraft-ui-egui --locked --lib && CARGO_PROFILE_DEV_DEBUG=0 cargo test -p photocraft-ui-egui --locked --doc && CARGO_PROFILE_DEV_DEBUG=0 cargo test -p photocraft-ui-egui --locked --test '*' -- --test-threads=1"
run-package-check: true
diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml
index 18392587a8..01cb9cd663 100644
--- a/.github/workflows/nix.yml
+++ b/.github/workflows/nix.yml
@@ -18,16 +18,6 @@ concurrency:
cancel-in-progress: true
jobs:
- eval:
- runs-on: ubuntu-latest
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- - uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
- - name: nix flake check --no-build
- run: |
- if [ -f flake.nix ]; then
- nix flake check --no-build --all-systems
- else
- echo "No flake.nix present in this repository; skipping check."
- fi
+ nix:
+ # Intentionally tracked at @main (not SHA-pinned) so org-wide CI improvements, security fixes, and build optimizations propagate without PR churn across all craftapp repos.
+ uses: storytold/craft-common-actions/.github/workflows/nix.yml@main
diff --git a/.github/workflows/packaging-lint.yml b/.github/workflows/packaging-lint.yml
index 1d110e28f2..6848088d37 100644
--- a/.github/workflows/packaging-lint.yml
+++ b/.github/workflows/packaging-lint.yml
@@ -29,3 +29,27 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: bash packaging/linux/verified-download-test.sh
+
+ windows-install-policy:
+ timeout-minutes: 10
+ name: Windows installation policy (no app build)
+ runs-on: windows-latest
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+ - name: Install the pinned packaging toolchain
+ shell: pwsh
+ run: |
+ $tools = Join-Path $env:RUNNER_TEMP 'craft-install-policy-wix'
+ dotnet tool install --tool-path $tools wix --version 5.0.2
+ if ($LASTEXITCODE -ne 0) { throw 'WiX installation failed.' }
+ $tools >> $env:GITHUB_PATH
+ $policy = Get-Content -Raw -LiteralPath packaging/windows/install-policy.json | ConvertFrom-Json
+ foreach ($extension in @($policy.extensions)) {
+ & (Join-Path $tools 'wix.exe') extension add -g "WixToolset.$extension.wixext/5.0.2"
+ if ($LASTEXITCODE -ne 0) { throw "WiX extension $extension installation failed." }
+ }
+ - name: Build and check non-executable installer fixtures
+ shell: pwsh
+ run: ./packaging/windows/test-install-policy.ps1 -OutputDirectory (Join-Path $env:RUNNER_TEMP 'craft-install-policy-tests')
diff --git a/.github/workflows/perf-nightly.yml b/.github/workflows/perf-nightly.yml
index 10d22292d2..71afc03e14 100644
--- a/.github/workflows/perf-nightly.yml
+++ b/.github/workflows/perf-nightly.yml
@@ -4,10 +4,13 @@ name: Perf (nightly)
# Metal), every night and on demand. It never runs on pull requests, so it can't block one.
# It fails when an enforced budget in perf/budgets.toml breaks or a scenario's p50 regresses
# more than 15 % against perf/baseline.json from the same machine class (other classes are
-# never compared). The table goes to the job summary; results.json is uploaded as an artifact.
+# never compared; a baseline built from several runs is judged against its highest p50). The
+# table goes to the job summary; results.json is uploaded as the `perf-results` artifact.
#
-# To give this runner class its own baseline: run it by hand with "update_baseline", download
-# the `perf-baseline` artifact and commit it as perf/baseline.json in a PR.
+# To give this runner class its own baseline: download the `perf-results` artifact of the last
+# five or more nightly runs (`gh run download -n perf-results -D runs/`), run
+# `cargo xtask perf --update-baseline --from runs//results.json ... --allow-contended` (this
+# runner is never idle) and commit perf/baseline.json and docs/scorecard.md in a PR.
on:
schedule:
@@ -40,13 +43,13 @@ jobs:
runs-on: macos-15
timeout-minutes: 120
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v7
with:
persist-credentials: false
- - uses: dtolnay/rust-toolchain@stable
+ - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- - uses: Swatinem/rust-cache@v2
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
key: perf-release
@@ -58,7 +61,8 @@ jobs:
run: |
args=()
if [ "$QUICK" = "true" ]; then args+=(--quick); fi
- if [ "$UPDATE" = "true" ]; then args+=(--update-baseline); fi
+ # This runner is never idle: a baseline from it is recorded labelled as contended.
+ if [ "$UPDATE" = "true" ]; then args+=(--update-baseline --allow-contended); fi
cargo xtask perf "${args[@]}"
- name: Job summary
@@ -72,7 +76,7 @@ jobs:
- name: Upload results
if: always()
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v7
with:
name: perf-results
path: |
@@ -83,7 +87,7 @@ jobs:
- name: Upload baseline
if: always() && inputs.update_baseline
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v7
with:
name: perf-baseline
path: perf/baseline.json
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index bfdca9e3e9..4b78fac526 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -24,7 +24,7 @@ jobs:
with:
app-name: photocraft
app-title: PhotoCraft
- craft-fonts-ref: abb83316d96aa59c1cf64784289e378fe9fa5695
+ craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
version: ${{ inputs.version }}
secrets:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
new file mode 100644
index 0000000000..8f1aa5ad52
--- /dev/null
+++ b/.github/workflows/sonarcloud.yml
@@ -0,0 +1,24 @@
+name: SonarCloud
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ types: [opened, synchronize, reopened]
+
+permissions:
+ contents: read
+
+concurrency:
+ group: sonarcloud-${{ github.ref }}
+ # A push to main is the run that publishes coverage; superseded runs there would never finish.
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
+
+jobs:
+ sonarcloud:
+ # Track shared CI improvements on main.
+ uses: storytold/craft-common-actions/.github/workflows/sonarcloud.yml@main
+ with:
+ timeout-minutes: 120
+ fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
+ secrets: inherit
diff --git a/.github/workflows/windows-arm64.yml b/.github/workflows/windows-arm64.yml
index 30a07f4cd5..fe092e498a 100644
--- a/.github/workflows/windows-arm64.yml
+++ b/.github/workflows/windows-arm64.yml
@@ -7,6 +7,8 @@ name: Windows ARM64
# Nightly on main (dependency and runner-image drift shows up within a day), and on PRs that
# change the Windows packaging itself.
on:
+ push:
+ branches: [release]
pull_request:
paths:
- .github/workflows/windows-arm64.yml
@@ -29,3 +31,5 @@ jobs:
with:
app-name: photocraft
app-dir: PhotoCraft
+ install-relative-path: Programs/ArtCraft/PhotoCraft
+ install-scope: perUser
diff --git a/.gitignore b/.gitignore
index f310f32921..0e71c973d8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,5 @@
*~
-plan/
+/plan/
/target
target/
/dist
diff --git a/AGENTS.md b/AGENTS.md
index 97b5ccdbc0..e849cb4506 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -19,7 +19,7 @@ PhotoCraft is an open-source, native, Photoshop-comparable image editor written
| `docs/parity-checklist.md` | Generated list of every Photoshop menu item, live or missing |
| `docs/scorecard.md` | Generated scorecard: performance budgets and numbers, corpus floors, per-area checklists (tools, files, UI, type, automation, reliability, distribution), settings that do nothing |
| `crates//README.md` (where present) | Public API of that crate |
-| [photocraft-corpus](https://github.com/storytold/photocraft-corpus) + `docs/development.md` › Test corpora | Real-file test oracles (our Photoshop-authored PSDs); with psd-tools, ag-psd and PngSuite fetched into `corpus/` by `cargo xtask corpus --all` at the pins in `xtask/src/corpus_pins.rs` |
+| [photocraft-corpus](https://github.com/storytold/photocraft-corpus) + `docs/development.md` › Test corpora | Real-file test oracles (our Photoshop-authored PSDs and GIMP-authored XCFs); with psd-tools, ag-psd and PngSuite fetched into `corpus/` by `cargo xtask corpus --all` at the pins in `xtask/src/corpus_pins.rs` |
## 2. Workspace map
@@ -27,7 +27,7 @@ PhotoCraft is an open-source, native, Photoshop-comparable image editor written
crates/
geom cms color raster L0 foundation (geometry, ICC colour management, pixel formats + blend math, COW tiles)
psd codecs L0 standalone format crates (no workspace deps; publishable)
- tablet L0 standalone pen tablet input (macOS AppKit, X11 XInput2); the one isolated unsafe crate
+ tablet L0 standalone pen tablet input (macOS AppKit, X11 XInput2, Windows barrel button); the one isolated unsafe crate
doc L1 document model (layers, masks, adjustments, effects, smart objects: pure data)
ops paint algo text vector L2 history, brush engine, imaging algorithms, type engine, paths/shapes
compose gpu format L3 CPU compositor (the oracle), wgpu compositor, .pcraft native format
@@ -52,13 +52,13 @@ xtask/ cargo xtask layers | wasm | ci | stats | corpus | t
People trust PhotoCraft with their work, and a crash loses it. A malformed file, a bad command or MCP param, a corrupt settings file, an odd keystroke or a full disk must produce an error the user or agent can act on, never a panic. Don't ship a feature by adding a panic path; fix a crash before building on top of it. The shared standard is `../craftrules/standards/never-crash.md`.
- **Non-test code never panics.** No `unwrap()`, `expect()`, `panic!`, `unreachable!`, `todo!` or `unimplemented!`. Return the crate's error type and propagate with `?`; use `ok_or(..)?`, `let .. else { return Err(..) }`, `if let`, or `unwrap_or*` where a fallback is truly correct (never one that silently corrupts a document). Unfinished features return an "unsupported" error. The only exception is a provably infallible literal: `#[allow(clippy::expect_used)]` plus `.expect("why it can't fail")`.
-- **No `unsafe`.** The workspace sets `unsafe_code = "forbid"`. The one exception is the isolated helper crate `photocraft-tablet` (`crates/tablet`): winit drops pen tablet data, and reading it on macOS needs an AppKit event monitor (Objective-C interop). Only its `src/macos.rs` allows `unsafe` (`unsafe_code = "deny"` crate-wide, every block has a `SAFETY:` comment, tested against real `NSEvent`s); its X11 path and all mapping code are safe. Don't add `unsafe` anywhere else.
+- **No `unsafe`.** The workspace sets `unsafe_code = "forbid"`. The one exception is the isolated helper crate `photocraft-tablet` (`crates/tablet`): winit drops pen tablet data, and reading it on macOS needs an AppKit event monitor (Objective-C interop) and on Windows a pointer message hook (`GetPointerPenInfo`). Only its `src/macos.rs` and `src/windows.rs` allow `unsafe` (`unsafe_code = "deny"` crate-wide, every block has a `SAFETY:` comment, tested against real `NSEvent`s and pointer messages); its X11 path and all mapping code are safe. Don't add `unsafe` anywhere else.
- **Input-derived numbers are hostile.** Use `get()` rather than `[i]`/`[a..b]` for indices from files, params, selections or arithmetic on them; slice strings only at char boundaries; use `checked_*`/`saturating_*` for lengths, offsets and counts; guard division by zero and NaN/inf casts; cap allocations sized by input.
- **Bound recursion** with depth limits or seen-sets (documents can be deep or cyclic).
- **Don't cascade.** Handle lock poisoning (`lock().unwrap_or_else(PoisonError::into_inner)`) and treat thread joins as `Result`s.
- **Last-resort guard.** The app shell must catch an escaped panic around command dispatch and file import/export, reports it as an error and keeps the document. It's a safety net, not a licence to panic. Keep `panic = "unwind"`.
- **Prove it.** Every crash fix comes with a small synthetic regression test that panicked before the fix.
-- **Enforced by clippy.** `clippy.toml` allows `unwrap`/`expect`/`panic`/indexing in tests only. Clean crates carry `#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]`; new crates start with it.
+- **Enforced by clippy.** `clippy.toml` allows `unwrap`/`expect`/`panic` in tests only. Clean production crate roots carry `#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]`; every new workspace crate must also include `[lints] workspace = true` in `Cargo.toml` to inherit `[workspace.lints]`.
1. **Everything is a command.** New user-visible behaviour = a command in the engine (`crates/engine/src/*_cmds.rs`, registered in `commands.rs`) with id, label, menu path, shortcut, params doc, `enabled` and `run`, plus tests. The UI, CLI, control channel and MCP all dispatch commands by id. Use the **exact id from `crates/ui-egui/src/menu_catalog.rs`** and the menu item goes live automatically. Only pure view/window state (zoom, panels, screen mode) belongs to the shell (`menus.rs` `UI_COMMANDS`).
2. **No format or colour assumptions.** Bit depth (8/16/32f) and colour model (RGB/Gray/CMYK/Lab…) are runtime data. Never introduce a `u8`-only pixel path in public APIs. Never assume sRGB: colour conversions go through `photocraft-cms` (`Transform`, `transform::cached`). Test at several depths.
@@ -70,6 +70,7 @@ People trust PhotoCraft with their work, and a crash loses it. A malformed file,
8. **Performance is a feature.** Benchmark heavy operations on a 24–36 MP image in release. Work per tile in parallel (rayon), skip empty tiles, never scan a full surface per frame (cache per revision), and record before/after timings in the dev log.
9. **Never panic on input** (see *Never crash* above). A command's `run` closure and anything it calls must return `Err`, never panic, for *any* params or document state: validate params, check bounds before indexing or dividing, and reject absurd sizes before allocating. The `panic_hunt` integration test fuzzes every command with adversarial params and must stay green.
+10. **Time goes through `chrono`** (workspace dependency). Never hand-roll UTC/calendar conversion (days-to-date algorithms, leap-year math); a crate owns only its output format string. The one exception is range extension: past the years chrono can represent, shift the date by whole 400-year Gregorian cycles (146,097 days, after which the calendar repeats), let chrono compute the month and day, and add the cycles back to the year (splitting seconds into hours, minutes and seconds is plain arithmetic).
## 4. Picking work
@@ -107,7 +108,7 @@ cargo xtask test-corpus # if you touched psd, io, codecs, compose, gpu, text
While iterating, run less and keep the full commands above as the final gate: `cargo test -p --lib --tests` skips the examples and doctests plain `cargo test` builds every time (ui-egui has 11 examples), and `cargo test -p --test ` runs one integration-test file. `cargo nextest run` runs tests in parallel across binaries; see `docs/development.md` › Faster test loops.
-**Test corpora.** Real-file corpora live in `corpus/` (gitignored, never committed), fetched at pinned commits and sha256-verified by `cargo xtask corpus --all`: our Photoshop-authored oracles from https://github.com/storytold/photocraft-corpus plus psd-tools, ag-psd and PngSuite from their upstreams. Pins: `xtask/src/corpus_pins.rs`. The corpus tests are opt-in (cargo feature `corpus`): plain `cargo test` skips them, and with the feature on a missing corpus fails ("run `cargo xtask corpus --all`"). `cargo xtask test-corpus` fetches and runs them all. CI always runs them (the `corpus` job, cached by pin). Never commit corpus files; new oracles go to photocraft-corpus (its `AGENTS.md`), then a pin bump here. Details: `docs/development.md` › Test corpora.
+**Test corpora.** Real-file corpora live in `corpus/` (gitignored, never committed), fetched at pinned commits and sha256-verified by `cargo xtask corpus --all`: our Photoshop- and GIMP-authored oracles from https://github.com/storytold/photocraft-corpus plus psd-tools, ag-psd and PngSuite from their upstreams. Pins: `xtask/src/corpus_pins.rs`. The corpus tests are opt-in (cargo feature `corpus`): plain `cargo test` skips them, and with the feature on a missing corpus fails ("run `cargo xtask corpus --all`"). `cargo xtask test-corpus` fetches and runs them all. CI always runs them (the `corpus` job, cached by pin). Never commit corpus files; new oracles go to photocraft-corpus (its `AGENTS.md`), then a pin bump here. Details: `docs/development.md` › Test corpora.
Commands must **never panic** on bad input (Rule 9): every `run` closure and the code it calls returns `Err`, not a panic, for any params or document state. New commands come with a graceful-failure test (empty/out-of-range/wrong-type params → `Err`, not a crash).
@@ -157,3 +158,8 @@ If the field has a PSD equivalent, map it in `crates/io` too, and keep unknown P
GitHub profiles). Never hand-edit `contributors.json`.
- Maintainers refresh the stats with `python3 ../../craftrules/scripts/contributors.py .` (it also
re-verifies who wrote each `people.toml` entry; `--check` only verifies).
+
+## CI workflows
+- Workflows in `.github/workflows/` call the shared workflows in [`storytold/craft-common-actions`](https://github.com/storytold/craft-common-actions) at `@main`, with their inputs and secrets. No other jobs: if no shared workflow does what's needed, it doesn't go here.
+- Don't add or change CI in a feature or fix PR. If the existing workflows can't build or test a change, link an existing craft-common-actions issue or PR, or open a new issue, or a PR only for a small fix that is safe for every app and does not increase CI time.
+- Some workflow files here still run their own jobs. Don't add to them. Moving a job into craft-common-actions is its own task, never part of another PR, and the job stays here until a shared workflow runs it.
diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md
index 26eca62464..66cd9f1307 100644
--- a/ATTRIBUTION.md
+++ b/ATTRIBUTION.md
@@ -23,26 +23,39 @@ next to them.
| `crates/ui-egui/src/i18n/cs.tsv` | Czech UI translations | PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
| `crates/ui-egui/src/i18n/hu.tsv` | Hungarian UI translations | PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
| `crates/ui-egui/src/i18n/vi.tsv` | Vietnamese UI translations | PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
+| `crates/ui-egui/src/i18n/ar.tsv` | Arabic UI translations | PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
| `crates/ui-egui/src/i18n/tr.tsv` | Turkish UI translations | PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
| `crates/ui-egui/src/i18n/sr.tsv` | Serbian (Latin, Ekavian) UI translations | PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
+| `crates/ui-egui/src/i18n/ru.tsv` | Russian UI translations | PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
+| `crates/ui-egui/src/i18n/sv.tsv` | Swedish UI translations | @kler, @davvarn and PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
+| `crates/ui-egui/src/i18n/fi.tsv` | Finnish UI translations | @Janiz-zzz, @metuuu and PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
+| `crates/ui-egui/src/i18n/da.tsv` | Danish UI translations | @pechnikov2026-star and PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
+| `crates/ui-egui/src/i18n/nb.tsv` | Norwegian Bokmål UI translations | @nikolainyegaard, @Bolla76 and PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
+| `epaint_default_fonts::EGUI_ICONS` (build input; deflated into `OUT_DIR/egui_fonts/egui-icons.ttf.deflate`, registered by `crates/ui-egui/src/egui_fonts.rs`) | egui-icons, five-glyph subset of emoji-icon-font | John Slegers | [egui fork at 6d518fc](https://github.com/storytold/egui/tree/6d518fc799681571963842f95b55a6b68431b15a/crates/epaint_default_fonts/fonts), [original](https://github.com/jslegers/emoji-icon-font); egui subset, unmodified here | MIT; Copyright (c) 2014 John Slegers; full upstream notice in [NOTICE](NOTICE) |
| `assets/fonts/Inter-Regular.ttf`, `Inter-Medium.ttf`, `Inter-SemiBold.ttf` | Inter 4.001 (UI font) | The Inter Project Authors (Rasmus Andersson) | | SIL OFL 1.1, [`assets/fonts/OFL-Inter.txt`](assets/fonts/OFL-Inter.txt) |
| `assets/fonts/JetBrainsMono-Regular.ttf` | JetBrains Mono 2.305 (numeric font) | The JetBrains Mono Project Authors | | SIL OFL 1.1, [`assets/fonts/OFL-JetBrainsMono.txt`](assets/fonts/OFL-JetBrainsMono.txt) |
-| `assets/icons/*.svg` except `slice-knife.svg`, `sampler.svg`, `artboard.svg`, `perspective-crop.svg`, `frame-placeholder.svg`, `gradient.svg`, `type-mask.svg`, `type-mask-vertical.svg`, `clip-below.svg`, `clip-release.svg`, `layer-mask.svg`, `adjustment-layer.svg`, `brush-replace.svg`, `quick-selection.svg`, `eraser-background.svg`, `eraser-magic.svg`, `lasso-magnetic.svg`, `direct-select.svg`, `convert-point.svg`, `pen-add-anchor.svg`, `pen-delete-anchor.svg`, `pen-freeform.svg`, `pen-curvature.svg`, `bandage-sparkle.svg`, `painting-symmetry.svg`, `symmetry-*.svg` and `marquee-{row,column}.svg` (113 files; `star-filled.svg` is `star.svg` with a solid fill) | Lucide icons | Lucide Icons and Contributors | (`icons/.svg`; `align-*` are now named `text-align-*` upstream) | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
+| `assets/icons/*.svg` except `slice-knife.svg`, `slice-select.svg`, `font-similar.svg`, `font-variable.svg`, `sampler.svg`, `artboard.svg`, `perspective-crop.svg`, `frame-placeholder.svg`, `ellipse-dashed.svg`, `gradient.svg`, `type-mask.svg`, `type-mask-vertical.svg`, `text-warp.svg`, `clip-below.svg`, `clip-release.svg`, `layer-mask.svg`, `adjustment-layer.svg`, `brush-replace.svg`, `quick-selection.svg`, `eraser-background.svg`, `eraser-magic.svg`, `lasso-magnetic.svg`, `direct-select.svg`, `convert-point.svg`, `pen-add-anchor.svg`, `pen-delete-anchor.svg`, `pen-freeform.svg`, `pen-curvature.svg`, `bandage-sparkle.svg`, `painting-symmetry.svg`, `symmetry-*.svg`, `path-op-*.svg` and `marquee-{row,column}.svg`, `align-edge-*.svg` and `distribute-*.svg` (114 files; `star-filled.svg` is `star.svg` with a solid fill, `rotate-ccw.svg` is `rotate-cw.svg` mirrored) | Lucide icons | Lucide Icons and Contributors | (`icons/.svg`; `align-*` are now named `text-align-*` upstream) | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
| `assets/icons/{check,chevron-down,chevron-left,chevron-right,chevron-up,chevrons-left,chevrons-right,circle,clock,compass,info,link,link-2,lock,minus,monitor,moon,move,navigation,plus,search,square,trash,triangle,type,x,zoom-in}.svg` | Lucide icons derived from Feather (subset of the row above) | Cole Bemis (Feather), Lucide Contributors | via Lucide | MIT (Feather) and ISC (Lucide), [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
| `assets/icons/slice-knife.svg` | Slice tool glyph | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
+| `assets/icons/slice-select.svg` | Slice Select tool glyph | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/sampler.svg` | Color Sampler tool glyph: a target reticle marking a sampled pixel | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
+| `assets/icons/font-similar.svg`, `assets/icons/font-variable.svg` | Font menu filter glyphs: two waves (Show Similar Fonts) and a T over a slider (Show Variable Fonts), drawn on the 24 px icon grid | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/convert-point.svg` | Convert Point tool glyph: an angle with a square anchor on its apex, drawn on Lucide's 24 px grid and stroke | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/artboard.svg` | Artboard tool glyph: a board with a tick at each end of its edges | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/perspective-crop.svg` | Perspective Crop tool glyph: a crop frame in perspective with its grid and crop-mark ticks | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/type-mask.svg`, `assets/icons/type-mask-vertical.svg` | Horizontal and Vertical Type Mask tool glyphs: a T drawn as marching ants (the vertical one beside a downward arrow), on Lucide's 24 px grid and stroke | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
+| `assets/icons/path-op-{new-layer,combine,subtract,intersect,exclude,merge}.svg` | Path Operations glyphs (Pen options bar): a single square for New Layer, and two overlapping squares showing the area each operation keeps (union, back minus front, overlap, everything but the overlap, the merged outline), drawn on Lucide's 24 px grid and stroke | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
+| `assets/icons/text-warp.svg` | Create Warped Text glyph (Type tool options bar): a T above a bowed arc, drawn on Lucide's 24 px grid and stroke | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/marquee-row.svg`, `assets/icons/marquee-column.svg` | Single Row and Single Column Marquee tool glyphs: a dashed row (column) between two edge bars, drawn on Lucide's 24 px grid and stroke | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/clip-below.svg`, `assets/icons/clip-release.svg` | Clipping-mask cursors (⌥ over the line between two layers): a hooked arrow onto the layer below; the same with a small "no" badge to release | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/layer-mask.svg`, `assets/icons/adjustment-layer.svg` | Layers panel footer glyphs: Add a mask (a frame around a solid disc) and New Fill or Adjustment Layer (a circle, one half solid), drawn on Lucide's 24 px grid and stroke | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
+| `assets/icons/align-edge-*.svg`, `assets/icons/distribute-*.svg` | Move tool options-bar glyphs: Align (six edges/centres) and Distribute (edges, centres, spacing), a guide line or edge lines with bars, drawn on Lucide's 24 px grid and stroke | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
+| `assets/icons/ellipse-dashed.svg` | Elliptical Marquee tool glyph: a dashed horizontal ellipse, drawn on Lucide's 24 px grid and stroke | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/frame-placeholder.svg` | Frame tool glyph: an empty placeholder frame, crossed corner to corner | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/gradient.svg` | Gradient tool glyph: a rounded rectangle filled with a left-to-right linear ramp, drawn on Lucide's 24 px grid and stroke | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/eraser-background.svg`, `assets/icons/eraser-magic.svg` | Background Eraser and Magic Eraser tool glyphs: Lucide `eraser` plus added marks | Lucide Icons and Contributors; marks by PhotoCraft contributors | Derived from `icons/eraser.svg` | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
| `assets/icons/brush-replace.svg` | Color Replacement tool glyph: Lucide `brush` plus two swap arrows | Lucide Icons and Contributors; arrows by PhotoCraft contributors | Derived from `icons/brush.svg` | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
-| `assets/icons/quick-selection.svg` | Quick Selection tool glyph: Lucide `brush` plus a dashed selection arc around the bristles | Lucide Icons and Contributors; arc by PhotoCraft contributors | Derived from `icons/brush.svg` | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
+| `assets/icons/quick-selection.svg` | Quick Selection tool glyph: Lucide `brush`, scaled to 70%, inside a dashed upright rounded "C" selection | Lucide Icons and Contributors; selection by PhotoCraft contributors | Derived from `icons/brush.svg` | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
| `assets/icons/bandage-sparkle.svg` | Remove tool glyph: Lucide `bandage` moved down, plus a sparkle mark | Lucide Icons and Contributors; mark by PhotoCraft contributors | Derived from `icons/bandage.svg` | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
| `assets/icons/direct-select.svg` | Direct Selection tool glyph: Lucide `mouse-pointer-2` plus an anchor square | Lucide Icons and Contributors; square by PhotoCraft contributors | Derived from `icons/mouse-pointer-2.svg` | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
| `assets/icons/pen-freeform.svg`, `assets/icons/pen-curvature.svg` | Freeform Pen and Curvature Pen tool glyphs: Lucide `pen-tool` scaled down, plus a freehand squiggle or a curve through two points | Lucide Icons and Contributors; marks by PhotoCraft contributors | Derived from `icons/pen-tool.svg` | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
@@ -57,6 +70,7 @@ next to them.
| `crates/ui-egui/src/theme.rs` (Solarized Dark palette) | Solarized colour scheme used by the Solarized Dark theme | Ethan Schoonover | | MIT, [`LICENSE-solarized.txt`](crates/ui-egui/src/LICENSE-solarized.txt) |
| `crates/ui-egui/src/theme.rs` (Breeze Light and Breeze Dark themes) | The Breeze Light and Breeze Dark themes are original colour values on PhotoCraft's Studio layout, chosen to look close to KDE Plasma's Breeze (cool blue-greys, blue accent, 5 px frame radius) so the app blends into a Plasma desktop. None of Breeze's colour values, files or code are copied; the values are a few levels away from its schemes and tuned for text contrast | PhotoCraft contributors | Inspired by the look of KDE Breeze, (its colour schemes are LGPL-2.0-or-later) | Original work |
| `crates/ui-egui/src/theme.rs` (Soft Dark and Soft Light themes) | Original colour values and radii for two low-contrast themes on PhotoCraft's Studio layout; no third-party palette, file or code is used | PhotoCraft contributors | Original | Original work |
+| `crates/algo/data/libfacedetection.bin` (face detection weights, read by `crates/algo/src/faces.rs`, whose network code is a port of the library's) | libfacedetection CNN (YuNet design) weights and inference code, weights converted to half precision | Shiqi Yu | [ShiqiYu/libfacedetection](https://github.com/ShiqiYu/libfacedetection) (`src/facedetectcnn-data.cpp`, `facedetectcnn.cpp`, `facedetectcnn-model.cpp`) | BSD-3-Clause, [`LICENSE-libfacedetection.txt`](crates/algo/data/LICENSE-libfacedetection.txt) |
### Optional build input: craft-fonts (not files in this repo)
@@ -82,6 +96,8 @@ The other built-in ICC profiles and the generated LUT looks are produced by code
| `docs/brand/` (all files) | ArtCraft name, wordmark and mark | ArtCraft Team | getartcraft.com | Not open source; trademarks of the ArtCraft Team, [`docs/brand/LICENSE-brand.txt`](docs/brand/LICENSE-brand.txt) |
| `docs/images/photocraft-*.jpg` | PhotoCraft screenshots | PhotoCraft contributors (UI) | Rendered offscreen with the `snapshot` example | MIT OR Apache-2.0 (UI); the artwork in each is public domain, listed below |
| `docs/images/preferences-apply-*.png` | Preferences before and after adding Apply (no artwork) | PhotoCraft contributors | PhotoCraft control-channel capture and offscreen `snapshot` example | MIT OR Apache-2.0 |
+| `docs/images/gradient-overlay-method-*.png` | Gradient Overlay Method selector, before and after (synthetic gradient) | @oRE-o | Rendered offscreen with the `snapshot` example; no external artwork | MIT OR Apache-2.0 |
+| `docs/images/cpu-pixel-alignment/*.png` | CPU canvas pixel alignment, before and after #8321 | PhotoCraft contributors | Original synthetic noise rendered with the offscreen `snapshot` example; see the adjacent README | MIT OR Apache-2.0, adjacent `LICENSE-MIT` and `LICENSE-APACHE` |
Artwork shown in the screenshots (all public domain, via Wikimedia Commons; details in
[`docs/images/SOURCES.md`](docs/images/SOURCES.md)):
@@ -107,12 +123,14 @@ next to the files:
| Path (fetched) | Title | Author | Source | License |
|---|---|---|---|---|
-| `corpus/photoshop/` (256 PSDs) | Photoshop oracle corpus: smart filters, layer-style effects, type, adjustments in every mode and depth | PhotoCraft contributors (authored with Adobe Photoshop 2026 by a script) | [https://github.com/storytold/photocraft-corpus](https://github.com/storytold/photocraft-corpus) (`photoshop/`, with its generator and README) | MIT OR Apache-2.0 |
+| `corpus/photoshop/` (258 PSDs) | Photoshop oracle corpus: smart filters, layer-style effects, type, adjustments in every mode and depth | PhotoCraft contributors (authored with Adobe Photoshop 2026 by a script) | [https://github.com/storytold/photocraft-corpus](https://github.com/storytold/photocraft-corpus) (`photoshop/`, with its generator and README) | MIT OR Apache-2.0 |
+| `corpus/gimp/` (28 files, 251 KB) | GIMP XCF oracles: 40×30 procedural layers written by GIMP 3.2.6 through the corpus generator `tools/gimp-xcf/xcf_fixtures.py`, each with GIMP's merged rendering as a PNG | PhotoCraft contributors (authored with GIMP 3.2.6 by a script) | [https://github.com/storytold/photocraft-corpus](https://github.com/storytold/photocraft-corpus) (`gimp/`, with its generator and README) | MIT OR Apache-2.0 |
| `corpus/psd-tools/` (309 files) | psd-tools test set | Kota Yamaguchi and contributors | [psd-tools `tests/psd_files`](https://github.com/psd-tools/psd-tools/tree/main/tests/psd_files) | MIT, Copyright (c) 2019 Kota Yamaguchi |
| `corpus/psd/` (170 files) | Small selection of the psd-tools and ag-psd test files | Kota Yamaguchi; Agamnentzar | psd-tools (above) and [ag-psd `test/`](https://github.com/Agamnentzar/ag-psd/tree/master/test) | MIT (both) |
| `corpus/heif/` (9 files, 0.1 MB) | HEIC/HEIF test files: `heic-rs/` checkerboards, RGB strips and a grid-tiled photo with EXIF and XMP (synthetic pixels encoded by macOS `sips`, each `.ref.png` Apple's decode); `pillow-heif/` the 10-bit RGBA `RGBA_10__29x100.heif` and its source `RGBA_16__29x100.png` | Thomas Braun (heic-rs); Pillow-Heif contributors | [heic-rs `tests/fixtures`](https://github.com/tbraun96/heic-rs/tree/main/tests/fixtures), [pillow-heif `tests/images`](https://github.com/bigcat88/pillow_heif/tree/master/tests/images) | MIT OR Apache-2.0 (heic-rs); BSD-3-Clause (pillow-heif) |
| `corpus/exr/` (5 files, 2.3 MB) | The deep OpenEXR test images `11`, `42`, `64`, `multivariate` and `objectid.deep.exr` | Contributors to the OpenEXR Project | [openexr `src/test/bin/test_images`](https://github.com/AcademySoftwareFoundation/openexr/tree/main/src/test/bin/test_images) | BSD-3-Clause |
| `corpus/affinity/` (60 files) | Public Affinity documents and PNG references: `vector-art/` (9 documents), `afdesignload/` (9), `jac21/` (2), `asset-store-template/` (1), and `affinity-samples/` (18 CC0 documents plus exported references) | samuel-etver; Nick Beeuwsaert; Jeremy Cantu; DAIKI (eviltwo); satoshoe-dev | [vector-art `simple/`](https://github.com/samuel-etver/vector-art/tree/255f8add3c8f0740196e22bd59502b811b532f0b/simple), [AFDesignLoad `testDesigns/`](https://github.com/NickBeeuwsaert/AFDesignLoad/tree/a18dd50a7079fb861a28835eeefa0d015f03f4a1/testDesigns), [Jac21/Branding `Logos/JC/DesignerFiles/Affinity`](https://github.com/Jac21/Branding/tree/57ae3f45bf4637f6927c0b07de25b922c55f944f/Logos/JC/DesignerFiles/Affinity), [AssetStoreTemplate `AssetStoreTemplate/`](https://github.com/eviltwo/AssetStoreTemplate/tree/f671981ee89d15526285b3cc87b4393d3defe644/AssetStoreTemplate), [affinity-samples](https://github.com/satoshoe-dev/affinity-samples/tree/96aca6bd86bbe7a677f1cf0630bd832d23943be8) | CC0-1.0 (vector-art and affinity-samples); MIT, Copyright (c) 2015 Nick Beeuwsaert; MIT, Copyright (c) 2018 Jeremy Cantu; MIT, Copyright (c) 2024 DAIKI |
+| `corpus/atn/` (16 files, 0.9 MB) | Photoshop Actions sets, one folder per repository: `sbaril/` (Frequency Separation, Firefly, Dimension, Harmonize, Photo, Quick Object Extraction, Generative Upscale), `bjango/` (Bjango Actions, Adjustment Actions, Scale Actions), `bkwld/` (Save layers for web), `atntools/` (test.atn), `trimmer/` (Trimmer), `alpha-utility/` (AlphaUtilityAdditions), `gif-creator/` (BannerActions) | Stéphane Baril; Bjango and Marc Edwards; BKWLD; Maurits Rijk; damsmcfly; UCLA Game Lab; overbyte | [sbaril/Photoshop-Scripts](https://github.com/sbaril/Photoshop-Scripts), [bjango/Bjango-Actions](https://github.com/bjango/Bjango-Actions), [BKWLD/photoshop-actions](https://github.com/BKWLD/photoshop-actions), [mrijk/atntools](https://github.com/mrijk/atntools), [damsmcfly/photoshop-cleaner-trimmer](https://github.com/damsmcfly/photoshop-cleaner-trimmer), [uclagamelab/AlphaUtilityAdditions](https://github.com/uclagamelab/AlphaUtilityAdditions), [overbyte/photoshop-gif-creator-script](https://github.com/overbyte/photoshop-gif-creator-script), pinned in [xtask/src/corpus_pins.rs](xtask/src/corpus_pins.rs) | MIT (sbaril, BKWLD, atntools, gif-creator), BSD (bjango, per `Help/License.md`), BSD-2-Clause (alpha-utility), Unlicense (trimmer); each licence file sits next to its files |
| `corpus/pngsuite/` | PngSuite | Willem van Schaik | | Public domain |
| `corpus/pixls/` (11 files) | Real camera raws, one per decode path: Canon PowerShot SX50 HS (CR2 and its DNG conversion), Nikon D3 uncompressed NEF and Z6 paired 12/14-bit lossy and packed NEFs, Sony DSC-RX0 cRAW ARW, Panasonic DC-G9 high-res RW2, Olympus E-1 GRBG ORF, plus the E-5 packed ORF as the documented known-unsupported case. Per file (each CC0, per its database entry): [IMG_4059.CR2](https://raw.pixls.us/data/Canon/PowerShot%20SX50%20HS/IMG_4059.CR2), [CRW_4061.DNG](https://raw.pixls.us/data/Canon/PowerShot%20SX50%20HS/CRW_4061.DNG), [JD1_8203.NEF](https://raw.pixls.us/data/Nikon/D3/JD1_8203.NEF), [DSC00009.ARW](https://raw.pixls.us/data/Sony/DSC-RX0/DSC00009.ARW), [P1000475.RW2](https://raw.pixls.us/data/Panasonic/DC-G9/P1000475.RW2), [E_1__C106743_gredos.ORF](https://raw.pixls.us/data/Olympus/E-1/E_1__C106743_gredos.ORF), [_7061961_copy.ORF](https://raw.pixls.us/data/Olympus/E-5/_7061961_copy.ORF), [DSC_0750.NEF](https://raw.pixls.us/data/Nikon/Z%206/DSC_0750.NEF), [DSC_0751.NEF](https://raw.pixls.us/data/Nikon/Z%206/DSC_0751.NEF), [DSC_0753.NEF](https://raw.pixls.us/data/Nikon/Z%206/DSC_0753.NEF), [DSC_0754.NEF](https://raw.pixls.us/data/Nikon/Z%206/DSC_0754.NEF) | The photographers of the pixls.us raw samples database | [raw.pixls.us](https://raw.pixls.us) `data/`, fetched per [xtask/src/corpus_pins.rs](xtask/src/corpus_pins.rs) | CC0 / public domain, per file as linked |
diff --git a/Cargo.lock b/Cargo.lock
index 138ca3d814..8186c52112 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,9 +4,9 @@ version = 4
[[package]]
name = "accesskit"
-version = "0.24.1"
+version = "0.25.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3b7f7f85a7e5f68090000ed7622545829afd484d210358702ae4cb97dd0c320"
+checksum = "ad442f58ee04714aaa0ba0a2768c1ea1935b29507bb22ddece8cbbc76db02932"
dependencies = [
"enumn",
"serde",
@@ -15,12 +15,12 @@ dependencies = [
[[package]]
name = "accesskit_atspi_common"
-version = "0.18.1"
+version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e8c61bee90b42a772d39d06a740207dc71a4e780004ace1db8d99fb1baaa954"
+checksum = "52c182f9c282ac9c5638d876d551d15e5f7d397ec263349a0c6a2b61595dd5e4"
dependencies = [
"accesskit",
- "accesskit_consumer 0.36.0",
+ "accesskit_consumer",
"atspi-common",
"phf",
"serde",
@@ -29,43 +29,37 @@ dependencies = [
[[package]]
name = "accesskit_consumer"
-version = "0.35.0"
+version = "0.39.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53cf47daed85312e763fbf85ceca136e0d7abc68e0a7e12abe11f48172bc3b10"
+checksum = "8a45e2bb300bea6d5f33a82c3e051c3ddc6f41c209750f68a0acbe991a284344"
dependencies = [
"accesskit",
- "hashbrown 0.16.1",
+ "hashbrown 0.17.1",
]
[[package]]
-name = "accesskit_consumer"
-version = "0.36.0"
+name = "accesskit_ios"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25e0d7e25d06f4dc21d1774d67146e9e80d6789216cbd4d1e88185b0095dba60"
+checksum = "28e539d64b27fd4c14de8f78ada8f7c944c092f52f7e49fb63316507a57f6937"
dependencies = [
"accesskit",
- "hashbrown 0.16.1",
-]
-
-[[package]]
-name = "accesskit_consumer"
-version = "0.38.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d10a236f96f87d70732e44520046785431ef01d5bcd6b041317bfadd2f88245"
-dependencies = [
- "accesskit",
- "hashbrown 0.16.1",
+ "accesskit_consumer",
+ "hashbrown 0.17.1",
+ "objc2 0.5.2",
+ "objc2-foundation 0.2.2",
+ "objc2-ui-kit 0.2.2",
]
[[package]]
name = "accesskit_macos"
-version = "0.26.3"
+version = "0.27.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce02dc63b43f0c9296af9ac946312a2dc8814427d7a64d2d600971dac55b6076"
+checksum = "5701624bf6a11efb6d4c8e922bf44126ed96250e5faa9a7a0468c979635839a4"
dependencies = [
"accesskit",
- "accesskit_consumer 0.38.0",
- "hashbrown 0.16.1",
+ "accesskit_consumer",
+ "hashbrown 0.17.1",
"objc2 0.5.2",
"objc2-app-kit 0.2.2",
"objc2-foundation 0.2.2",
@@ -73,9 +67,9 @@ dependencies = [
[[package]]
name = "accesskit_unix"
-version = "0.21.1"
+version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b016ca8db0ea0ea2ceff29a9d6240391492d960716aa471967c00e8cc8cb197c"
+checksum = "202f24df034a7476d07b7f74284de84f6d62aabd858dbe7ee9cad3b7ad6f8f9d"
dependencies = [
"accesskit",
"accesskit_atspi_common",
@@ -91,13 +85,13 @@ dependencies = [
[[package]]
name = "accesskit_windows"
-version = "0.32.1"
+version = "0.35.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eff7009f1a532e917d66970a1e80c965140c6cfbbabbdde3d64e5431e6c78e21"
+checksum = "ce63f35d6bdcf59f26b76b3379063f738e6412cef46999cc772d46aa3de35adb"
dependencies = [
"accesskit",
- "accesskit_consumer 0.35.0",
- "hashbrown 0.16.1",
+ "accesskit_consumer",
+ "hashbrown 0.17.1",
"static_assertions",
"windows",
"windows-core",
@@ -105,11 +99,12 @@ dependencies = [
[[package]]
name = "accesskit_winit"
-version = "0.32.2"
+version = "0.34.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fe9a94394896352cc4660ca2288bd4ef883d83238853c038b44070c8f134313"
+checksum = "ee96dd150375c05912d8a473f98c2fb155fb3234fac88292d396548a2460fa77"
dependencies = [
"accesskit",
+ "accesskit_ios",
"accesskit_macos",
"accesskit_unix",
"accesskit_windows",
@@ -179,6 +174,15 @@ dependencies = [
"alloc-no-stdlib",
]
+[[package]]
+name = "alloca"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4"
+dependencies = [
+ "cc",
+]
+
[[package]]
name = "allocator-api2"
version = "0.2.21"
@@ -241,12 +245,56 @@ dependencies = [
"unicode-width",
]
+[[package]]
+name = "anstream"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d"
+dependencies = [
+ "anstyle",
+ "anstyle-parse",
+ "anstyle-query",
+ "anstyle-wincon",
+ "colorchoice",
+ "is_terminal_polyfill",
+ "utf8parse",
+]
+
[[package]]
name = "anstyle"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"
+[[package]]
+name = "anstyle-parse"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e"
+dependencies = [
+ "utf8parse",
+]
+
+[[package]]
+name = "anstyle-query"
+version = "1.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
+dependencies = [
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "anstyle-wincon"
+version = "3.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
+dependencies = [
+ "anstyle",
+ "once_cell_polyfill",
+ "windows-sys 0.61.2",
+]
+
[[package]]
name = "anyhow"
version = "1.0.104"
@@ -261,21 +309,21 @@ checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1"
[[package]]
name = "arboard"
-version = "3.6.1"
+version = "3.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0348a1c054491f4bfe6ab86a7b6ab1e44e45d899005de92f58b3df180b36ddaf"
+checksum = "aeb9553e62312c8756a5979254fc6d7da8bbeb5986a1e17037fab932f7037917"
dependencies = [
"clipboard-win",
"image",
"log",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-app-kit 0.3.2",
"objc2-core-foundation",
"objc2-core-graphics",
"objc2-foundation 0.3.2",
"parking_lot",
"percent-encoding",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
"wl-clipboard-rs",
"x11rb",
]
@@ -611,15 +659,6 @@ dependencies = [
"syn 2.0.119",
]
-[[package]]
-name = "bit-set"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3"
-dependencies = [
- "bit-vec 0.8.0",
-]
-
[[package]]
name = "bit-set"
version = "0.10.0"
@@ -630,10 +669,13 @@ dependencies = [
]
[[package]]
-name = "bit-vec"
-version = "0.8.0"
+name = "bit-set"
+version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
+checksum = "56d87354e4229f54a44f7bf2435906a4656dba36026ab6eaca629a2c436a691c"
+dependencies = [
+ "bit-vec 0.10.1",
+]
[[package]]
name = "bit-vec"
@@ -641,6 +683,16 @@ version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b71798fca2c1fe1086445a7258a4bc81e6e49dcd24c8d0dd9a1e57395b603f51"
+[[package]]
+name = "bit-vec"
+version = "0.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5727b15fa97d4f4fee0a3b7c3d550ed0269f54329207b86388de918604e31269"
+dependencies = [
+ "borsh",
+ "serde",
+]
+
[[package]]
name = "bit_field"
version = "0.10.3"
@@ -714,7 +766,7 @@ version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5"
dependencies = [
- "objc2 0.6.4",
+ "objc2 0.6.5",
]
[[package]]
@@ -730,6 +782,30 @@ dependencies = [
"piper",
]
+[[package]]
+name = "borsh"
+version = "1.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "553c5d846a6ba5150c65e3b1b8ec073bcf1abc20f9b7220de384a4443ea4e20a"
+dependencies = [
+ "borsh-derive",
+ "bytes",
+ "cfg_aliases",
+]
+
+[[package]]
+name = "borsh-derive"
+version = "1.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "12cdfe656708a01f89b451a7d36466e6fe6c414de0aa18fc54f864f6f9ca9f56"
+dependencies = [
+ "once_cell",
+ "proc-macro-crate",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.6",
+]
+
[[package]]
name = "brotli-decompressor"
version = "5.0.3"
@@ -849,7 +925,7 @@ dependencies = [
"maybe-owned",
"rustix 1.1.5",
"rustix-linux-procfs",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
"winx",
]
@@ -993,6 +1069,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa8876b300ab35ba921adea3dfd70157a46249b33f95c9084ae5709785478946"
dependencies = [
"clap_builder",
+ "clap_derive",
]
[[package]]
@@ -1001,8 +1078,31 @@ version = "4.6.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0797fb7aeb1406c84efac526901f7ec3ead2124f946b494e72879d4b54704d"
dependencies = [
+ "anstream",
"anstyle",
"clap_lex",
+ "strsim",
+]
+
+[[package]]
+name = "clap_complete"
+version = "4.6.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "037e2a1a92236d0aff7e845093f64661d6df4c02c9fcc61a60e9e1d736fa392f"
+dependencies = [
+ "clap",
+]
+
+[[package]]
+name = "clap_derive"
+version = "4.6.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f9c751b79415d4e559e3d1fcf128e09e720eb673a06d26cf6f392d37d75b66e0"
+dependencies = [
+ "heck",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.6",
]
[[package]]
@@ -1011,6 +1111,16 @@ version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486"
+[[package]]
+name = "clap_mangen"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "211d617eaa4b735c96c9e0228fcbdb5120ef623f2b8cb67ffb84c3e02dbc28a4"
+dependencies = [
+ "clap",
+ "roff",
+]
+
[[package]]
name = "clipboard-win"
version = "5.4.1"
@@ -1053,6 +1163,15 @@ dependencies = [
"x509-cert",
]
+[[package]]
+name = "cobs"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1"
+dependencies = [
+ "thiserror 2.0.21",
+]
+
[[package]]
name = "codespan-reporting"
version = "0.13.1"
@@ -1079,6 +1198,12 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
+[[package]]
+name = "colorchoice"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
+
[[package]]
name = "colored"
version = "2.2.0"
@@ -1222,14 +1347,55 @@ dependencies = [
"libc",
]
+[[package]]
+name = "craft-docpath"
+version = "0.1.0"
+source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+
+[[package]]
+name = "craft-fonts-build"
+version = "0.1.0"
+source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+
+[[package]]
+name = "craft-i18n"
+version = "0.1.0"
+source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+dependencies = [
+ "fixed_decimal",
+ "icu_decimal",
+ "icu_locale_core",
+ "icu_locale_fallback",
+ "icu_normalizer",
+ "icu_plurals",
+ "icu_properties",
+ "icu_provider",
+ "icu_provider_adapters",
+ "icu_provider_blob",
+ "log",
+ "objc2-foundation 0.3.2",
+ "sys-locale",
+ "unicode-bidi",
+ "windows-registry",
+ "writeable",
+]
+
+[[package]]
+name = "craft-jpeg"
+version = "0.1.0"
+source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+dependencies = [
+ "thiserror 2.0.21",
+]
+
[[package]]
name = "craft-print"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=3d37da389a3618ab9b76109da11416e9ca4ea719#3d37da389a3618ab9b76109da11416e9ca4ea719"
+source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
dependencies = [
"craft-winprint-gdi",
- "miniz_oxide 0.8.9",
- "roxmltree",
+ "miniz_oxide 0.9.1",
+ "roxmltree 0.21.1",
"tempfile",
"winprint",
"winsafe",
@@ -1238,10 +1404,48 @@ dependencies = [
[[package]]
name = "craft-ui"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=5c874d51eeb3de70e735c8ce87a59a7dedd47675#5c874d51eeb3de70e735c8ce87a59a7dedd47675"
+source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
dependencies = [
+ "craft-fonts-build",
+ "craft-i18n",
"egui",
+ "epaint",
+ "js-sys",
+ "log",
+ "objc2 0.6.5",
+ "objc2-app-kit 0.3.2",
+ "objc2-foundation 0.3.2",
"serde",
+ "skrifa",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
+]
+
+[[package]]
+name = "craft-update"
+version = "0.1.0"
+source = "git+https://github.com/storytold/craft-libs?rev=04aa1703b32d299e54f78fcde4182f2b393a9116#04aa1703b32d299e54f78fcde4182f2b393a9116"
+dependencies = [
+ "chrono",
+ "dunce",
+ "egui",
+ "flate2",
+ "getrandom 0.3.4",
+ "image",
+ "log",
+ "plist",
+ "semver",
+ "serde",
+ "serde_json",
+ "sha2",
+ "tar",
+ "tempfile",
+ "ureq",
+ "verifysign",
+ "winreg",
+ "winsafe",
+ "zip",
]
[[package]]
@@ -1254,32 +1458,31 @@ dependencies = [
[[package]]
name = "crc32fast"
-version = "1.5.2"
+version = "1.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01a7799fd6b852db0e61728dde9a204c423b44d689dbd432522543614b490e78"
+checksum = "0ba106e844045ddc02c20768ac4b0b7cb45f2cc2ecbd833ac9f5dacb183c2055"
dependencies = [
"cfg-if",
]
[[package]]
name = "criterion"
-version = "0.5.1"
+version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f"
+checksum = "950046b2aa2492f9a536f5f4f9a3de7b9e2476e575e05bd6c333371add4d98f3"
dependencies = [
+ "alloca",
"anes",
"cast",
"ciborium",
"clap",
"criterion-plot",
- "is-terminal",
- "itertools 0.10.5",
+ "itertools 0.13.0",
"num-traits",
- "once_cell",
"oorandom",
+ "page_size",
"regex",
"serde",
- "serde_derive",
"serde_json",
"tinytemplate",
"walkdir",
@@ -1287,12 +1490,12 @@ dependencies = [
[[package]]
name = "criterion-plot"
-version = "0.5.0"
+version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1"
+checksum = "d8d80a2f4f5b554395e47b5d8305bc3d27813bacb73493eb1001e8f76dae29ea"
dependencies = [
"cast",
- "itertools 0.10.5",
+ "itertools 0.13.0",
]
[[package]]
@@ -1427,6 +1630,12 @@ dependencies = [
"syn 2.0.119",
]
+[[package]]
+name = "deranged"
+version = "0.5.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e9de72ce2ad1f90dc62fa25f0f430ef85eb4b0d8fa0be4f30373bc40a21d28e"
+
[[package]]
name = "dify"
version = "0.8.0"
@@ -1465,7 +1674,7 @@ dependencies = [
"bitflags 2.13.2",
"block2 0.6.2",
"libc",
- "objc2 0.6.4",
+ "objc2 0.6.5",
]
[[package]]
@@ -1578,9 +1787,8 @@ checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"
[[package]]
name = "ecolor"
-version = "0.36.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0656a7530b9e2841ee7a5f983965bdd9840c32f4012f759cfd44b912cced6b34"
+version = "0.37.0"
+source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a"
dependencies = [
"bytemuck",
"emath",
@@ -1589,9 +1797,8 @@ dependencies = [
[[package]]
name = "eframe"
-version = "0.36.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55ad41fac6e3149abb4866e93df37dbd33baa95db525c3368c944584e95a5dc2"
+version = "0.37.0"
+source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a"
dependencies = [
"ahash",
"bytemuck",
@@ -1605,7 +1812,7 @@ dependencies = [
"image",
"js-sys",
"log",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-app-kit 0.3.2",
"objc2-foundation 0.3.2",
"parking_lot",
@@ -1614,6 +1821,7 @@ dependencies = [
"profiling",
"raw-window-handle",
"ron",
+ "send_wrapper",
"serde",
"static_assertions",
"wasm-bindgen",
@@ -1626,9 +1834,8 @@ dependencies = [
[[package]]
name = "egui"
-version = "0.36.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc938cc27cd911415e1e4d151bc56ff9df063d8db081374e87aeb805ea74b2ba"
+version = "0.37.0"
+source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a"
dependencies = [
"accesskit",
"ahash",
@@ -1648,9 +1855,8 @@ dependencies = [
[[package]]
name = "egui-wgpu"
-version = "0.36.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5cef1f6d1bba40b09a4d0d62cb822b81030922cfbf65c5373398c3a3caafc5bd"
+version = "0.37.0"
+source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a"
dependencies = [
"ahash",
"bytemuck",
@@ -1668,31 +1874,34 @@ dependencies = [
[[package]]
name = "egui-winit"
-version = "0.36.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "98466000559d66ba4db786a30448b01483946add4188e7f10f522a27b4fb89cc"
+version = "0.37.0"
+source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a"
dependencies = [
"accesskit_winit",
"arboard",
+ "block2 0.6.2",
"bytemuck",
"egui",
+ "image",
"log",
- "objc2 0.6.4",
+ "objc2 0.6.5",
+ "objc2-app-kit 0.3.2",
"objc2-foundation 0.3.2",
"objc2-ui-kit 0.3.2",
+ "parking_lot",
"profiling",
"raw-window-handle",
"serde",
"smithay-clipboard",
"web-time",
+ "windows-sys 0.61.2",
"winit",
]
[[package]]
name = "egui_extras"
-version = "0.36.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05cbdc785020861553f230f23d330ba1fb72613b9d8e0e457f3bdc8ba6db6dcf"
+version = "0.37.0"
+source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a"
dependencies = [
"ahash",
"egui",
@@ -1705,9 +1914,8 @@ dependencies = [
[[package]]
name = "egui_glow"
-version = "0.36.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "606ed4167daf341e5753d703285c4c1d562324b2c07aa8f405cd7d066fe58f3b"
+version = "0.37.0"
+source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a"
dependencies = [
"bytemuck",
"egui",
@@ -1719,9 +1927,8 @@ dependencies = [
[[package]]
name = "egui_kittest"
-version = "0.36.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5eb3f3effb2726fee23449293e67acbf6cc6ce35525b1722bd5743bb348114d5"
+version = "0.37.0"
+source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a"
dependencies = [
"dify",
"eframe",
@@ -1746,9 +1953,8 @@ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
[[package]]
name = "emath"
-version = "0.36.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52c8d4141cf0f60fb2f7aefaf352d3ffa5171ef0ab09731c64391801e95e48f1"
+version = "0.37.0"
+source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a"
dependencies = [
"bytemuck",
"serde",
@@ -1776,22 +1982,22 @@ checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"
[[package]]
name = "enum-map"
-version = "2.7.3"
+version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9"
+checksum = "d4532960034c15ba2f55e9eee631040ecc473c32e6c4b200828c759840f13a06"
dependencies = [
"enum-map-derive",
]
[[package]]
name = "enum-map-derive"
-version = "0.17.0"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb"
+checksum = "7127272f64b3e098f7d81f350d672081b879bff896d219c42370dc858b1af9ff"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.119",
+ "syn 3.0.6",
]
[[package]]
@@ -1828,9 +2034,8 @@ dependencies = [
[[package]]
name = "epaint"
-version = "0.36.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0ec0308dc23130fc1a7d4623a8534c2ed069c6dc84e258ee4f3de99615aa1a3"
+version = "0.37.0"
+source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a"
dependencies = [
"ahash",
"bytemuck",
@@ -1847,16 +2052,17 @@ dependencies = [
"serde",
"skrifa",
"smallvec",
+ "unicode-bidi",
"unicode-general-category",
+ "unicode-properties",
"unicode-segmentation",
"vello_cpu",
]
[[package]]
name = "epaint_default_fonts"
-version = "0.36.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773fa9c96dd0dbef887e39d0ed6177f141cce4d68e6041df77570aa3702dfa13"
+version = "0.37.0"
+source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a"
[[package]]
name = "equator"
@@ -1891,7 +2097,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -1929,6 +2135,18 @@ dependencies = [
"pin-project-lite",
]
+[[package]]
+name = "exacl"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8de9e551ced9d700a31dacb8b168129640240fcd7a279a3fa4d59608b84ebcae"
+dependencies = [
+ "bitflags 2.13.2",
+ "log",
+ "scopeguard",
+ "uuid",
+]
+
[[package]]
name = "exr"
version = "1.74.2"
@@ -2003,6 +2221,17 @@ version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aedcfb3409746eddb02b9e19ebda1c3394f759a152e48ee875a0844d1b955484"
+[[package]]
+name = "fixed_decimal"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2214fb00f669ee96bee5bb29dfb1ddabe058b2bc426817efc79afa03c9bc55ae"
+dependencies = [
+ "displaydoc",
+ "smallvec",
+ "writeable",
+]
+
[[package]]
name = "fixedbitset"
version = "0.5.7"
@@ -2060,7 +2289,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90642cf66dde7f205dc8b42dfe57b47d0f3a29f571b832742883ef512e23fe55"
dependencies = [
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-app-kit 0.3.2",
"objc2-foundation 0.3.2",
]
@@ -2099,7 +2328,7 @@ version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbc773e24e02d4ddd8395fd30dc147524273a83e54e0f312d986ea30de5f5646"
dependencies = [
- "roxmltree",
+ "roxmltree 0.20.0",
]
[[package]]
@@ -2124,9 +2353,17 @@ dependencies = [
"hashbrown 0.17.1",
"linebender_resource_handle",
"memmap2",
+ "objc2 0.6.5",
+ "objc2-core-foundation",
+ "objc2-core-text",
+ "objc2-foundation 0.3.2",
"parlance",
"read-fonts",
+ "roxmltree 0.21.1",
"smallvec",
+ "windows",
+ "windows-core",
+ "yeslogic-fontconfig-sys",
]
[[package]]
@@ -2417,9 +2654,9 @@ dependencies = [
[[package]]
name = "glifo"
-version = "0.2.0"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed4a1bb24121291d27230c1b1b44e07d6a9b28cefdb32fe1581dfb84e14f940a"
+checksum = "282a26c1e23de04bdab3e34a21b6f877a479b96737792516b9b8b8f69b6661be"
dependencies = [
"bytemuck",
"foldhash 0.2.0",
@@ -2463,7 +2700,7 @@ dependencies = [
"glutin_glx_sys",
"glutin_wgl_sys",
"libloading",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-app-kit 0.3.2",
"objc2-core-foundation",
"objc2-foundation 0.3.2",
@@ -2776,6 +3013,23 @@ dependencies = [
"zerovec",
]
+[[package]]
+name = "icu_decimal"
+version = "2.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9eb8f655bba2d0c0459e43a5b0e6cd3cd388109898fb3d85d048165e8b0abd08"
+dependencies = [
+ "displaydoc",
+ "fixed_decimal",
+ "icu_locale_core",
+ "icu_pattern",
+ "icu_plurals",
+ "icu_provider",
+ "serde",
+ "writeable",
+ "zerovec",
+]
+
[[package]]
name = "icu_locale_core"
version = "2.3.0"
@@ -2821,6 +3075,9 @@ dependencies = [
"icu_properties",
"icu_provider",
"smallvec",
+ "utf16_iter",
+ "utf8_iter",
+ "write16",
"zerovec",
]
@@ -2830,6 +3087,32 @@ version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1563da1ed3e0b3bf3d74c9b85917ac9c56464d2f57242270c09c9e752f8021a0"
+[[package]]
+name = "icu_pattern"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b3db611446bd92c246b03e4aa0bafa71ddb194af431ddbb42b9d70e4bfce1a0"
+dependencies = [
+ "displaydoc",
+ "either",
+ "serde",
+ "writeable",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_plurals"
+version = "2.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e475e6766ef87b1d3c1f97be6363995b0bfaeddbc789671615df598a97ff0593"
+dependencies = [
+ "displaydoc",
+ "fixed_decimal",
+ "icu_provider",
+ "serde",
+ "zerovec",
+]
+
[[package]]
name = "icu_properties"
version = "2.3.0"
@@ -2859,6 +3142,7 @@ checksum = "d27bbb9d3abbefac45d55f647c9de1d44aafcd1186eb91879afef17c396c3e73"
dependencies = [
"displaydoc",
"icu_locale_core",
+ "postcard",
"serde",
"stable_deref_trait",
"writeable",
@@ -2868,6 +3152,30 @@ dependencies = [
"zerovec",
]
+[[package]]
+name = "icu_provider_adapters"
+version = "2.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "df887bc4f55dbc773c7c45a0c7dfa75be886f7b7812830a71ab7271cc1801820"
+dependencies = [
+ "icu_locale_fallback",
+ "icu_provider",
+]
+
+[[package]]
+name = "icu_provider_blob"
+version = "2.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5916b44fac319d3f58e4d8d805a627df19e27937b582cd99fcde3bb6b7ce1b0e"
+dependencies = [
+ "icu_provider",
+ "postcard",
+ "serde",
+ "writeable",
+ "zerotrie",
+ "zerovec",
+]
+
[[package]]
name = "icu_segmenter"
version = "2.3.0"
@@ -2990,7 +3298,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20fd6de4ccfcc187e38bc21cfa543cb5a302cb86a8b114eb7f0bf0dc9f8ac00f"
dependencies = [
"io-lifetimes 3.0.1",
- "windows-sys 0.60.2",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -3020,17 +3328,6 @@ dependencies = [
"once_cell",
]
-[[package]]
-name = "is-terminal"
-version = "0.4.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46"
-dependencies = [
- "hermit-abi",
- "libc",
- "windows-sys 0.59.0",
-]
-
[[package]]
name = "is-wsl"
version = "0.4.0"
@@ -3041,6 +3338,12 @@ dependencies = [
"once_cell",
]
+[[package]]
+name = "is_terminal_polyfill"
+version = "1.70.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
+
[[package]]
name = "itertools"
version = "0.10.5"
@@ -3050,6 +3353,15 @@ dependencies = [
"either",
]
+[[package]]
+name = "itertools"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
+dependencies = [
+ "either",
+]
+
[[package]]
name = "itertools"
version = "0.14.0"
@@ -3366,12 +3678,12 @@ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
[[package]]
name = "kittest"
-version = "0.4.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90ceaa75eb0036a32b6b9833962eb18137449e9817e2e586006471925b727fd5"
+checksum = "0bb81a721ba76aa095b7f45deb180504f786904e56ca4b8e141f66eb89a78b75"
dependencies = [
"accesskit",
- "accesskit_consumer 0.35.0",
+ "accesskit_consumer",
]
[[package]]
@@ -3417,9 +3729,9 @@ checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8"
[[package]]
name = "libc"
-version = "0.2.189"
+version = "0.2.191"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
+checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
[[package]]
name = "libfuzzer-sys"
@@ -3536,6 +3848,9 @@ name = "litemap"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae"
+dependencies = [
+ "serde_core",
+]
[[package]]
name = "litrs"
@@ -3677,20 +3992,20 @@ dependencies = [
[[package]]
name = "muda"
-version = "0.21.1"
+version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a7b000cca0783af26837fe2ebd9ddf1c42279463c085b97622ee1d2f444b89e"
+checksum = "4340e89c178916e62879c5c36b7f699019369be413e496178a6983ce91b8bc03"
dependencies = [
"crossbeam-channel",
"dpi",
"keyboard-types",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-app-kit 0.3.2",
"objc2-core-foundation",
"objc2-foundation 0.3.2",
"png 0.18.1",
"thiserror 2.0.21",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -3773,6 +4088,18 @@ version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
+[[package]]
+name = "nix"
+version = "0.31.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d"
+dependencies = [
+ "bitflags 2.13.2",
+ "cfg-if",
+ "cfg_aliases",
+ "libc",
+]
+
[[package]]
name = "no_std_io2"
version = "0.9.4"
@@ -3833,6 +4160,12 @@ dependencies = [
"num-traits",
]
+[[package]]
+name = "num-conv"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441"
+
[[package]]
name = "num-derive"
version = "0.4.2"
@@ -3914,9 +4247,9 @@ dependencies = [
[[package]]
name = "objc2"
-version = "0.6.4"
+version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f"
+checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8"
dependencies = [
"objc2-encode",
]
@@ -3946,7 +4279,7 @@ dependencies = [
"bitflags 2.13.2",
"block2 0.6.2",
"libc",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-cloud-kit 0.3.2",
"objc2-core-data 0.3.2",
"objc2-core-foundation",
@@ -3967,7 +4300,7 @@ dependencies = [
"bitflags 2.13.2",
"block2 0.6.2",
"dispatch2",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-avf-audio",
"objc2-core-audio-types",
"objc2-core-foundation",
@@ -3986,7 +4319,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13a380031deed8e99db00065c45937da434ca987c034e13b87e4441f9e4090be"
dependencies = [
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-foundation 0.3.2",
]
@@ -4010,7 +4343,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c"
dependencies = [
"bitflags 2.13.2",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-foundation 0.3.2",
]
@@ -4032,7 +4365,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1eebcea8b0dbff5f7c8504f3107c68fc061a3eb44932051c8cf8a68d969c3b2"
dependencies = [
"dispatch2",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-core-audio-types",
"objc2-core-foundation",
]
@@ -4044,7 +4377,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a89f2ec274a0cf4a32642b2991e8b351a404d290da87bb6a9a9d8632490bd1c"
dependencies = [
"bitflags 2.13.2",
- "objc2 0.6.4",
+ "objc2 0.6.5",
]
[[package]]
@@ -4066,7 +4399,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa"
dependencies = [
"bitflags 2.13.2",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-foundation 0.3.2",
]
@@ -4080,7 +4413,7 @@ dependencies = [
"block2 0.6.2",
"dispatch2",
"libc",
- "objc2 0.6.4",
+ "objc2 0.6.5",
]
[[package]]
@@ -4093,7 +4426,7 @@ dependencies = [
"block2 0.6.2",
"dispatch2",
"libc",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-core-foundation",
"objc2-io-surface",
"objc2-metal 0.3.2",
@@ -4117,7 +4450,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006"
dependencies = [
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-foundation 0.3.2",
]
@@ -4142,7 +4475,7 @@ dependencies = [
"bitflags 2.13.2",
"block2 0.6.2",
"dispatch2",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-core-audio",
"objc2-core-audio-types",
"objc2-core-foundation",
@@ -4156,7 +4489,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d"
dependencies = [
"bitflags 2.13.2",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-core-foundation",
"objc2-core-graphics",
]
@@ -4169,7 +4502,7 @@ checksum = "d425caf1df73233f29fd8a5c3e5edbc30d2d4307870f802d18f00d83dc5141a6"
dependencies = [
"bitflags 2.13.2",
"block2 0.6.2",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-core-foundation",
"objc2-core-graphics",
"objc2-io-surface",
@@ -4204,7 +4537,7 @@ dependencies = [
"bitflags 2.13.2",
"block2 0.6.2",
"libc",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-core-foundation",
]
@@ -4214,7 +4547,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32b0446e98cf4a784cc7a0177715ff317eeaa8463841c616cfc78aa4f953c4ea"
dependencies = [
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-core-foundation",
"objc2-core-graphics",
]
@@ -4226,7 +4559,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d"
dependencies = [
"bitflags 2.13.2",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-core-foundation",
]
@@ -4248,7 +4581,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edd9fdde720df3da7046bb9097811000c1e7ab5cd579fa89d96b27d56781fb30"
dependencies = [
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-core-audio-types",
"objc2-core-foundation",
"objc2-core-media",
@@ -4274,7 +4607,7 @@ checksum = "a0125f776a10d00af4152d74616409f0d4a2053a6f57fa5b7d6aa2854ac04794"
dependencies = [
"bitflags 2.13.2",
"block2 0.6.2",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-foundation 0.3.2",
]
@@ -4298,7 +4631,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f"
dependencies = [
"bitflags 2.13.2",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-core-foundation",
"objc2-core-graphics",
"objc2-foundation 0.3.2",
@@ -4343,7 +4676,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22"
dependencies = [
"bitflags 2.13.2",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-core-foundation",
"objc2-foundation 0.3.2",
]
@@ -4378,6 +4711,12 @@ version = "1.21.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
+[[package]]
+name = "once_cell_polyfill"
+version = "1.70.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
+
[[package]]
name = "oorandom"
version = "11.1.5"
@@ -4386,9 +4725,9 @@ checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"
[[package]]
name = "open"
-version = "5.4.4"
+version = "5.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa576c76302b7b808eecc68061e67336c47833ef9d22caa74dda10fa9675eebc"
+checksum = "8d8c8b8e725ad26404d6896eb2f064294a0a7b4f1d9120210d85544684c4ca95"
dependencies = [
"is-wsl",
"libc",
@@ -4436,7 +4775,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967"
dependencies = [
"libc",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "page_size"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da"
+dependencies = [
+ "libc",
+ "winapi",
]
[[package]]
@@ -4570,9 +4919,9 @@ dependencies = [
[[package]]
name = "phf"
-version = "0.13.1"
+version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf"
+checksum = "010378780309880b08997fae13be7834dba947d36393bd372f2b1556deb2a2f6"
dependencies = [
"phf_macros",
"phf_shared",
@@ -4581,9 +4930,9 @@ dependencies = [
[[package]]
name = "phf_generator"
-version = "0.13.1"
+version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737"
+checksum = "aeb62e0959d5a1bebc965f4d15d9e2b7cea002b6b0f5ba8cde6cc26738467100"
dependencies = [
"fastrand",
"phf_shared",
@@ -4591,9 +4940,9 @@ dependencies = [
[[package]]
name = "phf_macros"
-version = "0.13.1"
+version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef"
+checksum = "5fa8d0ca26d424d27630da600c6624696e7dec8bf7b3b492b383c5dc49e5e085"
dependencies = [
"phf_generator",
"phf_shared",
@@ -4604,20 +4953,23 @@ dependencies = [
[[package]]
name = "phf_shared"
-version = "0.13.1"
+version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266"
+checksum = "c6fd9027e2d9319be6349febd1db4e8d02aa544921200c9b777720ac34a3aa89"
dependencies = [
"siphasher",
]
[[package]]
name = "photocraft"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"arboard",
"async-io",
+ "chrono",
+ "clap",
"core-graphics2",
+ "craft-update",
"dispatch2",
"eframe",
"egui",
@@ -4625,7 +4977,7 @@ dependencies = [
"futures-lite",
"log",
"muda",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-app-kit 0.3.2",
"objc2-foundation 0.3.2",
"open",
@@ -4645,7 +4997,10 @@ dependencies = [
"resvg",
"rfd",
"ron",
+ "serde",
"serde_json",
+ "tempfile",
+ "thiserror 2.0.21",
"winit",
"winresource",
"winsafe",
@@ -4657,7 +5012,7 @@ dependencies = [
[[package]]
name = "photocraft-affinity"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"crc32fast",
"flate2",
@@ -4667,11 +5022,13 @@ dependencies = [
[[package]]
name = "photocraft-algo"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
+ "criterion",
"photocraft-color",
"photocraft-geom",
"photocraft-raster",
+ "photocraft-testkit",
"rayon",
"rustfft",
"serde",
@@ -4680,19 +5037,22 @@ dependencies = [
[[package]]
name = "photocraft-automation"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
- "base64 0.22.1",
+ "base64 0.23.1",
"cap-std",
+ "clap",
"getrandom 0.3.4",
"photocraft-codecs",
"photocraft-compose",
"photocraft-doc",
"photocraft-engine",
"photocraft-format",
- "photocraft-geom",
"photocraft-io",
+ "photocraft-raster",
+ "photocraft-raw",
"rmcp",
+ "rustix 1.1.5",
"schemars",
"serde",
"serde_json",
@@ -4702,21 +5062,26 @@ dependencies = [
[[package]]
name = "photocraft-cli"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
+ "clap",
+ "clap_complete",
+ "clap_mangen",
"photocraft-automation",
"photocraft-codecs",
"photocraft-engine",
"photocraft-format",
"photocraft-io",
+ "photocraft-raw",
"serde_json",
+ "thiserror 2.0.21",
"tokio",
"winresource",
]
[[package]]
name = "photocraft-cms"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"moxcms",
"rayon",
@@ -4724,14 +5089,16 @@ dependencies = [
[[package]]
name = "photocraft-codecs"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
+ "craft-jpeg",
"exr",
"flate2",
"half",
"image",
"image-webp",
"jpeg-encoder",
+ "jxl-oxide",
"photocraft-heif",
"png 0.18.1",
"proptest",
@@ -4741,11 +5108,12 @@ dependencies = [
"tiff",
"zune-core 0.5.3",
"zune-jpeg 0.5.15",
+ "zune-jpegxl",
]
[[package]]
name = "photocraft-color"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"photocraft-cms",
"serde",
@@ -4753,9 +5121,10 @@ dependencies = [
[[package]]
name = "photocraft-compose"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"criterion",
+ "photocraft-cms",
"photocraft-color",
"photocraft-doc",
"photocraft-geom",
@@ -4768,7 +5137,7 @@ dependencies = [
[[package]]
name = "photocraft-doc"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -4779,9 +5148,10 @@ dependencies = [
[[package]]
name = "photocraft-engine"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"blake3",
+ "chrono",
"craft-print",
"exr",
"flate2",
@@ -4795,29 +5165,35 @@ dependencies = [
"photocraft-format",
"photocraft-geom",
"photocraft-io",
+ "photocraft-ipp",
"photocraft-ops",
"photocraft-paint",
"photocraft-plugins",
"photocraft-psd",
"photocraft-raster",
"photocraft-raw",
+ "photocraft-testkit",
"photocraft-text",
"photocraft-vector",
"rayon",
- "roxmltree",
+ "roxmltree 0.21.1",
+ "same-file",
+ "semver",
"serde",
"serde_json",
"tempfile",
"thiserror 2.0.21",
"wat",
+ "winsafe",
]
[[package]]
name = "photocraft-format"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"blake3",
"crc32fast",
+ "exacl",
"flate2",
"libc",
"photocraft-codecs",
@@ -4831,21 +5207,25 @@ dependencies = [
"serde",
"serde_json",
"thiserror 2.0.21",
+ "winsafe",
]
[[package]]
name = "photocraft-geom"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"serde",
]
[[package]]
name = "photocraft-gpu"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
+ "bytemuck",
"half",
"log",
+ "photocraft-algo",
+ "photocraft-cms",
"photocraft-color",
"photocraft-compose",
"photocraft-doc",
@@ -4859,18 +5239,20 @@ dependencies = [
[[package]]
name = "photocraft-heif"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"heic-rs",
]
[[package]]
name = "photocraft-io"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"blake3",
+ "craft-docpath",
"crc32fast",
"flate2",
+ "miniz_oxide 0.9.1",
"photocraft-affinity",
"photocraft-algo",
"photocraft-cms",
@@ -4884,41 +5266,53 @@ dependencies = [
"photocraft-psd",
"photocraft-raster",
"photocraft-raw",
+ "photocraft-testkit",
"photocraft-text",
"photocraft-vector",
"proptest",
"resvg",
- "roxmltree",
+ "roxmltree 0.21.1",
"serde_json",
"thiserror 2.0.21",
+ "tiff",
+ "zune-core 0.5.3",
+ "zune-jpegxl",
]
+[[package]]
+name = "photocraft-ipp"
+version = "0.17.0"
+
[[package]]
name = "photocraft-ops"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"photocraft-doc",
]
[[package]]
name = "photocraft-paint"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
+ "photocraft-cms",
"photocraft-color",
"photocraft-geom",
"photocraft-raster",
+ "rayon",
+ "rustc-hash 2.1.3",
"serde",
"serde_json",
]
[[package]]
name = "photocraft-plugins"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"photocraft-color",
"photocraft-geom",
"photocraft-raster",
"rayon",
+ "rustix 1.1.5",
"serde",
"serde_json",
"thiserror 2.0.21",
@@ -4928,7 +5322,7 @@ dependencies = [
[[package]]
name = "photocraft-psd"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"flate2",
"photocraft-psd",
@@ -4939,17 +5333,18 @@ dependencies = [
[[package]]
name = "photocraft-raster"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"photocraft-color",
"photocraft-geom",
"proptest",
+ "rayon",
"serde",
]
[[package]]
name = "photocraft-raw"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"flate2",
"image",
@@ -4964,10 +5359,10 @@ dependencies = [
[[package]]
name = "photocraft-tablet"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"block2 0.6.2",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-app-kit 0.3.2",
"objc2-core-graphics",
"objc2-foundation 0.3.2",
@@ -4976,18 +5371,15 @@ dependencies = [
[[package]]
name = "photocraft-testkit"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"memory-stats",
- "photocraft-color",
- "photocraft-geom",
- "photocraft-raster",
"serde_json",
]
[[package]]
name = "photocraft-text"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"flate2",
"parley",
@@ -4996,16 +5388,18 @@ dependencies = [
"photocraft-geom",
"photocraft-psd",
"photocraft-raster",
+ "rayon",
"skrifa",
]
[[package]]
name = "photocraft-ui-egui"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
- "base64 0.22.1",
+ "base64 0.23.1",
"craft-print",
"craft-ui",
+ "craft-update",
"eframe",
"egui",
"egui_extras",
@@ -5036,13 +5430,16 @@ dependencies = [
"serde",
"serde_json",
"sys-locale",
+ "tempfile",
"toml",
+ "unicode-bidi",
+ "web-time",
"winsafe",
]
[[package]]
name = "photocraft-vector"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"photocraft-color",
"photocraft-doc",
@@ -5053,7 +5450,7 @@ dependencies = [
[[package]]
name = "photocraft-web"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"eframe",
"egui",
@@ -5075,7 +5472,7 @@ dependencies = [
[[package]]
name = "photocraft-web-boot"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
"flate2",
"js-sys",
@@ -5164,6 +5561,19 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
+[[package]]
+name = "plist"
+version = "1.10.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "327a4cb2ad49dc48adfdc9da89e22c64d488b508c67a044d71ba729e4521a285"
+dependencies = [
+ "base64 0.23.1",
+ "indexmap",
+ "quick-xml 0.42.0",
+ "serde",
+ "time",
+]
+
[[package]]
name = "png"
version = "0.17.16"
@@ -5240,6 +5650,16 @@ dependencies = [
"portable-atomic",
]
+[[package]]
+name = "postcard"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24"
+dependencies = [
+ "cobs",
+ "serde",
+]
+
[[package]]
name = "potential_utf"
version = "0.1.6"
@@ -5251,6 +5671,12 @@ dependencies = [
"zerovec",
]
+[[package]]
+name = "powerfmt"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958"
+
[[package]]
name = "ppv-lite86"
version = "0.2.21"
@@ -5338,16 +5764,17 @@ dependencies = [
[[package]]
name = "proptest"
-version = "1.11.0"
+version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744"
+checksum = "b8530004ccb15eae51c7e40009fbe317f341f804db54dc033eec1c50be28cfa0"
dependencies = [
- "bit-set 0.8.0",
- "bit-vec 0.8.0",
+ "bit-set 0.11.1",
+ "bit-vec 0.10.1",
"bitflags 2.13.2",
+ "chacha20",
+ "core_detect",
"num-traits",
- "rand 0.9.5",
- "rand_chacha",
+ "rand 0.10.3",
"rand_xorshift",
"regex-syntax",
"rusty-fork",
@@ -5414,6 +5841,15 @@ dependencies = [
"memchr",
]
+[[package]]
+name = "quick-xml"
+version = "0.42.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "41b1177fdf999d2321d3fb46ff47159d9c1fb9ad66a4879f8c50a0b504615e9b"
+dependencies = [
+ "memchr",
+]
+
[[package]]
name = "quinn"
version = "0.11.12"
@@ -5468,7 +5904,7 @@ dependencies = [
"once_cell",
"socket2",
"tracing",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -5555,11 +5991,11 @@ dependencies = [
[[package]]
name = "rand_xorshift"
-version = "0.4.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a"
+checksum = "60aa6af80be32871323012e02e6e65f8a7cc7890931ae421d217ad8fe0df2ccf"
dependencies = [
- "rand_core 0.9.5",
+ "rand_core 0.10.1",
]
[[package]]
@@ -5638,7 +6074,7 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40d213455a5f1dc59214213c7330e074ddf8114c9a42411eb890c767357ce135"
dependencies = [
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-core-foundation",
"objc2-foundation 0.3.2",
"objc2-quartz-core 0.3.2",
@@ -5834,7 +6270,7 @@ dependencies = [
"js-sys",
"libc",
"log",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-app-kit 0.3.2",
"objc2-core-foundation",
"objc2-foundation 0.3.2",
@@ -5875,13 +6311,14 @@ dependencies = [
[[package]]
name = "rmcp"
-version = "3.5.0"
+version = "3.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fae7019994ae0fe4ada40b732f798f3ff26f0f04facb1477f1bf37eb4f18a2d3"
+checksum = "ceb42e9e47443cd83a834dea57b5816d35481417bae72ade5dc5615c59122e26"
dependencies = [
"chrono",
"futures",
"indexmap",
+ "libc",
"pastey 0.2.3",
"pin-project-lite",
"rmcp-macros",
@@ -5898,9 +6335,9 @@ dependencies = [
[[package]]
name = "rmcp-macros"
-version = "3.5.0"
+version = "3.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7e66877136e969d5a2d561ee5841b17717a0619aebd64abb47a2a2f46e34683"
+checksum = "967fa7f7935d7d6217d593df0e8e5c9307bcaf256974a5a9ee64476c97735389"
dependencies = [
"darling",
"proc-macro2",
@@ -5909,6 +6346,12 @@ dependencies = [
"syn 3.0.6",
]
+[[package]]
+name = "roff"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "323c417e1d9665a65b263ec744ba09030cfb277e9daa0b018a4ab62e57bc8189"
+
[[package]]
name = "ron"
version = "0.12.2"
@@ -5929,6 +6372,15 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"
+[[package]]
+name = "roxmltree"
+version = "0.21.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f1964b10c76125c36f8afe190065a4bf9a87bf324842c05701330bba9f1cacbb"
+dependencies = [
+ "memchr",
+]
+
[[package]]
name = "rustc-hash"
version = "1.1.0"
@@ -5987,7 +6439,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys 0.12.1",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -6002,12 +6454,14 @@ dependencies = [
[[package]]
name = "rustls"
-version = "0.23.45"
+version = "0.23.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634"
+checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"
dependencies = [
"aws-lc-rs",
+ "log",
"once_cell",
+ "ring",
"rustls-pki-types",
"rustls-webpki",
"subtle",
@@ -6054,7 +6508,7 @@ dependencies = [
"security-framework",
"security-framework-sys",
"webpki-root-certs",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -6152,9 +6606,9 @@ dependencies = [
[[package]]
name = "schemars"
-version = "1.2.2"
+version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "687274d293b6cdc6e73e0fee520bf2049650090d7164f87672d212a3c530cf4a"
+checksum = "ab508826f74a77ca9d5aba6ff19b522583ee3eaf28a19384ff3d0e5835fadf6e"
dependencies = [
"chrono",
"dyn-clone",
@@ -6166,9 +6620,9 @@ dependencies = [
[[package]]
name = "schemars_derive"
-version = "1.2.2"
+version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d98c67716b46af2f0b8cf752abc930f6f9aecfbf671ecfb531db8a31dbe4e2ba"
+checksum = "e1c3a92094fa7d61aa124645844facb6b554dfc797136d0f5fd1f890e2bffc69"
dependencies = [
"proc-macro2",
"quote",
@@ -6222,6 +6676,16 @@ name = "semver"
version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
+dependencies = [
+ "serde",
+ "serde_core",
+]
+
+[[package]]
+name = "send_wrapper"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73"
[[package]]
name = "serde"
@@ -6266,9 +6730,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.151"
+version = "1.0.154"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
+checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
dependencies = [
"itoa",
"memchr",
@@ -6692,7 +7156,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
dependencies = [
"libc",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -6858,7 +7322,10 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4"
dependencies = [
+ "js-sys",
"libc",
+ "wasm-bindgen",
+ "web-sys",
]
[[package]]
@@ -6919,10 +7386,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
dependencies = [
"fastrand",
- "getrandom 0.3.4",
+ "getrandom 0.4.3",
"once_cell",
"rustix 1.1.5",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -6988,6 +7455,36 @@ dependencies = [
"zune-jpeg 0.5.15",
]
+[[package]]
+name = "time"
+version = "0.3.55"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134"
+dependencies = [
+ "deranged",
+ "num-conv",
+ "powerfmt",
+ "serde_core",
+ "time-core",
+ "time-macros",
+]
+
+[[package]]
+name = "time-core"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109"
+
+[[package]]
+name = "time-macros"
+version = "0.2.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85"
+dependencies = [
+ "num-conv",
+ "time-core",
+]
+
[[package]]
name = "tiny-skia"
version = "0.11.4"
@@ -7064,9 +7561,9 @@ dependencies = [
[[package]]
name = "tokio"
-version = "1.53.1"
+version = "1.54.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"
+checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3"
dependencies = [
"bytes",
"libc",
@@ -7302,6 +7799,12 @@ dependencies = [
"rustc-hash 2.1.3",
]
+[[package]]
+name = "typed-path"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ce898823d8cd0f028662d2f349694b1af0a5cc9be83f1d213a00d3147445e1e"
+
[[package]]
name = "typeid"
version = "1.0.3"
@@ -7322,7 +7825,7 @@ checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"
dependencies = [
"memoffset",
"tempfile",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -7403,6 +7906,35 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
+[[package]]
+name = "ureq"
+version = "3.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cde93ff05758a36a851a398a772b0b79a82fbe3c186a46f2696baaeaf84c966b"
+dependencies = [
+ "base64 0.23.1",
+ "flate2",
+ "log",
+ "percent-encoding",
+ "rustls",
+ "rustls-pki-types",
+ "rustls-platform-verifier",
+ "ureq-proto",
+ "utf8-zero",
+]
+
+[[package]]
+name = "ureq-proto"
+version = "0.6.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "841583fc36089d7d59419568ae157f43a5a03a2e5a81ba87c77d1596ef46e922"
+dependencies = [
+ "base64 0.23.1",
+ "http",
+ "httparse",
+ "log",
+]
+
[[package]]
name = "url"
version = "2.5.8"
@@ -7429,7 +7961,7 @@ dependencies = [
"kurbo 0.11.3",
"log",
"pico-args",
- "roxmltree",
+ "roxmltree 0.20.0",
"rustybuzz",
"simplecss",
"siphasher",
@@ -7442,12 +7974,30 @@ dependencies = [
"xmlwriter",
]
+[[package]]
+name = "utf16_iter"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246"
+
+[[package]]
+name = "utf8-zero"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e"
+
[[package]]
name = "utf8_iter"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
+[[package]]
+name = "utf8parse"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
+
[[package]]
name = "uuid"
version = "1.26.1"
@@ -7473,9 +8023,9 @@ dependencies = [
[[package]]
name = "vello_common"
-version = "0.1.0"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2e9aed918117e8152c9eddfd8362d73c465c23f26c44786aa331707b8a64fa2"
+checksum = "bbb2141a2bca6e6d598e471fd4d1d7eed8e020aad6a28187edda07f091a325dd"
dependencies = [
"bytemuck",
"fearless_simd",
@@ -7488,9 +8038,9 @@ dependencies = [
[[package]]
name = "vello_cpu"
-version = "0.1.0"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac7349e1f55f6b801c7c277958df4ea53e7f20f21e8014910ad888b2ecda93ea"
+checksum = "ace506ca414548966fcf3c283be94eb1cad8254de488791ee698bf438b0890a9"
dependencies = [
"bytemuck",
"glifo",
@@ -7498,6 +8048,16 @@ dependencies = [
"vello_common",
]
+[[package]]
+name = "verifysign"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6acfcc42a8d44f340d001193d97ef56bf33210b51ad760ae8308c97d5241ca51"
+dependencies = [
+ "core-foundation 0.10.1",
+ "windows-sys 0.61.2",
+]
+
[[package]]
name = "version-compare"
version = "0.2.1"
@@ -7611,12 +8171,12 @@ dependencies = [
[[package]]
name = "wasm-encoder"
-version = "0.261.0"
+version = "0.262.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2608e8bb6d67fd68f5a8d0eb1363d6e7bcbc1f8ded5a0bd3a1e382462b876b22"
+checksum = "4495a6f85dd94c411c749303efcbc5defade0b0cbdbc0541495241ab917a9b5a"
dependencies = [
"leb128fmt",
- "wasmparser 0.261.0",
+ "wasmparser 0.262.0",
]
[[package]]
@@ -7671,9 +8231,9 @@ dependencies = [
[[package]]
name = "wasmparser"
-version = "0.261.0"
+version = "0.262.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4f20f20e44f7e8aeb6744823ea9d869ede51e51be4fdaedede2852282e54d2d8"
+checksum = "974d643b125b272607e2fff8012ea14a8328acd7621e4bafa7afb32500052b1b"
dependencies = [
"bitflags 2.13.2",
"indexmap",
@@ -7682,9 +8242,9 @@ dependencies = [
[[package]]
name = "wast"
-version = "261.0.0"
+version = "262.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "776443145731a4062e5b0d392892a2005909b6ab72d9fdc3cad53dd1a714e44a"
+checksum = "30612a0c29249b5f185888a107e8a519d920226b7d07f9d351fd094e9f75eb23"
dependencies = [
"bumpalo",
"leb128fmt",
@@ -7695,9 +8255,9 @@ dependencies = [
[[package]]
name = "wat"
-version = "1.261.0"
+version = "1.262.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7b4d1a49ea73a8f3326e74e3a05db667001b16bd1035ed3356fc1a0ed05ca7f"
+checksum = "e228027f2b07bbaf946980ebbe2437fca73be6f54c40c2a8d4f42f277075f8d1"
dependencies = [
"wast",
]
@@ -7821,7 +8381,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "338e30461b3a2b67d70eb30a6d89f8e0c93a833e07d2ae89085cd070c4a00ac0"
dependencies = [
"proc-macro2",
- "quick-xml",
+ "quick-xml 0.41.0",
"quote",
]
@@ -8015,7 +8575,7 @@ dependencies = [
"naga",
"naga-types",
"ndk-sys",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-core-foundation",
"objc2-core-graphics",
"objc2-foundation 0.3.2",
@@ -8076,15 +8636,37 @@ version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471"
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
[[package]]
name = "winapi-util"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+
[[package]]
name = "windows"
version = "0.62.2"
@@ -8203,7 +8785,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
- "windows-targets 0.52.6",
+ "windows-targets",
]
[[package]]
@@ -8212,16 +8794,7 @@ version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
dependencies = [
- "windows-targets 0.52.6",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.60.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
-dependencies = [
- "windows-targets 0.53.5",
+ "windows-targets",
]
[[package]]
@@ -8239,31 +8812,14 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
- "windows_aarch64_gnullvm 0.52.6",
- "windows_aarch64_msvc 0.52.6",
- "windows_i686_gnu 0.52.6",
- "windows_i686_gnullvm 0.52.6",
- "windows_i686_msvc 0.52.6",
- "windows_x86_64_gnu 0.52.6",
- "windows_x86_64_gnullvm 0.52.6",
- "windows_x86_64_msvc 0.52.6",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.53.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
-dependencies = [
- "windows-link",
- "windows_aarch64_gnullvm 0.53.1",
- "windows_aarch64_msvc 0.53.1",
- "windows_i686_gnu 0.53.1",
- "windows_i686_gnullvm 0.53.1",
- "windows_i686_msvc 0.53.1",
- "windows_x86_64_gnu 0.53.1",
- "windows_x86_64_gnullvm 0.53.1",
- "windows_x86_64_msvc 0.53.1",
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
]
[[package]]
@@ -8281,101 +8837,52 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
-
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
-
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
-[[package]]
-name = "windows_i686_gnu"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
-
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
-[[package]]
-name = "windows_i686_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
-
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
-[[package]]
-name = "windows_i686_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
-
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
-
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
-
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
-
[[package]]
name = "winit"
version = "0.30.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6755fa58a9f8350bd1e472d4c3fcc25f824ec358933bba33306d0b63df5978d"
+source = "git+https://github.com/storytold/winit.git?rev=a517b3846ee8457d84ee4975110bfda6797c44dc#a517b3846ee8457d84ee4975110bfda6797c44dc"
dependencies = [
"ahash",
"android-activity",
@@ -8453,10 +8960,20 @@ dependencies = [
]
[[package]]
-name = "winresource"
-version = "0.1.31"
+name = "winreg"
+version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0986a8b1d586b7d3e4fe3d9ea39fb451ae22869dcea4aa109d287a374d866087"
+checksum = "cb5a765337c50e9ec252c2069be9bf91c7df47afb103b642ba3a53bf8101be97"
+dependencies = [
+ "cfg-if",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "winresource"
+version = "0.1.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a2bc6d36480b829272a5bdabf08e6dca8004761c1da7e35efef800540c66221b"
dependencies = [
"toml",
"version_check",
@@ -8502,11 +9019,20 @@ dependencies = [
"wayland-protocols-wlr",
]
+[[package]]
+name = "write16"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936"
+
[[package]]
name = "writeable"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
+dependencies = [
+ "either",
+]
[[package]]
name = "x11-dl"
@@ -8585,7 +9111,7 @@ dependencies = [
"image",
"libwayshot-xcap",
"log",
- "objc2 0.6.4",
+ "objc2 0.6.5",
"objc2-app-kit 0.3.2",
"objc2-av-foundation",
"objc2-core-foundation",
@@ -8614,7 +9140,7 @@ checksum = "a6c2ad15e0e922856ee89afe862b8992334bbe7953adad56cd1199358cb30566"
dependencies = [
"bitflags 2.13.2",
"libc",
- "quick-xml",
+ "quick-xml 0.41.0",
]
[[package]]
@@ -8662,8 +9188,9 @@ checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"
[[package]]
name = "xtask"
-version = "0.9.0"
+version = "0.17.0"
dependencies = [
+ "chrono",
"serde",
"serde_json",
"toml",
@@ -8675,6 +9202,17 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448"
+[[package]]
+name = "yeslogic-fontconfig-sys"
+version = "6.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1d8b8abf912b9a29ff112e1671c97c33636903d13a69712037190e6805af4f76"
+dependencies = [
+ "dlib",
+ "once_cell",
+ "pkg-config",
+]
+
[[package]]
name = "yoke"
version = "0.8.3"
@@ -8872,6 +9410,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f"
dependencies = [
"displaydoc",
+ "litemap",
+ "serde_core",
"yoke",
"zerofrom",
"zerovec",
@@ -8900,6 +9440,23 @@ dependencies = [
"syn 3.0.6",
]
+[[package]]
+name = "zip"
+version = "9.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2886b00003a72c4ccee3f42cfc34908d33b2508a74d827dc2a4244706475c704"
+dependencies = [
+ "crc32fast",
+ "flate2",
+ "getrandom 0.4.3",
+ "indexmap",
+ "memchr",
+ "nix",
+ "typed-path",
+ "windows-sys 0.61.2",
+ "zopfli",
+]
+
[[package]]
name = "zlib-rs"
version = "0.6.8"
@@ -8912,6 +9469,18 @@ version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
+[[package]]
+name = "zopfli"
+version = "0.8.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aaf7fc5d30c28483d93805c4a5e12b05bbb52407fa67c5f8bd552374cd01fb11"
+dependencies = [
+ "bumpalo",
+ "crc32fast",
+ "log",
+ "simd-adler32",
+]
+
[[package]]
name = "zune-core"
version = "0.4.12"
@@ -9000,3 +9569,18 @@ dependencies = [
"syn 3.0.6",
"winnow",
]
+
+[[patch.unused]]
+name = "egui_demo_lib"
+version = "0.37.0"
+source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a"
+
+[[patch.unused]]
+name = "egui_inspection"
+version = "0.37.0"
+source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a"
+
+[[patch.unused]]
+name = "egui_system_font_provider"
+version = "0.37.0"
+source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a"
diff --git a/Cargo.toml b/Cargo.toml
index 0d0f93ae7c..144b7e4475 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,13 +4,13 @@ members = ["crates/*", "apps/*", "xtask"]
default-members = ["crates/*", "apps/photocraft", "apps/photocraft-cli", "xtask"]
[workspace.package]
-version = "0.9.0"
+version = "0.17.0"
edition = "2024"
license = "MIT OR Apache-2.0"
rust-version = "1.95"
[workspace.dependencies]
-craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "5c874d51eeb3de70e735c8ce87a59a7dedd47675", features = ["serde"] }
+craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0", features = ["serde"] }
# internal
photocraft-geom = { path = "crates/geom" }
photocraft-color = { path = "crates/color" }
@@ -36,47 +36,66 @@ photocraft-engine = { path = "crates/engine" }
photocraft-ui-egui = { path = "crates/ui-egui" }
photocraft-testkit = { path = "crates/testkit" }
photocraft-tablet = { path = "crates/tablet" }
+photocraft-ipp = { path = "crates/ipp" }
# external
-craft-print = { git = "https://github.com/storytold/craft-libs", rev = "3d37da389a3618ab9b76109da11416e9ca4ea719" }
+craft-print = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" }
+craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" }
+craft-jpeg = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" }
+# craft-update: app-specific pretend versions apply to startup and manual checks.
+craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "04aa1703b32d299e54f78fcde4182f2b393a9116", features = ["egui"] }
thiserror = "2"
serde = { version = "1", features = ["derive", "rc"] }
serde_json = "1"
+clap = { version = "4", features = ["derive", "env"] }
+clap_complete = "4.6.11"
+clap_mangen = { version = "0.3.3", features = ["env"] }
arc-swap = "1"
bytemuck = { version = "1", features = ["derive"] }
-flate2 = { version = "1", default-features = false, features = ["rust_backend"] }
+flate2 = { version = "1.1.10", default-features = false, features = ["zlib-rs", "runtime_detection"] }
image = { version = "0.25", default-features = false }
# Baseline-JPEG decode of lossy DNG tiles (compression 34892), shared with zune-jpeg.
zune-core = "0.5"
zune-jpeg = "0.5"
proptest = "1"
-eframe = { version = "0.36", default-features = false }
+eframe = { version = "0.37", default-features = false }
# Without `default_fonts`, which embeds egui's fonts uncompressed: ui-egui ships them deflated
# (egui_fonts.rs; the web build's size gate).
-egui = { version = "0.36", default-features = false }
-egui_kittest = "0.36"
+egui = { version = "0.37", default-features = false }
+egui_kittest = "0.37"
rfd = "0.17"
log = "0.4"
+# All date/time conversion goes through chrono (no hand-rolled calendar code beyond the 400-year range extension; AGENTS.md).
+chrono = { version = "0.4.45", default-features = false, features = ["std"] }
rayon = "1"
-criterion = { version = "0.5", default-features = false }
+rustc-hash = "2.1.3"
+criterion = { version = "0.8", default-features = false }
getrandom = "0.3"
+# Monotonic clock on native and wasm (screenshot deadlines: a wall clock can jump).
+web-time = "1"
[workspace.lints.rust]
unsafe_code = "forbid"
[workspace.lints.clippy]
+cognitive_complexity = "deny"
+too_many_arguments = "deny"
+wildcard_imports = "deny"
dbg_macro = "warn"
todo = "warn"
+# Dependencies carry no debug info: their frames in a backtrace lose file:line, and the target dir
+# and link times shrink. The test profile inherits both settings.
[profile.dev.package."*"]
opt-level = 2
+debug = false
[profile.dev]
opt-level = 1
# Line tables keep file:line in panic backtraces but drop variable info, which roughly halves link
-# time and PDB size for the ~260 test binaries (#2204). CI sets the same through
-# CARGO_PROFILE_DEV_DEBUG (and no debuginfo at all for the Windows tests). To inspect locals in a
-# debugger, build with CARGO_PROFILE_DEV_DEBUG=true.
+# time and PDB size for the test binaries (#2204). CI's Windows legs build with no debuginfo at all
+# (CARGO_PROFILE_DEV_DEBUG=0). To inspect locals in a debugger, build with
+# CARGO_PROFILE_DEV_DEBUG=true.
debug = "line-tables-only"
# Test builds compile ui-egui without optimization: its library and unit tests were the biggest
@@ -136,6 +155,14 @@ opt-level = "z"
[profile.wasm-release.package.naga]
opt-level = "z"
+# The browser UI toolkit favors size to stay within the WebAssembly upload budget.
+[profile.wasm-release.package.egui]
+opt-level = "z"
+[profile.wasm-release.package.epaint]
+opt-level = "z"
+[profile.wasm-release.package.eframe]
+opt-level = "z"
+
# Pixel processing keeps its speed-oriented optimization level, with two exceptions.
# Colour-management transforms are built once and cached (`transform::cached`), so "z" costs
# little runtime. The browser app composites per frame on the GPU (`crates/gpu`, WebGPU/WebGL2),
@@ -157,3 +184,20 @@ opt-level = "z"
[profile.wasm-release.package.photocraft-paint]
opt-level = 3
+# Keep the complete egui family and native event bridge on reviewed fork commits.
+[patch.crates-io]
+ecolor = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+emath = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+epaint = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+egui = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+egui-winit = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+egui_glow = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+egui_extras = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+egui_system_font_provider = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+eframe = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+egui_demo_lib = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+egui_inspection = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" }
diff --git a/Dockerfile b/Dockerfile
index 66734f255a..1803d3a2e9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -25,8 +25,8 @@ RUN set -eu; \
asset="trunk-${arch}-unknown-linux-musl.tar.gz"; \
url="https://github.com/trunk-rs/trunk/releases/download/v${TRUNK_VERSION}"; \
cd /tmp; \
- curl -fsSL --retry 3 -A Photocraft-dev "$url/$asset" -o "$asset"; \
- curl -fsSL --retry 3 -A Photocraft-dev "$url/$asset.sha256" -o "$asset.sha256"; \
+ curl --proto '=https' -fsSL --retry 3 -A Photocraft-dev "$url/$asset" -o "$asset"; \
+ curl --proto '=https' -fsSL --retry 3 -A Photocraft-dev "$url/$asset.sha256" -o "$asset.sha256"; \
printf '%s %s\n' "$(cat "$asset.sha256")" "$asset" | sha256sum -c -; \
tar -xzf "$asset" -C /usr/local/bin trunk; \
rm "$asset" "$asset.sha256"; \
diff --git a/NOTICE b/NOTICE
index 887010d4a6..6250865673 100644
--- a/NOTICE
+++ b/NOTICE
@@ -16,8 +16,26 @@ Inter font (assets/fonts/Inter-*.ttf) — SIL Open Font License 1.1. See assets/
JetBrains Mono font (assets/fonts/JetBrainsMono-Regular.ttf) — SIL Open Font License 1.1. See assets/fonts/OFL-JetBrainsMono.txt.
Lucide icons (assets/icons/*.svg, except slice-knife.svg) — ISC; icons derived from Feather also MIT. See assets/icons/LICENSE-lucide.txt.
SCOWL English word list (assets/dict/en_US-scowl-50.txt.gz) — SCOWL license. See assets/dict/LICENSE-SCOWL.txt.
+libfacedetection face detection weights and network (crates/algo/data/libfacedetection.bin, crates/algo/src/faces/cnn.rs) — BSD-3-Clause, Copyright (c) 2015-2019, Shiqi Yu, all rights reserved. See crates/algo/data/LICENSE-libfacedetection.txt.
Builds made with craft-fonts (CRAFT_FONTS_DIR; all official releases) also embed the fonts listed in
https://github.com/storytold/craft-fonts/blob/main/ATTRIBUTION.md (today BIZ UDPGothic, Shippori Mincho and
BIZ UDMincho; not the web build), under the SIL Open Font License 1.1. Their licence texts
ship with the package as OFL-.txt.
+
+The egui-icons font subset is embedded from epaint_default_fonts by crates/ui-egui/build.rs
+and registered in the native and web fallback stacks by crates/ui-egui/src/egui_fonts.rs.
+It is a subset of emoji-icon-font by John Slegers; the same upstream MIT license applies.
+Source: https://github.com/storytold/egui/tree/6d518fc799681571963842f95b55a6b68431b15a/crates/epaint_default_fonts/fonts
+Original: https://github.com/jslegers/emoji-icon-font
+The following notice is reproduced verbatim from emoji-icon-font-mit-license.txt:
+
+MIT License
+
+Copyright (c) 2014 John Slegers
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/README.md b/README.md
index d1e839323c..3c4e586f26 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,10 @@
+
+
+
+
PhotoCraft
@@ -20,6 +24,9 @@
+
+
+
@@ -178,8 +185,8 @@ Every screenshot here is the real app at work on public-domain art, rendered off
-
🧰 67 tools
- Move · Artboard · Rectangular and Elliptical Marquee · Single Row Marquee · Single Column Marquee · Lasso · Polygonal Lasso · Magnetic Lasso · Object Selection · Quick Selection · Magic Wand · Crop · Perspective Crop · Slice · Slice Select · Frame · Eyedropper · Color Sampler · Ruler · Note · Count · Remove · Spot Healing Brush · Healing Brush · Patch · Content-Aware Move · Red Eye · Brush · Pencil · Mixer Brush · Color Replacement · Clone Stamp · Pattern Stamp · History Brush · Eraser · Background Eraser · Magic Eraser · Gradient · Paint Bucket · Blur · Sharpen · Smudge · Dodge · Burn · Sponge · Pen · Freeform Pen · Curvature Pen · Add Anchor Point · Delete Anchor Point · Convert Point · Horizontal and Vertical Type · Horizontal and Vertical Type Mask · Path Selection · Direct Selection · Rectangle · Ellipse · Triangle · Polygon · Line · Custom Shape · Hand · Rotate View · Zoom
+
🧰 68 tools
+ Move · Artboard · Rectangular and Elliptical Marquee · Single Row Marquee · Single Column Marquee · Lasso · Polygonal Lasso · Magnetic Lasso · Object Selection · Quick Selection · Magic Wand · Crop · Perspective Crop · Slice · Slice Select · Frame · Eyedropper · Color Sampler · Ruler · Note · Count · Remove · Spot Healing Brush · Healing Brush · Patch · Content-Aware Move · Red Eye · Brush · Pencil · Mixer Brush · Color Replacement · Clone Stamp · Pattern Stamp · History Brush · Art History Brush · Eraser · Background Eraser · Magic Eraser · Gradient · Paint Bucket · Blur · Sharpen · Smudge · Dodge · Burn · Sponge · Pen · Freeform Pen · Curvature Pen · Add Anchor Point · Delete Anchor Point · Convert Point · Horizontal and Vertical Type · Horizontal and Vertical Type Mask · Path Selection · Direct Selection · Rectangle · Ellipse · Triangle · Polygon · Line · Custom Shape · Hand · Rotate View · Zoom
🖌️ A real brush engine
@@ -199,7 +206,7 @@ Every screenshot here is the real app at work on public-domain art, rendered off
🗂️ Formats
- PSD and PSB, layered TIFF (Photoshop's layer data in the TIFF, read and written in either byte order), Paint.NET PDN3 (read, with editable layers and all 14 blend modes), OpenRaster (read and write, with layers, groups and blend modes, for Krita, MyPaint and GIMP), Krita .kra (read, with paint layers, groups, blend modes and transparency masks), SVG (opens as shape layers, places as a vector Smart Object), plus flat PNG, JPEG, TIFF, WebP (lossy and lossless), GIF, BMP, TGA, ICO, QOI, PNM, OpenEXR, Radiance HDR and FITS (astronomy images: 8/16-bit and 32-bit float, gray or RGB, header kept), and the native .pcraft format. Flat formats retain the depths they support: PNG keeps 8/16-bit samples, TIFF keeps 8/16-bit and 32-bit float samples, and OpenEXR keeps half/float samples; JPEG, WebP and the other 8-bit formats reduce higher-depth samples with an export warning. See the codec capability matrix for each format. HEIC photos from iPhone and Mac are read-only (included in official builds; optional --features heif for source builds). AVIF is write-only with the optional avif build feature; AVIF decoding and JPEG XL are unavailable. Affinity documents (.af, .afdesign, .afphoto, .afpub) open natively, read only, with artboards, layers, vectors, text, images and masks; effects, adjustments and other unsupported parts are listed in a warning, and Affinity export is unavailable.
+ PSD and PSB, layered TIFF (Photoshop's layer data in the TIFF, read and written in either byte order), Paint.NET PDN3 (read, with editable layers and all 14 blend modes), OpenRaster (read and write, with layers, groups and blend modes, for Krita, MyPaint and GIMP), GIMP XCF (read, with layers, groups, masks, blend modes, channels and the selection), Krita .kra (read, with paint layers, groups, blend modes and transparency masks), SVG (opens as shape layers, places as a vector Smart Object), plus flat PNG, JPEG, TIFF, WebP (lossy and lossless), GIF, BMP, TGA, ICO, QOI, PNM, OpenEXR, Radiance HDR and FITS (astronomy images: 8/16-bit and 32-bit float, gray or RGB, header kept), and the native .pcraft format. Flat formats retain the depths they support: PNG keeps 8/16-bit samples, TIFF keeps 8/16-bit and 32-bit float samples, and OpenEXR keeps half/float samples; JPEG, WebP and the other 8-bit formats reduce higher-depth samples with an export warning. See the codec capability matrix for each format. HEIC photos from iPhone and Mac are read-only (included in official builds; optional --features heif for source builds). AVIF is write-only with the optional avif build feature; AVIF decoding and JPEG XL are unavailable. Affinity documents (.af, .afdesign, .afphoto, .afpub) open natively, read only, with artboards, layers, vectors, text, images and masks; effects, adjustments and other unsupported parts are listed in a warning, and Affinity export is unavailable.
🪄 The everyday essentials
@@ -214,7 +221,7 @@ Every screenshot here is the real app at work on public-domain art, rendered off
PhotoCraft's PSD support is a standalone crate written from Adobe's public specification and tested against a corpus of real-world files.
-- **Faithful round trips:** opening and re-saving a document renders the same for 307 of the 309 files in the psd-tools test set and 169 of 170 in our mixed ag-psd/psd-tools set (`crates/io/tests/corpus.rs`; fetch the psd-tools set with `cargo xtask corpus --psd-tools`), and anything we don't model yet (raw blocks, descriptors, extras) is carried over instead of being dropped. A re-saved file is not byte-identical to its source: PhotoCraft rewrites image resources, layer records and the composite. Only the standalone `photocraft-psd` crate, parsing and writing a file without the document model, reproduces every parseable corpus file byte for byte (`crates/psd/tests/corpus.rs`).
+- **Faithful round trips:** opening and re-saving a document renders the same for 307 of the 309 files in the psd-tools test set and 169 of 170 in our mixed ag-psd/psd-tools set (`crates/io/tests/it/corpus.rs`; fetch the psd-tools set with `cargo xtask corpus --psd-tools`), and anything we don't model yet (raw blocks, descriptors, extras) is carried over instead of being dropped. A re-saved file is not byte-identical to its source: PhotoCraft rewrites image resources, layer records and the composite. Only the standalone `photocraft-psd` crate, parsing and writing a file without the document model, reproduces every parseable corpus file byte for byte (`crates/psd/tests/it/corpus.rs`).
- **Pixels that match:** a composite oracle compares our render with Photoshop's own merged image, covering gradient interpolation (Classic, Perceptual and Linear), layer effects, shape strokes, clipping and fill opacity.
- **Large documents:** PSB, 16 and 32-bit files, and CMYK and Lab documents open natively.
@@ -275,8 +282,12 @@ flatpak install --user photocraft--linux-x86_64.flatpak # or -linux-a
flatpak run ai.storyteller.photocraft
```
+The Flatpak prints through the host's CUPS socket (File › Print talks IPP to it directly, no `lp` needed); without CUPS, or without a printer, File › Print opens the system print dialog through the print portal. See [printing](docs/printing.md).
+
The AppImage needs no install: the first run registers its launcher icon and menu entry in `~/.local/share` so the dock shows PhotoCraft's icon on Wayland. Set `PHOTOCRAFT_NO_DESKTOP_INTEGRATION=1` to skip that, and see [`docs/releasing.md`](docs/releasing.md) › Linux to undo it.
+To use the bundled CLI, run `./photocraft--linux-x86_64.AppImage --cli --help`, or `--cli mcp` to start the MCP server on stdio. CLI launches skip desktop integration. A symlink named `photocraft-cli` also selects the CLI; see [`docs/development.md`](docs/development.md#headless-cli).
+
On a Wayland session, files dropped on the window don't open yet: winit 0.30, the windowing library under egui, has no Wayland drag and drop (#386). Use File › Open, or copy the image in your file manager and paste it with Ctrl+V. To drag and drop, start PhotoCraft under XWayland: `WAYLAND_DISPLAY= photocraft`, `WAYLAND_DISPLAY= ./photocraft--linux-x86_64.AppImage`, or `flatpak run --nosocket=wayland --socket=x11 ai.storyteller.photocraft`. On Wayland, PhotoCraft shows the command for your install in a notice until you dismiss it. Preferences › Performance › Linux display server = X11 does the same on every launch. With a fractional display scale (125%, 150%, 175%) an XWayland window is drawn at a lower resolution and enlarged by the compositor, so the interface is blurred there; native Wayland stays sharp (#1072).
On macOS, the command-line tool comes as `photocraft-cli--macos-universal.zip`. The binary is signed with the same Developer ID as the app and notarized by Apple. A bare binary can't carry a stapled notarization ticket the way the DMG does, so the first time you run it macOS checks the notarization online. You can confirm it yourself:
@@ -300,6 +311,19 @@ Maintainers: [`docs/releasing.md`](docs/releasing.md) explains how releases are
> [!IMPORTANT]
> **Status:** PhotoCraft is in early alpha, and we want to be straight about where it stands: much of Photoshop's feature surface exists in some form, but **it is not yet a Photoshop replacement for daily professional work**. The biggest gaps are AI/generative features, 15 missing tools, depth in typography and pro workflows, and plug-in compatibility. Every Photoshop menu item is wired to a command ([`docs/parity-checklist.md`](docs/parity-checklist.md)), but that measures wiring, not behaviour. The honest, dimension-by-dimension picture and where we're going next are in the [roadmap](ROADMAP.md) and [parity assessment](docs/target-app-parity.md). Expect rough edges, and please file issues (include your OS, document size, layer count and a screenshot). You can also tell us what broke on [Discord](https://discord.gg/artcraft).
+## Community packages
+
+These installers are maintained by community members, not by the PhotoCraft team.
+
+On Gentoo, the [::snakebyte overlay](https://github.com/switch87/snakebyte-overlay) packages the Linux release as `media-gfx/photocraft-bin`:
+
+```sh
+eselect repository add snakebyte git https://github.com/switch87/snakebyte-overlay.git
+emaint sync -r snakebyte
+echo 'media-gfx/photocraft-bin ~amd64' >> /etc/portage/package.accept_keywords/photocraft
+emerge --ask media-gfx/photocraft-bin
+```
+
## Documentation
Developer, architecture, automation, format, and security documentation is maintained in the [PhotoCraft documentation book](book/).
@@ -321,7 +345,7 @@ sha256-verified. Fetch them with `cargo xtask corpus --all` and run the tests wi
**New to PhotoCraft?** Download it from the [PhotoCraft page on getartcraft.com](https://getartcraft.com/apps/photocraft). That's the easiest way to install it.
-**Want a specific build or format?** On GitHub, the [latest release](https://github.com/storytold/photocraft/releases/latest) has every build listed below, and [all releases](https://github.com/storytold/photocraft/releases) has earlier versions and their notes. `` in the file names is the version number, and `SHA256SUMS.txt` lists a checksum for every file.
+**Want a specific build or format?** On GitHub, the [latest release](https://github.com/storytold/photocraft/releases/latest) has every build listed below, and [all releases](https://github.com/storytold/photocraft/releases) have earlier versions and their notes. `` in the file names is the version number, and `SHA256SUMS.txt` lists a checksum for every file.
### Windows
diff --git a/ROADMAP.md b/ROADMAP.md
index f41b71bfc9..829ff75af8 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -2,7 +2,7 @@
**Stage: alpha** · next: beta, ~30 points (ready for real work ~45% → ~75%, with reliable PSD) and ~1,100–1,800 h away
-> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-10-13 · **Change:** minor (oracle floor 145 of 258 and 953 open issues, as in gaps.md and on GitHub; toolbox count 56 of 68, 12 missing) · **Target:** Adobe Photoshop 2026
+> **Last reviewed:** 2026-10-17 · **Last updated:** 2026-10-17 · **Change:** minor (Object Finder retains large enclosed foregrounds (#6548); Russian catalog covers every dynamic label; previously minor: oracle floor 145 of 258 and 953 open issues, as in gaps.md and on GitHub; toolbox count 56 of 68, 12 missing) · **Target:** Adobe Photoshop 2026
PhotoCraft's one-page summary of how close it is to Adobe Photoshop 2026 (27.11.0, measured from
the installed app on 2026-10-10) at version 0.6.0. Detail: [target-app parity](docs/target-app-parity.md)
@@ -104,7 +104,7 @@ because engine messages are still English. Detail: [localization-parity](docs/lo
| Korean | `ko` | 100% | partial |
| Vietnamese | `vi` | 0% | none |
-Also shipped: Traditional Chinese, Russian, Ukrainian, Czech, Polish, Greek, Dutch, Italian (8).
+Also shipped: Traditional Chinese, Russian (every dynamic label, [notes](docs/localization-ru.md)), Ukrainian, Czech, Polish, Greek, Dutch, Italian (8).
## Upcoming
@@ -122,6 +122,7 @@ Detail and the next releases: [docs/roadmap.md](docs/roadmap.md).
| Date | Entry |
|---|---|
+| 2026-10-17 | Object Finder classifies background by boundary coverage, retaining large enclosed foregrounds and rejecting surrounding backdrop (#6548); learned segmentation remains open (#2788) |
| 2026-10-10 | Full re-measure against Photoshop 2026 27.11.0 (installed bundle inspected): breadth ~76%, ready ~45%, alpha. Progress docs reorganized to the craftrules standard (`parity.md` → `parity-checklist.md`, `parity-estimate.md` merged into `target-app-parity.md`). 0.6.0 released. |
| 2026-10-09 | Remove tool, Rotate View, crop rotation; OpenRaster and Paint.NET; 39 Affinity documents in the corpus |
| 2026-10-08 | 0.5.0. Affinity import; Magnetic Lasso, Pattern Stamp, Mixer Brush, Pencil, Patch, Vertical Type on the toolbar |
@@ -135,7 +136,9 @@ Detail and the next releases: [docs/roadmap.md](docs/roadmap.md).
| Date | Change | Summary |
|---|---|---|
-| 2026-10-13 | minor | Focus item 1 quoted the oracle floor as 133 of 256; it is 145 of 258 (`crates/io/tests/corpus.rs`, gaps.md G1). Open issues 579 → 953 (2026-10-13) |
+| 2026-10-17 | minor | Object Finder retains large enclosed foregrounds (#6548) |
+| 2026-10-13 | minor | Focus item 1 quoted the oracle floor as 133 of 256; it is 145 of 258 (`crates/io/tests/it/corpus.rs`, gaps.md G1). Open issues 579 → 953 (2026-10-13) |
+| 2026-10-15 | minor | Russian catalog covers every dynamic UI label the other catalogs translate |
| 2026-10-11 | minor | Toolbox count 56 of 68 (12 missing) with the Convert Point tool (#3204) |
| 2026-10-10 | minor | Readiness by audience with hours per tier |
| 2026-10-10 | minor | Mainstream-practitioner and essentials-user numbers added |
diff --git a/apps/photocraft-cli/Cargo.toml b/apps/photocraft-cli/Cargo.toml
index f4848f379a..94e04b518a 100644
--- a/apps/photocraft-cli/Cargo.toml
+++ b/apps/photocraft-cli/Cargo.toml
@@ -28,9 +28,19 @@ photocraft-engine = { workspace = true }
photocraft-io = { workspace = true }
photocraft-format = { path = "../../crates/format" }
photocraft-codecs = { workspace = true }
+clap = { workspace = true }
serde_json = { workspace = true }
+thiserror = { workspace = true }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
+[dev-dependencies]
+# Synthetic camera raws (#7789).
+photocraft-raw = { workspace = true, features = ["testgen"] }
+# Shell completions and man pages (examples/man-and-completions.rs, for the packages); not in
+# the binary.
+clap_complete = { workspace = true }
+clap_mangen = { workspace = true }
+
[build-dependencies]
# Icon + VERSIONINFO for photocraft-cli.exe; build.rs only uses it when targeting Windows.
winresource = "0.1"
diff --git a/apps/photocraft-cli/build.rs b/apps/photocraft-cli/build.rs
index c757a4a7c5..3951c46b81 100644
--- a/apps/photocraft-cli/build.rs
+++ b/apps/photocraft-cli/build.rs
@@ -12,6 +12,14 @@ fn main() -> std::io::Result<()> {
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("windows") {
return Ok(());
}
+ // Printing to PDF (winprint's `PdfCreateRenderer`) imports Windows.Data.Pdf.dll, which
+ // stripped Windows images (NTLite, some N/LTSC builds) lack. A load-time import stops the exe
+ // from starting at all ("windows.data.pdf.dll was not found", #5884), so load it on first use;
+ // the print command checks for it first and reports an error instead.
+ if std::env::var("CARGO_CFG_TARGET_ENV").as_deref() == Ok("msvc") {
+ println!("cargo:rustc-link-arg-bins=/DELAYLOAD:windows.data.pdf.dll");
+ println!("cargo:rustc-link-arg-bins=delayimp.lib");
+ }
let mut res = winresource::WindowsResource::new();
// FileVersion / ProductVersion strings and the numeric FILEVERSION / PRODUCTVERSION are left
// to `WindowsResource::new`, which reads the Cargo package version. A pre-release such as
diff --git a/apps/photocraft-cli/examples/man-and-completions.rs b/apps/photocraft-cli/examples/man-and-completions.rs
new file mode 100644
index 0000000000..ddb9cf0233
--- /dev/null
+++ b/apps/photocraft-cli/examples/man-and-completions.rs
@@ -0,0 +1,41 @@
+//! Writes photocraft-cli's shell completions ([`clap_complete`]: bash, zsh, fish, elvish,
+//! PowerShell) and man pages ([`clap_mangen`]: `photocraft-cli.1` and one per subcommand, such as
+//! `photocraft-cli-convert.1`) into a directory. The Linux and FreeBSD packages ship them
+//! (`packaging/linux/package.sh`, `packaging/freebsd/package.sh`):
+//!
+//! ```sh
+//! cargo run -p photocraft-cli --example man-and-completions --
+//! ```
+
+use std::path::Path;
+use std::process::ExitCode;
+
+use clap::ValueEnum;
+use clap_complete::Shell;
+
+fn main() -> ExitCode {
+ let mut args = std::env::args_os().skip(1);
+ let (Some(dir), None) = (args.next(), args.next()) else {
+ eprintln!("usage: man-and-completions ");
+ return ExitCode::from(2);
+ };
+ let dir = Path::new(&dir);
+ match generate(dir) {
+ Ok(()) => ExitCode::SUCCESS,
+ Err(e) => {
+ eprintln!("error: {}: {e}", dir.display());
+ ExitCode::FAILURE
+ }
+ }
+}
+
+fn generate(dir: &Path) -> std::io::Result<()> {
+ std::fs::create_dir_all(dir)?;
+ let mut cmd = photocraft_cli::command();
+ for &shell in Shell::value_variants() {
+ clap_complete::generate_to(shell, &mut cmd, "photocraft-cli", dir)?;
+ }
+ // A fresh command: `clap_complete::generate_to` built `cmd`, adding the `help` subcommand,
+ // which `clap_mangen` would otherwise give pages of its own (`photocraft-cli-help-convert.1`).
+ clap_mangen::generate_to(photocraft_cli::command(), dir)
+}
diff --git a/apps/photocraft-cli/src/actions.rs b/apps/photocraft-cli/src/actions.rs
new file mode 100644
index 0000000000..4d494c8a82
--- /dev/null
+++ b/apps/photocraft-cli/src/actions.rs
@@ -0,0 +1,116 @@
+use std::path::{Path, PathBuf};
+
+use photocraft_engine::actions_cmds::Action;
+use serde_json::{Value, json};
+
+/// Why an actions file can't be played.
+#[derive(Debug, thiserror::Error)]
+pub enum ActionsError {
+ #[error("actions JSON: {0}")]
+ Json(#[source] serde_json::Error),
+ /// The steps don't parse ([`photocraft_engine::automate_cmds::parse_action`]).
+ #[error(transparent)]
+ Steps(#[from] photocraft_engine::EngineError),
+ #[error("--action picks an action from an Actions set ({{\"actions\": [{{\"name\", \"steps\"}}…]}}), but this file holds one action's steps")]
+ NotASet,
+ #[error("Actions set: {0}")]
+ Set(#[source] serde_json::Error),
+ #[error("no action named `{name}` in the set (it holds {})", quoted(names))]
+ NoSuchAction { name: String, names: Vec },
+ #[error("the Actions set holds {} actions: pick one with --action ({})", names.len(), quoted(names))]
+ PickOne { names: Vec },
+ #[error("{}: {source}", path.display())]
+ Read { path: PathBuf, source: std::io::Error },
+ #[error("{}: {source}", path.display())]
+ Utf8 { path: PathBuf, source: std::string::FromUtf8Error },
+ /// A Photoshop Actions file that doesn't import ([`photocraft_engine::atn_cmds::import`]).
+ #[error("{}: {message}", path.display())]
+ Atn { path: PathBuf, message: String },
+ #[error("no action named `{name}` in the set `{set}` (it holds {})", quoted(names))]
+ NoSuchAtnAction { name: String, set: String, names: Vec },
+ #[error("{}: the set holds no actions", path.display())]
+ EmptyAtn { path: PathBuf },
+ #[error("the set `{set}` holds {} actions: pick one with --action ({})", names.len(), quoted(names))]
+ PickOneAtn { set: String, names: Vec },
+}
+
+/// `` `a`, `b` ``: the action names an error lists.
+fn quoted(names: &[String]) -> String {
+ names.iter().map(|n| format!("`{n}`")).collect::>().join(", ")
+}
+
+fn names(actions: &[Action]) -> Vec {
+ actions.iter().map(|a| a.name.clone()).collect()
+}
+
+/// Parse an actions file: the steps of a recorded action or a droplet (`[id, params]` pairs,
+/// `{"command": id, "params": {…}}` objects or bare ids; `"id"` is accepted for `"command"`), as a
+/// list or wrapped in `{"actions": […]}`, `{"steps": […]}` or a droplet (#489).
+pub fn parse_actions(text: &str) -> Result, ActionsError> {
+ let v: Value = serde_json::from_str(text).map_err(ActionsError::Json)?;
+ steps_of(&v)
+}
+
+fn steps_of(v: &Value) -> Result {
+ Ok(photocraft_engine::automate_cmds::parse_action(v.get("actions").unwrap_or(v), "batch --actions")?)
+}
+
+/// Engine commands to run in order: `(id, params)`.
+pub type Steps = Vec<(String, Value)>;
+
+/// The steps `batch` plays on each file, and the actions they can call. An Actions set (the
+/// Actions panel's `actions.json`: `{"actions": [{"name", "steps"}…]}`, or the bare list) plays
+/// the action `name` picks (optional when the set holds one) with the whole set loaded, as
+/// Photoshop's Batch does; anything else is one action's steps ([`parse_actions`]) (#2786).
+pub fn load_actions(text: &str, name: Option<&str>) -> Result<(Steps, Vec), ActionsError> {
+ let v: Value = serde_json::from_str(text).map_err(ActionsError::Json)?;
+ let list = v.get("actions").unwrap_or(&v);
+ let is_set = list.as_array().is_some_and(|a| !a.is_empty() && a.iter().all(|x| x.get("name").is_some_and(Value::is_string)));
+ if !is_set {
+ if name.is_some() {
+ return Err(ActionsError::NotASet);
+ }
+ return Ok((steps_of(&v)?, Vec::new()));
+ }
+ let set: Vec = serde_json::from_value(list.clone()).map_err(ActionsError::Set)?;
+ let action = match (name, set.as_slice()) {
+ (Some(n), _) => set.iter().find(|a| a.name == n).ok_or_else(|| ActionsError::NoSuchAction { name: n.to_owned(), names: names(&set) })?,
+ (None, [only]) => only,
+ (None, _) => return Err(ActionsError::PickOne { names: names(&set) }),
+ };
+ let play = vec![("actions.play".to_string(), json!({"action": action.name}))];
+ Ok((play, set))
+}
+
+/// [`load_actions`] for a file on disk: a Photoshop Actions file (`.atn`, by extension or by
+/// its version word) is converted first; the played action's steps with no PhotoCraft
+/// equivalent come back as warnings (they fail at playback, as in Photoshop when a step can't run).
+pub fn load_actions_file(path: &Path, name: Option<&str>) -> Result<(Steps, Vec, Vec), ActionsError> {
+ let bytes = std::fs::read(path).map_err(|source| ActionsError::Read { path: path.to_path_buf(), source })?;
+ let is_atn = path.extension().is_some_and(|e| e.eq_ignore_ascii_case("atn")) || bytes.starts_with(&[0, 0, 0, 16]);
+ if !is_atn {
+ let text = String::from_utf8(bytes).map_err(|source| ActionsError::Utf8 { path: path.to_path_buf(), source })?;
+ let (steps, set) = load_actions(&text, name)?;
+ return Ok((steps, set, Vec::new()));
+ }
+ let imp = photocraft_engine::atn_cmds::import(&bytes).map_err(|message| ActionsError::Atn { path: path.to_path_buf(), message })?;
+ let action = match (name, imp.actions.as_slice()) {
+ (Some(n), _) => imp.actions.iter().find(|a| a.name == n).ok_or_else(|| ActionsError::NoSuchAtnAction {
+ name: n.to_owned(),
+ set: imp.set.clone(),
+ names: names(&imp.actions),
+ })?,
+ (None, [only]) => only,
+ (None, []) => return Err(ActionsError::EmptyAtn { path: path.to_path_buf() }),
+ (None, _) => return Err(ActionsError::PickOneAtn { set: imp.set.clone(), names: names(&imp.actions) }),
+ };
+ let warnings = imp
+ .unsupported
+ .iter()
+ .filter(|u| u.action == action.name)
+ .map(|u| format!("`{}` step {}: Photoshop's \"{}\" ({}) has no PhotoCraft equivalent yet", u.action, u.step + 1, u.name, u.event))
+ .chain(imp.warnings.iter().cloned())
+ .collect();
+ let play = vec![("actions.play".to_string(), json!({"action": action.name}))];
+ Ok((play, imp.actions, warnings))
+}
diff --git a/apps/photocraft-cli/src/args.rs b/apps/photocraft-cli/src/args.rs
new file mode 100644
index 0000000000..91b99ef33b
--- /dev/null
+++ b/apps/photocraft-cli/src/args.rs
@@ -0,0 +1,428 @@
+//! The command line, as clap types. Values are parsed into their types here, so a bad one is a
+//! usage error naming its flag (exit 2) and the handlers never see it (#7071). A flag a
+//! subcommand doesn't take is a usage error too, so a typo such as `--fromat` can't be silently
+//! ignored (#423), and so is a repeated one: `--quality 80 --quality 60` is more likely a mistake
+//! than a choice. A value starting with `-` is written `--out=-image.png` (or `./-image.png`), so a
+//! value flag never takes the next flag as its value; negative numbers are kept where they mean
+//! something.
+
+use std::ffi::OsString;
+use std::fmt;
+use std::net::{Ipv4Addr, SocketAddr};
+use std::path::PathBuf;
+
+use clap::error::ErrorKind;
+use clap::parser::ValueSource;
+use clap::{ArgAction, ArgGroup, ArgMatches, Args, CommandFactory, FromArgMatches, Parser, Subcommand};
+use photocraft_automation::args::{AutomationArgs, ControlArgs, blank_env_is_unset, conflict, control_port, name_env_vars};
+use photocraft_codecs::{JpegFormat, TiffCompression};
+use photocraft_io::{DdsCompression, DpxBits, TgaBits};
+use serde_json::Value;
+
+/// photocraft-cli: headless PhotoCraft
+#[derive(Parser)]
+#[command(name = "photocraft-cli", version = photocraft_engine::build_info::long_version_static(), arg_required_else_help = true)]
+pub(crate) struct Cli {
+ #[command(subcommand)]
+ pub(crate) command: Command,
+}
+
+#[derive(Subcommand)]
+pub(crate) enum Command {
+ Convert(ConvertArgs),
+ Info(InfoArgs),
+ Run(RunArgs),
+ Batch(BatchArgs),
+ Droplet(DropletArgs),
+ Commands(CommandsArgs),
+ Mcp(McpArgs),
+ Serve(ServeArgs),
+}
+
+// How an image is written: shared by `convert`, `run` and `batch`.
+#[derive(Args)]
+pub(crate) struct ExportArgs {
+ /// Output format, overriding the output's extension (png, jpg, tif, webp, …)
+ #[arg(long, value_name = "EXT")]
+ pub(crate) format: Option,
+ /// JPEG or WebP quality, 1-100. A WebP written with a quality is lossy, without one lossless
+ // allow_negative_numbers makes `--quality -1` an out-of-range value rather than an unexpected argument.
+ #[arg(long, value_name = "1-100", value_parser = clap::value_parser!(u8).range(1..=100), allow_negative_numbers = true)]
+ pub(crate) quality: Option,
+ /// Keep the layers in TIFF output (Photoshop layer data); TIFF output is flat without it
+ #[arg(long)]
+ pub(crate) tiff_layers: bool,
+ /// Compress TIFF output: none (the default), lzw or zip
+ #[arg(long, value_name = "none|lzw|zip", value_parser = tiff_compression)]
+ pub(crate) tiff_compression: Option,
+ /// A TGA's bits per pixel: 32 writes the alpha channel (or else the transparency) as its
+ /// alpha, 24 none. Without it: 32 with an alpha channel or transparency, else 24
+ #[arg(long, value_name = "24|32", value_parser = tga_bits)]
+ pub(crate) tga_bits: Option,
+ /// A DPX's bits per sample. Without it: 8 for an 8-bit document, else 16
+ #[arg(long, value_name = "8|10|12|16", value_parser = dpx_bits)]
+ pub(crate) dpx_bits: Option,
+ /// A DDS texture's compression: none (uncompressed, the default), bc1 (DXT1: alpha on or
+ /// off), bc2 (DXT3) or bc3 (DXT5)
+ #[arg(long, value_name = "none|bc1|bc2|bc3", value_parser = dds_compression)]
+ pub(crate) dds_compression: Option,
+ /// Also write a DDS texture's full mip chain
+ #[arg(long)]
+ pub(crate) dds_mipmaps: bool,
+ /// A JPEG's scans, as JPEG Options picks them: baseline (the default), optimized (Huffman
+ /// tables fitted to the image; RGB is written 4:2:0 and keeps the standard tables, so only Gray
+ /// and CMYK shrink) or progressive
+ #[arg(long, value_name = "baseline|optimized|progressive", value_parser = jpeg_format)]
+ pub(crate) jpeg_format: Option,
+}
+
+/// Convert between formats (.pcraft, .psd, .png, .jpg, .tif, .webp, .exr, …)
+///
+/// An that is the file is refused, as the result would replace the original;
+/// --in-place allows it.
+#[derive(Args)]
+pub(crate) struct ConvertArgs {
+ /// The file to read
+ #[arg(value_name = "IN")]
+ pub(crate) input: PathBuf,
+ /// The file to write; its extension picks the format unless --format is given
+ #[arg(value_name = "OUT")]
+ pub(crate) output: PathBuf,
+ /// Allow an that is the file, replacing the original
+ #[arg(long)]
+ pub(crate) in_place: bool,
+ #[command(flatten)]
+ pub(crate) export: ExportArgs,
+}
+
+/// Print the document as JSON (size, mode, depth, layer tree)
+#[derive(Args)]
+pub(crate) struct InfoArgs {
+ pub(crate) file: PathBuf,
+ /// One line of JSON instead of pretty-printed
+ #[arg(long)]
+ pub(crate) compact: bool,
+}
+
+/// Open a file (or start a new document), run engine commands in order, save the result
+///
+/// Prints each command's JSON result. Give exactly one of or --new, and at least one --cmd
+/// or --out. An --out that is the is refused, as the result would replace the original;
+/// --in-place allows it.
+#[derive(Args)]
+#[command(group(ArgGroup::new("source").args(["file", "new"]).required(true)))]
+#[command(group(ArgGroup::new("work").args(["cmd", "out"]).required(true).multiple(true)))]
+pub(crate) struct RunArgs {
+ /// The document to open
+ pub(crate) file: Option,
+ /// Start from a new document with these JSON parameters instead of opening a file
+ #[arg(long, value_name = "JSON", value_parser = json)]
+ pub(crate) new: Option,
+ /// An engine command to run; repeat for several, run in order
+ #[arg(long, value_name = "ID", action = ArgAction::Append)]
+ pub(crate) cmd: Vec,
+ /// JSON parameters for the --cmd before it (default {})
+ #[arg(long, value_name = "JSON", action = ArgAction::Append, value_parser = json)]
+ pub(crate) params: Vec,
+ /// Save the result to this file
+ #[arg(long, value_name = "FILE")]
+ pub(crate) out: Option,
+ /// Allow an --out that is the , replacing the original
+ #[arg(long)]
+ pub(crate) in_place: bool,
+ #[command(flatten)]
+ pub(crate) export: ExportArgs,
+ /// `--cmd` and `--params` values in command-line order, set by [`parse`].
+ #[arg(skip)]
+ pub(crate) steps: Vec,
+}
+
+/// One `--cmd` or `--params` of `run`, in command-line order.
+pub(crate) enum Step {
+ Cmd(String),
+ Params(Value),
+}
+
+/// Apply an action list to every image in a directory
+///
+/// A Photoshop Actions file (.atn) is a set: its action --action names plays, as below. JSON steps
+/// are [id, params] pairs, {"command": id, "params": {…}} objects or bare ids, as a recorded
+/// action or droplet stores them (a list, or wrapped in {"actions": …}, {"steps": …} or a
+/// droplet). An Actions set (the Actions panel's actions.json, {"actions": [{"name", "steps"}…]})
+/// plays the action --action names (needed when the set holds more than one) with the whole set
+/// loaded, so its steps can play other actions of the set.
+#[derive(Args)]
+pub(crate) struct BatchArgs {
+ /// The action list: actions.json, a droplet, or a Photoshop Actions file (.atn)
+ #[arg(long, value_name = "FILE")]
+ pub(crate) actions: PathBuf,
+ /// Which action of an Actions set to play
+ #[arg(long, value_name = "NAME")]
+ pub(crate) action: Option,
+ /// The folder of images to process
+ #[arg(long = "in", value_name = "DIR")]
+ pub(crate) in_dir: PathBuf,
+ /// The folder to write the results to, as .
+ #[arg(long, value_name = "DIR")]
+ pub(crate) out: PathBuf,
+ /// An --out folder that is the --in folder is refused, as the results would replace the
+ /// originals; --in-place allows it
+ #[arg(long)]
+ pub(crate) in_place: bool,
+ #[command(flatten)]
+ pub(crate) export: ExportArgs,
+}
+
+/// Run a droplet (File › Automate › Create Droplet) on images and folders
+#[derive(Args)]
+pub(crate) struct DropletArgs {
+ /// The droplet to run
+ #[arg(value_name = "FILE.pcdroplet")]
+ pub(crate) file: String,
+ /// Images and folders to run it on
+ #[arg(value_name = "FILE-OR-DIR", required = true)]
+ pub(crate) inputs: Vec,
+ /// The folder to write the results to
+ #[arg(long, value_name = "DIR")]
+ pub(crate) out: Option,
+}
+
+/// List the engine command registry
+#[derive(Args)]
+pub(crate) struct CommandsArgs {
+ /// Print the entries as JSON
+ #[arg(long)]
+ pub(crate) json: bool,
+ /// Only the commands matching this text
+ #[arg(long, value_name = "TEXT", allow_negative_numbers = true)]
+ pub(crate) filter: Option,
+}
+
+/// Run the MCP server on stdio (headless engine, or bridge to a running `photocraft --control `)
+///
+/// Headless: each automation root grants that direction of file access; an omitted root denies it.
+/// Prefer absolute root paths in MCP client configurations. Bridge: set the roots on the desktop
+/// app; root flags are refused. The token flags require --bridge (or PHOTOCRAFT_CONTROL_PORT).
+#[derive(Args)]
+pub(crate) struct McpArgs {
+ /// Bridge to the PhotoCraft app listening here instead of a headless engine; a bare port means
+ /// 127.0.0.1:
+ #[arg(long, value_name = "127.0.0.1:PORT", env = "PHOTOCRAFT_CONTROL_PORT", value_parser = bridge)]
+ pub(crate) bridge: Option,
+ /// `--bridge` came from PHOTOCRAFT_CONTROL_PORT, set by [`parse`].
+ #[arg(skip)]
+ pub(crate) bridge_from_env: bool,
+ #[command(flatten)]
+ pub(crate) control: ControlArgs,
+ #[command(flatten)]
+ pub(crate) automation: AutomationArgs,
+}
+
+/// Keep one headless session open and answer JSON lines on stdio, or on 127.0.0.1:
+///
+/// Each request is a JSON line {"id", "method", "params"}. Methods: engine.execute,
+/// jobs.list/cancel, engine.commands,
+/// doc.open/new/place/save/exportLayers/exportDataSets/importDataSets/inspect/render/select/close,
+/// session.list, batch, methods (docs/control-protocol.md#headless-server). The token flags require
+/// --port (or PHOTOCRAFT_CONTROL_PORT); stdio needs no control token.
+#[derive(Args)]
+pub(crate) struct ServeArgs {
+ /// Listen on 127.0.0.1: instead of stdio
+ #[arg(long, value_name = "PORT", env = "PHOTOCRAFT_CONTROL_PORT", value_parser = control_port)]
+ pub(crate) port: Option,
+ /// `--port` came from PHOTOCRAFT_CONTROL_PORT, set by [`parse`].
+ #[arg(skip)]
+ pub(crate) port_from_env: bool,
+ #[command(flatten)]
+ pub(crate) control: ControlArgs,
+ #[command(flatten)]
+ pub(crate) automation: AutomationArgs,
+}
+
+/// Why a value was refused: clap prints it after the flag and its value (exit 2).
+#[derive(Debug, thiserror::Error)]
+enum ValueError {
+ #[error("expected 24 or 32")]
+ TgaBits,
+ #[error("expected 8, 10, 12 or 16")]
+ DpxBits,
+ #[error("expected none, bc1, bc2 or bc3")]
+ DdsCompression,
+ #[error("expected none, lzw or zip")]
+ TiffCompression,
+ #[error("expected baseline, optimized or progressive")]
+ JpegFormat,
+ /// Why a `--bridge` value, or a PHOTOCRAFT_CONTROL_PORT value for `mcp`, is refused.
+ #[error("expected a port, 0-65535 (--bridge also takes 127.0.0.1:)")]
+ Bridge,
+}
+
+/// Why `parse` refuses `mcp` or `serve` options clap accepted: clap prints it as a usage error
+/// (exit 2).
+#[derive(Debug, thiserror::Error)]
+enum ServerOptionError {
+ /// PHOTOCRAFT_CONTROL_PORT holds a port, as for the desktop app's --control: only the flag
+ /// takes host:port.
+ #[error("invalid value '{0}' for 'PHOTOCRAFT_CONTROL_PORT': {bridge}", bridge = ValueError::Bridge)]
+ BridgeVar(String),
+ /// With --bridge the roots are the desktop process's to set: accepting them here promises
+ /// authority the bridge can't give (#8035).
+ #[error("configure automation roots on the desktop app; --automation-read-root and --automation-write-root require headless MCP mode")]
+ BridgeRoots,
+ /// A token flag without the bridge or port that reads it would be ignored (#8035).
+ #[error("{flag} requires {transport}")]
+ NeedsTransport { flag: &'static str, transport: &'static str },
+}
+
+impl ServerOptionError {
+ fn into_clap(self, cmd: &mut clap::Command) -> clap::Error {
+ let kind = match self {
+ Self::BridgeVar(_) => ErrorKind::ValueValidation,
+ Self::BridgeRoots => ErrorKind::ArgumentConflict,
+ Self::NeedsTransport { .. } => ErrorKind::MissingRequiredArgument,
+ };
+ cmd.error(kind, self)
+ }
+}
+
+fn tga_bits(s: &str) -> Result {
+ s.parse().ok().and_then(TgaBits::from_bits).ok_or(ValueError::TgaBits)
+}
+
+fn dpx_bits(s: &str) -> Result {
+ s.parse().ok().and_then(DpxBits::from_bits).ok_or(ValueError::DpxBits)
+}
+
+fn dds_compression(s: &str) -> Result {
+ DdsCompression::from_name(s).ok_or(ValueError::DdsCompression)
+}
+
+fn tiff_compression(s: &str) -> Result {
+ match s {
+ "none" => Ok(TiffCompression::None),
+ "lzw" => Ok(TiffCompression::Lzw),
+ "zip" => Ok(TiffCompression::Deflate),
+ _ => Err(ValueError::TiffCompression),
+ }
+}
+
+fn jpeg_format(s: &str) -> Result {
+ JpegFormat::parse(s).ok_or(ValueError::JpegFormat)
+}
+
+/// Where `mcp --bridge` connects. Shown as the address: `127.0.0.1:` for a port.
+#[derive(Clone)]
+pub(crate) enum Bridge {
+ /// A bare port: the app on 127.0.0.1.
+ Port(u16),
+ /// `host:port`, as given. Whether the host is loopback is the bridge's to say.
+ Addr(String),
+}
+
+impl fmt::Display for Bridge {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ match self {
+ Bridge::Port(port) => SocketAddr::from((Ipv4Addr::LOCALHOST, *port)).fmt(f),
+ Bridge::Addr(addr) => f.write_str(addr),
+ }
+ }
+}
+
+/// `mcp --bridge`, or PHOTOCRAFT_CONTROL_PORT, which holds a port.
+fn bridge(s: &str) -> Result {
+ match control_port(s) {
+ Ok(port) => Ok(Bridge::Port(port)),
+ Err(_) if s.contains(':') => Ok(Bridge::Addr(s.to_owned())),
+ Err(_) => Err(ValueError::Bridge),
+ }
+}
+
+/// `--new` and `--params`: bad JSON is a usage error, before any work. Whether the value is an
+/// object is the command's to say.
+fn json(s: &str) -> Result {
+ serde_json::from_str(s)
+}
+
+/// `--cmd` and `--params` values back in command-line order: clap keeps each flag's values apart,
+/// their indices say how they interleave.
+fn steps(m: &ArgMatches) -> Vec {
+ let mut steps: Vec<(usize, Step)> = Vec::new();
+ if let (Some(at), Ok(Some(ids))) = (m.indices_of("cmd"), m.try_get_many::("cmd")) {
+ steps.extend(at.zip(ids).map(|(i, id)| (i, Step::Cmd(id.clone()))));
+ }
+ if let (Some(at), Ok(Some(params))) = (m.indices_of("params"), m.try_get_many::("params")) {
+ steps.extend(at.zip(params).map(|(i, p)| (i, Step::Params(p.clone()))));
+ }
+ steps.sort_by_key(|s| s.0);
+ steps.into_iter().map(|(_, s)| s).collect()
+}
+
+/// Parse the arguments (without the binary name). clap reads them as `OsString`s: a path need not
+/// be valid Unicode (#1108), text must. A flag left out falls back to its environment variable,
+/// unless that is empty, and a bad value from one is a usage error naming the variable (#2491). A
+/// bare `--help` or `-h` is help even after a mistake on the same line (`--out --help`, `mcp
+/// stray.psd --help`): clap reports the mistake first.
+pub(crate) fn parse(args: &[OsString]) -> Result {
+ let mut cmd = Cli::command().mut_subcommands(|sub| sub.mut_args(blank_env_is_unset));
+ let argv = std::iter::once(OsString::from("photocraft-cli")).chain(args.iter().cloned());
+ let matches = match cmd.try_get_matches_from_mut(argv) {
+ Err(e) if args.iter().take_while(|a| *a != "--").any(|a| *a == "--help" || *a == "-h") => {
+ let help = [OsString::from("photocraft-cli"), args.first().cloned().unwrap_or_default(), OsString::from("--help")];
+ return Err(cmd.try_get_matches_from_mut(help).err().unwrap_or(e));
+ }
+ matches => matches.map_err(|e| name_env_vars(e, &cmd, args))?,
+ };
+ let mut cli = Cli::from_arg_matches(&matches)?;
+ let from_env = |m: &ArgMatches, id: &str| m.value_source(id) == Some(ValueSource::EnvVariable);
+ match (&mut cli.command, matches.subcommand()) {
+ (Command::Run(r), Some((_, m))) => r.steps = steps(m),
+ (Command::Mcp(a), Some((name, m))) => {
+ a.bridge_from_env = from_env(m, "bridge");
+ if a.bridge_from_env
+ && let Some(Bridge::Addr(v)) = &a.bridge
+ {
+ return Err(ServerOptionError::BridgeVar(v.clone()).into_clap(&mut cmd));
+ }
+ if let Some(sub) = cmd.find_subcommand_mut(name) {
+ // Only the bridge reads a token, so a stale exported pair doesn't stop a headless
+ // run.
+ if a.bridge.is_some() {
+ conflict(sub, m, "control_token", "control_token_file")?;
+ }
+ // The roots are the headless engine's: the variable switching to the bridge would
+ // drop them, and the error names it.
+ if a.bridge_from_env {
+ conflict(sub, m, "automation_read_root", "bridge")?;
+ conflict(sub, m, "automation_write_root", "bridge")?;
+ }
+ if a.bridge.is_some() && (a.automation.automation_read_root.is_some() || a.automation.automation_write_root.is_some()) {
+ return Err(ServerOptionError::BridgeRoots.into_clap(sub));
+ }
+ check_server(sub, m, a.bridge.is_some(), "--bridge")?;
+ }
+ }
+ (Command::Serve(a), Some((name, m))) => {
+ a.port_from_env = from_env(m, "port");
+ if let Some(sub) = cmd.find_subcommand_mut(name) {
+ // Only the TCP server reads a token, so a stale exported pair doesn't stop stdio.
+ if a.port.is_some() {
+ conflict(sub, m, "control_token", "control_token_file")?;
+ }
+ check_server(sub, m, a.port.is_some(), "--port")?;
+ }
+ }
+ _ => {}
+ }
+ Ok(cli)
+}
+
+/// Refuse a token flag without the bridge or port that reads it (as a flag or its variable). A
+/// token variable alone may be a stale export, so it isn't refused.
+fn check_server(sub: &mut clap::Command, m: &ArgMatches, has_transport: bool, transport: &'static str) -> Result<(), clap::Error> {
+ for (id, flag) in [("control_token", "--control-token"), ("control_token_file", "--control-token-file")] {
+ if m.value_source(id) == Some(ValueSource::CommandLine) && !has_transport {
+ return Err(ServerOptionError::NeedsTransport { flag, transport }.into_clap(sub));
+ }
+ }
+ Ok(())
+}
diff --git a/apps/photocraft-cli/src/automation.rs b/apps/photocraft-cli/src/automation.rs
new file mode 100644
index 0000000000..062f2f2eef
--- /dev/null
+++ b/apps/photocraft-cli/src/automation.rs
@@ -0,0 +1,82 @@
+use std::io::Write;
+use std::net::{Ipv4Addr, SocketAddr};
+
+use serde_json::Value;
+
+use photocraft_automation::{Headless, PhotocraftMcp, security};
+
+use crate::{
+ Result,
+ args::{CommandsArgs, McpArgs, ServeArgs},
+ output::{JsonStyle, print_json},
+};
+
+pub(crate) fn commands(a: &CommandsArgs, out: &mut dyn Write) -> Result {
+ let h = Headless::new();
+ let list = h.command_list();
+ let needle = a.filter.as_deref().map(str::to_lowercase);
+ let items: Vec<&Value> = list
+ .as_array()
+ .map(|v| v.iter().collect::>())
+ .unwrap_or_default()
+ .into_iter()
+ .filter(|c| needle.as_ref().is_none_or(|n| photocraft_engine::commands::list_entry_matches(c, n)))
+ .collect();
+ if a.json {
+ return print_json(out, &Value::Array(items.into_iter().cloned().collect()), JsonStyle::Pretty);
+ }
+ for c in items {
+ let menu = c["menu"].as_array().map(|m| m.iter().filter_map(Value::as_str).collect::>().join(" > ")).unwrap_or_default();
+ writeln!(out, "{:<44} {:<32} {}", c["id"].as_str().unwrap_or(""), c["label"].as_str().unwrap_or(""), menu)?;
+ }
+ Ok(())
+}
+
+pub(crate) fn serve(a: &ServeArgs, err: &mut dyn Write) -> Result {
+ use std::sync::{Arc, Mutex};
+ let h = Arc::new(Mutex::new(Headless::with_workspace(a.automation.workspace()?)));
+ match a.port {
+ Some(port) => {
+ if a.port_from_env {
+ // Name the mode switch: an exported variable changes what this command does, and
+ // unsetting it (or setting it empty) is the way back to stdio.
+ let _ = writeln!(err, "photocraft-cli: PHOTOCRAFT_CONTROL_PORT={port} is set; serving on TCP instead of stdio (unset it to serve stdio)");
+ }
+ let addr = SocketAddr::from((Ipv4Addr::LOCALHOST, port)).to_string();
+ let (supplied, token_file) = (a.control.control_token.as_deref(), a.control.control_token_file.as_deref());
+ let token = security::server_token(supplied, token_file)?;
+ if let Some(path) = token_file {
+ let _ = writeln!(err, "photocraft-cli control token file: {}", path.display());
+ } else if supplied.is_none() {
+ let _ = writeln!(err, "photocraft-cli control token: {token}");
+ }
+ photocraft_automation::rpc::serve_tcp(&addr, h, token, |local| {
+ let _ = writeln!(err, "photocraft-cli serving on {local}");
+ })?;
+ Ok(())
+ }
+ None => {
+ let stdin = std::io::stdin();
+ Ok(photocraft_automation::rpc::serve_lines(&h, stdin.lock(), std::io::stdout())?)
+ }
+ }
+}
+
+pub(crate) fn mcp(a: &McpArgs, err: &mut dyn Write) -> Result {
+ let server = match &a.bridge {
+ Some(addr) => {
+ if a.bridge_from_env {
+ // Name the mode switch, as `serve` does: the way back to headless is to unset it.
+ let _ = writeln!(
+ err,
+ "photocraft-cli: PHOTOCRAFT_CONTROL_PORT is set; bridging to the app on {addr} instead of a headless engine (unset it to run headless)"
+ );
+ }
+ let token = security::client_token(a.control.control_token.as_deref(), a.control.control_token_file.as_deref())?;
+ PhotocraftMcp::bridge(&addr.to_string(), &token)?
+ }
+ None => PhotocraftMcp::headless_with_workspace(a.automation.workspace()?),
+ };
+ let rt = tokio::runtime::Builder::new_multi_thread().enable_all().build()?;
+ Ok(rt.block_on(server.serve_stdio())?)
+}
diff --git a/apps/photocraft-cli/src/batch.rs b/apps/photocraft-cli/src/batch.rs
new file mode 100644
index 0000000000..02bb1bb702
--- /dev/null
+++ b/apps/photocraft-cli/src/batch.rs
@@ -0,0 +1,213 @@
+use std::io::Write;
+use std::path::{Path, PathBuf};
+
+use photocraft_automation::Headless;
+use photocraft_engine::actions_cmds::Action;
+use photocraft_io::ExportOptions;
+use serde_json::json;
+
+use crate::{
+ CliError, Result,
+ actions::load_actions_file,
+ args::{BatchArgs, DropletArgs},
+ output::warn_all,
+};
+
+/// Whether `a` and `b` name the same existing folder, however they are spelt (relative, with a
+/// trailing separator, through a symbolic link).
+fn same_dir(a: &Path, b: &Path) -> bool {
+ matches!((std::fs::canonicalize(a), std::fs::canonicalize(b)), (Ok(a), Ok(b)) if a == b)
+}
+
+pub(crate) fn is_input(p: &Path) -> bool {
+ let known = |e: &str| {
+ matches!(e, "pcraft" | "psd" | "psb" | "pdn" | "ora" | "kra" | "krz" | "af" | "afdesign" | "afphoto" | "afpub")
+ || photocraft_codecs::from_extension(e).is_some_and(|f| photocraft_codecs::caps(f).read)
+ };
+ p.is_file() && p.extension().is_some_and(|e| known(&e.to_string_lossy().to_ascii_lowercase()))
+}
+
+/// Drops the Save and view steps the desktop records from `action` (Batch saves each result
+/// itself, #3143), keeping its unchecked and dialog flags on the steps that remain (#6860).
+fn strip_shell_steps(action: &mut Action) {
+ use photocraft_engine::actions_cmds::{shell_save_command, shell_view_command};
+ let (mut steps, mut disabled, mut dialogs) = (Vec::new(), std::collections::BTreeSet::new(), std::collections::BTreeSet::new());
+ for (i, (id, p)) in std::mem::take(&mut action.steps).into_iter().enumerate() {
+ if shell_save_command(&id) || shell_view_command(&id) {
+ continue;
+ }
+ if action.disabled.contains(&i) {
+ disabled.insert(steps.len());
+ }
+ if action.dialogs.contains(&i) {
+ dialogs.insert(steps.len());
+ }
+ steps.push((id, p));
+ }
+ (action.steps, action.disabled, action.dialogs) = (steps, disabled, dialogs);
+}
+
+pub(crate) fn batch(a: &BatchArgs, out: &mut dyn Write, err: &mut dyn Write) -> Result {
+ let (in_dir, out_dir) = (a.in_dir.as_path(), a.out.as_path());
+ let (actions, mut set, warnings) = load_actions_file(&a.actions, a.action.as_deref())?;
+ set.iter_mut().for_each(strip_shell_steps);
+ warn_all(err, &warnings);
+ let opts = ExportOptions::from(&a.export);
+ // Results are saved as `/.`, so an `--out` that is the `--in` folder would
+ // replace the originals (#492).
+ if !a.in_place && same_dir(in_dir, out_dir) {
+ return Err(CliError::OutIsIn(out_dir.to_path_buf()));
+ }
+ std::fs::create_dir_all(out_dir)?;
+ let mut inputs: Vec = std::fs::read_dir(in_dir)
+ .map_err(|source| CliError::ReadDir { path: in_dir.to_path_buf(), source })?
+ .flatten()
+ .map(|e| e.path())
+ .filter(|p| is_input(p))
+ .collect();
+ inputs.sort();
+ let (mut ok, mut failed) = (0, 0);
+ let mut written = photocraft_engine::file_cmds::OutputClaims::default();
+ // `--format .jpg` names outputs `.jpg`, as `--format jpg` does (#490).
+ let format = a.export.format.as_deref().map(|f| f.strip_prefix('.').unwrap_or(f));
+ for input in &inputs {
+ let ext = format.map(str::to_owned).or_else(|| input.extension().map(|e| e.to_string_lossy().into_owned())).unwrap_or_else(|| "png".into());
+ let stem = input.file_stem().map(|s| s.to_string_lossy().into_owned()).unwrap_or_default();
+ let target = out_dir.join(format!("{stem}.{ext}"));
+ let target_text = target.to_string_lossy();
+ let r = (|| -> Result> {
+ written.check(&target_text).map_err(CliError::OutputClaimed)?;
+ let mut h = Headless::trusted_local();
+ // Steps that play another action find it in the set; the session's playback stack
+ // stops an action that calls itself.
+ h.session.actions.list = set.clone();
+ h.open(input)?;
+ for (id, p) in &actions {
+ if photocraft_engine::actions_cmds::shell_view_command(id)
+ || photocraft_engine::actions_cmds::shell_save_command(id)
+ || photocraft_engine::actions_cmds::noop_step(&h.session, id, p)
+ {
+ continue;
+ }
+ let r = h.command_run(id, p.clone()).map_err(|source| CliError::Command { id: id.clone(), source })?;
+ // A failed step inside a called action makes this file an error, not a saved result.
+ if let Some(message) = photocraft_engine::actions_cmds::nested_failure(id, &r) {
+ return Err(CliError::NestedFailure { id: id.clone(), message });
+ }
+ }
+ let r = h.save(None, Some(&target), Some(&ext), &opts)?;
+ Ok(serde_json::from_value(r["warnings"].clone()).unwrap_or_default())
+ })();
+ match r {
+ Ok(ws) => {
+ ok += 1;
+ written.record(&target_text, &input.to_string_lossy());
+ let _ = writeln!(out, "ok {} -> {}", input.display(), target.display());
+ warn_all(err, &ws);
+ }
+ Err(e) => {
+ failed += 1;
+ let _ = writeln!(err, "FAIL {}: {e}", input.display());
+ }
+ }
+ }
+ let _ = writeln!(out, "{ok} succeeded, {failed} failed");
+ if failed > 0 { Err(CliError::FilesFailed(failed)) } else { Ok(()) }
+}
+
+pub(crate) fn droplet(a: &DropletArgs, out: &mut dyn Write, err: &mut dyn Write) -> Result {
+ let (file, inputs) = (&a.file, &a.inputs);
+ let mut p = json!({"droplet": file, "input": inputs});
+ if let Some(o) = &a.out {
+ p["output"] = json!(o);
+ }
+ let mut s = photocraft_engine::Session::new();
+ let r = s.execute("file.automate.runDroplet", p)?;
+ for f in r["files"].as_array().into_iter().flatten() {
+ let _ = writeln!(out, "ok {}", f.as_str().unwrap_or_default());
+ }
+ let errors = r["errors"].as_array().cloned().unwrap_or_default();
+ for e in &errors {
+ let _ = writeln!(err, "FAIL {}: {}", e["file"].as_str().unwrap_or_default(), e["error"].as_str().unwrap_or_default());
+ }
+ if errors.is_empty() { Ok(()) } else { Err(CliError::FilesFailed(errors.len())) }
+}
+
+#[cfg(test)]
+mod batch_action_set_tests {
+ use super::*;
+ use crate::test_support::{Invoke, invoke};
+ use serde_json::Value;
+
+ /// A batched action that plays another action of its set finds it in every file's session; a
+ /// failure inside the called action fails the file, and a self-call stops instead of looping.
+ #[test]
+ fn batch_plays_an_action_that_calls_another_action_of_its_set() {
+ let dir = std::env::temp_dir().join(format!("photocraft-cli-action-set-{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&dir);
+ let path = |name: &str| dir.join(name).to_string_lossy().to_string();
+ std::fs::create_dir_all(dir.join("in")).unwrap();
+ for name in ["a", "b"] {
+ let Invoke { code, stderr, .. } = invoke(&["run", "--new", r#"{"width":8,"height":6}"#, "--out", &path(&format!("in/{name}.png"))]);
+ assert_eq!(code, 0, "{stderr}");
+ }
+ let set = json!({"version": 1, "actions": [
+ {"name": "Outer", "steps": [["actions.play", {"action": "Rotate"}]]},
+ {"name": "Rotate", "steps": [["image.imageRotation.90cw", {}]]},
+ {"name": "Calls bad", "steps": [["actions.play", {"action": "Bad"}]]},
+ {"name": "Bad", "steps": [["layer.delete", {"layer": 999_999}]]},
+ {"name": "Loop", "steps": [["actions.play", {"action": "Loop"}]]},
+ ]});
+ std::fs::write(dir.join("actions.json"), set.to_string()).unwrap();
+ let batch = |action: &str| invoke(&["batch", "--actions", &path("actions.json"), "--action", action, "--in", &path("in"), "--out", &path(action)]);
+
+ let Invoke { code, stdout, stderr } = batch("Outer");
+ assert_eq!(code, 0, "{stdout}{stderr}");
+ for name in ["a", "b"] {
+ let Invoke { code, stdout: info, stderr } = invoke(&["info", &path(&format!("Outer/{name}.png")), "--compact"]);
+ assert_eq!(code, 0, "{stderr}");
+ let info: Value = serde_json::from_str(&info).unwrap();
+ assert_eq!((info["width"].as_u64(), info["height"].as_u64()), (Some(6), Some(8)), "rotated by the called action");
+ }
+ for action in ["Calls bad", "Loop"] {
+ let Invoke { code, stdout, stderr } = batch(action);
+ assert_ne!(code, 0, "{stdout}");
+ assert_eq!(stderr.matches("FAIL").count(), 2, "{stderr}");
+ assert!(!dir.join(action).join("a.png").exists(), "a file whose called action failed is not saved");
+ }
+ let _ = std::fs::remove_dir_all(&dir);
+ }
+
+ /// Save and view steps recorded inside a batched action set are skipped, also in a called
+ /// action, and unchecked steps stay unchecked once they are gone (#6860).
+ #[test]
+ fn batch_skips_save_and_view_steps_inside_an_action_set() {
+ let dir = std::env::temp_dir().join(format!("photocraft-cli-action-set-save-{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&dir);
+ let path = |name: &str| dir.join(name).to_string_lossy().to_string();
+ std::fs::create_dir_all(dir.join("in")).unwrap();
+ let Invoke { code, stderr, .. } = invoke(&["run", "--new", r#"{"width":8,"height":6}"#, "--out", &path("in/a.png")]);
+ assert_eq!(code, 0, "{stderr}");
+ let set = json!({"version": 1, "actions": [
+ {"name": "Outer", "steps": [["actions.play", {"action": "Rotate"}], ["file.saveAs", {}]]},
+ {"name": "Rotate", "steps": [
+ ["file.save", {}],
+ ["image.imageRotation.90cw", {}],
+ ["view.fitOnScreen", {}],
+ ["image.imageRotation.90cw", {}],
+ ["file.saveAs", {}],
+ ], "disabled": [3], "dialogs": [1]},
+ ]});
+ std::fs::write(dir.join("actions.json"), set.to_string()).unwrap();
+ for action in ["Outer", "Rotate"] {
+ let Invoke { code, stdout, stderr } =
+ invoke(&["batch", "--actions", &path("actions.json"), "--action", action, "--in", &path("in"), "--out", &path(action)]);
+ assert_eq!(code, 0, "{stdout}{stderr}");
+ let Invoke { code, stdout: info, stderr } = invoke(&["info", &path(&format!("{action}/a.png")), "--compact"]);
+ assert_eq!(code, 0, "{stderr}");
+ let info: Value = serde_json::from_str(&info).unwrap();
+ assert_eq!((info["width"].as_u64(), info["height"].as_u64()), (Some(6), Some(8)), "{action}: rotated once, the unchecked step skipped");
+ }
+ let _ = std::fs::remove_dir_all(&dir);
+ }
+}
diff --git a/apps/photocraft-cli/src/document.rs b/apps/photocraft-cli/src/document.rs
new file mode 100644
index 0000000000..95d4c28288
--- /dev/null
+++ b/apps/photocraft-cli/src/document.rs
@@ -0,0 +1,231 @@
+use std::io::Write;
+use std::path::Path;
+
+use photocraft_automation::{Headless, files};
+use serde_json::{Value, json};
+
+use photocraft_engine::type_extra_cmds::missing_font_warnings;
+use photocraft_io::ExportOptions;
+
+use crate::{
+ CliError, Result,
+ args::{ConvertArgs, InfoArgs, RunArgs, Step},
+ output::{JsonStyle, print_json, warn_all},
+};
+
+/// An output that is the input file itself, however it is spelt (relative, with `./`, through a
+/// hard or symbolic link), would replace the original, and a lossy re-encode can't be undone: it
+/// is refused unless `--in-place` asks for it, as `batch` refuses an `--out` that is its `--in`
+/// folder (#7437). The paths are compared when the command starts and the save opens `output`
+/// again later, so another process swapping in a link meanwhile goes unnoticed: this guards
+/// against mistakes, it is not a security boundary.
+fn refuse_overwriting_input(in_place: bool, input: &Path, output: &Path) -> Result {
+ if !in_place && photocraft_engine::file_cmds::same_file(input, output) {
+ return Err(CliError::OutIsInput(output.to_path_buf()));
+ }
+ Ok(())
+}
+
+pub(crate) fn convert(a: &ConvertArgs, _out: &mut dyn Write, err: &mut dyn Write) -> Result {
+ let (input, output) = (&a.input, &a.output);
+ let opts = ExportOptions::from(&a.export);
+ refuse_overwriting_input(a.in_place, input, output)?;
+ let mut o = files::open(input)?;
+ // Preferences › Raw Defaults › Resolution at its default, as `run` and `info` open a raw.
+ photocraft_engine::file_cmds::raw_defaults(&photocraft_engine::Session::new(), &o.warnings, &mut o.document);
+ warn_all(err, &o.warnings);
+ warn_all(err, &missing_font_warnings(&o.document));
+ let ws = files::save(&o.document, output, a.export.format.as_deref(), &opts, None)?;
+ warn_all(err, &ws);
+ Ok(())
+}
+
+pub(crate) fn info(a: &InfoArgs, out: &mut dyn Write) -> Result {
+ let file = &a.file;
+ let mut h = Headless::trusted_local();
+ let opened = h.open(file)?;
+ let mut doc = h.inspect(None)?;
+ let mut warnings = opened["warnings"].as_array().cloned().unwrap_or_default();
+ if let Some(st) = h.session.active() {
+ warnings.extend(missing_font_warnings(&st.doc).into_iter().map(Value::String));
+ }
+ doc["warnings"] = Value::Array(warnings);
+ doc["file"] = json!(file.to_string_lossy());
+ // Drop per-session noise.
+ if let Value::Object(m) = &mut doc {
+ for k in ["history", "canUndo", "canRedo", "revision"] {
+ m.remove(k);
+ }
+ }
+ print_json(out, &doc, if a.compact { JsonStyle::Compact } else { JsonStyle::Pretty })
+}
+
+/// `(id, params)` pairs from repeated `--cmd`/`--params` flags.
+fn command_list(a: &RunArgs) -> Result> {
+ let mut cmds: Vec<(String, Value)> = Vec::new();
+ for step in &a.steps {
+ match step {
+ Step::Cmd(id) => cmds.push((id.clone(), json!({}))),
+ Step::Params(p) => cmds.last_mut().ok_or(CliError::ParamsBeforeCmd)?.1 = p.clone(),
+ }
+ }
+ Ok(cmds)
+}
+
+pub(crate) fn run_cmds(a: &RunArgs, out: &mut dyn Write, err: &mut dyn Write) -> Result {
+ let opts = ExportOptions::from(&a.export);
+ let mut h = Headless::trusted_local();
+ // Opening, running commands and exporting can all notice the same missing font:
+ // one `run` invocation reports each warning line at most once.
+ let mut reported_fonts = std::collections::HashSet::::new();
+ // clap's `source` group gives exactly one of the two, and its `work` group a --cmd or --out.
+ if let Some(new) = &a.new {
+ h.command_run("file.new", new.clone()).map_err(CliError::New)?;
+ } else if let Some(file) = &a.file {
+ // Refused before the file is read or any command runs.
+ if let Some(out) = &a.out {
+ refuse_overwriting_input(a.in_place, file, out)?;
+ }
+ let o = h.open(file)?;
+ let ws: Vec = serde_json::from_value(o["warnings"].clone()).unwrap_or_default();
+ warn_all(err, &ws);
+ reported_fonts.extend(ws);
+ }
+ let cmds = command_list(a)?;
+ for (id, params) in cmds {
+ // A step that is a silent no-op in action playback (Deselect with nothing selected, an Arrange that cannot move the layer) is one in a script too (#8802).
+ if photocraft_engine::actions_cmds::noop_step(&h.session, &id, ¶ms) {
+ print_json(out, &json!({"command": id, "result": null}), JsonStyle::Compact)?;
+ continue;
+ }
+ let r = h.command_run(&id, params).map_err(|source| CliError::Command { id: id.clone(), source })?;
+ if let Some(message) = photocraft_engine::actions_cmds::nested_failure(&id, &r) {
+ return Err(CliError::NestedFailure { id, message });
+ }
+ let new_warnings: Vec =
+ h.session.active().map(|st| missing_font_warnings(&st.doc)).unwrap_or_default().into_iter().filter(|w| reported_fonts.insert(w.clone())).collect();
+ warn_all(err, &new_warnings);
+ let mut result = json!({"command": id, "result": r});
+ if !new_warnings.is_empty() {
+ result["warnings"] = json!(new_warnings);
+ }
+ print_json(out, &result, JsonStyle::Compact)?;
+ }
+ // A `run` with only `--out` still reports missing fonts before exporting.
+ let remaining: Vec =
+ h.session.active().map(|st| missing_font_warnings(&st.doc)).unwrap_or_default().into_iter().filter(|w| reported_fonts.insert(w.clone())).collect();
+ warn_all(err, &remaining);
+ if let Some(o) = a.out.as_deref() {
+ let r = h.save(None, Some(o), a.export.format.as_deref(), &opts)?;
+ let ws: Vec = serde_json::from_value(r["warnings"].clone()).unwrap_or_default();
+ let ws: Vec = ws.into_iter().filter(|w| reported_fonts.insert(w.clone())).collect();
+ warn_all(err, &ws);
+ }
+ Ok(())
+}
+
+#[cfg(test)]
+mod missing_font_warning_tests {
+ use super::*;
+ use crate::{
+ batch::is_input,
+ test_support::{Invoke, invoke},
+ };
+
+ #[test]
+ fn missing_typeface_is_reported_by_run_info_and_convert() {
+ let family = "DefinitelyMissingPhotoCraftTypeface1251";
+ let folder = std::env::temp_dir().join(format!("photocraft-cli-font-warnings-{}", std::process::id()));
+ std::fs::create_dir_all(&folder).unwrap();
+ let native = folder.join("missing.pcraft");
+ let png = folder.join("missing.png");
+ let native_str = native.to_string_lossy().to_string();
+ let png_str = png.to_string_lossy().to_string();
+ let params = json!({"x": 6, "y": 38, "text": "Missing font warning", "font": family, "size": 20}).to_string();
+
+ let Invoke { code, stdout, stderr } = invoke(&[
+ "run",
+ "--new",
+ r#"{"width":256,"height":96,"background":"white"}"#,
+ "--cmd",
+ "type.create",
+ "--params",
+ ¶ms,
+ "--cmd",
+ "type.resolveMissingFonts",
+ "--out",
+ &native_str,
+ ]);
+ assert_eq!(code, 0, "{stderr}");
+ assert_eq!(stderr.matches(family).count(), 1, "multi-command runs should not repeat the same missing font warning");
+ let commands: Vec = stdout.lines().map(|s| serde_json::from_str(s).unwrap()).collect();
+ assert_eq!(commands.len(), 2, "{stdout}");
+ assert!(commands[0]["warnings"].as_array().unwrap().iter().any(|w| w.as_str().is_some_and(|s| s.contains(family))));
+ assert!(commands[1].get("warnings").is_none(), "only newly detected missing fonts are reported");
+
+ let Invoke { code, stdout, stderr } = invoke(&["info", &native_str, "--compact"]);
+ assert_eq!(code, 0, "{stderr}");
+ let info: Value = serde_json::from_str(&stdout).unwrap();
+ assert!(info["warnings"].as_array().unwrap().iter().any(|w| w.as_str().is_some_and(|s| s.contains(family))));
+ assert!(stderr.is_empty(), "info puts warnings in JSON, not stderr");
+
+ let Invoke { code, stderr, .. } = invoke(&["convert", &native_str, &png_str]);
+ assert_eq!(code, 0, "{stderr}");
+ assert!(stderr.contains(&format!("warning: font '{family}'")), "{stderr}");
+ assert!(png.is_file());
+
+ // Even with no commands, run --out checks the opened document before export.
+ let Invoke { code, stdout, stderr } = invoke(&["run", &native_str, "--out", &png_str]);
+ assert_eq!(code, 0, "{stderr}");
+ assert!(stdout.is_empty());
+ assert_eq!(stderr.matches(family).count(), 1);
+
+ let _ = std::fs::remove_dir_all(&folder);
+ }
+
+ #[test]
+ fn convert_reads_and_writes_openraster() {
+ let folder = std::env::temp_dir().join(format!("photocraft-cli-ora-{}", std::process::id()));
+ std::fs::create_dir_all(&folder).unwrap();
+ let path = |name: &str| folder.join(name).to_string_lossy().to_string();
+ let (native, ora, png) = (path("layers.pcraft"), path("layers.ora"), path("back.png"));
+ let Invoke { code, stderr, .. } = invoke(&["run", "--new", r#"{"width":16,"height":12}"#, "--cmd", "layer.new.layer", "--out", &native]);
+ assert_eq!(code, 0, "{stderr}");
+ let Invoke { code, stderr, .. } = invoke(&["convert", &native, &ora]);
+ assert_eq!(code, 0, "{stderr}");
+ let Invoke { code, stdout, stderr } = invoke(&["info", &ora, "--compact"]);
+ assert_eq!(code, 0, "{stderr}");
+ let info: Value = serde_json::from_str(&stdout).unwrap();
+ assert_eq!(info["layers"].as_array().map(Vec::len), Some(2), "{info}");
+ let Invoke { code, stderr, .. } = invoke(&["convert", &ora, &png]);
+ assert_eq!(code, 0, "{stderr}");
+ assert!(is_input(std::path::Path::new(&ora)));
+ // Krita documents are batch inputs too (import-only).
+ for name in ["sketch.kra", "old.KRZ"] {
+ std::fs::write(folder.join(name), b"").unwrap();
+ assert!(is_input(&folder.join(name)), "{name}");
+ }
+ let _ = std::fs::remove_dir_all(&folder);
+ }
+
+ #[test]
+ fn no_type_layers_do_not_produce_missing_font_warnings() {
+ let folder = std::env::temp_dir().join(format!("photocraft-cli-no-font-warning-{}", std::process::id()));
+ std::fs::create_dir_all(&folder).unwrap();
+ let native = folder.join("blank.pcraft");
+ let png = folder.join("blank.png");
+ let native_str = native.to_string_lossy().to_string();
+ let png_str = png.to_string_lossy().to_string();
+ let Invoke { code, stderr, .. } = invoke(&["run", "--new", r#"{"width":16,"height":16}"#, "--out", &native_str]);
+ assert_eq!(code, 0, "{stderr}");
+ assert!(!stderr.contains("font '"), "{stderr}");
+ let Invoke { code, stdout, stderr } = invoke(&["info", &native_str, "--compact"]);
+ assert_eq!(code, 0, "{stderr}");
+ let info: Value = serde_json::from_str(&stdout).unwrap();
+ assert!(info["warnings"].as_array().unwrap().iter().all(|w| !w.as_str().unwrap_or_default().contains("font '")));
+ let Invoke { code, stderr, .. } = invoke(&["convert", &native_str, &png_str]);
+ assert_eq!(code, 0, "{stderr}");
+ assert!(!stderr.contains("font '"), "{stderr}");
+ let _ = std::fs::remove_dir_all(&folder);
+ }
+}
diff --git a/apps/photocraft-cli/src/error.rs b/apps/photocraft-cli/src/error.rs
new file mode 100644
index 0000000000..3e4aa3caef
--- /dev/null
+++ b/apps/photocraft-cli/src/error.rs
@@ -0,0 +1,42 @@
+use std::path::PathBuf;
+
+use photocraft_automation::AutomationError;
+
+use crate::actions::ActionsError;
+
+/// Why a subcommand failed: printed as `error: {e}`, exit 1.
+#[derive(Debug, thiserror::Error)]
+pub(crate) enum CliError {
+ #[error(transparent)]
+ Automation(#[from] AutomationError),
+ #[error(transparent)]
+ Engine(#[from] photocraft_engine::EngineError),
+ #[error(transparent)]
+ Io(#[from] std::io::Error),
+ #[error(transparent)]
+ Json(#[from] serde_json::Error),
+ #[error(transparent)]
+ Actions(#[from] ActionsError),
+ #[error("{}: {source}", path.display())]
+ ReadDir { path: PathBuf, source: std::io::Error },
+ #[error("--params must follow a --cmd")]
+ ParamsBeforeCmd,
+ #[error("--new: {0}")]
+ New(#[source] AutomationError),
+ #[error("`{id}`: {source}")]
+ Command { id: String, source: AutomationError },
+ /// A step inside an action the command played failed ([`photocraft_engine::actions_cmds::nested_failure`]).
+ #[error("`{id}`: {message}")]
+ NestedFailure { id: String, message: String },
+ #[error("{} is the input file, so the result would replace the original: choose another output, or pass --in-place to overwrite it", .0.display())]
+ OutIsInput(PathBuf),
+ #[error("--out {} is the --in folder, so the results would replace the originals: choose another --out folder, or pass --in-place to overwrite them", .0.display())]
+ OutIsIn(PathBuf),
+ /// Another input already wrote this output ([`photocraft_engine::file_cmds::OutputClaims::check`]).
+ #[error("{0}")]
+ OutputClaimed(String),
+ #[error("{0} file(s) failed")]
+ FilesFailed(usize),
+}
+
+pub(crate) type Result = std::result::Result;
diff --git a/apps/photocraft-cli/src/lib.rs b/apps/photocraft-cli/src/lib.rs
index 03001ab02d..c431b5529f 100644
--- a/apps/photocraft-cli/src/lib.rs
+++ b/apps/photocraft-cli/src/lib.rs
@@ -3,197 +3,63 @@
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
+use std::ffi::OsString;
use std::io::Write;
-use std::path::{Path, PathBuf};
-use photocraft_automation::{AuthorizedWorkspace, Headless, PhotocraftMcp, files, security};
-use photocraft_engine::actions_cmds::Action;
-use photocraft_io::ExportOptions;
-use serde_json::{Value, json};
+use clap::CommandFactory;
-pub const USAGE: &str = "\
-photocraft-cli: headless PhotoCraft
+mod actions;
+mod args;
+mod automation;
+mod batch;
+mod document;
+mod error;
+mod output;
-USAGE:
- photocraft-cli convert [--format ] [--quality <1-100>] [--tiff-layers] [--tga-bits <24|32>] [--dpx-bits <8|10|12|16>]
- Convert between formats (.pcraft, .psd, .png, .jpg, .tif, .webp, .exr, …).
- TIFF output is flat unless --tiff-layers keeps the layers (Photoshop layer data).
- --quality sets the JPEG or WebP quality; a WebP written with a quality is lossy, without one lossless.
- --tga-bits sets a TGA's bits per pixel: 32 writes the alpha channel (or else the transparency) as
- its alpha, 24 none. Without it: 32 with an alpha channel or transparency, else 24.
- --dpx-bits sets a DPX's bits per sample. Without it: 8 for an 8-bit document, else 16.
- photocraft-cli info [--compact]
- Print the document as JSON (size, mode, depth, layer tree).
- photocraft-cli run ( | --new ) --cmd [--params ] [--cmd …] [--out ] [--format ] [--quality <1-100>] [--tiff-layers] [--tga-bits <24|32>] [--dpx-bits <8|10|12|16>]
- Open a file, run engine commands in order, save the result. Each --params
- applies to the preceding --cmd. Prints each command's JSON result.
- photocraft-cli batch --actions [--action ] --in --out [--format ] [--quality <1-100>] [--in-place] [--tiff-layers] [--tga-bits <24|32>] [--dpx-bits <8|10|12|16>]
- Apply an action list to every image in a directory. A Photoshop Actions file (.atn) is a
- set: its action --action names plays, as below. JSON steps are [id, params] pairs,
- {\"command\": id, \"params\": {…}} objects or bare ids, as a recorded action or droplet stores them
- (a list, or wrapped in {\"actions\": …}, {\"steps\": …} or a droplet). An Actions set (the Actions
- panel's actions.json, {\"actions\": [{\"name\", \"steps\"}…]}) plays the action --action names (needed
- when the set holds more than one) with the whole set loaded, so its steps can play other actions
- of the set. An --out folder that is the --in folder is refused, as the results would replace
- the originals; --in-place allows it.
- photocraft-cli droplet … [--out ]
- Run a droplet (File › Automate › Create Droplet) on images and folders.
- photocraft-cli commands [--json] [--filter ]
- List the engine command registry.
- photocraft-cli mcp [--bridge <127.0.0.1:port>] [--control-token <64-hex> | --control-token-file ]
- [--automation-read-root ] [--automation-write-root ]
- Run the MCP server on stdio (headless engine, or bridge to a running `photocraft --control `).
- photocraft-cli serve [--port ] [--control-token <64-hex> | --control-token-file ]
- [--automation-read-root ] [--automation-write-root ]
- Keep one headless session open and answer JSON lines ({\"id\",\"method\",\"params\"}) on stdio,
- or on 127.0.0.1:. Methods: engine.execute, jobs.list/cancel, engine.commands,
- doc.open/new/place/save/exportLayers/exportDataSets/importDataSets/inspect/render/select/close, session.list, batch, methods
- (docs/control-protocol.md#headless-server).
+pub use actions::{ActionsError, Steps, load_actions, load_actions_file, parse_actions};
+use args::{Command, parse};
+use automation::{commands, mcp, serve};
+use batch::{batch, droplet};
+use document::{convert, info, run_cmds};
+pub(crate) use error::{CliError, Result};
- photocraft-cli --help (or -h) prints this text. A flag the subcommand doesn't take is
- an error.
-";
-
-struct Args {
- positional: Vec,
- flags: Vec<(String, Option)>,
+/// The command line's clap definition, for generating shell completions and man pages
+/// (`examples/man-and-completions.rs`).
+pub fn command() -> clap::Command {
+ args::Cli::command()
}
-/// A subcommand: the flags it reads (taking a value, or given bare) and what it runs. A flag
-/// outside these is a usage error, so a typo such as `--fromat` can't be silently ignored (#423).
-struct Subcommand {
- name: &'static str,
- values: &'static [&'static str],
- bare: &'static [&'static str],
- run: fn(&Args, &mut dyn Write, &mut dyn Write) -> R,
-}
-
-const SUBCOMMANDS: &[Subcommand] = &[
- Subcommand { name: "convert", values: &["--format", "--quality", "--tga-bits", "--dpx-bits"], bare: &["--tiff-layers"], run: convert },
- Subcommand { name: "info", values: &[], bare: &["--compact"], run: |a, out, _| info(a, out) },
- Subcommand {
- name: "run",
- values: &["--new", "--cmd", "--params", "--out", "--format", "--quality", "--tga-bits", "--dpx-bits"],
- bare: &["--tiff-layers"],
- run: run_cmds,
- },
- Subcommand {
- name: "batch",
- values: &["--actions", "--action", "--in", "--out", "--format", "--quality", "--tga-bits", "--dpx-bits"],
- bare: &["--in-place", "--tiff-layers"],
- run: batch,
- },
- Subcommand { name: "droplet", values: &["--out"], bare: &[], run: droplet },
- Subcommand { name: "commands", values: &["--filter"], bare: &["--json"], run: |a, out, _| commands(a, out) },
- Subcommand {
- name: "mcp",
- values: &["--bridge", "--control-token", "--control-token-file", "--automation-read-root", "--automation-write-root"],
- bare: &[],
- run: |a, _, _| mcp(a),
- },
- Subcommand {
- name: "serve",
- values: &["--port", "--control-token", "--control-token-file", "--automation-read-root", "--automation-write-root"],
- bare: &[],
- run: |a, _, err| serve(a, err),
- },
-];
-
-/// The subcommand's arguments, or `None` when they ask for help (`--help` or `-h`).
-fn parse(sub: &Subcommand, args: &[String]) -> Result