diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 246944ad1c..172ca5104b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,8 +51,15 @@ jobs: if: runner.os == 'Linux' run: cargo fmt --all -- --check + # `--features heif`: official builds open HEIC photos via the optional photocraft-heif crate. - name: Test - run: cargo test --workspace --locked + run: cargo test --workspace --locked --features heif + + # 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: runner.os == 'Linux' + run: cargo test -p photocraft-heif -p photocraft-codecs -p photocraft-io --locked # The same tests built with the optional craft-fonts input (crates/text/build.rs), so the # Japanese font tests that skip without it run here. Linux only. @@ -69,10 +76,10 @@ jobs: env: CRAFT_FONTS_DIR: ${{ github.workspace }}/craft-fonts CRAFT_FONTS_REQUIRED: "1" - run: cargo test --workspace --locked + run: cargo test --workspace --locked --features heif - name: Clippy - run: cargo clippy --workspace --all-targets --locked -- -D warnings + run: cargo clippy --workspace --all-targets --locked --features heif -- -D warnings - name: Dependency layering run: cargo xtask layers @@ -136,6 +143,7 @@ jobs: - { crate: codecs, name: decode_jpeg } - { crate: codecs, name: decode_tiff } - { crate: codecs, name: decode_exr } + - { crate: codecs, name: decode_heif } - { crate: format, name: load } steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index a5b7f0a216..4e12adb6fa 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -51,8 +51,8 @@ jobs: # The checkout is synced in under another owner; let tests that call git read it. git config --global --add safe.directory "*" rustc --version - CARGO_PROFILE_DEV_DEBUG=0 cargo build --workspace --all-targets --locked - CARGO_PROFILE_DEV_DEBUG=0 cargo test --workspace --locked --exclude photocraft-ui-egui + CARGO_PROFILE_DEV_DEBUG=0 cargo build --workspace --all-targets --locked --features heif + 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 # The VM's software Vulkan driver crashes (SIGSEGV) when several tests set up a GPU diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index 98b4f39b8a..f055069b5b 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -73,6 +73,7 @@ next to the files: | `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/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/pngsuite/` | PngSuite | Willem van Schaik | | Public domain | Files copied into `corpus/` by hand (tiff, exr, raw) must be MIT, BSD or CC0. diff --git a/Cargo.lock b/Cargo.lock index d7e2486b0a..61a12e9034 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2030,6 +2030,15 @@ dependencies = [ "foldhash 0.2.0", ] +[[package]] +name = "heic-rs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adf9dde634bb6d5b718bacd01bef80192f2334306b2f785519a0136cca7b9618" +dependencies = [ + "rayon", +] + [[package]] name = "hermit-abi" version = "0.5.3" @@ -3503,6 +3512,7 @@ dependencies = [ "image", "image-webp", "jpeg-encoder", + "photocraft-heif", "png 0.18.1", "proptest", "rayon", @@ -3618,6 +3628,13 @@ dependencies = [ "wgpu", ] +[[package]] +name = "photocraft-heif" +version = "0.3.0" +dependencies = [ + "heic-rs", +] + [[package]] name = "photocraft-io" version = "0.3.0" diff --git a/README.md b/README.md index 1c0049c6e9..7d4cc153b2 100644 --- a/README.md +++ b/README.md @@ -198,7 +198,7 @@ Every screenshot here is the real app at work on public-domain art, rendered off

πŸ—‚οΈ Formats

- PSD and PSB, plus PNG, JPEG, TIFF, WebP, GIF, BMP, TGA, ICO, QOI, PNM, OpenEXR, Radiance HDR and AVIF, with symmetric read and write at 8, 16 and 32 bits, and the native .pcraft format. + PSD and PSB, plus PNG, JPEG, TIFF, WebP, GIF, BMP, TGA, ICO, QOI, PNM, OpenEXR, Radiance HDR and AVIF, with symmetric read and write at 8, 16 and 32 bits, HEIC photos from iPhone and Mac (read; in official builds, an optional --features heif build feature), and the native .pcraft format.

πŸͺ„ The everyday essentials

diff --git a/apps/photocraft-cli/Cargo.toml b/apps/photocraft-cli/Cargo.toml index 8e07dcebb3..8e85e6f9c3 100644 --- a/apps/photocraft-cli/Cargo.toml +++ b/apps/photocraft-cli/Cargo.toml @@ -5,6 +5,11 @@ version.workspace = true edition.workspace = true license.workspace = true +[features] +# Open HEIC/HEIF photos (the optional photocraft-heif crate). Not default so distributors choose +# it; official builds (CI, packaging/, release) build with `--features heif`. +heif = ["photocraft-codecs/heif"] + [lints] workspace = true diff --git a/apps/photocraft-web/Cargo.toml b/apps/photocraft-web/Cargo.toml index f6ea819352..be1f764fa8 100644 --- a/apps/photocraft-web/Cargo.toml +++ b/apps/photocraft-web/Cargo.toml @@ -6,6 +6,11 @@ edition.workspace = true license.workspace = true publish = false +[features] +# Open HEIC/HEIF photos (the optional photocraft-heif crate). Not default so distributors choose +# it; official builds (CI, packaging/, release) build with `--features heif`. +heif = ["photocraft-codecs/heif"] + [lints] workspace = true diff --git a/apps/photocraft-web/index.html b/apps/photocraft-web/index.html index b9a19fb791..5e734006be 100644 --- a/apps/photocraft-web/index.html +++ b/apps/photocraft-web/index.html @@ -4,7 +4,7 @@ PhotoCraft - +