PhotoCraft: An open-source, photo editor written by scratch in pure Rust
pixls: usage and status text, per-file licence links, dedup, --changed for raw
Elvis33LE3bfaef668c47
diff --git a/ATTRIBUTION.md b/ATTRIBUTION.mdindex 4b1a1ff32..03eb256e9 100644--- a/ATTRIBUTION.md+++ b/ATTRIBUTION.md@@ -86,6 +86,6 @@ next to the files:| `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/` (21 files, 2.4 MB) | Public Affinity documents, unmodified: `vector-art/` (9), `afdesignload/` (9), `jac21/` (2) and `asset-store-template/` (1), each with its upstream licence next to it | samuel-etver; Nick Beeuwsaert; Jeremy Cantu; DAIKI (eviltwo) | [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) | CC0-1.0 (vector-art); MIT, Copyright (c) 2015 Nick Beeuwsaert; MIT, Copyright (c) 2018 Jeremy Cantu; MIT, Copyright (c) 2024 DAIKI || `corpus/pixls/` (7 files, 226 MB) | Real camera raws, one per decode path: Canon PowerShot SX50 HS (CR2 and its DNG conversion), Nikon D3 uncompressed NEF, 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. Each file (and its licence, per the database) is reachable at its path under [raw.pixls.us/data](https://raw.pixls.us/data/): [Canon SX50 HS](https://raw.pixls.us/data/Canon/PowerShot%20SX50%20HS/), [Nikon D3](https://raw.pixls.us/data/Nikon/D3/), [Sony DSC-RX0](https://raw.pixls.us/data/Sony/DSC-RX0/), [Panasonic DC-G9](https://raw.pixls.us/data/Panasonic/DC-G9/), [Olympus E-1](https://raw.pixls.us/data/Olympus/E-1/), [Olympus E-5](https://raw.pixls.us/data/Olympus/E-5/) | The photographers of the pixls.us raw samples database (per-file credits there) | [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 shown in the [database listing](https://raw.pixls.us) |-| `corpus/pngsuite/` | PngSuite | Willem van Schaik | <http://www.schaik.com/pngsuite/> | Public domain |+| `corpus/pixls/` (7 files, 226 MB) | Real camera raws, one per decode path: Canon PowerShot SX50 HS (CR2 and its DNG conversion), Nikon D3 uncompressed NEF, 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) | 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 |Files copied into `corpus/` by hand (tiff, exr, raw) must be MIT, BSD or CC0.diff --git a/xtask/src/corpus.rs b/xtask/src/corpus.rsindex 424452e0e..84754a039 100644--- a/xtask/src/corpus.rs+++ b/xtask/src/corpus.rs@@ -134,7 +134,8 @@ fn list() {corpus/affinity/ [{}] 21 public Affinity 1–3 documents (CC0, MIT): vector-art, AFDesignLoad,Jac21/Branding, AssetStoreTemplate; manifest xtask/affinity-corpus.sha256. Fetch: --affinitycorpus/pngsuite/ [{}] PngSuite (public domain), {PNGSUITE_URL}. Fetch: --pngsuite- corpus/tiff/, corpus/raw/ optional, copied in by hand+ corpus/pixls/ [opt-in] real camera raws from raw.pixls.us (public domain), one per decode+ path plus the known-unsupported packed ORF. Fetch: --pixls (opt-in)Pins: xtask/src/corpus_pins.rs. Moving one: change it, then --<name> --update-manifest.",corpus.display(),@@ -195,6 +196,7 @@ pub fn test_cmd(args: &[&str]) -> Result<(), String> {Some(i) => (&args[..i], &args[i + 1..]),None => (args, &[][..]),};+ let mut raw_changed = false;if ours.contains(&"--changed") {let changed = changed_files()?;let hits: Vec<&String> = changed.iter().filter(|f| CRITICAL.iter().any(|c| f.starts_with(c))).collect();@@ -203,6 +205,7 @@ pub fn test_cmd(args: &[&str]) -> Result<(), String> {return Ok(());}println!("test-corpus --changed: {} critical files changed (e.g. {}); running the corpus tests", hits.len(), hits[0]);+ raw_changed = hits.iter().any(|f| f.starts_with("crates/raw/"));}let mut crates: Vec<String> = Vec::new();let mut it = ours.iter();@@ -223,10 +226,13 @@ pub fn test_cmd(args: &[&str]) -> Result<(), String> {if crates.is_empty() {crates = CORPUS_CRATES.iter().map(|s| (*s).to_string()).collect();}- // `--pixls` opts in (and fetches): the raw corpus tests are not part of CI until a- // maintainer decides they belong there.- if ours.contains(&"--pixls") || crates.iter().any(|c| PIXLS_CRATES.contains(&c.as_str())) {+ // `--pixls` opts in (and fetches), and a raw change under --changed does too: the raw+ // corpus tests are not part of the default set until a maintainer decides otherwise.+ let wants_pixls = ours.contains(&"--pixls") || crates.iter().any(|c| PIXLS_CRATES.contains(&c.as_str())) || raw_changed;+ if wants_pixls && !crates.iter().any(|c| c == "photocraft-raw") {crates.push("photocraft-raw".to_string());+ }+ if wants_pixls {crate::pinned::fetch_pixls(false)?;}fetch_all(ours.contains(&"--local"))?;diff --git a/xtask/src/main.rs b/xtask/src/main.rsindex 634a6aa56..9399c7461 100644--- a/xtask/src/main.rs+++ b/xtask/src/main.rs@@ -25,9 +25,9 @@ commands:layers enforce the crate dependency layering (plan/architecture.md §3)wasm cargo check --target wasm32-unknown-unknown for the wasm-safe cratesci fmt --check, clippy -D warnings, test, layers, wasm (stops at first failure)- corpus [--all | --pngsuite | --psd | --psd-tools | --photoshop] [--local] [--update-manifest]+ corpus [--all | --pngsuite | --psd | --psd-tools | --pixls | --photoshop] [--local] [--update-manifest]show where test corpora live and their pins (xtask/src/corpus_pins.rs), or fetch- them into corpus/ (pinned commits, sha256-verified; --all = every corpus;+ them into corpus/ (pinned commits, sha256-verified; --all = every corpus but pixls,--photoshop --local copies from ../photocraft-corpus or $PHOTOCRAFT_CORPUS_REPO)test-corpus [-p <crate>]... [--changed] [--local] [-- <test args>]fetch every corpus, then cargo test --release --features corpus on the corpus