From fd1df348c0a5f60a4ffb2d4a829fbe2a7bd84dea Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 12 Nov 2026 05:33:48 +0000 Subject: [PATCH 1/7] Formats: move EffectCraft format codecs to craft-libs --- ATTRIBUTION.md | 2 +- Cargo.lock | 40 +- Cargo.toml | 32 +- crates/aep/Cargo.toml | 6 +- crates/aep/README.md | 21 +- crates/aep/examples/aepdump.rs | 75 -- crates/aep/examples/stubicc.rs | 359 ------ crates/aep/src/container.rs | 60 +- crates/aep/src/container/aepx.rs | 640 ---------- crates/aep/src/container/arbitrary.rs | 555 --------- crates/aep/src/container/bytes.rs | 50 - crates/aep/src/container/camera.rs | 135 --- crates/aep/src/container/chunk.rs | 213 ---- crates/aep/src/container/effect_map.rs | 2 +- crates/aep/src/container/effects.rs | 727 ------------ crates/aep/src/container/error.rs | 57 - crates/aep/src/container/footage.rs | 409 ------- crates/aep/src/container/header.rs | 549 --------- crates/aep/src/container/keys.rs | 361 ------ crates/aep/src/container/masks.rs | 258 ----- crates/aep/src/container/matte.rs | 68 -- crates/aep/src/container/read.rs | 142 --- crates/aep/src/container/settings.rs | 224 ---- crates/aep/src/container/shapes.rs | 273 ----- crates/aep/src/container/textdoc.rs | 1031 ----------------- crates/aep/src/container/typed.rs | 539 --------- crates/aep/src/container/values.rs | 263 ----- crates/aep/src/container/version.rs | 120 -- crates/aep/src/container/write.rs | 86 -- crates/aep/src/import/effects.rs | 2 +- crates/aep/src/import/markers.rs | 6 +- crates/aep/src/import/shapes.rs | 2 +- crates/aep/src/lib.rs | 3 +- crates/aep/tests/fixtures/tools/README.md | 2 +- crates/aep/tests/it/common/mod.rs | 7 + crates/aep/tests/it/container.rs | 29 - crates/aep/tests/it/container/aepx.rs | 174 --- crates/aep/tests/it/container/batch3_core.rs | 383 ------ .../aep/tests/it/container/batch3_objects.rs | 543 --------- crates/aep/tests/it/container/batch5.rs | 152 --- crates/aep/tests/it/container/cases_600.rs | 186 --- crates/aep/tests/it/container/ease_round2.rs | 69 -- crates/aep/tests/it/container/effects.rs | 292 ----- .../aep/tests/it/container/effects_batch4.rs | 307 ----- .../aep/tests/it/container/effects_batch5.rs | 151 --- .../tests/it/container/effects_exposure.rs | 145 --- crates/aep/tests/it/container/header.rs | 364 ------ crates/aep/tests/it/container/helpers.rs | 413 ------- crates/aep/tests/it/container/keyframes.rs | 230 ---- .../aep/tests/it/container/layer_switches.rs | 225 ---- crates/aep/tests/it/container/masks.rs | 203 ---- crates/aep/tests/it/container/matte.rs | 82 -- crates/aep/tests/it/container/odd_cases.rs | 266 ----- crates/aep/tests/it/container/robustness.rs | 731 ------------ crates/aep/tests/it/container/roundtrip.rs | 130 --- crates/aep/tests/it/container/shapes.rs | 128 -- crates/aep/tests/it/container/text_fields.rs | 209 ---- .../it/container/text_markers_footage.rs | 275 ----- .../tests/it/container/text_style_slots.rs | 153 --- crates/aep/tests/it/container/typed.rs | 268 ----- crates/aep/tests/it/container/values.rs | 252 ---- crates/aep/tests/it/export/built.rs | 21 +- crates/aep/tests/it/export/effects.rs | 2 +- crates/aep/tests/it/export/masks.rs | 5 +- crates/aep/tests/it/export/objects.rs | 58 +- crates/aep/tests/it/export/precomp.rs | 6 +- crates/aep/tests/it/export/styles.rs | 2 +- crates/aep/tests/it/import/cameras.rs | 36 +- crates/aep/tests/it/import/combined.rs | 2 +- .../aep/tests/it/import/effects_thirdparty.rs | 2 +- crates/aep/tests/it/import/versions.rs | 3 +- crates/aep/tests/it/main.rs | 1 - crates/lottie/Cargo.toml | 1 + crates/lottie/src/anim.rs | 260 ++--- crates/lottie/src/base64.rs | 69 -- crates/lottie/src/export.rs | 258 ++--- crates/lottie/src/import.rs | 333 +++--- crates/lottie/src/lib.rs | 5 +- crates/lottie/src/shapes.rs | 870 ++++++++------ crates/lottie/src/text.rs | 367 +++--- crates/media/Cargo.toml | 7 +- crates/media/src/dpx.rs | 447 ++----- crates/media/src/exr_channels.rs | 26 +- crates/media/src/gif_anim.rs | 15 +- crates/media/src/webp_anim.rs | 41 +- crates/model/Cargo.toml | 5 +- crates/model/src/fbx.rs | 969 +--------------- crates/model/src/fbx/tests.rs | 198 +--- crates/model/src/gltf.rs | 701 +---------- crates/model/src/lib.rs | 13 +- crates/model/src/obj.rs | 298 +---- crates/model/src/scene.rs | 268 +++++ crates/model/src/stl.rs | 206 +--- crates/model/src/tests.rs | 48 - crates/pdf/Cargo.toml | 1 + crates/pdf/README.md | 2 +- crates/pdf/src/ps/eps.rs | 28 +- crates/psd/Cargo.toml | 1 + crates/psd/src/engine_data.rs | 319 +---- crates/psd/src/parse.rs | 2 +- crates/raster/Cargo.toml | 1 + crates/raster/src/channels3d.rs | 62 +- crates/svg/Cargo.toml | 1 + crates/svg/src/lib.rs | 55 +- crates/svg/src/tests.rs | 4 +- docs/testing.md | 3 + xtask/src/pdf_deps.rs | 2 +- 107 files changed, 1755 insertions(+), 17948 deletions(-) delete mode 100644 crates/aep/examples/aepdump.rs delete mode 100644 crates/aep/examples/stubicc.rs delete mode 100644 crates/aep/src/container/aepx.rs delete mode 100644 crates/aep/src/container/arbitrary.rs delete mode 100644 crates/aep/src/container/bytes.rs delete mode 100644 crates/aep/src/container/camera.rs delete mode 100644 crates/aep/src/container/chunk.rs delete mode 100644 crates/aep/src/container/effects.rs delete mode 100644 crates/aep/src/container/error.rs delete mode 100644 crates/aep/src/container/footage.rs delete mode 100644 crates/aep/src/container/header.rs delete mode 100644 crates/aep/src/container/keys.rs delete mode 100644 crates/aep/src/container/masks.rs delete mode 100644 crates/aep/src/container/matte.rs delete mode 100644 crates/aep/src/container/read.rs delete mode 100644 crates/aep/src/container/settings.rs delete mode 100644 crates/aep/src/container/shapes.rs delete mode 100644 crates/aep/src/container/textdoc.rs delete mode 100644 crates/aep/src/container/typed.rs delete mode 100644 crates/aep/src/container/values.rs delete mode 100644 crates/aep/src/container/version.rs delete mode 100644 crates/aep/src/container/write.rs delete mode 100644 crates/aep/tests/it/container.rs delete mode 100644 crates/aep/tests/it/container/aepx.rs delete mode 100644 crates/aep/tests/it/container/batch3_core.rs delete mode 100644 crates/aep/tests/it/container/batch3_objects.rs delete mode 100644 crates/aep/tests/it/container/batch5.rs delete mode 100644 crates/aep/tests/it/container/cases_600.rs delete mode 100644 crates/aep/tests/it/container/ease_round2.rs delete mode 100644 crates/aep/tests/it/container/effects.rs delete mode 100644 crates/aep/tests/it/container/effects_batch4.rs delete mode 100644 crates/aep/tests/it/container/effects_batch5.rs delete mode 100644 crates/aep/tests/it/container/effects_exposure.rs delete mode 100644 crates/aep/tests/it/container/header.rs delete mode 100644 crates/aep/tests/it/container/helpers.rs delete mode 100644 crates/aep/tests/it/container/keyframes.rs delete mode 100644 crates/aep/tests/it/container/layer_switches.rs delete mode 100644 crates/aep/tests/it/container/masks.rs delete mode 100644 crates/aep/tests/it/container/matte.rs delete mode 100644 crates/aep/tests/it/container/odd_cases.rs delete mode 100644 crates/aep/tests/it/container/robustness.rs delete mode 100644 crates/aep/tests/it/container/roundtrip.rs delete mode 100644 crates/aep/tests/it/container/shapes.rs delete mode 100644 crates/aep/tests/it/container/text_fields.rs delete mode 100644 crates/aep/tests/it/container/text_markers_footage.rs delete mode 100644 crates/aep/tests/it/container/text_style_slots.rs delete mode 100644 crates/aep/tests/it/container/typed.rs delete mode 100644 crates/aep/tests/it/container/values.rs delete mode 100644 crates/lottie/src/base64.rs create mode 100644 crates/model/src/scene.rs diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index b463e79ea..6a9202fd2 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -64,7 +64,7 @@ and licence texts are in [`NOTICE`](NOTICE). | `crates/model/tests/fixtures/cube.obj` | EffectCraft contributors | Original work: Wavefront OBJ test fixture (unit cube, two materials) | MIT OR Apache-2.0 | | `crates/model/tests/fixtures/cube.mtl` | EffectCraft contributors | Original work: MTL test fixture (materials of cube.obj) | MIT OR Apache-2.0 | -Two small After Effects test projects of `crates/aep` are in this repository: `crates/aep/tests/fixtures/synthetic.aep` (original work, made with After Effects 2026 from own data, working space None, the embedded colour profile removed; MIT OR Apache-2.0, with its `.attribution` sidecar) and `crates/aep/tests/fixtures/ai-mask-3099.aep` (original work, made with After Effects 2026 from four hand-written one-page PDFs named `.ai`, footage paths and host name neutralised, the embedded colour profiles replaced by stubs made with `crates/aep/examples/stubicc.rs`; MIT OR Apache-2.0, with its `.attribution` sidecar). The other After Effects test projects of `crates/aep` are not in this repository. They are original work of an EffectCraft contributor, generated with After Effects 2026 as own test data (MIT OR Apache-2.0, each file with its `.attribution` sidecar); they are in [storytold/effectcraft-corpus](https://github.com/storytold/effectcraft-corpus) with their sidecars, fetched by `cargo xtask aep-corpus` (commit-pinned, SHA-256-verified), and the tests read them only from the folder named by `EFFECTCRAFT_AEP_FIXTURES` (opt-in). Their embedded colour profiles are replaced by stubs made with `crates/aep/examples/stubicc.rs` (a header and a description, no colour data), so no vendor profile data is in them. +Two small After Effects test projects of `crates/aep` are in this repository: `crates/aep/tests/fixtures/synthetic.aep` (original work, made with After Effects 2026 from own data, working space None, the embedded colour profile removed; MIT OR Apache-2.0, with its `.attribution` sidecar) and `crates/aep/tests/fixtures/ai-mask-3099.aep` (original work, made with After Effects 2026 from four hand-written one-page PDFs named `.ai`, footage paths and host name neutralised, the embedded colour profiles replaced by stubs made with the `stubicc` example of `craft-aep` (storytold/craft-libs; formerly `crates/aep/examples/stubicc.rs`); MIT OR Apache-2.0, with its `.attribution` sidecar). The other After Effects test projects of `crates/aep` are not in this repository. They are original work of an EffectCraft contributor, generated with After Effects 2026 as own test data (MIT OR Apache-2.0, each file with its `.attribution` sidecar); they are in [storytold/effectcraft-corpus](https://github.com/storytold/effectcraft-corpus) with their sidecars, fetched by `cargo xtask aep-corpus` (commit-pinned, SHA-256-verified), and the tests read them only from the folder named by `EFFECTCRAFT_AEP_FIXTURES` (opt-in). Their embedded colour profiles are replaced by stubs made with the `stubicc` example of `craft-aep` (storytold/craft-libs; formerly `crates/aep/examples/stubicc.rs`) (a header and a description, no colour data), so no vendor profile data is in them. ## Screenshots diff --git a/Cargo.lock b/Cargo.lock index 79691772a..319a0a63c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1089,24 +1089,29 @@ dependencies = [ "libc", ] +[[package]] +name = "craft-aep" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" + [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4#e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" +source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639)", "thiserror 2.0.21", ] [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4#e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" +source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4#e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" +source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" dependencies = [ "serde", "serde_json", @@ -1116,12 +1121,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4#e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" +source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4#e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" +source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" dependencies = [ "fixed_decimal", "icu_decimal", @@ -1144,7 +1149,7 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4#e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" +source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" dependencies = [ "thiserror 2.0.21", ] @@ -1160,7 +1165,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4#e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" +source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" dependencies = [ "hayro-syntax", "thiserror 2.0.21", @@ -1169,7 +1174,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4#e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" +source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" dependencies = [ "dispatch2", "egui", @@ -1180,7 +1185,7 @@ dependencies = [ [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4#e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" +source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" dependencies = [ "craft-fonts-build", "craft-i18n", @@ -1201,7 +1206,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4#e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" +source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" dependencies = [ "chrono", "dunce", @@ -1228,9 +1233,9 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4#e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" +source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639)", "rayon", "thiserror 2.0.21", ] @@ -1478,6 +1483,7 @@ dependencies = [ name = "effectcraft-aep" version = "0.24.1" dependencies = [ + "craft-aep", "effectcraft-color", "effectcraft-effects", "effectcraft-keyframe", @@ -1591,7 +1597,7 @@ name = "effectcraft-export" version = "0.24.1" dependencies = [ "craft-audio", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639)", "craft-video", "effectcraft-color", "effectcraft-effects", @@ -1756,7 +1762,7 @@ version = "0.24.1" dependencies = [ "craft-audio", "craft-docpath", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639)", "effectcraft-color", "effectcraft-effects", "effectcraft-model", @@ -3322,7 +3328,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4#e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" +source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" dependencies = [ "hayro-ccitt", ] @@ -3336,7 +3342,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4#e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" +source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index c812a3294..70782c345 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,12 +11,22 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" } -craft-quit = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } +craft-quit = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } +craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } +craft-eps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } +craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } +craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } +craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } +craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } +craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } +craft-lottie = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } +craft-mesh = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } # 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 = "e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4", features = ["egui"] } +craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", features = ["egui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -80,9 +90,9 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all three on one rev. -craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4", default-features = false, features = ["isobmff", "matroska"] } -craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4", default-features = false, features = ["aac-decode", "aac-encode", "opus-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4", features = ["h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", default-features = false, features = ["isobmff", "matroska"] } +craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", default-features = false, features = ["aac-decode", "aac-encode", "opus-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", features = ["h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -112,7 +122,7 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4", features = ["serde"] } +craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", features = ["serde"] } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -221,8 +231,8 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4", version = "=0.3.0" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", version = "=0.3.0" } 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" } diff --git a/crates/aep/Cargo.toml b/crates/aep/Cargo.toml index b1bf3f9fe..2686c1f02 100644 --- a/crates/aep/Cargo.toml +++ b/crates/aep/Cargo.toml @@ -10,6 +10,7 @@ rust-version.workspace = true workspace = true [dependencies] +craft-aep = { workspace = true } effectcraft-time = { workspace = true } effectcraft-color = { workspace = true } effectcraft-keyframe = { workspace = true } @@ -20,8 +21,3 @@ thiserror = { workspace = true } [dev-dependencies] serde_json = { workspace = true } - -# The tool's own tests run with the crate's (examples are only built by default). -[[example]] -name = "stubicc" -test = true diff --git a/crates/aep/README.md b/crates/aep/README.md index 5e8035d8f..fc1cbabe8 100644 --- a/crates/aep/README.md +++ b/crates/aep/README.md @@ -3,7 +3,9 @@ After Effects projects (`.aep`, `.aepx`) in one crate, the way `effectcraft-lottie` handles Lottie: - `container`: reads and writes the container as a lossless chunk tree, with a typed, read-only - view (below; its API is re-exported at the crate root); + view (below). This is `craft-aep` from [storytold/craft-libs](https://github.com/storytold/craft-libs), + re-exported at the crate root; its container tests and the `aepdump`/`stubicc` tools are there. + Only `effect_map` and `style_map` (After Effects effects and layer styles to EffectCraft's) are here; - `import`: maps the typed view into an EffectCraft project and reports everything it does not import ([`docs/aep-import.md`](../../docs/aep-import.md)); - `export`: writes an EffectCraft project as an `.aep` with every chunk built in code, and reports everything it does not export @@ -86,14 +88,9 @@ the import against After Effects' read-back, and the host's `vector_import` test - `tests/fixtures/tools/`: the generator of the test projects (regenerates the corpus with After Effects; its README says how). -- `examples/aepdump.rs`: prints the chunk tree of a file (ids, sizes, short data, match names): - `cargo run -p effectcraft-aep --example aepdump -- file.aep`. -- `examples/stubicc.rs`: replaces every embedded ICC profile of a saved project by a stub that keeps - only the profile's description: the JSON `colorProfileData` of the working space (any white space - around the colon, `\/` escapes, quotes as `"`) in an `.aep` chunk or the `.aepx` text, and a raw - profile of an imported image (an `.aep` chunk, or the `bdata` hex of an `.aepx`): - `cargo run -p effectcraft-aep --example stubicc -- in.aep out.aep`. A profile it cannot replace - stops it before anything is written. The importer reads the working space's name from the - description only, so the project imports the same; no vendor colour data stays in the test - project. Check the result independently, not by the tool's count (the corpus repository has - `tools/aep/inspect-embedded.py`, which scans the raw bytes, base64 and hex). +- `aepdump` (prints the chunk tree of a file) and `stubicc` (replaces every embedded ICC profile of a + saved project by a stub) are examples of `craft-aep` in + [storytold/craft-libs](https://github.com/storytold/craft-libs): + `cargo run -p craft-aep --example stubicc -- in.aep out.aep` there. Check the result independently, + not by the tool's count (the corpus repository has `tools/aep/inspect-embedded.py`, which scans the + raw bytes, base64 and hex). diff --git a/crates/aep/examples/aepdump.rs b/crates/aep/examples/aepdump.rs deleted file mode 100644 index 2fe492696..000000000 --- a/crates/aep/examples/aepdump.rs +++ /dev/null @@ -1,75 +0,0 @@ -//! Developer tool: prints the chunk tree of an .aep (ids, sizes, short data), match names inline. -#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)] -use effectcraft_aep::{Body, Chunk}; - -/// Ends this developer tool with a message instead of a panic. -trait OrExit { - fn or_exit(self, what: &str) -> T; -} - -impl OrExit for Option { - fn or_exit(self, what: &str) -> T { - match self { - Some(v) => v, - None => exit(what), - } - } -} - -impl OrExit for Result { - fn or_exit(self, what: &str) -> T { - match self { - Ok(v) => v, - Err(e) => exit(&format!("{what}: {e:?}")), - } - } -} - -fn exit(msg: &str) -> ! { - eprintln!("{msg}"); - std::process::exit(1) -} - -fn show(c: &Chunk<'_>, depth: usize, max: usize, hex: usize) { - let ind = " ".repeat(depth); - let id = String::from_utf8_lossy(&c.id).to_string(); - match &c.body { - Body::Data(d) if &c.id == b"tdmn" => { - let n: String = d.iter().take_while(|b| **b != 0).map(|b| *b as char).collect(); - println!("{ind}tdmn {n}"); - } - Body::Data(d) => { - let h: String = d.iter().take(hex).map(|b| format!("{b:02x}")).collect(); - let a: String = d.iter().take(hex).map(|b| if (32..127).contains(b) { *b as char } else { '.' }).collect(); - println!("{ind}{id} [{}] {h} |{a}|", d.len()); - } - Body::Chunks(k) => { - println!("{ind}{id} (nested)"); - if depth < max { - for x in k { - show(x, depth + 1, max, hex); - } - } - } - Body::List { list_type, children } => { - println!("{ind}LIST {} ({} children)", String::from_utf8_lossy(list_type), children.len()); - if depth < max { - for x in children { - show(x, depth + 1, max, hex); - } - } - } - Body::OpaqueList { list_type, data } => println!("{ind}LIST {} opaque [{}]", String::from_utf8_lossy(list_type), data.len()), - } -} -fn main() { - let a: Vec = std::env::args().collect(); - let bytes = std::fs::read(a.get(1).or_exit("usage: see the comment at the top of this file")).or_exit("read"); - let max: usize = a.get(2).and_then(|s| s.parse().ok()).unwrap_or(4); - let hex: usize = a.get(3).and_then(|s| s.parse().ok()).unwrap_or(32); - let f = effectcraft_aep::parse(&bytes).or_exit("parse"); - for c in &f.chunks { - show(c, 0, max, hex); - } - println!("trailer {} bytes", f.trailer.len()); -} diff --git a/crates/aep/examples/stubicc.rs b/crates/aep/examples/stubicc.rs deleted file mode 100644 index 9438da06d..000000000 --- a/crates/aep/examples/stubicc.rs +++ /dev/null @@ -1,359 +0,0 @@ -//! Developer tool: replaces every embedded ICC profile of an .aep / .aepx by a stub that keeps only the -//! profile's description. Fixture hygiene: a saved project carries the vendor's working-space profile -//! (a few KB of colour data); the importer reads only the profile's name, the `desc` tag, so the stub -//! (a 128-byte header, one `desc` tag, no colour data, made here) imports identically. -//! -//! `cargo run -p effectcraft-aep --example stubicc -- in.aep out.aep` -//! -//! It handles: -//! - the JSON value `"colorProfileData": ""` in any chunk of an .aep and anywhere in the text -//! of an .aepx (white space around the colon, `\/` escapes and quotes written as `"` allowed); -//! - a raw ICC profile stored as a chunk of its own (the profile of an imported image), in an .aep -//! as the chunk's bytes and in an .aepx as its `bdata=""` attribute. -//! -//! A profile it cannot replace (no readable description, data that does not decode) stops the tool -//! before anything is written. Check the result independently (the corpus has -//! `tools/aep/inspect-embedded.py`), not by this tool's own count. -#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)] -use effectcraft_aep::{Body, Chunk}; - -const B64: &[u8; 64] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -/// Ends this developer tool with a message instead of a panic. -trait OrExit { - fn or_exit(self, what: &str) -> T; -} - -impl OrExit for Option { - fn or_exit(self, what: &str) -> T { - match self { - Some(v) => v, - None => exit(what), - } - } -} - -impl OrExit for Result { - fn or_exit(self, what: &str) -> T { - match self { - Ok(v) => v, - Err(e) => exit(&format!("{what}: {e:?}")), - } - } -} - -fn exit(msg: &str) -> ! { - eprintln!("{msg}"); - std::process::exit(1) -} - -fn b64_decode(text: &[u8]) -> Option> { - let (mut out, mut acc, mut bits) = (Vec::new(), 0u32, 0u32); - for &c in text.iter().filter(|c| **c != b'=') { - let v = u32::try_from(B64.iter().position(|b| *b == c)?).ok()?; - acc = (acc << 6 | v) & 0x00ff_ffff; - bits += 6; - if bits >= 8 { - bits -= 8; - out.push(((acc >> bits) & 0xff) as u8); - } - } - Some(out) -} - -fn b64_encode(data: &[u8]) -> Vec { - let mut out = Vec::new(); - for ch in data.chunks(3) { - let at = |i: usize| u32::from(ch.get(i).copied().unwrap_or(0)); - let n = (at(0) << 16) | (at(1) << 8) | at(2); - for i in 0..4usize { - if i <= ch.len() { - out.push(B64.get(((n >> (18 - 6 * i)) & 63) as usize).copied().unwrap_or(b'A')); - } else { - out.push(b'='); - } - } - } - out -} - -fn be32(d: &[u8], at: usize) -> Option { - let b: [u8; 4] = d.get(at..at.checked_add(4)?)?.try_into().ok()?; - usize::try_from(u32::from_be_bytes(b)).ok() -} - -/// The profile description (ICC.1 `desc`: v2 ASCII or v4 `mluc`, first record). -fn description(icc: &[u8]) -> Option { - let count = be32(icc, 128)?; - let tag = (0..count.min(1024)).find_map(|i| { - let at = 132usize.checked_add(i.checked_mul(12)?)?; - (icc.get(at..at.checked_add(4)?)? == b"desc").then_some(at) - })?; - let off = be32(icc, tag.checked_add(4)?)?; - let body = icc.get(off..off.checked_add(be32(icc, tag.checked_add(8)?)?)?)?; - let text = match body.get(..4)? { - b"desc" => { - let n = be32(body, 8)?; - String::from_utf8_lossy(body.get(12..12usize.checked_add(n)?)?.split(|b| *b == 0).next()?).into_owned() - } - b"mluc" => { - let (n, at) = (be32(body, 20)?, be32(body, 24)?); - let units: Vec = body.get(at..at.checked_add(n)?)?.chunks(2).filter_map(|p| Some(u16::from_be_bytes([*p.first()?, *p.get(1)?]))).collect(); - String::from_utf16_lossy(&units) - } - _ => return None, - }; - Some(text.trim_end_matches('\0').trim().to_owned()) -} - -/// A profile with a header, one `desc` tag and no colour data. -fn stub(desc: &str) -> Option> { - let mut body = b"desc\0\0\0\0".to_vec(); - body.extend_from_slice(&u32::try_from(desc.len().checked_add(1)?).ok()?.to_be_bytes()); - body.extend_from_slice(desc.as_bytes()); - body.push(0); - body.extend_from_slice(&[0; 4 + 4 + 2 + 1 + 67]); - let mut p = vec![0u8; 128]; - for (at, v) in [(8, &0x0240_0000u32.to_be_bytes()[..]), (12, b"mntr"), (16, b"RGB "), (20, b"XYZ "), (36, b"acsp")] { - p.get_mut(at..at + v.len())?.copy_from_slice(v); - } - p.extend_from_slice(&1u32.to_be_bytes()); - p.extend_from_slice(b"desc"); - p.extend_from_slice(&144u32.to_be_bytes()); - p.extend_from_slice(&u32::try_from(body.len()).ok()?.to_be_bytes()); - p.extend_from_slice(&body); - let size = u32::try_from(p.len()).ok()?.to_be_bytes(); - p.get_mut(..4)?.copy_from_slice(&size); - Some(p) -} - -/// The JSON key, without its quotes. -const KEY: &[u8] = b"colorProfileData"; -/// How a JSON quote is written: as is (a `Utf8` chunk, the `` text of an .aepx) and as an -/// XML entity (JSON inside an attribute of an .aepx). -const QUOTES: [&[u8]; 2] = [b"\"", b"""]; - -/// What the tool did, counted. -#[derive(Default)] -struct Tally { - stubbed: usize, - /// Values too short to be a profile (no ICC header), kept as they are. - kept_short: usize, - /// Profiles that could not be replaced (no readable description, undecodable data): the tool - /// fails, so no profile is ever left behind silently. - failed: Vec, -} - -fn is_profile(d: &[u8]) -> bool { - d.len() > 132 && d.get(36..40) == Some(b"acsp") -} - -/// The stub for the bytes `d` of a value, or `None` (counted) when it holds no profile or the -/// profile has no readable description. -fn stub_of(d: &[u8], at: usize, tally: &mut Tally) -> Option> { - if !is_profile(d) { - tally.kept_short += 1; - return None; - } - let s = description(d).and_then(|t| stub(&t)); - if s.is_none() { - tally.failed.push(format!("profile at byte {at}: no readable description")); - } - s -} - -/// At the start of `t`: the key in quotes, optional white space, a colon, optional white space and -/// the opening quote of the value. Returns the length up to and including that quote, and the quote. -fn value_start(t: &[u8]) -> Option<(usize, &'static [u8])> { - let ws = |mut i: usize| { - while t.get(i).is_some_and(u8::is_ascii_whitespace) { - i += 1; - } - i - }; - QUOTES.into_iter().find_map(|q| { - let key_end = q.len().checked_mul(2)?.checked_add(KEY.len())?; - let quoted = t.get(..key_end)?; - if !(quoted.starts_with(q) && quoted.get(q.len()..q.len() + KEY.len())? == KEY && quoted.ends_with(q)) { - return None; - } - let colon = ws(key_end); - if t.get(colon) != Some(&b':') { - return None; - } - let open = ws(colon + 1); - t.get(open..)?.starts_with(q).then_some((open + q.len(), q)) - }) -} - -fn hex_decode(h: &[u8]) -> Option> { - if !h.len().is_multiple_of(2) { - return None; - } - h.chunks(2).map(|p| u8::from_str_radix(std::str::from_utf8(p).ok()?, 16).ok()).collect() -} - -fn hex_encode(d: &[u8], upper: bool) -> Vec { - d.iter().flat_map(|b| if upper { format!("{b:02X}") } else { format!("{b:02x}") }.into_bytes()).collect() -} - -/// Replaces, in `text`, every `colorProfileData` JSON value (base64; `\/` escapes, white space -/// around the colon and quotes written as `"` allowed) and every .aepx `bdata=""` -/// attribute that holds a raw profile. -fn stub_text(text: &[u8], tally: &mut Tally) -> Vec { - const BDATA: &[u8] = b"bdata=\""; - let (mut out, mut i) = (Vec::with_capacity(text.len()), 0); - while let Some(&b) = text.get(i) { - let rest = text.get(i..).unwrap_or_default(); - if let Some((open, q)) = value_start(rest) - && let Some(len) = rest.get(open..).and_then(|v| v.windows(q.len()).position(|w| w == q)) - { - let raw = rest.get(open..open + len).unwrap_or_default(); - let unescaped: Vec = raw.iter().copied().filter(|c| *c != b'\\').collect(); - let replaced = match b64_decode(&unescaped) { - Some(d) => stub_of(&d, i, tally).map(|s| b64_encode(&s)), - None => { - tally.failed.push(format!("colorProfileData at byte {i}: not base64")); - None - } - }; - out.extend_from_slice(rest.get(..open).unwrap_or_default()); - match replaced { - Some(enc) => { - out.extend_from_slice(&enc); - tally.stubbed += 1; - } - None => out.extend_from_slice(raw), - } - i += open + len; - continue; - } - if rest.starts_with(BDATA) - && let Some(len) = rest.get(BDATA.len()..).and_then(|v| v.iter().position(|c| *c == b'"')) - { - let hex = rest.get(BDATA.len()..BDATA.len() + len).unwrap_or_default(); - let replaced = hex_decode(hex).filter(|d| is_profile(d)).and_then(|d| stub_of(&d, i, tally)); - out.extend_from_slice(BDATA); - match replaced { - Some(s) => { - out.extend_from_slice(&hex_encode(&s, hex.iter().any(u8::is_ascii_uppercase))); - tally.stubbed += 1; - } - None => out.extend_from_slice(hex), - } - i += BDATA.len() + len; - continue; - } - out.push(b); - i += 1; - } - out -} - -fn walk(chunks: &mut [Chunk<'_>], tally: &mut Tally) { - for c in chunks.iter_mut() { - // Only a data chunk is rewritten as one: an opaque `LIST` also has bytes, but replacing it by - // a data chunk would drop its list type. - let data = if let Body::Data(d) = &c.body { Some(d.to_vec()) } else { None }; - match data { - Some(d) if d.windows(KEY.len()).any(|w| w == KEY) => { - let new = stub_text(&d, tally); - *c = Chunk::data(c.id, new); - } - Some(d) if is_profile(&d) => { - if let Some(s) = stub_of(&d, 0, tally) { - *c = Chunk::data(c.id, s); - tally.stubbed += 1; - } - } - _ => { - if let Body::List { children, .. } | Body::Chunks(children) = &mut c.body { - walk(children, tally); - } - } - } - } -} - -fn main() { - let args: Vec = std::env::args().collect(); - let (Some(input), Some(output)) = (args.get(1), args.get(2)) else { exit("usage: stubicc ") }; - let bytes = std::fs::read(input).or_exit("read the input"); - let mut tally = Tally::default(); - let out = if input.ends_with(".aepx") { - stub_text(&bytes, &mut tally) - } else { - let mut file = effectcraft_aep::parse(&bytes).or_exit("parse the input"); - walk(&mut file.chunks, &mut tally); - effectcraft_aep::write(&file).or_exit("write the output") - }; - if !tally.failed.is_empty() { - exit(&format!("nothing written: {} profile(s) could not be replaced:\n{}", tally.failed.len(), tally.failed.join("\n"))); - } - std::fs::write(output, out).or_exit("write the output"); - println!("stubbed {} profile(s); kept {} short value(s) that hold no profile", tally.stubbed, tally.kept_short); -} - -#[cfg(test)] -#[allow(clippy::unwrap_used)] -mod tests { - use super::*; - - fn profile(desc: &str) -> Vec { - // A profile with colour data after the description (like a real one): the stub of `desc` - // plus 3000 bytes, its size field updated. - let mut p = stub(desc).unwrap(); - p.extend(std::iter::repeat_n(0x5a, 3000)); - let size = u32::try_from(p.len()).unwrap().to_be_bytes(); - p[..4].copy_from_slice(&size); - p - } - - fn stubbed(text: &[u8]) -> (Vec, Tally) { - let mut tally = Tally::default(); - (stub_text(text, &mut tally), tally) - } - - #[test] - fn json_values_in_every_spelling_are_replaced() { - let b64 = String::from_utf8(b64_encode(&profile("sRGB IEC61966-2.1"))).unwrap(); - let want = String::from_utf8(b64_encode(&stub("sRGB IEC61966-2.1").unwrap())).unwrap(); - for (before, after) in [ - (format!("{{\"colorProfileData\":\"{b64}\"}}"), format!("{{\"colorProfileData\":\"{want}\"}}")), - (format!("{{\"colorProfileData\" : \n\t\"{b64}\"}}"), format!("{{\"colorProfileData\" : \n\t\"{want}\"}}")), - (format!("{{\"colorProfileData\":\"{}\"}}", b64.replace('/', "\\/")), format!("{{\"colorProfileData\":\"{want}\"}}")), - (format!("{{"colorProfileData": "{b64}"}}"), format!("{{"colorProfileData": "{want}"}}")), - ] { - let (out, tally) = stubbed(before.as_bytes()); - assert_eq!(String::from_utf8(out).unwrap(), after); - assert_eq!((tally.stubbed, tally.failed.len()), (1, 0)); - } - } - - #[test] - fn a_raw_profile_in_aepx_hex_is_replaced_and_other_hex_kept() { - let hex = String::from_utf8(hex_encode(&profile("Rec.709 Gamma 2.4"), false)).unwrap(); - let want = String::from_utf8(hex_encode(&stub("Rec.709 Gamma 2.4").unwrap(), false)).unwrap(); - let text = format!("", "ab".repeat(200)); - let (out, tally) = stubbed(text.as_bytes()); - assert_eq!(String::from_utf8(out).unwrap(), format!("", "ab".repeat(200))); - assert_eq!((tally.stubbed, tally.failed.len()), (1, 0)); - // Upper-case hex stays upper case. - let (out, _) = stubbed(format!("bdata=\"{}\"", hex.to_uppercase()).as_bytes()); - assert_eq!(String::from_utf8(out).unwrap(), format!("bdata=\"{}\"", want.to_uppercase())); - } - - #[test] - fn a_profile_that_cannot_be_replaced_is_a_failure_not_a_silent_copy() { - // An ICC header whose tag table has no `desc`. - let mut p = profile("x"); - p[132..136].copy_from_slice(b"wtpt"); - let (_, tally) = stubbed(format!("\"colorProfileData\":\"{}\"", String::from_utf8(b64_encode(&p)).unwrap()).as_bytes()); - assert_eq!((tally.stubbed, tally.failed.len()), (0, 1)); - let (_, tally) = stubbed(b"\"colorProfileData\":\"not*base64\""); - assert_eq!(tally.failed.len(), 1); - // A short value holds no profile: kept and counted, not a failure. - let (out, tally) = stubbed(b"\"colorProfileData\":\"AAAA\""); - assert_eq!((out.as_slice(), tally.kept_short, tally.failed.len()), (&b"\"colorProfileData\":\"AAAA\""[..], 1, 0)); - } -} diff --git a/crates/aep/src/container.rs b/crates/aep/src/container.rs index 531d74843..d9dbcfb14 100644 --- a/crates/aep/src/container.rs +++ b/crates/aep/src/container.rs @@ -1,61 +1,7 @@ -//! After Effects project (`.aep`) container reader and writer. -//! -//! An `.aep` is a `RIFX` container (big-endian RIFF) with form type `Egg!`. This crate reads it -//! into a lossless chunk tree ([`AepFile`]) and writes it back byte for byte. The XML form of a -//! project (`.aepx`) is read into the same tree by [`read_aepx`]; [`parse_any`] picks the reader -//! by content. See -//! `docs/aep-format.md` for the observed format and how it was established (clean room: only -//! files we generated ourselves, one change per file). -//! -//! [`Project::new`] opens a typed, read-only view over the tree: items, compositions -//! ([`CompHeader`]), layers ([`LayerHeader`], [`Transform`], effects, masks, text documents, -//! markers), properties, keyframes and footage. Only fields whose layout was verified against the -//! values the test files were made with are decoded; every accessor returns `None` (or an empty -//! list) on damaged data instead of failing. +//! The `.aep` / `.aepx` container and its typed view come from `craft-aep`; only the tables that map +//! After Effects effects and layer styles onto EffectCraft's are kept here. -mod aepx; -mod arbitrary; -mod bytes; -mod camera; -mod chunk; pub mod effect_map; -mod effects; -mod error; -mod footage; -mod header; -mod keys; -mod masks; -mod matte; -mod read; -mod settings; -mod shapes; pub mod style_map; -mod textdoc; -mod typed; -mod values; -mod version; -mod write; -pub use aepx::{is_aepx, parse_any, read_aepx, read_aepx_with_limits}; -pub use arbitrary::{ - CURVE_IDENTITY, CryptomatteData, CurvesData, ExtractorChannels, HueSaturationData, LevelsData, MeshData, curve_lut, identifier_channel_type, -}; -pub use camera::{CameraPosition, DEFAULT_CAMERA_ZOOM}; -pub use chunk::{AepFile, Body, Chunk, LIST, NESTED_IDS, Walk}; -pub use effects::{DefinitionSource, Effect, EffectDefinitions, EffectParam, LayerRef, ParamKind, ParamValue}; -pub use error::AepError; -pub use footage::{Footage, SequenceInfo}; -pub use header::{BlendMode, CompHeader, LayerHeader, LayerType, LightType, Quality, Rational, Renderer}; -pub use keys::{ExpressionFlags, Interpolation, KeyEase, KeyframeKind, SpatialKey}; -pub use masks::{Mask, MaskAtom, MaskMode, PathVertex, ShapePath}; -pub use matte::{MatteMode, TrackMatte}; -pub use read::{Limits, parse, parse_with_limits}; -pub use settings::{ProjectSettings, TimeDisplay, WorkingSpace}; -pub use shapes::{GradientType, PolystarType, ShapeDetail, ShapeGroup, ShapeItem, Stroke, StrokeCap, StrokeJoin}; -pub use textdoc::{ - AutoKern, Caps, CueType, FontBaseline, Justification, KernRun, Marker, ParagraphRun, StyleRun, TextBox, TextDocument, TextValue, parse_text_dict, -}; -pub use typed::{Comp, Item, ItemKind, KeyLayout, KeyList, Keyframe, Layer, ListHeader, Project, PropEntry, PropGroup, PropNode, Property, TimeBase}; -pub use values::{Orientation, OrientationKey, TimeRemap, TimeRemapKey, Tracked, Transform, ValueSource}; -pub use version::AeVersion; -pub use write::{write, write_to}; +pub use craft_aep::*; diff --git a/crates/aep/src/container/aepx.rs b/crates/aep/src/container/aepx.rs deleted file mode 100644 index a45cbae1d..000000000 --- a/crates/aep/src/container/aepx.rs +++ /dev/null @@ -1,640 +0,0 @@ -//! Reading the XML form of a project (`.aepx`) into the same chunk tree as an `.aep`. -//! -//! An `.aepx` is the `RIFX` chunk tree written as XML: one element per chunk, named by the chunk -//! id (or the list type of a `LIST`), with the body as hex in a `bdata` attribute. A few chunks -//! are written as text instead (`Utf8` as ``, the numbers `numS` and `ppSn`, the footage -//! alias `alas` as ``), and the XMP packet that follows the container of an `.aep` -//! is the element ``. The mapping, with the cases it was found on, is in -//! `docs/aep-format.md` (section 1.1). -//! -//! The reader is a small XML tokenizer for exactly that subset: elements, attributes, text, the -//! five predefined entities and character references, CDATA, comments and processing -//! instructions. A document type declaration is refused (no entity expansion). It runs without -//! recursion; the nesting depth and the element count are bounded by [`Limits`], and everything -//! it allocates is bounded by the size of the input. - -use std::borrow::Cow; - -use crate::container::chunk::{AepFile, Body, Chunk, LIST, NESTED_IDS}; -use crate::container::error::AepError; -use crate::container::read::{Limits, parse}; - -/// The root element of an `.aepx`. -const ROOT: &[u8] = b"AfterEffectsProject"; -/// The element that holds the XMP packet (the trailer of an `.aep`). -const XMP: &[u8] = b"ProjectXMPMetadata"; -/// The element of a `Utf8` chunk. -const STRING: &[u8] = b"string"; -/// The element of an `alas` chunk (footage alias), written as attributes instead of JSON. -const FILE_REFERENCE: &[u8] = b"fileReference"; - -/// List types whose body is not a chunk sequence: the `.aepx` writes them like data chunks (with -/// `bdata`), the `.aep` as an opaque `LIST`. -const OPAQUE_LIST_TYPES: [[u8; 4]; 1] = [*b"btdk"]; - -/// True when `data` looks like an `.aepx`: optional UTF-8 byte order mark and white space, then -/// an XML declaration or the `AfterEffectsProject` root element. -pub fn is_aepx(data: &[u8]) -> bool { - let rest = data.strip_prefix(&[0xef, 0xbb, 0xbf][..]).unwrap_or(data); - let start = rest.iter().position(|b| !b.is_ascii_whitespace()).unwrap_or(rest.len()); - let rest = rest.get(start..).unwrap_or(&[]); - rest.starts_with(b" Result, AepError> { - if is_aepx(data) { read_aepx(data) } else { parse(data) } -} - -/// Reads an `.aepx` with the default [`Limits`] into the chunk tree an `.aep` of the same project -/// gives. -/// -/// # Errors -/// [`AepError::Xml`] for input that is not well-formed XML of the `.aepx` subset (bad UTF-8, an -/// unknown entity, an unclosed or mismatched tag, invalid or odd-length hex, a number that does -/// not parse, a document type declaration, a root element other than `AfterEffectsProject`); -/// [`AepError::TooDeep`] / [`AepError::TooManyChunks`] beyond the limits. -pub fn read_aepx(data: &[u8]) -> Result, AepError> { - read_aepx_with_limits(data, Limits::default()) -} - -/// Like [`read_aepx`] with explicit [`Limits`]: `max_depth` bounds the element nesting (the root -/// element's children are depth 1), `max_chunks` the number of elements. -/// -/// # Errors -/// See [`read_aepx`]. -pub fn read_aepx_with_limits(data: &[u8], limits: Limits) -> Result, AepError> { - let text = match std::str::from_utf8(data) { - Ok(t) => t.as_bytes(), - Err(e) => return Err(xml(e.valid_up_to(), "the file is not valid UTF-8")), - }; - Reader { data: text, pos: 0, limits, count: 0, stack: Vec::new(), top: None, trailer: None }.run() -} - -fn xml(offset: usize, what: &'static str) -> AepError { - AepError::Xml { offset, what } -} - -/// What an open element becomes when it closes. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum Kind { - /// The root element: its children are the top-level chunks. - Root, - /// A chunk with this id (or a `LIST` with this list type). - Chunk([u8; 4]), - /// A `Utf8` chunk. - Utf8, - /// An `alas` chunk built from the attributes. - Alias, - /// The XMP packet (only directly below the root). - Xmp, - /// An element without a chunk counterpart (a name that is no chunk id); skipped with its content. - Skip, -} - -struct Frame { - kind: Kind, - /// Offset of the start tag (for errors). - at: usize, - /// The name as written, to match the end tag. - name: (usize, usize), - /// The decoded `bdata` attribute. - bdata: Option>, - /// The attributes of a `fileReference`, in document order. - attrs: Vec<(String, String)>, - /// Collected text (only for `string` and the XMP packet). - text: Vec, - children: Vec>, -} - -struct Reader<'d> { - data: &'d [u8], - pos: usize, - limits: Limits, - count: usize, - stack: Vec, - /// The top-level chunks once the root element has closed. - top: Option>>, - trailer: Option>, -} - -impl Reader<'_> { - fn run(mut self) -> Result, AepError> { - if self.data.starts_with(&[0xef, 0xbb, 0xbf]) { - self.pos = 3; - } - while self.pos < self.data.len() { - if self.rest().starts_with(b"<") { - self.markup()?; - } else { - self.text()?; - } - } - if let Some(open) = self.stack.last() { - return Err(xml(open.at, "an element is not closed before the end of the file")); - } - let chunks = self.top.ok_or_else(|| xml(self.data.len(), "no AfterEffectsProject root element"))?; - Ok(AepFile { chunks, trailer: Cow::Owned(self.trailer.unwrap_or_default()) }) - } - - fn rest(&self) -> &[u8] { - self.data.get(self.pos..).unwrap_or(&[]) - } - - /// The offset of `needle` at or after `from`. - fn find(&self, from: usize, needle: &[u8]) -> Option { - let hay = self.data.get(from..)?; - if needle.is_empty() || hay.len() < needle.len() { - return None; - } - let first = *needle.first()?; - let mut i = 0; - while let Some(p) = hay.get(i..)?.iter().position(|b| *b == first) { - let at = i.checked_add(p)?; - if hay.get(at..)?.starts_with(needle) { - return from.checked_add(at); - } - i = at.checked_add(1)?; - } - None - } - - /// Skips to just after `close`, which must follow. - fn skip_past(&mut self, close: &[u8], what: &'static str) -> Result { - let at = self.find(self.pos, close).ok_or(xml(self.pos, what))?; - self.pos = at.saturating_add(close.len()); - Ok(at) - } - - fn markup(&mut self) -> Result<(), AepError> { - let rest = self.rest(); - if rest.starts_with(b"", "a processing instruction is not closed")?; - } else if rest.starts_with(b"", "a comment is not closed")?; - } else if rest.starts_with(b"", "a CDATA section is not closed")?; - let content = self.data.get(start..end).unwrap_or(&[]); - let at = start; - match self.stack.last_mut() { - Some(frame) => { - if matches!(frame.kind, Kind::Utf8 | Kind::Xmp) { - frame.text.extend_from_slice(content); - } - } - None => return Err(xml(at, "CDATA outside the root element")), - } - } else if rest.starts_with(b" bool { - !(b.is_ascii_whitespace() || matches!(b, b'<' | b'>' | b'/' | b'=' | b'"' | b'\'' | b'&')) - } - - fn name(&mut self) -> Result<(usize, usize), AepError> { - let start = self.pos; - let len = self.rest().iter().position(|b| !Self::is_name_byte(*b)).unwrap_or(self.rest().len()); - if len == 0 { - return Err(xml(start, "a tag or attribute has no name")); - } - self.pos = start.saturating_add(len); - Ok((start, self.pos)) - } - - fn skip_ws(&mut self) { - let n = self.rest().iter().position(|b| !b.is_ascii_whitespace()).unwrap_or(self.rest().len()); - self.pos = self.pos.saturating_add(n); - } - - fn slice(&self, (a, b): (usize, usize)) -> &[u8] { - self.data.get(a..b).unwrap_or(&[]) - } - - fn start_tag(&mut self) -> Result<(), AepError> { - let at = self.pos; - self.pos = self.pos.saturating_add(1); - let name = self.name()?; - let mut attrs: Vec<((usize, usize), Vec)> = Vec::new(); - let self_closing = loop { - self.skip_ws(); - let rest = self.rest(); - if rest.starts_with(b"/>") { - self.pos = self.pos.saturating_add(2); - break true; - } - if rest.starts_with(b">") { - self.pos = self.pos.saturating_add(1); - break false; - } - if rest.is_empty() { - return Err(xml(at, "a start tag is not closed")); - } - let key = self.name()?; - self.skip_ws(); - if !self.rest().starts_with(b"=") { - return Err(xml(self.pos, "an attribute has no value")); - } - self.pos = self.pos.saturating_add(1); - self.skip_ws(); - let quote = *self.rest().first().ok_or(xml(self.pos, "a start tag is not closed"))?; - if quote != b'"' && quote != b'\'' { - return Err(xml(self.pos, "an attribute value is not quoted")); - } - let vstart = self.pos.saturating_add(1); - let vend = self.find(vstart, &[quote]).ok_or(xml(vstart, "an attribute value is not closed"))?; - let raw = self.data.get(vstart..vend).unwrap_or(&[]); - if raw.contains(&b'<') { - return Err(xml(vstart, "`<` inside an attribute value")); - } - let mut value = Vec::new(); - decode_entities(raw, vstart, &mut value)?; - self.pos = vend.saturating_add(1); - attrs.push((key, value)); - }; - let kind = self.kind_of(name, at)?; - if kind != Kind::Root { - self.count = self.count.saturating_add(1); - if self.count > self.limits.max_chunks { - return Err(AepError::TooManyChunks); - } - // The root's children are depth 1, like the top-level chunks of an `.aep`. - if self.stack.len() > self.limits.max_depth { - return Err(AepError::TooDeep); - } - } - let mut frame = Frame { kind, at, name, bdata: None, attrs: Vec::new(), text: Vec::new(), children: Vec::new() }; - if matches!(kind, Kind::Chunk(_)) { - if let Some((key, value)) = attrs.iter().find(|(k, _)| self.slice(*k) == b"bdata") { - frame.bdata = Some(decode_hex(value, key.1)?); - } - } else if kind == Kind::Alias { - frame.attrs = attrs.iter().map(|(k, v)| (String::from_utf8_lossy(self.slice(*k)).into_owned(), String::from_utf8_lossy(v).into_owned())).collect(); - } - self.stack.push(frame); - if self_closing { - self.close()?; - } - Ok(()) - } - - /// Classifies an element by its name and where it is. - fn kind_of(&self, name: (usize, usize), at: usize) -> Result { - let n = self.slice(name); - let parent = match self.stack.last() { - None => { - if self.top.is_some() { - return Err(xml(at, "a second root element")); - } - if n != ROOT { - return Err(xml(at, "the root element is not AfterEffectsProject")); - } - return Ok(Kind::Root); - } - Some(p) => p.kind, - }; - Ok(match parent { - Kind::Skip | Kind::Utf8 | Kind::Xmp | Kind::Alias => Kind::Skip, - Kind::Root | Kind::Chunk(_) => { - if n == STRING { - Kind::Utf8 - } else if n == FILE_REFERENCE { - Kind::Alias - } else if n == XMP && parent == Kind::Root { - Kind::Xmp - } else if let Some(id) = chunk_id(n) { - Kind::Chunk(id) - } else { - Kind::Skip - } - } - }) - } - - fn end_tag(&mut self) -> Result<(), AepError> { - let at = self.pos; - self.pos = self.pos.saturating_add(2); - let name = self.name()?; - self.skip_ws(); - if !self.rest().starts_with(b">") { - return Err(xml(at, "an end tag is not closed")); - } - self.pos = self.pos.saturating_add(1); - let open = self.stack.last().ok_or(xml(at, "an end tag without a start tag"))?; - if self.slice(open.name) != self.slice(name) { - return Err(xml(at, "an end tag does not match its start tag")); - } - self.close() - } - - /// Closes the innermost element and hands its chunk to the parent. - fn close(&mut self) -> Result<(), AepError> { - let frame = self.stack.pop().ok_or(xml(self.pos, "an end tag without a start tag"))?; - let chunk = match frame.kind { - Kind::Root => { - self.top = Some(frame.children); - return Ok(()); - } - Kind::Skip => return Ok(()), - Kind::Xmp => { - if self.trailer.is_none() { - self.trailer = Some(frame.text); - } - return Ok(()); - } - Kind::Utf8 => Chunk::data(*b"Utf8", frame.text), - Kind::Alias => Chunk::data(*b"alas", alias_json(&frame.attrs).into_bytes()), - Kind::Chunk(id) => chunk_of(id, frame)?, - }; - if let Some(parent) = self.stack.last_mut() { - parent.children.push(chunk); - } - Ok(()) - } - - fn text(&mut self) -> Result<(), AepError> { - let start = self.pos; - let len = self.rest().iter().position(|b| *b == b'<').unwrap_or(self.rest().len()); - let end = start.saturating_add(len); - self.pos = end; - let raw = self.data.get(start..end).unwrap_or(&[]); - match self.stack.last_mut() { - Some(frame) if matches!(frame.kind, Kind::Utf8 | Kind::Xmp) => decode_entities(raw, start, &mut frame.text), - Some(_) => Ok(()), - None if raw.iter().all(u8::is_ascii_whitespace) => Ok(()), - None => Err(xml(start, "text outside the root element")), - } - } -} - -/// The chunk id of an element name: 1 to 4 printable ASCII bytes, padded with spaces (`Pin` is -/// the list type `Pin `). -fn chunk_id(name: &[u8]) -> Option<[u8; 4]> { - if name.is_empty() || name.len() > 4 || !name.iter().all(|b| b.is_ascii_graphic()) { - return None; - } - let mut id = [b' '; 4]; - for (d, s) in id.iter_mut().zip(name) { - *d = *s; - } - Some(id) -} - -/// The chunk of a closed element named by a chunk id. -fn chunk_of(id: [u8; 4], frame: Frame) -> Result, AepError> { - if let Some(bytes) = frame.bdata { - if OPAQUE_LIST_TYPES.contains(&id) { - let pad = if bytes.len() % 2 == 1 { Some(0) } else { None }; - return Ok(Chunk { id: LIST, body: Body::OpaqueList { list_type: id, data: Cow::Owned(bytes) }, pad }); - } - return Ok(Chunk::data(id, bytes)); - } - // Numbers written as text: `0` and `150.000000000`. - if &id == b"numS" || &id == b"ppSn" { - let text = match frame.children.as_slice() { - [only] if only.is(b"Utf8") => only.bytes().unwrap_or(&[]), - _ => return Err(xml(frame.at, "a numS or ppSn element without its number")), - }; - let text = std::str::from_utf8(text).map_err(|_| xml(frame.at, "a number is not text"))?.trim(); - let body = if &id == b"numS" { - // Only `0` is sampled, so whether the field is signed is open: accept both readings of 4 bytes. - let n = text.parse::().ok().filter(|n| (i64::from(i32::MIN)..=i64::from(u32::MAX)).contains(n)); - let n = n.ok_or(xml(frame.at, "numS is not a 32-bit integer"))?; - (n as u32).to_be_bytes().to_vec() - } else { - text.parse::().map_err(|_| xml(frame.at, "ppSn is not a number"))?.to_be_bytes().to_vec() - }; - return Ok(Chunk::data(id, body)); - } - if NESTED_IDS.contains(&id) { - if frame.children.is_empty() { - return Ok(Chunk::data(id, Vec::new())); - } - return Ok(Chunk { id, body: Body::Chunks(frame.children), pad: None }); - } - Ok(Chunk::list(id, frame.children)) -} - -/// Appends `raw` with the predefined entities and character references decoded. -fn decode_entities(raw: &[u8], offset: usize, out: &mut Vec) -> Result<(), AepError> { - let mut i = 0; - while let Some(rest) = raw.get(i..) { - let Some(amp) = rest.iter().position(|b| *b == b'&') else { - out.extend_from_slice(rest); - break; - }; - out.extend_from_slice(rest.get(..amp).unwrap_or(&[])); - let at = offset.saturating_add(i).saturating_add(amp); - let after = rest.get(amp.saturating_add(1)..).unwrap_or(&[]); - let semi = after.iter().take(12).position(|b| *b == b';').ok_or(xml(at, "an entity is not terminated"))?; - let name = after.get(..semi).unwrap_or(&[]); - let ch = match name { - b"amp" => '&', - b"lt" => '<', - b"gt" => '>', - b"quot" => '"', - b"apos" => '\'', - _ => { - let code = if let Some(hex) = name.strip_prefix(b"#x").or_else(|| name.strip_prefix(b"#X")) { - std::str::from_utf8(hex).ok().and_then(|h| u32::from_str_radix(h, 16).ok()) - } else if let Some(dec) = name.strip_prefix(b"#") { - std::str::from_utf8(dec).ok().and_then(|d| d.parse::().ok()) - } else { - return Err(xml(at, "an unknown entity")); - }; - code.filter(|c| *c != 0).and_then(char::from_u32).ok_or(xml(at, "an invalid character reference"))? - } - }; - let mut buf = [0u8; 4]; - out.extend_from_slice(ch.encode_utf8(&mut buf).as_bytes()); - i = i.saturating_add(amp).saturating_add(semi).saturating_add(2); - } - Ok(()) -} - -/// Decodes a `bdata` value (hex digits, two per byte). -fn decode_hex(text: &[u8], offset: usize) -> Result, AepError> { - if text.len() % 2 == 1 { - return Err(xml(offset, "bdata has an odd number of hex digits")); - } - let digit = |b: u8| match b { - b'0'..=b'9' => Some(b - b'0'), - b'a'..=b'f' => Some(b - b'a' + 10), - b'A'..=b'F' => Some(b - b'A' + 10), - _ => None, - }; - let (pairs, _) = text.as_chunks::<2>(); - pairs - .iter() - .map(|[hi, lo]| digit(*hi).zip(digit(*lo)).map(|(h, l)| (h << 4) | l)) - .collect::>>() - .ok_or(xml(offset, "bdata holds a character that is not a hex digit")) -} - -/// The JSON body of an `alas` chunk from the attributes of a `fileReference`, keys in document -/// order (alphabetical in every sample, as in the `.aep`): the two `ascendcount_*` values as -/// numbers, `platform` `Win` as `1`, `target_is_folder` `0` / `1` as `false` / `true`, everything -/// else as a string. -fn alias_json(attrs: &[(String, String)]) -> String { - let mut out = String::from("{"); - for (i, (key, value)) in attrs.iter().enumerate() { - if i > 0 { - out.push(','); - } - json_str(&mut out, key); - out.push(':'); - let number = value.parse::().ok(); - match (key.as_str(), value.as_str()) { - ("ascendcount_base" | "ascendcount_target", _) if number.is_some() => out.push_str(value), - ("platform", "Win") => out.push('1'), - ("platform", _) if number.is_some() => out.push_str(value), - ("target_is_folder", "0" | "false") => out.push_str("false"), - ("target_is_folder", "1" | "true") => out.push_str("true"), - _ => json_str(&mut out, value), - } - } - out.push('}'); - out -} - -fn json_str(out: &mut String, s: &str) { - out.push('"'); - for c in s.chars() { - match c { - '"' => out.push_str("\\\""), - '\\' => out.push_str("\\\\"), - '\n' => out.push_str("\\n"), - '\r' => out.push_str("\\r"), - '\t' => out.push_str("\\t"), - c if u32::from(c) < 0x20 => out.push_str(&format!("\\u{:04x}", u32::from(c))), - c => out.push(c), - } - } - out.push('"'); -} - -#[cfg(test)] -mod tests { - use super::*; - - fn doc(body: &str) -> String { - format!("\n{body}\n") - } - - #[test] - fn maps_elements_to_chunks() { - let x = doc(concat!( - "\n", - "A & BA-3", - "150.000000000x", - "]]>" - )); - let f = read_aepx(x.as_bytes()).unwrap(); - assert_eq!(f.trailer.as_ref(), b""); - let ids: Vec<_> = f.chunks.iter().map(|c| (c.id, c.list_type())).collect(); - assert_eq!( - ids, - vec![ - (*b"head", None), - (LIST, Some(*b"Pin ")), - (LIST, Some(*b"Pefl")), - (*b"tdsn", None), - (*b"numS", None), - (*b"ppSn", None), - (LIST, Some(*b"btdk")) - ] - ); - assert_eq!(f.chunks[1].children()[0].bytes(), Some(&[1u8][..])); - assert_eq!(f.chunks[1].children()[0].pad, Some(0)); - assert_eq!(f.chunks[3].children()[0].bytes(), Some(&b"A & BA"[..])); - assert_eq!(f.chunks[4].bytes(), Some(&(-3i32).to_be_bytes()[..])); - assert_eq!(f.chunks[5].bytes(), Some(&150f64.to_be_bytes()[..])); - assert_eq!(f.chunks[6].bytes(), Some(&b"ABC"[..])); - // The tree writes as a valid `.aep` that parses back to itself. - let bin = crate::container::write(&f).unwrap(); - assert_eq!(parse(&bin).unwrap(), f); - } - - #[test] - fn file_reference_becomes_alias_json() { - let x = doc(concat!( - "" - )); - let f = read_aepx(x.as_bytes()).unwrap(); - let alas = f.chunks[0].children()[0].bytes().unwrap(); - assert_eq!( - std::str::from_utf8(alas).unwrap(), - r#"{"ascendcount_base":1,"ascendcount_target":1,"fullpath":"C:\\a\\\"b.png","platform":1,"server_name":"N","server_volume_name":"V","target_is_folder":false}"# - ); - } - - #[test] - fn nums_takes_signed_and_unsigned_32_bit_values() { - for (text, bytes) in [("-2147483648", [0x80, 0, 0, 0]), ("4294967295", [0xff; 4]), (" 7 ", [0, 0, 0, 7])] { - let f = read_aepx(doc(&format!("{text}")).as_bytes()).unwrap(); - assert_eq!(f.chunks[0].bytes(), Some(&bytes[..]), "{text}"); - } - for text in ["-2147483649", "4294967296", "1.5"] { - assert!(read_aepx(doc(&format!("{text}")).as_bytes()).is_err(), "{text}"); - } - } - - #[test] - fn detection() { - assert!(is_aepx(b"\xef\xbb\xbf ")); - assert!(is_aepx(b"")); - assert!(!is_aepx(b"RIFX\0\0\0\x04Egg!")); - assert!(parse_any(b"RIFX\0\0\0\x04Egg!").is_ok()); - assert!(parse_any(doc("").as_bytes()).is_ok()); - } - - #[test] - fn bad_input_is_an_error() { - let bad = [ - doc(""), - doc(""), - doc(" "), - doc("�"), - doc("&"), - doc(""), - doc(""), - doc("x"), - doc(""), - doc(""), - doc(""), - "]>".into(), - "".into(), - "".into(), - "".into(), - "junk".into(), - ""); - } else if rest.starts_with(b""); - } else if rest.starts_with(b""); - } else if rest.starts_with(b""); - } else if rest.starts_with(b""); - } else { - // A start tag: find its end outside quotes; `/>` closes it at once. - let mut j = i + 1; - let mut quote = None; - while let Some(&c) = b.get(j) { - match quote { - Some(q) if c == q => quote = None, - Some(_) => {} - None if c == b'"' || c == b'\'' => quote = Some(c), - None if c == b'>' => break, - None => {} - } - j += 1; - } - if b.get(j.wrapping_sub(1)) != Some(&b'/') { - depth += 1; - max = max.max(depth); - } - i = j + 1; - } - } - max -} - /// Nodes a document may expand to: a few kilobytes of nested internal entities /// (``) otherwise expand to millions and exhaust memory. const MAX_XML_NODES: u32 = 4_000_000; @@ -1292,7 +1243,7 @@ const MAX_XML_NODES: u32 = 4_000_000; pub fn parse(bytes: &[u8]) -> Result { let text = String::from_utf8_lossy(bytes); let text = text.trim_start_matches('\u{feff}'); - if xml_depth(text) > MAX_XML_DEPTH { + if craft_svg::guard::deeper_than(text, MAX_XML_DEPTH) { return Err(Error::Xml(format!("elements nested more than {MAX_XML_DEPTH} levels deep"))); } // DTDs stay allowed (Illustrator's SVGs declare entities), but expansion is bounded (#2129). diff --git a/crates/svg/src/tests.rs b/crates/svg/src/tests.rs index 2d44d6d31..7d0e24001 100644 --- a/crates/svg/src/tests.rs +++ b/crates/svg/src/tests.rs @@ -208,6 +208,8 @@ fn malformed_input() { assert_eq!(d.skipped, vec!["text".to_string()]); assert!(looks_like_svg(BASIC)); assert!(!looks_like_svg(b"\x89PNG")); + // The first element must be the `svg`: an HTML page with an inline SVG is not one. + assert!(!looks_like_svg(b"")); } #[test] @@ -245,7 +247,7 @@ fn deep_nesting_errors_instead_of_overflowing_the_stack() { "".repeat(1000), "".repeat(1000) ); - assert_eq!(crate::xml_depth(&s), 2); + assert!(!craft_svg::guard::deeper_than(&s, 2) && craft_svg::guard::deeper_than(&s, 1)); assert!(crate::parse(s.as_bytes()).is_ok()); } diff --git a/docs/testing.md b/docs/testing.md index 4c5bfddcb..dbbca2cb3 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -20,6 +20,9 @@ cargo xtask aep-corpus EFFECTCRAFT_AEP_FIXTURES=corpus/aep EFFECTCRAFT_AEP_FIXTURES_REQUIRED=1 cargo test -p effectcraft-aep ``` +The container and typed-view tests are in `craft-aep` ([storytold/craft-libs](https://github.com/storytold/craft-libs)), +which reads the same corpus from `CRAFT_AEP_FIXTURES` (and `CRAFT_AEP_FIXTURES_REQUIRED`). + The `dev` profile keeps debug info to line tables (fast builds, readable backtraces). To debug interactively — local variables, parameters, column breakpoints — build with the `dev-full` profile: `cargo run --profile dev-full -p effectcraft -- --demo` (see `CONTRIBUTING.md`). diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index beb1e0cc9..58ef9bcc7 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4"; +const REV: &str = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639"; const PACKAGES: &[(&str, &str)] = &[("craft-pdf", "0.1.0"), ("hayro-syntax", "0.7.2"), ("hayro-jbig2", "0.3.0")]; pub fn run(root: &Path) -> Result<(), String> { From 3e1965e274cb5741aa815c5971938eb87fc960dd Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 12 Nov 2026 05:34:09 +0000 Subject: [PATCH 2/7] Dependencies: pin craft-libs at current main --- Cargo.lock | 132 ++++++++++++++++++++++++++++++------ Cargo.toml | 42 ++++++------ crates/lottie/src/anim.rs | 2 +- crates/lottie/src/import.rs | 12 ++-- crates/lottie/src/shapes.rs | 22 +++++- crates/lottie/src/text.rs | 4 +- crates/media/src/dpx.rs | 11 ++- crates/model/src/lib.rs | 2 +- crates/model/src/scene.rs | 3 +- crates/model/src/tests.rs | 1 - crates/pdf/README.md | 2 +- xtask/src/pdf_deps.rs | 2 +- 12 files changed, 175 insertions(+), 60 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 319a0a63c..3def04dfc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1092,41 +1092,67 @@ dependencies = [ [[package]] name = "craft-aep" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb)", "thiserror 2.0.21", ] [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" + +[[package]] +name = "craft-dpx" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +dependencies = [ + "thiserror 2.0.21", +] [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" dependencies = [ "serde", "serde_json", "thiserror 2.0.21", ] +[[package]] +name = "craft-eps" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" + +[[package]] +name = "craft-exr" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +dependencies = [ + "serde_json", +] + [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" + +[[package]] +name = "craft-gif" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" dependencies = [ "fixed_decimal", "icu_decimal", @@ -1146,10 +1172,19 @@ dependencies = [ "writeable", ] +[[package]] +name = "craft-lottie" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +dependencies = [ + "serde_json", + "thiserror 2.0.21", +] + [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" dependencies = [ "thiserror 2.0.21", ] @@ -1162,19 +1197,39 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-mesh" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +dependencies = [ + "miniz_oxide 0.9.1", + "serde_json", +] + [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" dependencies = [ "hayro-syntax", "thiserror 2.0.21", ] +[[package]] +name = "craft-psd" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +dependencies = [ + "encoding_rs", + "flate2", + "rayon", + "thiserror 2.0.21", +] + [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" dependencies = [ "dispatch2", "egui", @@ -1182,10 +1237,22 @@ dependencies = [ "objc2-app-kit 0.3.2", ] +[[package]] +name = "craft-svg" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +dependencies = [ + "craft-xml", + "flate2", + "kurbo", + "roxmltree", + "thiserror 2.0.21", +] + [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" dependencies = [ "craft-fonts-build", "craft-i18n", @@ -1206,7 +1273,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" dependencies = [ "chrono", "dunce", @@ -1233,13 +1300,30 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb)", "rayon", "thiserror 2.0.21", ] +[[package]] +name = "craft-webp" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +dependencies = [ + "thiserror 2.0.21", +] + +[[package]] +name = "craft-xml" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +dependencies = [ + "quick-xml 0.41.0", + "thiserror 2.0.21", +] + [[package]] name = "crc32fast" version = "1.5.2" @@ -1597,7 +1681,7 @@ name = "effectcraft-export" version = "0.24.1" dependencies = [ "craft-audio", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb)", "craft-video", "effectcraft-color", "effectcraft-effects", @@ -1743,6 +1827,7 @@ name = "effectcraft-lottie" version = "0.24.1" dependencies = [ "craft-docpath", + "craft-lottie", "effectcraft-color", "effectcraft-effects", "effectcraft-keyframe", @@ -1762,7 +1847,11 @@ version = "0.24.1" dependencies = [ "craft-audio", "craft-docpath", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639)", + "craft-dpx", + "craft-exr", + "craft-gif", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb)", + "craft-webp", "effectcraft-color", "effectcraft-effects", "effectcraft-model", @@ -1793,12 +1882,11 @@ dependencies = [ name = "effectcraft-model" version = "0.24.1" dependencies = [ + "craft-mesh", "effectcraft-geom", "image", "log", - "miniz_oxide 0.9.1", "serde", - "serde_json", "thiserror 2.0.21", ] @@ -1825,6 +1913,7 @@ dependencies = [ name = "effectcraft-pdf" version = "0.24.1" dependencies = [ + "craft-eps", "craft-pdf", "effectcraft-raster", "effectcraft-svg", @@ -1867,6 +1956,7 @@ dependencies = [ name = "effectcraft-psd" version = "0.24.1" dependencies = [ + "craft-psd", "miniz_oxide 0.9.1", ] @@ -1874,6 +1964,7 @@ dependencies = [ name = "effectcraft-raster" version = "0.24.1" dependencies = [ + "craft-exr", "effectcraft-color", "effectcraft-geom", "rayon", @@ -1949,6 +2040,7 @@ dependencies = [ name = "effectcraft-svg" version = "0.24.1" dependencies = [ + "craft-svg", "effectcraft-geom", "effectcraft-path", "effectcraft-raster", @@ -3328,7 +3420,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" dependencies = [ "hayro-ccitt", ] @@ -3342,7 +3434,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=c31fc02ab9867ce3a8312b40cb6a8eae85cff639#c31fc02ab9867ce3a8312b40cb6a8eae85cff639" +source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index 70782c345..018ec6848 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,22 +11,22 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } -craft-quit = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } -craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } -craft-eps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } -craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } -craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } -craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } -craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } -craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } -craft-lottie = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } -craft-mesh = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } -craft-aep = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } +craft-quit = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } +craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } +craft-eps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } +craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } +craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } +craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } +craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } +craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } +craft-lottie = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } +craft-mesh = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } # 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 = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", features = ["egui"] } +craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", features = ["egui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -90,9 +90,9 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all three on one rev. -craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", default-features = false, features = ["isobmff", "matroska"] } -craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", default-features = false, features = ["aac-decode", "aac-encode", "opus-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", features = ["h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", default-features = false, features = ["isobmff", "matroska"] } +craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", default-features = false, features = ["aac-decode", "aac-encode", "opus-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", features = ["h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -122,7 +122,7 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", features = ["serde"] } +craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", features = ["serde"] } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -231,8 +231,8 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639", version = "=0.3.0" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", version = "=0.3.0" } 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" } diff --git a/crates/lottie/src/anim.rs b/crates/lottie/src/anim.rs index 8a2233459..62550f86f 100644 --- a/crates/lottie/src/anim.rs +++ b/crates/lottie/src/anim.rs @@ -294,7 +294,7 @@ pub(crate) fn to_vec3(j: &Json, z: f64) -> Option { pub(crate) fn to_color(j: &Json) -> Option { // Some files use 0–255: `craft_lottie::color` divides those. - craft_lottie::color(j).map(|c| Value::Color(c.map(|x| x as f32))) + craft_lottie::color(j).map(Value::Color) } pub(crate) fn to_bool(j: &Json) -> Option { diff --git a/crates/lottie/src/import.rs b/crates/lottie/src/import.rs index 7411df4bf..6534727dc 100644 --- a/crates/lottie/src/import.rs +++ b/crates/lottie/src/import.rs @@ -3,6 +3,8 @@ use std::collections::{BTreeMap, HashMap}; use std::sync::Arc; +use craft_lottie::model::{Asset, Effect, Layer as LottieLayer, LayerContent, Mask, Transform}; +use craft_lottie::{Animated, Animation, Json}; use effectcraft_color::Label; use effectcraft_keyframe::{ShapePath, Value}; use effectcraft_project::build::{self, Ids}; @@ -10,8 +12,6 @@ use effectcraft_project::{ AlphaMode, AutoOrient, Comp, Footage, FootageKind, GroupKind, ItemId, ItemKind, Layer, LayerId, LayerSource, Marker, MatteKind, Node, ParamUi, Project, PropGroup, Property, Solid, TrackMatte, }; -use craft_lottie::model::{Asset, Effect, Layer as LottieLayer, LayerContent, Mask, Transform}; -use craft_lottie::{Animated, Animation, Json}; use effectcraft_time::{FrameRate, Tick}; use crate::anim::{self, Im, import_animated, import_prop}; @@ -283,8 +283,12 @@ fn transform(im: &Im, ks: &Transform, tr: &mut PropGroup, next: &mut u64) { // Separated dimensions: X/Y/Z Position after Position. let at = tr.children.iter().position(|c| c.match_id() == "position").map(|i| i + 1).unwrap_or(tr.children.len()); let base = tr.get("position").map(|p| p.value.as_vec3()).unwrap_or([0.0; 3]); - for (d, (j, m, name)) in - dims.iter().zip([("positionX", "X Position"), ("positionY", "Y Position"), ("positionZ", "Z Position")]).map(|(j, (m, n))| (j, m, n)).enumerate().rev() + for (d, (j, m, name)) in dims + .iter() + .zip([("positionX", "X Position"), ("positionY", "Y Position"), ("positionZ", "Z Position")]) + .map(|(j, (m, n))| (j, m, n)) + .enumerate() + .rev() { let mut pr = Property::new(*next, m, name, Value::Scalar(base[d])).with_ui(ParamUi::Number); *next += 1; diff --git a/crates/lottie/src/shapes.rs b/crates/lottie/src/shapes.rs index e41dc4c2c..ab13374e9 100644 --- a/crates/lottie/src/shapes.rs +++ b/crates/lottie/src/shapes.rs @@ -626,7 +626,16 @@ pub(crate) fn import_items<'a>(im: &mut Im, ids: &mut Ids, items: &mut dyn Itera ShapeKind::GradientFill(gf) => { let radial = int(gf.gradient_type, x, "t") == Some(2); let mut g = build::shape_gradient_fill(ids, radial, [0.0, 0.0], [100.0, 0.0], Gradient::default()); - gradient_common(im, &mut g, gf.opacity.as_ref(), gf.start.as_ref(), gf.end.as_ref(), gf.highlight_length.as_ref(), gf.highlight_angle.as_ref(), gf.colors.as_ref()); + gradient_common( + im, + &mut g, + gf.opacity.as_ref(), + gf.start.as_ref(), + gf.end.as_ref(), + gf.highlight_length.as_ref(), + gf.highlight_angle.as_ref(), + gf.colors.as_ref(), + ); if int(gf.rule, x, "r") == Some(2) { set_enum(&mut g, "rule", 1); } @@ -636,7 +645,16 @@ pub(crate) fn import_items<'a>(im: &mut Im, ids: &mut Ids, items: &mut dyn Itera ShapeKind::GradientStroke(gs) => { let radial = int(gs.gradient_type, x, "t") == Some(2); let mut g = build::shape_gradient_stroke(ids, radial, [0.0, 0.0], [100.0, 0.0], Gradient::default(), 2.0); - gradient_common(im, &mut g, gs.opacity.as_ref(), gs.start.as_ref(), gs.end.as_ref(), gs.highlight_length.as_ref(), gs.highlight_angle.as_ref(), gs.colors.as_ref()); + gradient_common( + im, + &mut g, + gs.opacity.as_ref(), + gs.start.as_ref(), + gs.end.as_ref(), + gs.highlight_length.as_ref(), + gs.highlight_angle.as_ref(), + gs.colors.as_ref(), + ); let fields = StrokeIn { width: gs.width.as_ref(), cap: int(gs.cap, x, "lc"), diff --git a/crates/lottie/src/text.rs b/crates/lottie/src/text.rs index a847720b1..2bb17572c 100644 --- a/crates/lottie/src/text.rs +++ b/crates/lottie/src/text.rs @@ -1,7 +1,9 @@ //! Text layers ↔ Lottie text data (`t`: document keys `d`, animators `a`, more options `m`), //! and text converted to glyph shapes. -use craft_lottie::model::{Font, Map, Path, Shape, ShapeKind, TextAlign, TextData, TextDocKey, TextDocs, TextDocument, TextFollowPath, TextRange, TextSelector, TextStyle}; +use craft_lottie::model::{ + Font, Map, Path, Shape, ShapeKind, TextAlign, TextData, TextDocKey, TextDocs, TextDocument, TextFollowPath, TextRange, TextSelector, TextStyle, +}; use craft_lottie::{Animated, Json}; use effectcraft_keyframe::{Justify, TextDoc, Value}; use effectcraft_project::build::{self, Ids}; diff --git a/crates/media/src/dpx.rs b/crates/media/src/dpx.rs index 229e7ae47..17df4bb85 100644 --- a/crates/media/src/dpx.rs +++ b/crates/media/src/dpx.rs @@ -73,11 +73,8 @@ pub(crate) fn probe(path: &str, bytes: &[u8]) -> Result> { let alpha = h.layout.has_alpha(); let mut f = crate::probe::still_footage(path, h.width, h.height, image::ImageFormat::Png, alpha); f.alpha = if alpha { AlphaMode::Straight } else { AlphaMode::Ignore }; - f.pixel_aspect = h - .pixel_aspect - .map(|(x, y)| f64::from(x) / f64::from(y)) - .filter(|a| (0.1..=10.0).contains(a) && h.kind == craft_dpx::Kind::Dpx) - .unwrap_or(1.0); + f.pixel_aspect = + h.pixel_aspect.map(|(x, y)| f64::from(x) / f64::from(y)).filter(|a| (0.1..=10.0).contains(a) && h.kind == craft_dpx::Kind::Dpx).unwrap_or(1.0); let name = if h.kind == craft_dpx::Kind::Dpx { "DPX" } else { "Cineon" }; f.codec = format!("{name} {}-bit {}", h.bits, layout_name(&h)); let t = transfer(&h); @@ -172,7 +169,9 @@ mod tests { assert!(decode("t.dpx", good.get(..n).expect("cut")).is_err(), "{n}"); } // huge, zero, Y'CbCr, unsupported depth, transposed - for (w, h, d, bits, p, o) in [(u32::MAX, u32::MAX, 50, 10, 1, 0), (0, 4, 50, 10, 1, 0), (4, 4, 102, 10, 1, 0), (4, 4, 50, 32, 0, 0), (4, 4, 50, 10, 1, 5)] { + for (w, h, d, bits, p, o) in + [(u32::MAX, u32::MAX, 50, 10, 1, 0), (0, 4, 50, 10, 1, 0), (4, 4, 102, 10, 1, 0), (4, 4, 50, 32, 0, 0), (4, 4, 50, 10, 1, 5)] + { let mut b = dpx_header(w, h, d, bits, p, o); b.extend(std::iter::repeat_n(0, 64)); assert!(probe("h.dpx", &b).is_err() && decode("h.dpx", &b).is_err(), "{w}x{h} {d} {bits} {p} {o}"); diff --git a/crates/model/src/lib.rs b/crates/model/src/lib.rs index cbc758bdc..7a1b7f30e 100644 --- a/crates/model/src/lib.rs +++ b/crates/model/src/lib.rs @@ -49,7 +49,7 @@ pub(crate) fn perr(s: impl Into) -> ModelError { } /// Texture coordinate wrapping (glTF sampler wrap modes). -#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] pub enum Wrap { #[default] Repeat, diff --git a/crates/model/src/scene.rs b/crates/model/src/scene.rs index abacc556d..c3ec05415 100644 --- a/crates/model/src/scene.rs +++ b/crates/model/src/scene.rs @@ -229,7 +229,8 @@ fn mesh(m: &cm::Mesh, materials: &[Material], missing: MissingNormals) -> Mesh { continue; } for c in t { - let key = cm::Corner { position: c.position, normal: if normals { c.normal } else { cm::NONE }, uv: if uvs.is_some() { c.uv } else { cm::NONE } }; + let key = + cm::Corner { position: c.position, normal: if normals { c.normal } else { cm::NONE }, uv: if uvs.is_some() { c.uv } else { cm::NONE } }; let next = p.positions.len() as u32; let id = *ids.entry(key).or_insert_with(|| { let at = c.position as usize; diff --git a/crates/model/src/tests.rs b/crates/model/src/tests.rs index 012b85d66..b63ec558c 100644 --- a/crates/model/src/tests.rs +++ b/crates/model/src/tests.rs @@ -682,4 +682,3 @@ fn gltf_buffer_less_accessors_share_one_zero_budget() { let doc = gltf_doc(acc, r#"{"buffer": 0}"#, 3); assert!(crate::gltf::parse(doc.as_bytes(), &|_| None).is_ok()); } - diff --git a/crates/pdf/README.md b/crates/pdf/README.md index 868ce5e0f..5d3685090 100644 --- a/crates/pdf/README.md +++ b/crates/pdf/README.md @@ -144,7 +144,7 @@ ffmpeg elsewhere) to check the code tables against an independent implementation ## Shared parser setup and bounds The workspace pins `craft-pdf` to `craft-libs` Git revision -`c31fc02ab9867ce3a8312b40cb6a8eae85cff639`, with `default-features = false` and only the explicit `read` +`4cb271b785b02e7aafd83ab91d3737f2939111fb`, with `default-features = false` and only the explicit `read` feature. This excludes the backend's bundled fonts and Adobe CMaps and preserves EffectCraft's font and asset policies. The shared parser does not change the supported drawing operators, image codecs, continuously rasterized SVG tree, editable shapes, or EPS interpreter. diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 58ef9bcc7..d6fa0d87b 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "c31fc02ab9867ce3a8312b40cb6a8eae85cff639"; +const REV: &str = "4cb271b785b02e7aafd83ab91d3737f2939111fb"; const PACKAGES: &[(&str, &str)] = &[("craft-pdf", "0.1.0"), ("hayro-syntax", "0.7.2"), ("hayro-jbig2", "0.3.0")]; pub fn run(root: &Path) -> Result<(), String> { From 1ae04027df5ff706bda7a09d6a799991ed62ec84 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 12 Nov 2026 06:23:01 +0000 Subject: [PATCH 3/7] fix app adapters for shared format readers --- Cargo.lock | 56 ++++++++--------- Cargo.toml | 42 ++++++------- crates/lottie/src/shapes.rs | 2 +- crates/lottie/src/text.rs | 2 +- crates/media/src/dpx.rs | 27 +++++---- crates/model/src/gltf.rs | 4 +- crates/model/src/lib.rs | 3 + crates/model/src/obj.rs | 4 +- crates/model/src/scene.rs | 106 +++++++++++++++++++++++++++++---- crates/model/src/tests.rs | 21 +++---- crates/pdf/README.md | 2 +- crates/pdf/src/tests/import.rs | 3 +- crates/svg/src/tests.rs | 2 +- xtask/src/pdf_deps.rs | 2 +- 14 files changed, 187 insertions(+), 89 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3def04dfc..ee7db8b6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1092,26 +1092,26 @@ dependencies = [ [[package]] name = "craft-aep" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5)", "thiserror 2.0.21", ] [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "thiserror 2.0.21", ] @@ -1119,7 +1119,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "serde", "serde_json", @@ -1129,12 +1129,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" [[package]] name = "craft-exr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "serde_json", ] @@ -1142,17 +1142,17 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "fixed_decimal", "icu_decimal", @@ -1175,7 +1175,7 @@ dependencies = [ [[package]] name = "craft-lottie" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "serde_json", "thiserror 2.0.21", @@ -1184,7 +1184,7 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "thiserror 2.0.21", ] @@ -1200,7 +1200,7 @@ dependencies = [ [[package]] name = "craft-mesh" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "miniz_oxide 0.9.1", "serde_json", @@ -1209,7 +1209,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "hayro-syntax", "thiserror 2.0.21", @@ -1218,7 +1218,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "encoding_rs", "flate2", @@ -1229,7 +1229,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "dispatch2", "egui", @@ -1240,7 +1240,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "craft-xml", "flate2", @@ -1252,7 +1252,7 @@ dependencies = [ [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "craft-fonts-build", "craft-i18n", @@ -1273,7 +1273,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "chrono", "dunce", @@ -1300,9 +1300,9 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5)", "rayon", "thiserror 2.0.21", ] @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "craft-webp" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "thiserror 2.0.21", ] @@ -1318,7 +1318,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "quick-xml 0.41.0", "thiserror 2.0.21", @@ -1681,7 +1681,7 @@ name = "effectcraft-export" version = "0.24.1" dependencies = [ "craft-audio", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5)", "craft-video", "effectcraft-color", "effectcraft-effects", @@ -1850,7 +1850,7 @@ dependencies = [ "craft-dpx", "craft-exr", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5)", "craft-webp", "effectcraft-color", "effectcraft-effects", @@ -3420,7 +3420,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "hayro-ccitt", ] @@ -3434,7 +3434,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=4cb271b785b02e7aafd83ab91d3737f2939111fb#4cb271b785b02e7aafd83ab91d3737f2939111fb" +source = "git+https://github.com/storytold/craft-libs?rev=091863e4a615f38743bfd5d6dc62a2e8f37cd5d5#091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index 018ec6848..3ac4eccbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,22 +11,22 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } -craft-quit = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } -craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } -craft-eps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } -craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } -craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } -craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } -craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } -craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } -craft-lottie = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } -craft-mesh = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } -craft-aep = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" } +craft-quit = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" } +craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" } +craft-eps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" } +craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" } +craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" } +craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" } +craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" } +craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" } +craft-lottie = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" } +craft-mesh = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5" } # 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 = "4cb271b785b02e7aafd83ab91d3737f2939111fb", features = ["egui"] } +craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5", features = ["egui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -90,9 +90,9 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all three on one rev. -craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", default-features = false, features = ["isobmff", "matroska"] } -craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", default-features = false, features = ["aac-decode", "aac-encode", "opus-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", features = ["h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5", default-features = false, features = ["isobmff", "matroska"] } +craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5", default-features = false, features = ["aac-decode", "aac-encode", "opus-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5", features = ["h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -122,7 +122,7 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", features = ["serde"] } +craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5", features = ["serde"] } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -231,8 +231,8 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "4cb271b785b02e7aafd83ab91d3737f2939111fb", version = "=0.3.0" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5", version = "=0.3.0" } 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" } diff --git a/crates/lottie/src/shapes.rs b/crates/lottie/src/shapes.rs index ab13374e9..f28e73a04 100644 --- a/crates/lottie/src/shapes.rs +++ b/crates/lottie/src/shapes.rs @@ -532,7 +532,7 @@ fn repeater_tr_get(t: &RepeaterTransform) -> impl Fn(&str) -> Option + '_ } /// Import Lottie shape items into shape contents groups. -pub(crate) fn import_items<'a>(im: &mut Im, ids: &mut Ids, items: &mut dyn Iterator) -> Vec { +pub(crate) fn import_items(im: &mut Im, ids: &mut Ids, items: &mut dyn Iterator) -> Vec { let mut out = vec![]; for s in items { let x = &s.extra; diff --git a/crates/lottie/src/text.rs b/crates/lottie/src/text.rs index 2bb17572c..39199cfb3 100644 --- a/crates/lottie/src/text.rs +++ b/crates/lottie/src/text.rs @@ -55,7 +55,7 @@ fn doc_json(d: &TextDoc) -> TextDocument { /// A colour of a text document (`fc`, `sc`), 0..=1 or 0..=255. fn doc_color(c: Option<&Vec>, extra: &Map, key: &str) -> Option<[f32; 4]> { - let j = c.map(|c| json!(c)).or_else(|| extra.get(key).cloned())?; + let j = c.filter(|c| !c.is_empty()).map(|c| json!(c)).or_else(|| extra.get(key).cloned())?; anim::to_color(&j).map(|v| v.as_color()) } diff --git a/crates/media/src/dpx.rs b/crates/media/src/dpx.rs index 17df4bb85..f08f1344d 100644 --- a/crates/media/src/dpx.rs +++ b/crates/media/src/dpx.rs @@ -89,20 +89,27 @@ pub(crate) fn decode(path: &str, bytes: &[u8]) -> Result image::ImageBuffer::from_raw(w32, h32, out).map(image::DynamicImage::ImageLuma16), diff --git a/crates/model/src/gltf.rs b/crates/model/src/gltf.rs index 219a9d364..68bc86764 100644 --- a/crates/model/src/gltf.rs +++ b/crates/model/src/gltf.rs @@ -18,7 +18,9 @@ pub fn parse(bytes: &[u8], resolve: &dyn Fn(&str) -> Option>) -> Result< let uri = im.uri.as_deref()?; match uri.strip_prefix("data:") { Some(_) => None, - None => resolve(&uri_decode(uri)), + // craft-mesh decodes external image URIs while constructing the scene. Decode only + // once here; a second pass changes literal percent escapes in valid filenames. + None => resolve(uri), } }) } diff --git a/crates/model/src/lib.rs b/crates/model/src/lib.rs index 7a1b7f30e..b016c52b0 100644 --- a/crates/model/src/lib.rs +++ b/crates/model/src/lib.rs @@ -204,6 +204,9 @@ impl Primitive { if !self.uvs.is_empty() { p.uvs.push(self.uvs[i]); } + if !self.tangents.is_empty() { + p.tangents.push(self.tangents[i]); + } if !self.joints.is_empty() { p.joints.push(self.joints[i]); p.weights.push(self.weights[i]); diff --git a/crates/model/src/obj.rs b/crates/model/src/obj.rs index fd39dbd53..c305cf23f 100644 --- a/crates/model/src/obj.rs +++ b/crates/model/src/obj.rs @@ -29,7 +29,9 @@ fn resolve_reference(resolve: &dyn Fn(&str) -> Option>, name: &str) -> O /// Parse OBJ text (and its MTL libraries and textures through `resolve`). pub fn parse(bytes: &[u8], resolve: &dyn Fn(&str) -> Option>) -> Result { - let mut library = |name: &str| resolve_reference(resolve, name); + // `craft-mesh` splits `mtllib` names and tries each complete library path itself. Applying + // texture-option fallback here first can mistake the last library for the whole directive. + let mut library = |name: &str| resolve(name); let scene = craft_mesh::obj::read(bytes, &limits(), &mut library).map_err(error)?; to_model(scene, MissingNormals::BySmoothing, &|im| resolve_reference(resolve, im.uri.as_deref()?.trim())) } diff --git a/crates/model/src/scene.rs b/crates/model/src/scene.rs index c3ec05415..587b25586 100644 --- a/crates/model/src/scene.rs +++ b/crates/model/src/scene.rs @@ -120,7 +120,8 @@ pub(crate) fn to_model(scene: cm::Scene, missing: MissingNormals, image: &dyn Fn unlit: m.unlit, }) .collect(); - let meshes = scene.meshes.iter().map(|m| mesh(m, &materials, missing)).collect(); + let mut adapter_bytes = 0u64; + let meshes = scene.meshes.iter().map(|m| mesh(m, &materials, missing, &mut adapter_bytes)).collect::>>()?; let nodes = scene .nodes .iter() @@ -215,13 +216,32 @@ pub(crate) fn to_model(scene: cm::Scene, missing: MissingNormals, image: &dyn Fn /// One primitive per part, each with one vertex per distinct corner of its triangles. Normals /// and UVs are kept for a part when every corner of it has them; a triangle naming a vertex /// that is not there is left out. -fn mesh(m: &cm::Mesh, materials: &[Material], missing: MissingNormals) -> Mesh { +fn mesh(m: &cm::Mesh, materials: &[Material], missing: MissingNormals, adapter_bytes: &mut u64) -> Result { let skinned = !m.joints.is_empty() && m.joints.len() == m.positions.len() && m.weights.len() == m.positions.len(); let uv_set = m.uv_sets.first(); + let smooth = smooth_normals(m, missing); + // Include temporary hash keys and the peak duplicate produced by flat-normal expansion. + // Account against the whole scene before building any primitive arrays. + let projected = m + .parts + .iter() + .try_fold(0u64, |sum, part| { + let has_normals = part.corners.iter().any(|c| (c.normal as usize) < m.normals.len()); + let vertices = + if missing == MissingNormals::Flat && !has_normals { (part.triangle_count() as u64).checked_mul(3)? } else { part.corners.len() as u64 }; + sum.checked_add(vertices.checked_mul(64)?) + }) + .ok_or_else(|| ModelError::Parse("expanded mesh size overflow".into()))?; + *adapter_bytes = adapter_bytes.checked_add(projected).ok_or_else(|| ModelError::Parse("expanded mesh size overflow".into()))?; + if *adapter_bytes > (2u64 << 30) { + return Err(ModelError::Parse("expanded mesh data exceeds the 2 GiB import limit".into())); + } let mut primitives = vec![]; for part in &m.parts { - let normals = part.corners.iter().all(|c| (c.normal as usize) < m.normals.len()); - let uvs = uv_set.filter(|set| part.corners.iter().all(|c| (c.uv as usize) < set.len())); + let normals = part.corners.iter().any(|c| (c.normal as usize) < m.normals.len()); + let tangents = part.has_tangents && m.tangents.len() == m.positions.len(); + let uvs = uv_set.filter(|set| part.corners.iter().any(|c| (c.uv as usize) < set.len())); + let mut authored_normals = vec![]; let mut ids: HashMap = HashMap::new(); let mut p = Primitive { material: part.material.filter(|&i| i < materials.len()), ..Primitive::default() }; for t in part.triangles() { @@ -229,14 +249,23 @@ fn mesh(m: &cm::Mesh, materials: &[Material], missing: MissingNormals) -> Mesh { continue; } for c in t { - let key = - cm::Corner { position: c.position, normal: if normals { c.normal } else { cm::NONE }, uv: if uvs.is_some() { c.uv } else { cm::NONE } }; + let has_normal = (c.normal as usize) < m.normals.len(); + let has_uv = uvs.is_some_and(|set| (c.uv as usize) < set.len()); + let key = cm::Corner { position: c.position, normal: if has_normal { c.normal } else { cm::NONE }, uv: if has_uv { c.uv } else { cm::NONE } }; let next = p.positions.len() as u32; let id = *ids.entry(key).or_insert_with(|| { let at = c.position as usize; p.positions.push(m.positions.get(at).copied().unwrap_or_default().map(|x| x as f32)); if normals { - p.normals.push(m.normals.get(c.normal as usize).copied().unwrap_or_default().map(|x| x as f32)); + let authored = m.normals.get(c.normal as usize).copied().map(|n| n.map(|x| x as f32)); + let fallback = smooth.get(&(c.position, part.material, smooth_group(part, missing))).copied(); + authored_normals.push(authored.or(fallback)); + p.normals.push(authored.or(fallback).unwrap_or([0.0, 0.0, 1.0])); + } else if let Some(n) = smooth.get(&(c.position, part.material, smooth_group(part, missing))) { + p.normals.push(*n); + } + if tangents { + p.tangents.push(m.tangents.get(at).copied().unwrap_or_default().map(|x| x as f32)); } if let Some(set) = uvs { p.uvs.push(set.get(c.uv as usize).copied().unwrap_or_default()); @@ -253,17 +282,74 @@ fn mesh(m: &cm::Mesh, materials: &[Material], missing: MissingNormals) -> Mesh { if p.indices.is_empty() { continue; } - if p.normals.is_empty() { + if normals && authored_normals.iter().any(Option::is_none) { + // Keep authored corner normals, and fill only absent ones from the surrounding + // triangles. The generated normals are smooth in a mixed-authorship part. + if authored_normals.iter().any(Option::is_none) { + p.compute_normals(); + for (n, authored) in p.normals.iter_mut().zip(authored_normals) { + if let Some(authored) = authored { + *n = authored; + } + } + } + } else if p.normals.is_empty() { match missing { MissingNormals::Flat => p.flat_normals(), MissingNormals::BySmoothing if part.smoothing == 0 => p.flat_normals(), MissingNormals::Smooth | MissingNormals::BySmoothing => p.compute_normals(), } } - if p.material.is_some_and(|i| materials.get(i).is_some_and(|mat| mat.normal_tex.is_some())) { + if p.tangents.is_empty() && p.material.is_some_and(|i| materials.get(i).is_some_and(|mat| mat.normal_tex.is_some())) { p.compute_tangents(); } primitives.push(p); } - Mesh { name: m.name.clone(), primitives } + Ok(Mesh { name: m.name.clone(), primitives }) +} + +fn smooth_group(part: &cm::Part, missing: MissingNormals) -> u32 { + match missing { + MissingNormals::Smooth => 1, + MissingNormals::BySmoothing => part.smoothing, + MissingNormals::Flat => 0, + } +} + +/// Area weighted generated normals across parts with the same material and smoothing state. +fn smooth_normals(m: &cm::Mesh, missing: MissingNormals) -> HashMap<(u32, Option, u32), [f32; 3]> { + let mut sums: HashMap<(u32, Option, u32), [f64; 3]> = HashMap::new(); + if missing == MissingNormals::Flat { + return HashMap::new(); + } + for part in &m.parts { + let group = smooth_group(part, missing); + if group == 0 { + continue; + } + for tri in part.triangles() { + let Some(a) = m.positions.get(tri[0].position as usize) else { continue }; + let Some(b) = m.positions.get(tri[1].position as usize) else { continue }; + let Some(c) = m.positions.get(tri[2].position as usize) else { continue }; + let u = [b[0] - a[0], b[1] - a[1], b[2] - a[2]]; + let v = [c[0] - a[0], c[1] - a[1], c[2] - a[2]]; + let face = [u[1] * v[2] - u[2] * v[1], u[2] * v[0] - u[0] * v[2], u[0] * v[1] - u[1] * v[0]]; + for corner in tri { + if (corner.normal as usize) < m.normals.len() { + continue; + } + let n = sums.entry((corner.position, part.material, group)).or_default(); + for i in 0..3 { + n[i] += face[i]; + } + } + } + } + sums.into_iter() + .map(|(key, n)| { + let len = (n[0] * n[0] + n[1] * n[1] + n[2] * n[2]).sqrt(); + let n = if len > 0.0 { n.map(|x| (x / len) as f32) } else { [0.0, 0.0, 1.0] }; + (key, n) + }) + .collect() } diff --git a/crates/model/src/tests.rs b/crates/model/src/tests.rs index b63ec558c..125e4bf81 100644 --- a/crates/model/src/tests.rs +++ b/crates/model/src/tests.rs @@ -597,9 +597,9 @@ fn gltf_accessor_counts_are_checked_against_the_buffer_before_allocating() { let view = r#"{"buffer": 0, "byteLength": 36}"#; let cases = [ // A count far beyond the 36-byte buffer. - (r#"{"bufferView": 0, "componentType": 5126, "type": "VEC3", "count": 4000000000}"#, view, "past its buffer"), + (r#"{"bufferView": 0, "componentType": 5126, "type": "VEC3", "count": 4000000000}"#, view, "limit allows"), // count * components overflows. - (r#"{"bufferView": 0, "componentType": 5126, "type": "MAT4", "count": 9223372036854775807}"#, view, "too large"), + (r#"{"bufferView": 0, "componentType": 5126, "type": "MAT4", "count": 9223372036854775807}"#, view, "limit allows"), // Offsets that overflow when added. ( r#"{"bufferView": 0, "componentType": 5126, "type": "VEC3", "count": 3, "byteOffset": 16}"#, @@ -607,11 +607,11 @@ fn gltf_accessor_counts_are_checked_against_the_buffer_before_allocating() { "past its buffer", ), // A stride that overflows with the count. - (r#"{"bufferView": 0, "componentType": 5126, "type": "VEC3", "count": 3000000000}"#, r#"{"buffer": 0, "byteStride": 252}"#, "past its buffer"), + (r#"{"bufferView": 0, "componentType": 5126, "type": "VEC3", "count": 3000000000}"#, r#"{"buffer": 0, "byteStride": 252}"#, "limit allows"), // A stride smaller than an element would re-read the same bytes for a huge count. (r#"{"bufferView": 0, "componentType": 5126, "type": "MAT4", "count": 30}"#, r#"{"buffer": 0, "byteStride": 1}"#, "smaller than"), // No buffer view: nothing backs the count, so it is capped. - (r#"{"componentType": 5126, "type": "VEC3", "count": 1000000000}"#, view, "without a bufferView"), + (r#"{"componentType": 5126, "type": "VEC3", "count": 1000000000}"#, view, "limit allows"), ]; let t0 = std::time::Instant::now(); for (acc, v, want) in cases { @@ -669,16 +669,13 @@ fn gltf_issue_2139_huge_mat4_count_is_an_error() { } #[test] -fn gltf_buffer_less_accessors_share_one_zero_budget() { - // Each buffer-less accessor is capped, but nothing backs any of them, so referencing a capped - // one from many primitives must not multiply the allocation (#2139). +fn gltf_reused_buffer_less_accessor_is_read_once() { + // The shared reader parses a repeated accessor only once, so referencing it from several + // primitives does not multiply its one bounded allocation. let acc = r#"{"componentType": 5126, "type": "VEC3", "count": 5000000}"#; let prims = [r#"{"attributes": {"POSITION": 0}}"#; 4].join(", "); let doc = gltf_doc(acc, r#"{"buffer": 0}"#, 3).replace(r#"[{"attributes": {"POSITION": 0}}]"#, &format!("[{prims}]")); assert_eq!(doc.matches(r#""POSITION": 0"#).count(), 4); - let e = crate::gltf::parse(doc.as_bytes(), &|_| None).err().unwrap_or_else(|| panic!("imported")); - assert!(e.to_string().contains("without a bufferView"), "{e}"); - // One such accessor read once still imports. - let doc = gltf_doc(acc, r#"{"buffer": 0}"#, 3); - assert!(crate::gltf::parse(doc.as_bytes(), &|_| None).is_ok()); + let result = crate::gltf::parse(doc.as_bytes(), &|_| None); + assert!(result.is_ok(), "{result:?}"); } diff --git a/crates/pdf/README.md b/crates/pdf/README.md index 5d3685090..53689ba9a 100644 --- a/crates/pdf/README.md +++ b/crates/pdf/README.md @@ -144,7 +144,7 @@ ffmpeg elsewhere) to check the code tables against an independent implementation ## Shared parser setup and bounds The workspace pins `craft-pdf` to `craft-libs` Git revision -`4cb271b785b02e7aafd83ab91d3737f2939111fb`, with `default-features = false` and only the explicit `read` +`091863e4a615f38743bfd5d6dc62a2e8f37cd5d5`, with `default-features = false` and only the explicit `read` feature. This excludes the backend's bundled fonts and Adobe CMaps and preserves EffectCraft's font and asset policies. The shared parser does not change the supported drawing operators, image codecs, continuously rasterized SVG tree, editable shapes, or EPS interpreter. diff --git a/crates/pdf/src/tests/import.rs b/crates/pdf/src/tests/import.rs index 516ff054d..f8c6509c2 100644 --- a/crates/pdf/src/tests/import.rs +++ b/crates/pdf/src/tests/import.rs @@ -563,7 +563,8 @@ fn bounding_box_comments_are_scanned_once() { // A rejected `%%BoundingBox:` comment is not scanned again from each later marker on its // line: 20,000 markers on one line would otherwise take quadratic work. let mut src = b"%!PS-Adobe-3.0 EPSF-3.0\n".to_vec(); - src.extend_from_slice("%%BoundingBox: x ".repeat(20_000).as_bytes()); + // Keep the valid comment inside craft-eps's bounded header window. + src.extend_from_slice("%%BoundingBox: x ".repeat(3_000).as_bytes()); src.extend_from_slice(b"\n%%BoundingBox: 0 0 50 50\n0 0 10 10 rectfill\n"); let doc = parse(&src).unwrap(); assert_eq!((doc.width, doc.height), (50.0, 50.0)); diff --git a/crates/svg/src/tests.rs b/crates/svg/src/tests.rs index 7d0e24001..99c318c82 100644 --- a/crates/svg/src/tests.rs +++ b/crates/svg/src/tests.rs @@ -247,7 +247,7 @@ fn deep_nesting_errors_instead_of_overflowing_the_stack() { "".repeat(1000), "".repeat(1000) ); - assert!(!craft_svg::guard::deeper_than(&s, 2) && craft_svg::guard::deeper_than(&s, 1)); + assert!(!craft_svg::guard::deeper_than(&s, 3) && craft_svg::guard::deeper_than(&s, 2)); assert!(crate::parse(s.as_bytes()).is_ok()); } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index d6fa0d87b..776ce5891 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "4cb271b785b02e7aafd83ab91d3737f2939111fb"; +const REV: &str = "091863e4a615f38743bfd5d6dc62a2e8f37cd5d5"; const PACKAGES: &[(&str, &str)] = &[("craft-pdf", "0.1.0"), ("hayro-syntax", "0.7.2"), ("hayro-jbig2", "0.3.0")]; pub fn run(root: &Path) -> Result<(), String> { From d71ccdfc9d57e5d490311591b604aa6f782dece5 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 12 Nov 2026 06:34:42 +0000 Subject: [PATCH 4/7] bound shared mesh scene conversion before allocation --- crates/model/src/scene.rs | 36 ++++++++++++++++++++++++++---------- crates/model/src/tests.rs | 16 ++++++++++++++++ 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/crates/model/src/scene.rs b/crates/model/src/scene.rs index 587b25586..14416ffb9 100644 --- a/crates/model/src/scene.rs +++ b/crates/model/src/scene.rs @@ -219,46 +219,53 @@ pub(crate) fn to_model(scene: cm::Scene, missing: MissingNormals, image: &dyn Fn fn mesh(m: &cm::Mesh, materials: &[Material], missing: MissingNormals, adapter_bytes: &mut u64) -> Result { let skinned = !m.joints.is_empty() && m.joints.len() == m.positions.len() && m.weights.len() == m.positions.len(); let uv_set = m.uv_sets.first(); - let smooth = smooth_normals(m, missing); - // Include temporary hash keys and the peak duplicate produced by flat-normal expansion. + // Include temporary hash keys, smoothing maps and the peak duplicate produced by + // flat-normal expansion. // Account against the whole scene before building any primitive arrays. let projected = m .parts .iter() .try_fold(0u64, |sum, part| { - let has_normals = part.corners.iter().any(|c| (c.normal as usize) < m.normals.len()); - let vertices = - if missing == MissingNormals::Flat && !has_normals { (part.triangle_count() as u64).checked_mul(3)? } else { part.corners.len() as u64 }; - sum.checked_add(vertices.checked_mul(64)?) + let has_missing = part.corners.iter().any(|c| (c.normal as usize) >= m.normals.len()); + let flat = missing == MissingNormals::Flat || (missing == MissingNormals::BySmoothing && part.smoothing == 0); + let vertices = if flat && has_missing { (part.triangle_count() as u64).checked_mul(3)? } else { part.corners.len() as u64 }; + let bytes_per_vertex = if missing == MissingNormals::Flat { 64 } else { 128 }; + sum.checked_add(vertices.checked_mul(bytes_per_vertex)?) }) .ok_or_else(|| ModelError::Parse("expanded mesh size overflow".into()))?; *adapter_bytes = adapter_bytes.checked_add(projected).ok_or_else(|| ModelError::Parse("expanded mesh size overflow".into()))?; if *adapter_bytes > (2u64 << 30) { return Err(ModelError::Parse("expanded mesh data exceeds the 2 GiB import limit".into())); } + let smooth = smooth_normals(m, missing); let mut primitives = vec![]; for part in &m.parts { let normals = part.corners.iter().any(|c| (c.normal as usize) < m.normals.len()); let tangents = part.has_tangents && m.tangents.len() == m.positions.len(); let uvs = uv_set.filter(|set| part.corners.iter().any(|c| (c.uv as usize) < set.len())); + let flat_missing = missing == MissingNormals::BySmoothing && part.smoothing == 0; let mut authored_normals = vec![]; - let mut ids: HashMap = HashMap::new(); + let mut ids: HashMap<(cm::Corner, Option), u32> = HashMap::new(); let mut p = Primitive { material: part.material.filter(|&i| i < materials.len()), ..Primitive::default() }; - for t in part.triangles() { + for (face, t) in part.triangles().enumerate() { if t.iter().any(|c| c.position as usize >= m.positions.len()) { continue; } + let flat_face_normal = (normals && flat_missing).then(|| face_normal(m, t)); for c in t { let has_normal = (c.normal as usize) < m.normals.len(); let has_uv = uvs.is_some_and(|set| (c.uv as usize) < set.len()); - let key = cm::Corner { position: c.position, normal: if has_normal { c.normal } else { cm::NONE }, uv: if has_uv { c.uv } else { cm::NONE } }; + let key = ( + cm::Corner { position: c.position, normal: if has_normal { c.normal } else { cm::NONE }, uv: if has_uv { c.uv } else { cm::NONE } }, + (!has_normal && flat_face_normal.is_some()).then_some(face), + ); let next = p.positions.len() as u32; let id = *ids.entry(key).or_insert_with(|| { let at = c.position as usize; p.positions.push(m.positions.get(at).copied().unwrap_or_default().map(|x| x as f32)); if normals { let authored = m.normals.get(c.normal as usize).copied().map(|n| n.map(|x| x as f32)); - let fallback = smooth.get(&(c.position, part.material, smooth_group(part, missing))).copied(); + let fallback = flat_face_normal.or_else(|| smooth.get(&(c.position, part.material, smooth_group(part, missing))).copied()); authored_normals.push(authored.or(fallback)); p.normals.push(authored.or(fallback).unwrap_or([0.0, 0.0, 1.0])); } else if let Some(n) = smooth.get(&(c.position, part.material, smooth_group(part, missing))) { @@ -316,6 +323,15 @@ fn smooth_group(part: &cm::Part, missing: MissingNormals) -> u32 { } } +fn face_normal(m: &cm::Mesh, tri: [cm::Corner; 3]) -> [f32; 3] { + let [a, b, c] = tri.map(|corner| m.positions.get(corner.position as usize).copied().unwrap_or_default()); + let u = [b[0] - a[0], b[1] - a[1], b[2] - a[2]]; + let v = [c[0] - a[0], c[1] - a[1], c[2] - a[2]]; + let n = [u[1] * v[2] - u[2] * v[1], u[2] * v[0] - u[0] * v[2], u[0] * v[1] - u[1] * v[0]]; + let len = (n[0] * n[0] + n[1] * n[1] + n[2] * n[2]).sqrt(); + if len > 0.0 { n.map(|x| (x / len) as f32) } else { [0.0, 0.0, 1.0] } +} + /// Area weighted generated normals across parts with the same material and smoothing state. fn smooth_normals(m: &cm::Mesh, missing: MissingNormals) -> HashMap<(u32, Option, u32), [f32; 3]> { let mut sums: HashMap<(u32, Option, u32), [f64; 3]> = HashMap::new(); diff --git a/crates/model/src/tests.rs b/crates/model/src/tests.rs index 125e4bf81..69ba5e69b 100644 --- a/crates/model/src/tests.rs +++ b/crates/model/src/tests.rs @@ -119,6 +119,22 @@ fn obj_without_normals_gets_them() { assert!(obj::parse(b"v 0 0 0\n", &|_| None).is_err()); } +#[test] +fn obj_mixed_authored_normals_keep_flat_missing_corners() { + let src = b"v 0 0 0\nv 1 0 0\nv 0 1 0\nv 0 0 1\nvn 0 1 0\ns off\nf 1//1 2 3\nf 1 3 4\n"; + let m = obj::parse(src, &|_| None).unwrap(); + let corners: Vec<_> = m.meshes[0] + .primitives + .iter() + .flat_map(|p| p.positions.iter().zip(&p.normals)) + .filter(|(position, _)| **position == [0.0, 1.0, 0.0]) + .map(|(_, normal)| *normal) + .collect(); + assert!(corners.contains(&[0.0, 0.0, 1.0]), "{corners:?}"); + assert!(corners.contains(&[1.0, 0.0, 0.0]), "{corners:?}"); + assert!(m.meshes[0].primitives.iter().any(|p| p.normals.contains(&[0.0, 1.0, 0.0]))); +} + #[test] fn obj_textures_from_another_machine_find_the_file_next_to_the_model() { // No committed media: the material file and its textures are written by the test itself. From c43845a962a9d005435c3b5a7f8f6de7803ac0d7 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 12 Nov 2026 07:13:43 +0000 Subject: [PATCH 5/7] update tests for shared encoder output --- crates/export/tests/it/movie_bytes.rs | 14 ++++++-------- crates/lottie/src/tests.rs | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/crates/export/tests/it/movie_bytes.rs b/crates/export/tests/it/movie_bytes.rs index 00e19b396..95d67fd53 100644 --- a/crates/export/tests/it/movie_bytes.rs +++ b/crates/export/tests/it/movie_bytes.rs @@ -94,14 +94,12 @@ fn export_bytes(format: OutputFormat, name: &str) -> Vec { #[test] fn h264_movie_bytes_are_pinned() { let data = export_bytes(OutputFormat::H264, "/out/pinned.mp4"); - // FilmCraft 09aaf9b's encoder lists its settings in the first frame's user-data SEI (211 - // bytes where 0.1.1's name took 50): 161 bytes more than the FilmCraft 2c5ba7a pin. The encoder's - // version string "0.8.0" -> "0.12.0" in that SEI adds one more byte (and one to the size fields). - // craft-video's encoder (craft-libs) is that encoder at a later FilmCraft revision than the - // d5ead4b pin: it names itself "craft-h264enc 0.1.0" in the SEI (5 bytes fewer), and with these - // settings its packets match the pin's for the first ten frames and differ after (24 bytes more - // in all, with the size fields). - assert_eq!((data.len(), fnv1a(&data)), (104_366, 4_413_091_804_733_884_658), "H.264 MP4"); + // The shared encoder revision includes craft-video's later motion-search work (four-axis + // sub-pel refinement and gating 16x8/8x16 searches on the 8x8 result). The app's encoder + // configuration and input path are unchanged, but its coded decisions and output bytes differ + // from the earlier craft-video pin. craft-video pins those decisions and checks bit-exact + // decoding against its reconstruction with FFmpeg/ffprobe oracles. + assert_eq!((data.len(), fnv1a(&data)), (102_462, 9_984_203_720_367_148_918), "H.264 MP4"); } #[test] diff --git a/crates/lottie/src/tests.rs b/crates/lottie/src/tests.rs index 8656852de..35c52026d 100644 --- a/crates/lottie/src/tests.rs +++ b/crates/lottie/src/tests.rs @@ -381,7 +381,7 @@ fn offset_paths_miter_uses_animatable_lottie_value() { assert_eq!(shapes[0]["ml"]["k"][1]["s"], json!([9.0])); assert_eq!(shapes[1]["ml"], json!({"a": 0, "k": 6.0})); assert_eq!(shapes[2]["ty"], "st"); - assert_eq!(shapes[2]["ml"], json!(7.0)); + assert_eq!(shapes[2]["ml"].as_f64(), Some(7.0)); assert!(compare_comps(&p, cid, &q, nc) > 10); let restored = &q.comp(nc).unwrap().layers[0]; assert_eq!(restored.props.group("contents/offset").unwrap().get("miter").unwrap().keys.len(), 2); From dc9bf62870e220c919a1f62a91f7920afbd464ee Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 13 Nov 2026 07:18:50 +0000 Subject: [PATCH 6/7] Pin EffectCraft to merged craft-libs mesh --- Cargo.lock | 56 +++++++++++++++++++++++++++--------------------------- Cargo.toml | 42 ++++++++++++++++++++-------------------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 599834c0c..e6450c078 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1092,26 +1092,26 @@ dependencies = [ [[package]] name = "craft-aep" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9)", "thiserror 2.0.21", ] [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "thiserror 2.0.21", ] @@ -1119,7 +1119,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "serde", "serde_json", @@ -1129,12 +1129,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" [[package]] name = "craft-exr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "serde_json", ] @@ -1142,17 +1142,17 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "fixed_decimal", "icu_decimal", @@ -1175,7 +1175,7 @@ dependencies = [ [[package]] name = "craft-lottie" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "serde_json", "thiserror 2.0.21", @@ -1184,7 +1184,7 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "thiserror 2.0.21", ] @@ -1200,7 +1200,7 @@ dependencies = [ [[package]] name = "craft-mesh" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "miniz_oxide 0.9.1", "serde_json", @@ -1209,7 +1209,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "hayro-syntax", "thiserror 2.0.21", @@ -1218,7 +1218,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "encoding_rs", "flate2", @@ -1229,7 +1229,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "dispatch2", "egui", @@ -1240,7 +1240,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "craft-xml", "flate2", @@ -1252,7 +1252,7 @@ dependencies = [ [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "craft-fonts-build", "craft-i18n", @@ -1273,7 +1273,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "chrono", "dunce", @@ -1300,9 +1300,9 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9)", "rayon", "thiserror 2.0.21", ] @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "craft-webp" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "thiserror 2.0.21", ] @@ -1318,7 +1318,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "quick-xml 0.41.0", "thiserror 2.0.21", @@ -1683,7 +1683,7 @@ name = "effectcraft-export" version = "0.24.1" dependencies = [ "craft-audio", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9)", "craft-video", "effectcraft-color", "effectcraft-effects", @@ -1852,7 +1852,7 @@ dependencies = [ "craft-dpx", "craft-exr", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9)", "craft-webp", "effectcraft-color", "effectcraft-effects", @@ -3422,7 +3422,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "hayro-ccitt", ] @@ -3436,7 +3436,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=7ddd0864d57503fb861c727d4f2336b04fa48f58#7ddd0864d57503fb861c727d4f2336b04fa48f58" +source = "git+https://github.com/storytold/craft-libs?rev=47107f660191de2f0b425569506f4daa4faadac9#47107f660191de2f0b425569506f4daa4faadac9" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index 664a2315a..1b80048f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,22 +11,22 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58" } -craft-quit = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58" } -craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58" } -craft-eps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58" } -craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58" } -craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58" } -craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58" } -craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58" } -craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58" } -craft-lottie = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58" } -craft-mesh = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } -craft-aep = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9" } +craft-quit = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9" } +craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9" } +craft-eps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9" } +craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9" } +craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9" } +craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9" } +craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9" } +craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9" } +craft-lottie = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9" } +craft-mesh = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9" } # 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 = "7ddd0864d57503fb861c727d4f2336b04fa48f58", features = ["egui"] } +craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "47107f660191de2f0b425569506f4daa4faadac9", features = ["egui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -90,9 +90,9 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all three on one rev. -craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58", default-features = false, features = ["isobmff", "matroska"] } -craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58", default-features = false, features = ["aac-decode", "aac-encode", "opus-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58", features = ["h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9", default-features = false, features = ["isobmff", "matroska"] } +craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9", default-features = false, features = ["aac-decode", "aac-encode", "opus-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9", features = ["h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -122,7 +122,7 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58", features = ["serde"] } +craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9", features = ["serde"] } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -231,8 +231,8 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "7ddd0864d57503fb861c727d4f2336b04fa48f58", version = "=0.3.0" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9", version = "=0.3.0" } 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" } From 0ef1637d5af0125a1a4841c0386215d345684b29 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 13 Nov 2026 07:50:24 +0000 Subject: [PATCH 7/7] Update EffectCraft pdf pin validator after mesh merge --- xtask/src/pdf_deps.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 29c64fcd7..a4ed9d6dd 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "7ddd0864d57503fb861c727d4f2336b04fa48f58"; +const REV: &str = "47107f660191de2f0b425569506f4daa4faadac9"; const PACKAGES: &[(&str, &str)] = &[("craft-pdf", "0.1.0"), ("hayro-syntax", "0.7.2"), ("hayro-jbig2", "0.3.0")]; pub fn run(root: &Path) -> Result<(), String> {