mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-16 20:06:41 +00:00
Merge main into i778/effectcraft-opus-craft-audio; repin craft-libs to 5a7a63a2
This commit is contained in:
Generated
+58
-38
@@ -714,9 +714,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "brotli-decompressor"
|
||||
version = "6.3.1"
|
||||
version = "6.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75c74c9c51b9140663e196b5fb88bc94c334d7a497c8311cb759d8557874747f"
|
||||
checksum = "cc031cd87c6529082b0b65c604e86af0ed7744841b17ccfe60b1e31fa606179e"
|
||||
dependencies = [
|
||||
"alloc-no-stdlib",
|
||||
"alloc-stdlib",
|
||||
@@ -1117,21 +1117,26 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-aep"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
|
||||
[[package]]
|
||||
name = "craft-audio"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c)",
|
||||
"craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87)",
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-codepage"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
|
||||
[[package]]
|
||||
name = "craft-doc"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"craft-ecproj-format",
|
||||
"craft-pcraft-format",
|
||||
@@ -1145,12 +1150,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-docpath"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
|
||||
[[package]]
|
||||
name = "craft-dpx"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
@@ -1158,7 +1163,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ecproj-format"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -1168,12 +1173,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-eps"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
|
||||
[[package]]
|
||||
name = "craft-exr"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"serde_json",
|
||||
]
|
||||
@@ -1181,12 +1186,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-fonts-build"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
|
||||
[[package]]
|
||||
name = "craft-gif"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"gif",
|
||||
]
|
||||
@@ -1194,7 +1199,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-i18n"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"fixed_decimal",
|
||||
"icu_decimal",
|
||||
@@ -1217,7 +1222,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-image-codecs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"craft-jpeg",
|
||||
"craft-metadata",
|
||||
@@ -1242,7 +1247,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-jpeg"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
@@ -1250,7 +1255,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-lottie"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"craft-zip",
|
||||
"serde_json",
|
||||
@@ -1260,7 +1265,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-media"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
@@ -1276,7 +1281,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-mesh"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"miniz_oxide 0.9.1",
|
||||
"serde_json",
|
||||
@@ -1285,7 +1290,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-metadata"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"brotli-decompressor",
|
||||
"chrono",
|
||||
@@ -1294,10 +1299,20 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-mime"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"craft-codepage",
|
||||
"encoding_rs",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-pcraft-format"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"serde",
|
||||
@@ -1308,7 +1323,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-pdf"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"hayro-syntax",
|
||||
"thiserror 2.0.21",
|
||||
@@ -1317,7 +1332,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-psd"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"flate2",
|
||||
@@ -1328,7 +1343,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-quit"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"dispatch2",
|
||||
"egui",
|
||||
@@ -1339,12 +1354,13 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-svg"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"craft-image-codecs",
|
||||
"craft-xml",
|
||||
"flate2",
|
||||
"kurbo",
|
||||
"quick-xml 0.41.0",
|
||||
"roxmltree",
|
||||
"thiserror 2.0.21",
|
||||
"vectorcraft-geom",
|
||||
@@ -1354,7 +1370,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-tiff"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"thiserror 2.0.21",
|
||||
@@ -1363,7 +1379,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"craft-fonts-build",
|
||||
"craft-i18n",
|
||||
@@ -1384,7 +1400,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-update"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"dunce",
|
||||
@@ -1411,7 +1427,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-vectorcraft-format"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"serde",
|
||||
@@ -1422,9 +1438,9 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-video"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c)",
|
||||
"craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87)",
|
||||
"rayon",
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
@@ -1432,7 +1448,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-webp"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
@@ -1440,7 +1456,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-xml"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"quick-xml 0.41.0",
|
||||
"serde",
|
||||
@@ -1450,7 +1466,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-zip"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"thiserror 2.0.21",
|
||||
@@ -1702,6 +1718,7 @@ name = "effectcraft-aep"
|
||||
version = "0.24.1"
|
||||
dependencies = [
|
||||
"craft-aep",
|
||||
"craft-mime",
|
||||
"effectcraft-color",
|
||||
"effectcraft-effects",
|
||||
"effectcraft-keyframe",
|
||||
@@ -1717,6 +1734,7 @@ dependencies = [
|
||||
name = "effectcraft-automation"
|
||||
version = "0.24.1"
|
||||
dependencies = [
|
||||
"craft-mime",
|
||||
"effectcraft-engine",
|
||||
"effectcraft-host",
|
||||
"effectcraft-model",
|
||||
@@ -1816,7 +1834,7 @@ name = "effectcraft-export"
|
||||
version = "0.24.1"
|
||||
dependencies = [
|
||||
"craft-audio",
|
||||
"craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c)",
|
||||
"craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87)",
|
||||
"craft-video",
|
||||
"effectcraft-color",
|
||||
"effectcraft-effects",
|
||||
@@ -1985,7 +2003,7 @@ dependencies = [
|
||||
"craft-dpx",
|
||||
"craft-exr",
|
||||
"craft-gif",
|
||||
"craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c)",
|
||||
"craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87)",
|
||||
"craft-webp",
|
||||
"effectcraft-color",
|
||||
"effectcraft-effects",
|
||||
@@ -2206,6 +2224,7 @@ dependencies = [
|
||||
name = "effectcraft-track"
|
||||
version = "0.24.1"
|
||||
dependencies = [
|
||||
"craft-mime",
|
||||
"effectcraft-raster",
|
||||
"effectcraft-segment",
|
||||
"rayon",
|
||||
@@ -2220,6 +2239,7 @@ version = "0.24.1"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"chrono",
|
||||
"craft-mime",
|
||||
"craft-quit",
|
||||
"craft-ui",
|
||||
"craft-update",
|
||||
@@ -3553,7 +3573,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a"
|
||||
[[package]]
|
||||
name = "hayro-jbig2"
|
||||
version = "0.3.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"hayro-ccitt",
|
||||
]
|
||||
@@ -3570,7 +3590,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "hayro-syntax"
|
||||
version = "0.7.2"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b850981f835f39859077cf62ff4e76462e76167c#b850981f835f39859077cf62ff4e76462e76167c"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87"
|
||||
dependencies = [
|
||||
"hayro-jbig2",
|
||||
"hayro-jpeg2000",
|
||||
|
||||
+24
-23
@@ -11,24 +11,25 @@ rust-version = "1.95"
|
||||
repository = "https://github.com/storytold/effectcraft"
|
||||
|
||||
[workspace.dependencies]
|
||||
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c", version = "=0.1.0", default-features = false, features = ["read"] }
|
||||
craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c" }
|
||||
craft-quit = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c" }
|
||||
craft-ecproj-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c" }
|
||||
craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c" }
|
||||
craft-eps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c" }
|
||||
craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c" }
|
||||
craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c" }
|
||||
craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c" }
|
||||
craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c" }
|
||||
craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c" }
|
||||
craft-lottie = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c" }
|
||||
craft-mesh = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c", default-features = false, features = ["stl", "obj", "gltf", "fbx"] }
|
||||
craft-aep = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c" }
|
||||
craft-doc = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c" }
|
||||
craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c" }
|
||||
craft-mime = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87", version = "=0.1.0", default-features = false, features = ["read"] }
|
||||
craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
craft-quit = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
craft-ecproj-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
craft-eps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
craft-lottie = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
craft-mesh = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87", default-features = false, features = ["stl", "obj", "gltf", "fbx"] }
|
||||
craft-aep = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
craft-doc = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" }
|
||||
# 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 = "b850981f835f39859077cf62ff4e76462e76167c", features = ["egui"] }
|
||||
craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87", features = ["egui"] }
|
||||
# internal
|
||||
effectcraft-time = { path = "crates/time" }
|
||||
effectcraft-geom = { path = "crates/geom" }
|
||||
@@ -91,9 +92,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 = "b850981f835f39859077cf62ff4e76462e76167c", default-features = false, features = ["isobmff", "matroska"] }
|
||||
craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c", default-features = false, features = ["aac-decode", "aac-encode", "opus-decode", "opus-encode"] }
|
||||
craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c", features = ["h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] }
|
||||
craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87", default-features = false, features = ["isobmff", "matroska"] }
|
||||
craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87", default-features = false, features = ["aac-decode", "aac-encode", "opus-decode", "opus-encode"] }
|
||||
craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87", 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.
|
||||
@@ -123,7 +124,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 = "b850981f835f39859077cf62ff4e76462e76167c", features = ["serde"] }
|
||||
craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87", 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"] }
|
||||
@@ -229,8 +230,8 @@ lto = "thin"
|
||||
codegen-units = 1
|
||||
|
||||
[patch.crates-io]
|
||||
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c", version = "=0.7.2" }
|
||||
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "b850981f835f39859077cf62ff4e76462e76167c", version = "=0.3.0" }
|
||||
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87", version = "=0.7.2" }
|
||||
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87", 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" }
|
||||
|
||||
@@ -10,6 +10,7 @@ rust-version.workspace = true
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
craft-mime = { workspace = true }
|
||||
craft-aep = { workspace = true }
|
||||
effectcraft-time = { workspace = true }
|
||||
effectcraft-color = { workspace = true }
|
||||
|
||||
@@ -224,19 +224,7 @@ pub(crate) fn profile_json(icc: &[u8], name: &str) -> String {
|
||||
|
||||
/// Standard base64 with padding.
|
||||
pub(crate) fn base64(data: &[u8]) -> String {
|
||||
const T: &[u8; 64] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
let mut out = String::with_capacity(data.len().div_ceil(3) * 4);
|
||||
for c in data.chunks(3) {
|
||||
let n = (u32::from(c[0]) << 16) | (u32::from(c.get(1).copied().unwrap_or(0)) << 8) | u32::from(c.get(2).copied().unwrap_or(0));
|
||||
for (i, shift) in [18u32, 12, 6, 0].iter().enumerate() {
|
||||
if i <= c.len() {
|
||||
out.push(char::from(T[((n >> shift) & 63) as usize]));
|
||||
} else {
|
||||
out.push('=');
|
||||
}
|
||||
}
|
||||
}
|
||||
out
|
||||
craft_mime::base64::STANDARD.encode(data)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -10,6 +10,7 @@ rust-version.workspace = true
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
craft-mime = { workspace = true }
|
||||
effectcraft-engine = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
|
||||
@@ -1,16 +1,7 @@
|
||||
//! Standard base64 (RFC 4648 §4, padded): MCP image content and the control channel's inline PNGs.
|
||||
|
||||
const A: &[u8; 64] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
pub fn encode(data: &[u8]) -> String {
|
||||
let mut s = String::with_capacity(data.len().div_ceil(3) * 4);
|
||||
for c in data.chunks(3) {
|
||||
let n = (c[0] as u32) << 16 | (*c.get(1).unwrap_or(&0) as u32) << 8 | *c.get(2).unwrap_or(&0) as u32;
|
||||
for i in 0..4 {
|
||||
s.push(if i <= c.len() { A[(n >> (18 - 6 * i) & 63) as usize] as char } else { '=' });
|
||||
}
|
||||
}
|
||||
s
|
||||
craft_mime::base64::STANDARD.encode(data)
|
||||
}
|
||||
|
||||
/// Decode, ignoring ASCII whitespace; `None` on any other invalid input.
|
||||
@@ -48,6 +39,18 @@ pub fn decode(s: &str) -> Option<Vec<u8>> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn shared_encoder_round_trips_every_byte_and_remainder() {
|
||||
let all: Vec<u8> = (0..=255).cycle().take(513).collect();
|
||||
for length in 0..=all.len() {
|
||||
let input = &all[..length];
|
||||
let encoded = super::encode(input);
|
||||
assert_eq!(encoded.len(), length.div_ceil(3) * 4);
|
||||
assert_eq!(super::decode(&encoded).as_deref(), Some(input));
|
||||
assert_eq!(encoded.bytes().rev().take_while(|b| *b == b'=').count(), (3 - length % 3) % 3);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rfc4648_vectors() {
|
||||
for (i, o) in [("", ""), ("f", "Zg=="), ("fo", "Zm8="), ("foo", "Zm9v"), ("foob", "Zm9vYg=="), ("fooba", "Zm9vYmE="), ("foobar", "Zm9vYmFy")] {
|
||||
|
||||
@@ -17,7 +17,7 @@ fn export_lottie(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let dot = path.to_ascii_lowercase().ends_with(".lottie");
|
||||
let bytes = if dot {
|
||||
let stem = std::path::Path::new(&path).file_stem().map(|n| n.to_string_lossy().to_string()).unwrap_or_default();
|
||||
effectcraft_lottie::to_dotlottie(&res, &stem)
|
||||
effectcraft_lottie::try_to_dotlottie(&res, &stem).map_err(|e| EngineError::Other(e.to_string()))?
|
||||
} else {
|
||||
res.to_string_compact().into_bytes()
|
||||
};
|
||||
|
||||
+31
-13
@@ -1207,17 +1207,25 @@ impl GpuContext {
|
||||
if !ticket.active() {
|
||||
return;
|
||||
}
|
||||
let mapping = Arc::new(crate::readback::Mapping::new());
|
||||
let b = buffer.clone();
|
||||
let callback_mapping = Arc::clone(&mapping);
|
||||
buffer.map_async(wgpu::MapMode::Read, .., move |r| {
|
||||
if !ticket.active() {
|
||||
b.unmap();
|
||||
if let Err(e) = r {
|
||||
callback_mapping.failed();
|
||||
ticket.complete(Err(format!("GPU buffer mapping: {e}")));
|
||||
return;
|
||||
}
|
||||
let result = r.map_err(|e| format!("GPU buffer mapping: {e}")).and_then(|_| {
|
||||
let view = b.get_mapped_range(..).map_err(|e| format!("GPU mapped range: {e}"))?;
|
||||
crate::readback::packed(&view, row, stride, height)
|
||||
});
|
||||
b.unmap();
|
||||
if !callback_mapping.mapped() {
|
||||
return;
|
||||
}
|
||||
if !ticket.active() {
|
||||
callback_mapping.unmap(|| b.unmap());
|
||||
return;
|
||||
}
|
||||
let result =
|
||||
b.get_mapped_range(..).map_err(|e| format!("GPU mapped range: {e}")).and_then(|view| crate::readback::packed(&view, row, stride, height));
|
||||
callback_mapping.unmap(|| b.unmap());
|
||||
ticket.complete(result);
|
||||
});
|
||||
}
|
||||
@@ -1264,20 +1272,30 @@ impl GpuContext {
|
||||
if !ticket.active() {
|
||||
return Err("GPU readback cancelled".into());
|
||||
}
|
||||
let mapping = Arc::new(crate::readback::Mapping::new());
|
||||
let b = buffer.clone();
|
||||
let callback_mapping = Arc::clone(&mapping);
|
||||
buffer.map_async(wgpu::MapMode::Read, .., move |r| {
|
||||
if let Err(e) = r {
|
||||
callback_mapping.failed();
|
||||
ticket.complete(Err(format!("GPU buffer mapping: {e}")));
|
||||
return;
|
||||
}
|
||||
if !callback_mapping.mapped() {
|
||||
return;
|
||||
}
|
||||
// Timed out or cancelled: nobody reads the mapping.
|
||||
if !ticket.active() {
|
||||
b.unmap();
|
||||
callback_mapping.unmap(|| b.unmap());
|
||||
return;
|
||||
}
|
||||
// Mapped: the waiting thread reads the rows and unmaps (an empty vector = mapped).
|
||||
ticket.complete(r.map(|_| Vec::new()).map_err(|e| format!("GPU buffer mapping: {e}")));
|
||||
ticket.complete(Ok(Vec::new()));
|
||||
});
|
||||
// On any failure, unmap (harmless when not mapped; cancels a pending map) so a mapped
|
||||
// buffer can never be handed out again.
|
||||
// A timeout can cancel a pending map while its callback is being dispatched. The shared
|
||||
// guard makes sure the callback and waiter cannot both unmap the same buffer.
|
||||
let fail = |e: String| {
|
||||
buffer.unmap();
|
||||
mapping.unmap(|| buffer.unmap());
|
||||
e
|
||||
};
|
||||
self.wait_mapped(&rx, submission).map_err(fail)?.map_err(fail)?;
|
||||
@@ -1285,7 +1303,7 @@ impl GpuContext {
|
||||
let view = buffer.get_mapped_range(..).map_err(|e| format!("GPU mapped range: {e}"));
|
||||
view.and_then(|view| read(&view))
|
||||
};
|
||||
buffer.unmap();
|
||||
mapping.unmap(|| buffer.unmap());
|
||||
result
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
use std::collections::BTreeMap;
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
use std::sync::Condvar;
|
||||
use std::sync::atomic::{AtomicU8, Ordering};
|
||||
use std::sync::{Arc, Mutex, Weak};
|
||||
use std::time::Duration;
|
||||
|
||||
@@ -92,6 +93,48 @@ pub(crate) struct Ticket {
|
||||
id: u64,
|
||||
}
|
||||
|
||||
/// Tracks one GPU buffer mapping shared by the callback and its waiter. A timeout can race a
|
||||
/// late callback, so the buffer must be unmapped exactly once. A failed map is never unmapped.
|
||||
pub(crate) struct Mapping(AtomicU8);
|
||||
|
||||
impl Mapping {
|
||||
const PENDING: u8 = 0;
|
||||
const MAPPED: u8 = 1;
|
||||
const FAILED: u8 = 2;
|
||||
const FINISHED: u8 = 3;
|
||||
|
||||
pub(crate) fn new() -> Self {
|
||||
Self(AtomicU8::new(Self::PENDING))
|
||||
}
|
||||
|
||||
/// Claim a successful map callback. False means a timeout already cancelled the map.
|
||||
pub(crate) fn mapped(&self) -> bool {
|
||||
self.0.compare_exchange(Self::PENDING, Self::MAPPED, Ordering::AcqRel, Ordering::Acquire).is_ok()
|
||||
}
|
||||
|
||||
/// Record a failed map so the waiter will not unmap a buffer that was never mapped.
|
||||
pub(crate) fn failed(&self) {
|
||||
let _ = self.0.compare_exchange(Self::PENDING, Self::FAILED, Ordering::AcqRel, Ordering::Acquire);
|
||||
}
|
||||
|
||||
/// Unmap once if mapping is pending (cancel it) or mapped (release it).
|
||||
pub(crate) fn unmap(&self, unmap: impl FnOnce()) {
|
||||
let mut unmap = Some(unmap);
|
||||
loop {
|
||||
let state = self.0.load(Ordering::Acquire);
|
||||
if state != Self::PENDING && state != Self::MAPPED {
|
||||
return;
|
||||
}
|
||||
if self.0.compare_exchange(state, Self::FINISHED, Ordering::AcqRel, Ordering::Acquire).is_ok() {
|
||||
if let Some(unmap) = unmap.take() {
|
||||
unmap();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// User callbacks run outside locks and are isolated one at a time. On panic=abort
|
||||
/// (including the usual wasm build), Rust panics cannot be caught: the host must
|
||||
/// avoid panicking callbacks. This branch does not claim abort-mode recovery.
|
||||
@@ -402,6 +445,83 @@ mod tests {
|
||||
use super::*;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
||||
#[test]
|
||||
fn timeout_racing_late_map_callback_unmaps_once() {
|
||||
let mapping = Arc::new(Mapping::new());
|
||||
let unmap_calls = Arc::new(AtomicUsize::new(0));
|
||||
let barrier = Arc::new(std::sync::Barrier::new(3));
|
||||
|
||||
let timeout_mapping = Arc::clone(&mapping);
|
||||
let timeout_calls = Arc::clone(&unmap_calls);
|
||||
let timeout_barrier = Arc::clone(&barrier);
|
||||
let timeout = std::thread::spawn(move || {
|
||||
timeout_barrier.wait();
|
||||
timeout_mapping.unmap(|| {
|
||||
timeout_calls.fetch_add(1, Ordering::SeqCst);
|
||||
});
|
||||
});
|
||||
|
||||
let callback_mapping = Arc::clone(&mapping);
|
||||
let callback_calls = Arc::clone(&unmap_calls);
|
||||
let callback_barrier = Arc::clone(&barrier);
|
||||
let callback = std::thread::spawn(move || {
|
||||
callback_barrier.wait();
|
||||
if callback_mapping.mapped() {
|
||||
callback_mapping.unmap(|| {
|
||||
callback_calls.fetch_add(1, Ordering::SeqCst);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
barrier.wait();
|
||||
timeout.join().unwrap();
|
||||
callback.join().unwrap();
|
||||
assert_eq!(unmap_calls.load(Ordering::SeqCst), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn timeout_before_map_callback_cancels_late_map() {
|
||||
let mapping = Mapping::new();
|
||||
let unmap_calls = AtomicUsize::new(0);
|
||||
|
||||
mapping.unmap(|| {
|
||||
unmap_calls.fetch_add(1, Ordering::SeqCst);
|
||||
});
|
||||
assert!(!mapping.mapped());
|
||||
mapping.unmap(|| {
|
||||
unmap_calls.fetch_add(1, Ordering::SeqCst);
|
||||
});
|
||||
|
||||
assert_eq!(unmap_calls.load(Ordering::SeqCst), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mapped_callback_and_timeout_release_once() {
|
||||
let mapping = Mapping::new();
|
||||
let unmap_calls = AtomicUsize::new(0);
|
||||
assert!(mapping.mapped());
|
||||
|
||||
mapping.unmap(|| {
|
||||
unmap_calls.fetch_add(1, Ordering::SeqCst);
|
||||
});
|
||||
mapping.unmap(|| {
|
||||
unmap_calls.fetch_add(1, Ordering::SeqCst);
|
||||
});
|
||||
|
||||
assert_eq!(unmap_calls.load(Ordering::SeqCst), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn failed_map_is_not_unmapped() {
|
||||
let mapping = Mapping::new();
|
||||
let unmap_calls = AtomicUsize::new(0);
|
||||
mapping.failed();
|
||||
mapping.unmap(|| {
|
||||
unmap_calls.fetch_add(1, Ordering::SeqCst);
|
||||
});
|
||||
assert_eq!(unmap_calls.load(Ordering::SeqCst), 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn early_rejection_reports_no_pixels_exactly_once() {
|
||||
let calls = Arc::new(AtomicUsize::new(0));
|
||||
|
||||
@@ -75,8 +75,9 @@ fn fxc_colorama_phase(c: vec3<f32>, a: f32, mode: u32) -> f32 {
|
||||
// Selective Color range weights (color2::sc_weights).
|
||||
fn fxc_sc_weights(c0: vec3<f32>) -> array<f32, 9> {
|
||||
let c = clamp(c0, vec3<f32>(0.0), vec3<f32>(1.0));
|
||||
// Stable descending sort of the channel indices.
|
||||
var idx = vec3<u32>(0u, 1u, 2u);
|
||||
// Stable descending sort of the channel indices. Use an array because llvmpipe does not
|
||||
// preserve dynamically indexed writes to vector components here.
|
||||
var idx = array<u32, 3>(0u, 1u, 2u);
|
||||
for (var i = 1u; i < 3u; i++) {
|
||||
var j = i;
|
||||
while (j > 0u && c[idx[j]] > c[idx[j - 1u]]) {
|
||||
@@ -86,14 +87,14 @@ fn fxc_sc_weights(c0: vec3<f32>) -> array<f32, 9> {
|
||||
j--;
|
||||
}
|
||||
}
|
||||
let mx = c[idx.x];
|
||||
let md = c[idx.y];
|
||||
let mn = c[idx.z];
|
||||
let mx = c[idx[0]];
|
||||
let md = c[idx[1]];
|
||||
let mn = c[idx[2]];
|
||||
var w = array<f32, 9>(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
var prim = array<u32, 3>(0u, 2u, 4u);
|
||||
var sec = array<u32, 3>(3u, 5u, 1u);
|
||||
w[prim[idx.x]] = mx - md;
|
||||
w[sec[idx.z]] = md - mn;
|
||||
w[prim[idx[0]]] = mx - md;
|
||||
w[sec[idx[2]]] = md - mn;
|
||||
w[6] = max((mn - 0.5) * 2.0, 0.0);
|
||||
w[8] = max((0.5 - mx) * 2.0, 0.0);
|
||||
w[7] = clamp(1.0 - (abs(mx - 0.5) + abs(mn - 0.5)), 0.0, 1.0);
|
||||
|
||||
@@ -130,12 +130,15 @@ fn fxl_shape(at: u32, n: u32, x: f32, flip: bool) -> f32 {
|
||||
// partition_point(|p| p.x < x).
|
||||
var lo = 0u;
|
||||
var hi = n;
|
||||
while (lo < hi) {
|
||||
let mid = (lo + hi) / 2u;
|
||||
if (data[at + mid * 2u + kx] < x) {
|
||||
lo = mid + 1u;
|
||||
} else {
|
||||
hi = mid;
|
||||
// Bound the partition search as for inverse 1D LUTs below.
|
||||
for (var step = 0u; step < 32u; step++) {
|
||||
if (lo < hi) {
|
||||
let mid = lo + (hi - lo) / 2u;
|
||||
if (data[at + mid * 2u + kx] < x) {
|
||||
lo = mid + 1u;
|
||||
} else {
|
||||
hi = mid;
|
||||
}
|
||||
}
|
||||
}
|
||||
let i = clamp(lo, 1u, n - 1u);
|
||||
@@ -156,13 +159,22 @@ fn fxl_shaper_at(s: u32, k: u32) -> vec2<u32> {
|
||||
return vec2<u32>(at, u32(data[s + k]));
|
||||
}
|
||||
|
||||
// Evaluate independent shaper channels without dynamically writing vector lanes.
|
||||
fn fxl_shaper_apply(sh: u32, c: vec3<f32>, flip: bool) -> vec3<f32> {
|
||||
let r = fxl_shaper_at(sh, 0u);
|
||||
let g = fxl_shaper_at(sh, 1u);
|
||||
let b = fxl_shaper_at(sh, 2u);
|
||||
return vec3<f32>(
|
||||
fxl_shape(r.x, r.y, c.x, flip),
|
||||
fxl_shape(g.x, g.y, c.y, flip),
|
||||
fxl_shape(b.x, b.y, c.z, flip)
|
||||
);
|
||||
}
|
||||
|
||||
fn fxl_file_fwd(o: u32, sh: i32, c0: vec3<f32>, interp: u32) -> vec3<f32> {
|
||||
var c = c0;
|
||||
if (sh >= 0) {
|
||||
for (var k = 0u; k < 3u; k++) {
|
||||
let a = fxl_shaper_at(u32(sh), k);
|
||||
c[k] = fxl_shape(a.x, a.y, c[k], false);
|
||||
}
|
||||
c = fxl_shaper_apply(u32(sh), c, false);
|
||||
}
|
||||
return fxl_lut_apply(o, c, interp);
|
||||
}
|
||||
@@ -176,12 +188,16 @@ fn fxl_inv_1d(o: u32, i: u32, y: f32) -> f32 {
|
||||
// partition_point over the table's values.
|
||||
var lo = 0u;
|
||||
var hi = n;
|
||||
while (lo < hi) {
|
||||
let mid = (lo + hi) / 2u;
|
||||
if (data[b1 + mid * 3u + i] < y) {
|
||||
lo = mid + 1u;
|
||||
} else {
|
||||
hi = mid;
|
||||
// A u32 interval needs at most 32 halvings. A fixed trip count avoids
|
||||
// a divergent data-dependent loop on software Vulkan without changing lookup.
|
||||
for (var step = 0u; step < 32u; step++) {
|
||||
if (lo < hi) {
|
||||
let mid = lo + (hi - lo) / 2u;
|
||||
if (data[b1 + mid * 3u + i] < y) {
|
||||
lo = mid + 1u;
|
||||
} else {
|
||||
hi = mid;
|
||||
}
|
||||
}
|
||||
}
|
||||
let k = clamp(lo, 1u, n - 1u);
|
||||
@@ -205,10 +221,7 @@ fn fxl_file(o: u32, sh: i32, c: vec3<f32>, interp: u32, inverse: bool) -> vec3<f
|
||||
x = vec3<f32>(fxl_inv_1d(o, 0u, c.x), fxl_inv_1d(o, 1u, c.y), fxl_inv_1d(o, 2u, c.z));
|
||||
}
|
||||
if (sh >= 0) {
|
||||
for (var k = 0u; k < 3u; k++) {
|
||||
let a = fxl_shaper_at(u32(sh), k);
|
||||
x[k] = fxl_shape(a.x, a.y, x[k], true);
|
||||
}
|
||||
x = fxl_shaper_apply(u32(sh), x, true);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
@@ -444,12 +457,11 @@ fn fxl_run(c0: vec3<f32>) -> vec3<f32> {
|
||||
case 1u, 2u: {
|
||||
let tf = u32(data[pc + 1u]);
|
||||
let g = data[pc + 2u];
|
||||
for (var i = 0u; i < 3u; i++) {
|
||||
if (op == 1u) {
|
||||
c[i] = fxl_decode(tf, g, c[i]);
|
||||
} else {
|
||||
c[i] = fxl_encode(tf, g, c[i]);
|
||||
}
|
||||
// Explicit components avoid llvmpipe's dynamically indexed vector writes.
|
||||
if (op == 1u) {
|
||||
c = vec3<f32>(fxl_decode(tf, g, c.x), fxl_decode(tf, g, c.y), fxl_decode(tf, g, c.z));
|
||||
} else {
|
||||
c = vec3<f32>(fxl_encode(tf, g, c.x), fxl_encode(tf, g, c.y), fxl_encode(tf, g, c.z));
|
||||
}
|
||||
pc += 3u;
|
||||
}
|
||||
|
||||
@@ -97,6 +97,35 @@ fn apply_color_lut() {
|
||||
effect_case("ec.utility.applylut", &[("lut", s("/nonexistent/grade.cube"))]);
|
||||
}
|
||||
|
||||
// Keep this separate so Nextest runs the inverse lookup in a fresh process/device,
|
||||
// without the preceding 3D LUT submissions in `ocio_file_transform`. The combined
|
||||
// test stays intact to cover ordering and shared-device state as well.
|
||||
#[test]
|
||||
fn inverse_1d_lut_on_a_fresh_device_matches_cpu() {
|
||||
effect_direct("ec.color.ociofile", &[("file", s(&cube_1d())), ("direction", e(1))], false);
|
||||
}
|
||||
|
||||
// Isolate the first profile conversion that failed in hosted llvmpipe coverage.
|
||||
// This retains the same oracle and tolerance as the broader profile test.
|
||||
#[test]
|
||||
fn profile_conversion_on_a_fresh_device_matches_cpu() {
|
||||
effect_direct("ec.utility.colorprofileconverter", &[("inputProfile", e(1)), ("outputProfile", e(3)), ("intent", e(0))], false);
|
||||
}
|
||||
|
||||
// Unequal CSP channel point counts exercise shaper offsets on a fresh device.
|
||||
#[test]
|
||||
fn csp_shaper_on_a_fresh_device_matches_cpu() {
|
||||
effect_direct("ec.color.ociofile", &[("file", s(&csp())), ("interpolation", e(1))], false);
|
||||
effect_direct("ec.color.ociofile", &[("file", s(&csp())), ("direction", e(1))], false);
|
||||
}
|
||||
|
||||
// A 1D CSP takes the direct inverse-shaper path (flip=true), unlike a 3D CSP.
|
||||
#[test]
|
||||
fn inverse_1d_csp_shaper_on_a_fresh_device_matches_cpu() {
|
||||
let lut = "CSPLUTV100\n1D\n3\n0 0.5 1\n0 0.3 1\n2\n0 1\n0 1\n4\n0 0.2 0.6 1\n0 0.4 0.7 1\n2\n0 0 0\n1 1 1\n";
|
||||
effect_direct("ec.color.ociofile", &[("file", s(lut)), ("direction", e(1))], false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ocio_file_transform() {
|
||||
for interp in 1..4 {
|
||||
|
||||
@@ -505,11 +505,17 @@ pub fn export_comp(project: &Project, comp: ItemId, opts: &ExportOptions, read:
|
||||
|
||||
/// Package an export as a dotLottie archive (`manifest.json` + `animations/<id>.json`).
|
||||
pub fn to_dotlottie(res: &ExportResult, id: &str) -> Vec<u8> {
|
||||
try_to_dotlottie(res, id).unwrap_or_default()
|
||||
}
|
||||
|
||||
/// Package an export, reporting serialization or ZIP failures before any output is written.
|
||||
pub fn try_to_dotlottie(res: &ExportResult, id: &str) -> Result<Vec<u8>, LottieError> {
|
||||
let id: String = id.chars().map(|c| if c.is_ascii_alphanumeric() || c == '_' || c == '-' { c } else { '_' }).collect();
|
||||
let id = if id.is_empty() { "animation".to_string() } else { id };
|
||||
let manifest = json!({"version": "1", "generator": "EffectCraft", "author": "", "animations": [{"id": id, "speed": 1, "loop": true}]});
|
||||
crate::zip::store(&[
|
||||
("manifest.json".into(), serde_json::to_vec(&manifest).unwrap_or_default()),
|
||||
(format!("animations/{id}.json"), serde_json::to_vec(&res.json).unwrap_or_default()),
|
||||
crate::zip::try_store(&[
|
||||
("manifest.json".into(), serde_json::to_vec(&manifest).map_err(|e| LottieError::Invalid(e.to_string()))?),
|
||||
(format!("animations/{id}.json"), serde_json::to_vec(&res.json).map_err(|e| LottieError::Invalid(e.to_string()))?),
|
||||
])
|
||||
.map_err(|e| LottieError::Invalid(format!("dotLottie ZIP: {e}")))
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ pub struct ImportResult {
|
||||
pub warnings: Vec<String>,
|
||||
}
|
||||
|
||||
/// The Lottie document inside raw bytes (plain JSON, or a stored dotLottie archive), read into
|
||||
/// The Lottie document inside raw bytes (plain JSON, or a dotLottie archive), read into
|
||||
/// `craft-lottie`'s model within its default limits.
|
||||
fn document(bytes: &[u8]) -> Result<Animation, LottieError> {
|
||||
let read = |b: &[u8]| {
|
||||
@@ -51,12 +51,12 @@ fn document(bytes: &[u8]) -> Result<Animation, LottieError> {
|
||||
})
|
||||
};
|
||||
if bytes.starts_with(b"PK") {
|
||||
let entries = crate::zip::read_stored(bytes);
|
||||
let entries = crate::zip::read_entries(bytes).map_err(|e| LottieError::Parse(format!("dotLottie ZIP: {e}")))?;
|
||||
let anim = entries
|
||||
.iter()
|
||||
.find(|(n, _)| n.starts_with("animations/") && n.ends_with(".json"))
|
||||
.or_else(|| entries.iter().find(|(n, _)| n.ends_with(".json") && n != "manifest.json"))
|
||||
.ok_or_else(|| LottieError::Parse("dotLottie archive without an uncompressed animation".into()))?;
|
||||
.ok_or_else(|| LottieError::Parse("dotLottie archive without a JSON animation".into()))?;
|
||||
return read(&anim.1);
|
||||
}
|
||||
read(bytes)
|
||||
@@ -102,7 +102,7 @@ fn external_image(stored: &str, base_dir: &str) -> Result<String, String> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Import a Lottie document (JSON or a stored `.lottie` archive) into `project` as a new
|
||||
/// Import a Lottie document (JSON or a `.lottie` archive) into `project` as a new
|
||||
/// composition. `store` saves embedded images and returns the file path to use;
|
||||
/// `base_dir` resolves external image references.
|
||||
pub fn import(
|
||||
|
||||
@@ -30,7 +30,7 @@ pub mod zip;
|
||||
use effectcraft_color::BlendMode;
|
||||
use effectcraft_time::{FrameRate, TICKS_PER_SECOND, Tick};
|
||||
|
||||
pub use export::{ExportOptions, ExportResult, export_comp, to_dotlottie};
|
||||
pub use export::{ExportOptions, ExportResult, export_comp, to_dotlottie, try_to_dotlottie};
|
||||
pub use import::{ImportResult, ImportedImage, import};
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
|
||||
@@ -12,7 +12,7 @@ use effectcraft_render::render_frame;
|
||||
use effectcraft_time::{FrameRate, Tick};
|
||||
use serde_json::{Value as Json, json};
|
||||
|
||||
use crate::{ExportOptions, export_comp, import};
|
||||
use crate::{ExportOptions, LottieError, export_comp, import};
|
||||
|
||||
fn s(x: f64) -> Tick {
|
||||
Tick::from_seconds_f64(x)
|
||||
@@ -799,6 +799,32 @@ fn dotlottie_archive_roundtrip() {
|
||||
assert_eq!(q.comp(imp.comp).unwrap().layers.len(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dotlottie_archive_without_animation_is_rejected() {
|
||||
let zip = craft_lottie::zip::try_store(&[("manifest.json".into(), b"{}".to_vec())]).unwrap();
|
||||
let mut project = Project::default();
|
||||
let err = import(&mut project, &zip, "empty archive", "", &mut |_| None).unwrap_err();
|
||||
assert!(matches!(err, LottieError::Parse(message) if message.contains("without a JSON animation")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deflated_dotlottie_archive_imports() {
|
||||
let (mut p, cid) = setup();
|
||||
let l = solid_layer(&mut p, cid, [0.0, 1.0, 0.0], 40, 40);
|
||||
push(&mut p, cid, l);
|
||||
let res = export_comp(&p, cid, &ExportOptions::default(), &no_read).unwrap();
|
||||
let manifest = serde_json::to_vec(&serde_json::json!({"version":"1","animations":[{"id":"main"}]})).unwrap();
|
||||
let animation = serde_json::to_vec(&res.json).unwrap();
|
||||
let zip = craft_lottie::zip::try_store_with_compression(
|
||||
&[("manifest.json".into(), manifest), ("animations/main.json".into(), animation)],
|
||||
craft_lottie::zip::Compression::Deflated,
|
||||
)
|
||||
.unwrap();
|
||||
let mut q = Project::default();
|
||||
let imp = import(&mut q, &zip, "compressed", "", &mut |_| None).unwrap();
|
||||
assert_eq!(q.comp(imp.comp).unwrap().layers.len(), 1);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- hand-written fixtures
|
||||
|
||||
fn fixture(name: &str) -> (Project, ItemId, Vec<String>) {
|
||||
@@ -1062,3 +1088,12 @@ fn only_image_bytes_are_embedded() {
|
||||
assert!(res.json["assets"].as_array().is_none_or(|a| a.is_empty()), "{}", res.json["assets"]);
|
||||
assert!(res.warnings.iter().any(|w| w.contains("not a PNG")), "{:?}", res.warnings);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dotlottie_export_rejects_an_unrepresentable_entry_name() {
|
||||
let (p, cid) = setup();
|
||||
let res = export_comp(&p, cid, &ExportOptions::default(), &no_read).unwrap();
|
||||
let err = crate::try_to_dotlottie(&res, &"a".repeat(usize::from(u16::MAX))).unwrap_err();
|
||||
assert!(matches!(err, LottieError::Invalid(message) if message.contains("dotLottie ZIP")));
|
||||
assert_eq!(crate::try_to_dotlottie(&res, "Main").unwrap(), crate::to_dotlottie(&res, "Main"));
|
||||
}
|
||||
|
||||
+2
-120
@@ -1,121 +1,3 @@
|
||||
//! A minimal ZIP writer (stored entries, PKWARE APPNOTE 6.3 local headers + central directory)
|
||||
//! for `.lottie` (dotLottie) archives.
|
||||
//! Shared stored-entry ZIP functions used by dotLottie imports and exports.
|
||||
|
||||
fn crc32(data: &[u8]) -> u32 {
|
||||
let mut crc = 0xFFFF_FFFFu32;
|
||||
for &b in data {
|
||||
crc ^= b as u32;
|
||||
for _ in 0..8 {
|
||||
crc = if crc & 1 != 0 { (crc >> 1) ^ 0xEDB8_8320 } else { crc >> 1 };
|
||||
}
|
||||
}
|
||||
!crc
|
||||
}
|
||||
|
||||
/// Build a ZIP archive with the given (name, bytes) entries, uncompressed.
|
||||
pub fn store(entries: &[(String, Vec<u8>)]) -> Vec<u8> {
|
||||
let mut out = Vec::new();
|
||||
let mut central = Vec::new();
|
||||
let put16 = |v: &mut Vec<u8>, x: u16| v.extend_from_slice(&x.to_le_bytes());
|
||||
let put32 = |v: &mut Vec<u8>, x: u32| v.extend_from_slice(&x.to_le_bytes());
|
||||
for (name, data) in entries {
|
||||
let offset = out.len() as u32;
|
||||
let crc = crc32(data);
|
||||
let n = name.as_bytes();
|
||||
// Local file header.
|
||||
put32(&mut out, 0x0403_4b50);
|
||||
put16(&mut out, 20); // version needed
|
||||
put16(&mut out, 0x0800); // flags: UTF-8 names
|
||||
put16(&mut out, 0); // stored
|
||||
put16(&mut out, 0); // time
|
||||
put16(&mut out, 0x21); // date (1980-01-01)
|
||||
put32(&mut out, crc);
|
||||
put32(&mut out, data.len() as u32);
|
||||
put32(&mut out, data.len() as u32);
|
||||
put16(&mut out, n.len() as u16);
|
||||
put16(&mut out, 0);
|
||||
out.extend_from_slice(n);
|
||||
out.extend_from_slice(data);
|
||||
// Central directory record.
|
||||
put32(&mut central, 0x0201_4b50);
|
||||
put16(&mut central, 20); // made by
|
||||
put16(&mut central, 20);
|
||||
put16(&mut central, 0x0800);
|
||||
put16(&mut central, 0);
|
||||
put16(&mut central, 0);
|
||||
put16(&mut central, 0x21);
|
||||
put32(&mut central, crc);
|
||||
put32(&mut central, data.len() as u32);
|
||||
put32(&mut central, data.len() as u32);
|
||||
put16(&mut central, n.len() as u16);
|
||||
put16(&mut central, 0); // extra
|
||||
put16(&mut central, 0); // comment
|
||||
put16(&mut central, 0); // disk
|
||||
put16(&mut central, 0); // internal attrs
|
||||
put32(&mut central, 0); // external attrs
|
||||
put32(&mut central, offset);
|
||||
central.extend_from_slice(n);
|
||||
}
|
||||
let cd_offset = out.len() as u32;
|
||||
let cd_len = central.len() as u32;
|
||||
out.extend_from_slice(¢ral);
|
||||
put32(&mut out, 0x0605_4b50);
|
||||
put16(&mut out, 0);
|
||||
put16(&mut out, 0);
|
||||
put16(&mut out, entries.len() as u16);
|
||||
put16(&mut out, entries.len() as u16);
|
||||
put32(&mut out, cd_len);
|
||||
put32(&mut out, cd_offset);
|
||||
put16(&mut out, 0);
|
||||
out
|
||||
}
|
||||
|
||||
/// Whether an entry name is a relative path inside the archive: not absolute (`/…`, `\…`), no
|
||||
/// drive (`C:…`) and no `..` component.
|
||||
fn is_relative_name(name: &str) -> bool {
|
||||
let drive = name.as_bytes().get(1) == Some(&b':');
|
||||
!name.starts_with(['/', '\\']) && !drive && !name.split(['/', '\\']).any(|c| c == "..")
|
||||
}
|
||||
|
||||
/// Read the stored (uncompressed) entries of a ZIP archive written by [`store`] or any other
|
||||
/// writer that did not compress. Compressed entries and entries whose names are not relative
|
||||
/// paths inside the archive are skipped.
|
||||
pub fn read_stored(data: &[u8]) -> Vec<(String, Vec<u8>)> {
|
||||
let mut out = vec![];
|
||||
let mut i = 0usize;
|
||||
let u16_at = |p: usize| data.get(p..p + 2).map(|b| u16::from_le_bytes([b[0], b[1]]) as usize);
|
||||
let u32_at = |p: usize| data.get(p..p + 4).map(|b| u32::from_le_bytes([b[0], b[1], b[2], b[3]]) as usize);
|
||||
while u32_at(i) == Some(0x0403_4b50) {
|
||||
let (Some(method), Some(size), Some(nlen), Some(xlen)) = (u16_at(i + 8), u32_at(i + 18), u16_at(i + 26), u16_at(i + 28)) else { break };
|
||||
let name_start = i + 30;
|
||||
let body = name_start + nlen + xlen;
|
||||
let (Some(name), Some(bytes)) = (data.get(name_start..name_start + nlen), data.get(body..body + size)) else { break };
|
||||
let name = String::from_utf8_lossy(name).to_string();
|
||||
if method == 0 && is_relative_name(&name) {
|
||||
out.push((name, bytes.to_vec()));
|
||||
}
|
||||
i = body + size;
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn crc_and_roundtrip() {
|
||||
assert_eq!(super::crc32(b"123456789"), 0xCBF4_3926);
|
||||
let z = super::store(&[("a.json".into(), b"{}".to_vec()), ("b/c.txt".into(), b"hello".to_vec())]);
|
||||
let back = super::read_stored(&z);
|
||||
assert_eq!(back.len(), 2);
|
||||
assert_eq!(back[1].0, "b/c.txt");
|
||||
assert_eq!(back[1].1, b"hello");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn entries_outside_the_archive_root_are_skipped() {
|
||||
let names = ["../up.txt", "a/../../up.txt", "/abs/x", "\\abs\\x", "C:\\x", "c:x", "a\\..\\x", "ok/x.txt", "ok/..x"];
|
||||
let z = super::store(&names.iter().map(|n| (n.to_string(), b"x".to_vec())).collect::<Vec<_>>());
|
||||
let back: Vec<String> = super::read_stored(&z).into_iter().map(|(n, _)| n).collect();
|
||||
assert_eq!(back, ["ok/x.txt", "ok/..x"]);
|
||||
}
|
||||
}
|
||||
pub use craft_lottie::zip::{Limits, read_entries, read_entries_with_limits, read_stored, store, try_store, try_store_with_compression};
|
||||
|
||||
@@ -10,6 +10,7 @@ rust-version.workspace = true
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
craft-mime = { workspace = true }
|
||||
effectcraft-raster = { workspace = true }
|
||||
effectcraft-segment = { workspace = true }
|
||||
rayon = { workspace = true }
|
||||
|
||||
@@ -1,19 +1,8 @@
|
||||
//! Compact text encodings of mattes for project storage: run-length coding (LEB128 varints)
|
||||
//! wrapped in standard base64 (RFC 4648 §4).
|
||||
|
||||
const B64: &[u8; 64] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
pub fn base64_encode(data: &[u8]) -> String {
|
||||
let mut out = String::with_capacity(data.len().div_ceil(3) * 4);
|
||||
for c in data.chunks(3) {
|
||||
let b = [c[0], *c.get(1).unwrap_or(&0), *c.get(2).unwrap_or(&0)];
|
||||
let n = (b[0] as u32) << 16 | (b[1] as u32) << 8 | b[2] as u32;
|
||||
out.push(B64[(n >> 18) as usize & 63] as char);
|
||||
out.push(B64[(n >> 12) as usize & 63] as char);
|
||||
out.push(if c.len() > 1 { B64[(n >> 6) as usize & 63] as char } else { '=' });
|
||||
out.push(if c.len() > 2 { B64[n as usize & 63] as char } else { '=' });
|
||||
}
|
||||
out
|
||||
craft_mime::base64::STANDARD.encode(data)
|
||||
}
|
||||
|
||||
pub fn base64_decode(s: &str) -> Option<Vec<u8>> {
|
||||
|
||||
@@ -10,6 +10,7 @@ rust-version.workspace = true
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
craft-mime = { workspace = true }
|
||||
craft-ui = { workspace = true }
|
||||
craft-quit = { workspace = true, features = ["egui"] }
|
||||
effectcraft-time = { workspace = true }
|
||||
|
||||
@@ -803,19 +803,7 @@ fn render_frame(app: &EffectcraftApp, p: &Value) -> Outcome {
|
||||
|
||||
/// Standard base64 (RFC 4648, padded).
|
||||
pub fn base64(data: &[u8]) -> String {
|
||||
const A: &[u8; 64] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
let mut s = String::with_capacity(data.len().div_ceil(3) * 4);
|
||||
for c in data.chunks(3) {
|
||||
let n = (c[0] as u32) << 16 | (*c.get(1).unwrap_or(&0) as u32) << 8 | *c.get(2).unwrap_or(&0) as u32;
|
||||
for i in 0..4 {
|
||||
if i <= c.len() {
|
||||
s.push(A[(n >> (18 - 6 * i) & 63) as usize] as char);
|
||||
} else {
|
||||
s.push('=');
|
||||
}
|
||||
}
|
||||
}
|
||||
s
|
||||
craft_mime::base64::STANDARD.encode(data)
|
||||
}
|
||||
|
||||
/// Builds the `ui.inspect` reply: window size and pixels per point, fps, UI state with the
|
||||
|
||||
@@ -635,6 +635,7 @@ fn clicks_wait_for_the_probe_and_edits_popups_dialogs_and_comp_switches_end_or_b
|
||||
/// each Resolution. Skips without a GPU adapter.
|
||||
#[test]
|
||||
fn picks_on_the_gpu_viewer() {
|
||||
let _gpu = crate::gpu_test::lock();
|
||||
let Some(probe) = effectcraft_gpu::Gpu::headless() else {
|
||||
eprintln!("no GPU adapter: skipping");
|
||||
return;
|
||||
|
||||
@@ -5,7 +5,7 @@ use std::process::Command;
|
||||
|
||||
use serde_json::Value;
|
||||
|
||||
const REV: &str = "b850981f835f39859077cf62ff4e76462e76167c";
|
||||
const REV: &str = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87";
|
||||
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> {
|
||||
|
||||
Reference in New Issue
Block a user