mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-22 02:12:32 +01:00
Merge pull request #4270 from storytold/feat/cutover-avif-jxl-tests
chore(codecs): cut over AVIF, AV1, and JXL tests to craft-libs
This commit is contained in:
12 files changed
+490
-334
No files matched your search
Generated
+90
-13
@@ -1268,6 +1268,35 @@ dependencies = [
|
||||
"writeable",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-image-codecs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a#5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a"
|
||||
dependencies = [
|
||||
"avif-serialize",
|
||||
"craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a)",
|
||||
"craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a)",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a)",
|
||||
"crc32fast",
|
||||
"exr",
|
||||
"flate2",
|
||||
"half",
|
||||
"hayro-jpeg2000",
|
||||
"image",
|
||||
"image-webp",
|
||||
"jpeg-encoder 0.6.1",
|
||||
"png",
|
||||
"rav1e",
|
||||
"ravif",
|
||||
"rayon",
|
||||
"serde_json",
|
||||
"thiserror 2.0.21",
|
||||
"tiff",
|
||||
"zune-core",
|
||||
"zune-jpeg",
|
||||
"zune-jpegxl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-image-codecs"
|
||||
version = "0.1.0"
|
||||
@@ -1303,6 +1332,14 @@ dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-jpeg"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a#5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a"
|
||||
dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-jpeg"
|
||||
version = "0.1.0"
|
||||
@@ -1314,13 +1351,33 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-jxl"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b77af389f30bb10de10d8436ca9b39fe94e3bb67#b77af389f30bb10de10d8436ca9b39fe94e3bb67"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=478c50560d3c6fad3d613af2a30b35c3bc9f4c0f#478c50560d3c6fad3d613af2a30b35c3bc9f4c0f"
|
||||
dependencies = [
|
||||
"jixel",
|
||||
"jxl-oxide",
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-media"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5c91598ccc86537a779f438d520fa6406c26efe6#5c91598ccc86537a779f438d520fa6406c26efe6"
|
||||
dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-metadata"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a#5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a"
|
||||
dependencies = [
|
||||
"brotli-decompressor 6.0.1",
|
||||
"chrono",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a)",
|
||||
"quick-xml 0.41.0",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-metadata"
|
||||
version = "0.1.0"
|
||||
@@ -1401,6 +1458,15 @@ dependencies = [
|
||||
"zune-jpeg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-tiff"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a#5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-tiff"
|
||||
version = "0.1.0"
|
||||
@@ -1467,6 +1533,17 @@ dependencies = [
|
||||
"zip 9.1.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-video"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5c91598ccc86537a779f438d520fa6406c26efe6#5c91598ccc86537a779f438d520fa6406c26efe6"
|
||||
dependencies = [
|
||||
"craft-media",
|
||||
"rav1e",
|
||||
"rayon",
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-window"
|
||||
version = "0.1.0"
|
||||
@@ -3359,6 +3436,8 @@ dependencies = [
|
||||
"num-traits",
|
||||
"png",
|
||||
"qoi",
|
||||
"ravif",
|
||||
"rgb",
|
||||
"tiff",
|
||||
"zune-core",
|
||||
"zune-jpeg",
|
||||
@@ -3905,27 +3984,25 @@ dependencies = [
|
||||
name = "lightcraft-codecs"
|
||||
version = "0.21.1"
|
||||
dependencies = [
|
||||
"avif-serialize",
|
||||
"bytemuck",
|
||||
"craft-cms",
|
||||
"craft-gainmap",
|
||||
"craft-gif",
|
||||
"craft-heif",
|
||||
"craft-image-codecs",
|
||||
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a)",
|
||||
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=947dc5fb0ec436c0841f560eac0d65c6ad055ed4)",
|
||||
"craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=478c50560d3c6fad3d613af2a30b35c3bc9f4c0f)",
|
||||
"craft-jxl",
|
||||
"craft-psd",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=94777dcf7f8962476e96b049d08d22e25b9330c2)",
|
||||
"craft-video",
|
||||
"dhat",
|
||||
"jpeg-encoder 0.7.1",
|
||||
"jxl-oxide",
|
||||
"lightcraft-color",
|
||||
"lightcraft-geom",
|
||||
"lightcraft-raster",
|
||||
"lightcraft-testkit",
|
||||
"proptest",
|
||||
"rav1e",
|
||||
"ravif",
|
||||
"rayon",
|
||||
"serde",
|
||||
"thiserror 2.0.21",
|
||||
@@ -3994,6 +4071,7 @@ dependencies = [
|
||||
"chrono",
|
||||
"craft-docpath",
|
||||
"craft-heif",
|
||||
"craft-jxl",
|
||||
"craft-mime",
|
||||
"craft-pdf",
|
||||
"craft-plist",
|
||||
@@ -4001,7 +4079,6 @@ dependencies = [
|
||||
"crc32fast",
|
||||
"fs4",
|
||||
"harfrust 0.13.3",
|
||||
"jxl-oxide",
|
||||
"libc",
|
||||
"lightcraft-catalog",
|
||||
"lightcraft-codecs",
|
||||
@@ -4169,7 +4246,7 @@ dependencies = [
|
||||
name = "lightcraft-pipeline"
|
||||
version = "0.21.1"
|
||||
dependencies = [
|
||||
"craft-image-codecs",
|
||||
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=947dc5fb0ec436c0841f560eac0d65c6ad055ed4)",
|
||||
"dhat",
|
||||
"lightcraft-color",
|
||||
"lightcraft-develop",
|
||||
@@ -4188,7 +4265,7 @@ dependencies = [
|
||||
name = "lightcraft-preview"
|
||||
version = "0.21.1"
|
||||
dependencies = [
|
||||
"craft-image-codecs",
|
||||
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=947dc5fb0ec436c0841f560eac0d65c6ad055ed4)",
|
||||
"lightcraft-raster",
|
||||
"log",
|
||||
"siphasher",
|
||||
@@ -4211,10 +4288,12 @@ name = "lightcraft-raw"
|
||||
version = "0.21.1"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"craft-image-codecs",
|
||||
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=947dc5fb0ec436c0841f560eac0d65c6ad055ed4)",
|
||||
"craft-jxl",
|
||||
"craft-raw",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=94777dcf7f8962476e96b049d08d22e25b9330c2)",
|
||||
"dhat",
|
||||
"jixel",
|
||||
"lightcraft-color",
|
||||
"lightcraft-geom",
|
||||
"lightcraft-meta",
|
||||
@@ -4226,15 +4305,13 @@ dependencies = [
|
||||
"serde",
|
||||
"sha2",
|
||||
"thiserror 2.0.21",
|
||||
"zune-core",
|
||||
"zune-jpegxl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lightcraft-scenes"
|
||||
version = "0.21.1"
|
||||
dependencies = [
|
||||
"craft-image-codecs",
|
||||
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=947dc5fb0ec436c0841f560eac0d65c6ad055ed4)",
|
||||
"lightcraft-color",
|
||||
"lightcraft-raster",
|
||||
"rayon",
|
||||
|
||||
+6
-8
@@ -19,11 +19,16 @@ craft-crw = { git = "https://github.com/storytold/craft-libs", rev = "94777dcf7f
|
||||
craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "94777dcf7f8962476e96b049d08d22e25b9330c2" }
|
||||
craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "f0f4758c01581d79577b9bf5046c06f4e77b1f18", version = "0.1.0" }
|
||||
craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "b77af389f30bb10de10d8436ca9b39fe94e3bb67", features = ["frames"] }
|
||||
craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "b77af389f30bb10de10d8436ca9b39fe94e3bb67", default-features = false, features = ["decode", "encode"] }
|
||||
craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "478c50560d3c6fad3d613af2a30b35c3bc9f4c0f", default-features = false, features = ["decode", "encode"] }
|
||||
jixel = "=0.3.4"
|
||||
# Photo metadata: EXIF, IPTC-IIM, XMP packets and GPX track logs (craft-libs#949)
|
||||
craft-metadata = { git = "https://github.com/storytold/craft-libs", rev = "94777dcf7f8962476e96b049d08d22e25b9330c2" }
|
||||
craft-jpeg = { git = "https://github.com/storytold/craft-libs", rev = "478c50560d3c6fad3d613af2a30b35c3bc9f4c0f" }
|
||||
# Shared TIFF preflight plus image codec compatibility (craft-libs#1630).
|
||||
craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "947dc5fb0ec436c0841f560eac0d65c6ad055ed4" }
|
||||
craft-video = { git = "https://github.com/storytold/craft-libs", rev = "5c91598ccc86537a779f438d520fa6406c26efe6", features = ["av1", "av1-large-encode", "threads"] }
|
||||
# Isolate AVIF threading from the existing PNG/TIFF/WebP shared revision.
|
||||
craft-avif-encode = { package = "craft-image-codecs", git = "https://github.com/storytold/craft-libs", rev = "5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a", default-features = false, features = ["avif", "threads"] }
|
||||
craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "f0f4758c01581d79577b9bf5046c06f4e77b1f18" }
|
||||
# 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 = "6e03f65bf45181db77ba6229716e6624db9eb25b", features = ["egui"] }
|
||||
@@ -97,13 +102,6 @@ miniz_oxide = "0.9"
|
||||
# codecs
|
||||
ab_glyph = { version = "0.2", default-features = false, features = ["std"] } # Apache-2.0, pure Rust glyph rasterizer (export watermarks)
|
||||
moxcms = { version = "0.9", default-features = false, features = ["lut"] }
|
||||
jxl-oxide = { version = "0.12", default-features = false }
|
||||
zune-core = { version = "0.5", default-features = false, features = ["std"] }
|
||||
zune-jpegxl = { version = "0.5", default-features = false, features = ["std"] } # MIT/Apache-2.0/Zlib lossless JXL encoder (test fixtures only)
|
||||
ravif = { version = "0.13", default-features = false, features = ["threading"] } # no "asm": it needs nasm (non-Rust)
|
||||
# HDR AVIF (PQ): ravif fixes the sRGB transfer curve, so HDR files drive its rav1e + avif-serialize directly
|
||||
rav1e = { version = "0.8.1", default-features = false, features = ["threading"] }
|
||||
avif-serialize = "0.8.6"
|
||||
|
||||
# gpu (crates/gpu; native backends only, no GL: everything stays pure Rust)
|
||||
# SAM 3 inference (lightcraft-segment). 0.9.2: later releases pull `tokenizers` with the
|
||||
|
||||
@@ -27,9 +27,8 @@ rayon = { workspace = true, optional = true }
|
||||
craft-jxl = { workspace = true, optional = true }
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
ravif = { workspace = true, optional = true }
|
||||
rav1e = { workspace = true, optional = true }
|
||||
avif-serialize = { workspace = true, optional = true }
|
||||
craft-video = { workspace = true, optional = true }
|
||||
craft-avif-encode = { workspace = true, optional = true }
|
||||
|
||||
[features]
|
||||
default = ["parallel", "jxl", "avif"]
|
||||
@@ -40,16 +39,14 @@ jxl = ["dep:craft-jxl"]
|
||||
# distributors choose it at build time (HEVC patents are a distributor's call, same policy as
|
||||
# PhotoCraft); `cargo xtask ci` clippies and tests it (`--features heif`), releases don't ship it yet.
|
||||
heif = ["dep:craft-heif"]
|
||||
## AVIF encoding via ravif/rav1e (pure Rust, BSD). Native targets only; a no-op on wasm32.
|
||||
avif = ["dep:ravif", "dep:rav1e", "dep:avif-serialize"]
|
||||
## AVIF/AV1 encoding via craft-image-codecs / craft-video (pure Rust). Native targets only; a no-op on wasm32.
|
||||
avif = ["dep:craft-video", "dep:craft-avif-encode"]
|
||||
|
||||
[dev-dependencies]
|
||||
# tests record why they skip (`cargo xtask ci` lists the skips)
|
||||
lightcraft-testkit = { workspace = true }
|
||||
# JPEG parity tests and the benchmark use the prior/reference encoder only in development.
|
||||
jpeg-encoder = { workspace = true }
|
||||
# JPEG XL tests read encoded samples without our colour conversion
|
||||
jxl-oxide = { workspace = true }
|
||||
proptest = { workspace = true }
|
||||
# Lossless synthetic HEIC files for the `heif` feature's tests.
|
||||
craft-heif = { workspace = true, features = ["testdata"] }
|
||||
|
||||
+38
-182
@@ -54,10 +54,6 @@ impl<'a> EncodeImage<'a> {
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn has_alpha(&self) -> bool {
|
||||
self.channels == 2 || self.channels == 4
|
||||
}
|
||||
}
|
||||
|
||||
/// Metadata to embed.
|
||||
@@ -148,9 +144,9 @@ pub fn encode_jpeg(img: &EncodeImage, quality: u8, subsampling: ChromaSubsamplin
|
||||
.map_err(|e| Error::Encode(e.to_string()))
|
||||
}
|
||||
|
||||
/// Encode PNG (8- or 16-bit; float input is rejected — quantize first).
|
||||
pub fn encode_png(img: &EncodeImage, meta: &EncodeMeta) -> Result<Vec<u8>> {
|
||||
img.validate()?;
|
||||
/// `img` (already validated) as a `craft-image-codecs` image. `refuse_float` is the error for
|
||||
/// 32-bit float samples, for a format that cannot hold them; `None` converts them too.
|
||||
fn shared_image(img: &EncodeImage, refuse_float: Option<&str>) -> Result<craft_image_codecs::Image> {
|
||||
let n = img.width as usize * img.height as usize * img.channels as usize;
|
||||
let layout = match img.channels {
|
||||
1 => craft_image_codecs::ChannelLayout::Gray,
|
||||
@@ -158,12 +154,19 @@ pub fn encode_png(img: &EncodeImage, meta: &EncodeMeta) -> Result<Vec<u8>> {
|
||||
3 => craft_image_codecs::ChannelLayout::Rgb,
|
||||
_ => craft_image_codecs::ChannelLayout::Rgba,
|
||||
};
|
||||
let mut ic_img = match img.samples {
|
||||
Samples::U8(s) => craft_image_codecs::Image::from_u8(img.width, img.height, layout, s[..n].to_vec()),
|
||||
Samples::U16(s) => craft_image_codecs::Image::from_u16(img.width, img.height, layout, &s[..n]),
|
||||
Samples::F32(_) => return Err(Error::Encode("PNG needs 8- or 16-bit samples".into())),
|
||||
match (img.samples, refuse_float) {
|
||||
(Samples::U8(s), _) => craft_image_codecs::Image::from_u8(img.width, img.height, layout, s[..n].to_vec()),
|
||||
(Samples::U16(s), _) => craft_image_codecs::Image::from_u16(img.width, img.height, layout, &s[..n]),
|
||||
(Samples::F32(_), Some(refusal)) => return Err(Error::Encode(refusal.into())),
|
||||
(Samples::F32(s), None) => craft_image_codecs::Image::from_f32(img.width, img.height, layout, &s[..n]),
|
||||
}
|
||||
.map_err(|e| Error::Encode(e.to_string()))?;
|
||||
.map_err(|e| Error::Encode(e.to_string()))
|
||||
}
|
||||
|
||||
/// Encode PNG (8- or 16-bit; float input is rejected — quantize first).
|
||||
pub fn encode_png(img: &EncodeImage, meta: &EncodeMeta) -> Result<Vec<u8>> {
|
||||
img.validate()?;
|
||||
let mut ic_img = shared_image(img, Some("PNG needs 8- or 16-bit samples"))?;
|
||||
ic_img.icc = meta.icc.map(|b| b.to_vec());
|
||||
ic_img.meta.exif = meta.exif.map(|b| b.to_vec());
|
||||
ic_img.meta.xmp = meta.xmp.map(|x| x.to_string());
|
||||
@@ -208,19 +211,7 @@ pub enum TiffCompression {
|
||||
/// ICC and XMP are embedded; EXIF is not (write it through the TIFF writer in `craft-tiff`).
|
||||
pub fn encode_tiff(img: &EncodeImage, compression: TiffCompression, meta: &EncodeMeta) -> Result<Vec<u8>> {
|
||||
img.validate()?;
|
||||
let n = img.width as usize * img.height as usize * img.channels as usize;
|
||||
let layout = match img.channels {
|
||||
1 => craft_image_codecs::ChannelLayout::Gray,
|
||||
2 => craft_image_codecs::ChannelLayout::GrayA,
|
||||
3 => craft_image_codecs::ChannelLayout::Rgb,
|
||||
_ => craft_image_codecs::ChannelLayout::Rgba,
|
||||
};
|
||||
let mut ic_img = match img.samples {
|
||||
Samples::U8(s) => craft_image_codecs::Image::from_u8(img.width, img.height, layout, s[..n].to_vec()),
|
||||
Samples::U16(s) => craft_image_codecs::Image::from_u16(img.width, img.height, layout, &s[..n]),
|
||||
Samples::F32(s) => craft_image_codecs::Image::from_f32(img.width, img.height, layout, &s[..n]),
|
||||
}
|
||||
.map_err(|e| Error::Encode(e.to_string()))?;
|
||||
let mut ic_img = shared_image(img, None)?;
|
||||
ic_img.icc = meta.icc.map(|b| b.to_vec());
|
||||
ic_img.meta.xmp = meta.xmp.map(|x| x.to_string());
|
||||
ic_img.meta.dpi = meta.ppi.filter(|p| *p > 0).map(|p| (p as f32, p as f32));
|
||||
@@ -299,37 +290,27 @@ pub fn encode_avif(img: &EncodeImage, quality: u8, speed: u8, meta: &EncodeMeta)
|
||||
img.validate()?;
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
{
|
||||
let mut enc = ravif::Encoder::new()
|
||||
.with_quality(quality.clamp(1, 100) as f32)
|
||||
.with_alpha_quality(quality.clamp(1, 100) as f32)
|
||||
.with_speed(speed.clamp(1, 10));
|
||||
if let Some(exif) = meta.exif {
|
||||
enc = enc.with_exif(exif.to_vec());
|
||||
}
|
||||
let s = match img.samples {
|
||||
Samples::U8(s) => s,
|
||||
Samples::U16(s) => return avif_10bit(&enc, img, s),
|
||||
Samples::F32(_) => return Err(Error::Encode("AVIF encoder needs 8- or 16-bit samples".into())),
|
||||
// Keep AVIF on its threading-capable shared revision without changing other codecs.
|
||||
use craft_avif_encode::{ChannelLayout, Image};
|
||||
let n = img.width as usize * img.height as usize * img.channels as usize;
|
||||
let layout = match img.channels {
|
||||
1 => ChannelLayout::Gray,
|
||||
2 => ChannelLayout::GrayA,
|
||||
3 => ChannelLayout::Rgb,
|
||||
_ => ChannelLayout::Rgba,
|
||||
};
|
||||
let n = img.width as usize * img.height as usize;
|
||||
let ch = img.channels as usize;
|
||||
let px: Vec<ravif::RGBA8> = s
|
||||
.chunks_exact(ch)
|
||||
.take(n)
|
||||
.map(|c| match ch {
|
||||
1 => ravif::RGBA8::new(c[0], c[0], c[0], 255),
|
||||
2 => ravif::RGBA8::new(c[0], c[0], c[0], c[1]),
|
||||
3 => ravif::RGBA8::new(c[0], c[1], c[2], 255),
|
||||
_ => ravif::RGBA8::new(c[0], c[1], c[2], c[3]),
|
||||
})
|
||||
.collect();
|
||||
let r = enc.encode_rgba(ravif::Img::new(&px[..], img.width as usize, img.height as usize)).map_err(|e| Error::Encode(e.to_string()))?;
|
||||
let _ = img.has_alpha();
|
||||
Ok(r.avif_file)
|
||||
let mut ic_img = match img.samples {
|
||||
Samples::U8(s) => Image::from_u8(img.width, img.height, layout, s[..n].to_vec()),
|
||||
Samples::U16(s) => Image::from_u16(img.width, img.height, layout, &s[..n]),
|
||||
Samples::F32(_) => return Err(Error::Encode("AVIF encoder needs 8- or 16-bit samples".into())),
|
||||
}
|
||||
.map_err(|e| Error::Encode(e.to_string()))?;
|
||||
ic_img.meta.exif = meta.exif.map(|e| e.to_vec());
|
||||
craft_avif_encode::encode_avif_with_speed(&ic_img, quality, speed).map_err(|e| Error::Encode(e.to_string()))
|
||||
}
|
||||
#[cfg(not(all(feature = "avif", not(target_arch = "wasm32"))))]
|
||||
{
|
||||
let _ = (quality, speed, meta, img.has_alpha());
|
||||
let _ = (quality, speed, meta);
|
||||
Err(Error::Encode("AVIF encoding is not available in this build".into()))
|
||||
}
|
||||
}
|
||||
@@ -401,108 +382,12 @@ pub fn encode_avif_hdr(width: u32, height: u32, rgb: &[f32], quality: u8, speed:
|
||||
}
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
{
|
||||
use rav1e::prelude::*;
|
||||
const K: [f32; 3] = [0.2627, 0.6780, 0.0593]; // BT.2020 NCL
|
||||
let mut max_nits = 0f32;
|
||||
let mut sum_nits = 0f64;
|
||||
let planes: Vec<[u16; 3]> = rgb
|
||||
.as_chunks::<3>()
|
||||
.0
|
||||
.iter()
|
||||
.take(n)
|
||||
.map(|c| {
|
||||
let nits = c.map(|v| (if v.is_finite() { v.max(0.0) } else { 0.0 }) * HDR_REFERENCE_WHITE_NITS);
|
||||
let y_nits = K[0] * nits[0] + K[1] * nits[1] + K[2] * nits[2];
|
||||
max_nits = max_nits.max(nits[0].max(nits[1]).max(nits[2]));
|
||||
sum_nits += y_nits as f64;
|
||||
let [r, g, b] = match transfer {
|
||||
HdrTransfer::Pq => nits.map(pq_encode),
|
||||
HdrTransfer::Hlg => hlg_signal([c[0], c[1], c[2]]),
|
||||
};
|
||||
let y = K[0] * r + K[1] * g + K[2] * b;
|
||||
let cb = (b - y) / (2.0 * (1.0 - K[2])) + 0.5;
|
||||
let cr = (r - y) / (2.0 * (1.0 - K[0])) + 0.5;
|
||||
[y, cb, cr].map(|v| (v * 1023.0).round().clamp(0.0, 1023.0) as u16)
|
||||
})
|
||||
.collect();
|
||||
let q = quality.clamp(1, 100) as f32 / 100.0;
|
||||
// ravif's quality → quantizer curve, so qualities match the SDR AVIF path
|
||||
let x = if q >= 0.82 {
|
||||
(1.0 - q) * 2.6
|
||||
} else if q > 0.25 {
|
||||
1.0 - 0.125 - q * 0.5
|
||||
} else {
|
||||
1.0 - q
|
||||
let _ = (w, h, n);
|
||||
let t = match transfer {
|
||||
HdrTransfer::Pq => craft_avif_encode::HdrTransfer::Pq,
|
||||
HdrTransfer::Hlg => craft_avif_encode::HdrTransfer::Hlg,
|
||||
};
|
||||
let quantizer = (x * 255.0).round() as usize;
|
||||
let mut ec = EncoderConfig::with_speed_preset(speed.clamp(1, 10));
|
||||
ec.width = w;
|
||||
ec.height = h;
|
||||
ec.time_base = Rational::new(1, 1);
|
||||
ec.bit_depth = 10;
|
||||
ec.chroma_sampling = ChromaSampling::Cs444;
|
||||
ec.pixel_range = PixelRange::Full;
|
||||
ec.color_description = Some(ColorDescription {
|
||||
color_primaries: ColorPrimaries::BT2020,
|
||||
transfer_characteristics: match transfer {
|
||||
HdrTransfer::Pq => TransferCharacteristics::SMPTE2084,
|
||||
HdrTransfer::Hlg => TransferCharacteristics::HLG,
|
||||
},
|
||||
matrix_coefficients: MatrixCoefficients::BT2020NCL,
|
||||
});
|
||||
let cll = (max_nits.ceil().clamp(1.0, 10_000.0) as u16, ((sum_nits / n as f64).ceil().clamp(1.0, 10_000.0)) as u16);
|
||||
ec.content_light =
|
||||
(transfer == HdrTransfer::Pq).then_some(ContentLight { max_content_light_level: cll.0, max_frame_average_light_level: cll.1 });
|
||||
ec.still_picture = true;
|
||||
ec.quantizer = quantizer;
|
||||
ec.min_quantizer = quantizer.min(255) as u8;
|
||||
ec.speed_settings.multiref = false;
|
||||
ec.speed_settings.rdo_lookahead_frames = 1;
|
||||
ec.speed_settings.scene_detection_mode = SceneDetectionSpeed::None;
|
||||
let e = |e: &dyn std::fmt::Display| Error::Encode(format!("AV1: {e}"));
|
||||
let mut ctx: Context<u16> = Config::new().with_encoder_config(ec).new_context().map_err(|x| e(&x))?;
|
||||
let mut frame = ctx.new_frame();
|
||||
{
|
||||
let mut it = planes.iter();
|
||||
let mut fp = frame.planes.iter_mut();
|
||||
let (Some(py), Some(pu), Some(pv)) = (fp.next(), fp.next(), fp.next()) else {
|
||||
return Err(Error::Encode("AV1: frame has no planes".into()));
|
||||
};
|
||||
let (mut sy, mut su, mut sv) = (py.mut_slice(Default::default()), pu.mut_slice(Default::default()), pv.mut_slice(Default::default()));
|
||||
for ((ry, ru), rv) in sy.rows_iter_mut().zip(su.rows_iter_mut()).zip(sv.rows_iter_mut()).take(h) {
|
||||
for ((y, u), v) in ry.iter_mut().zip(ru.iter_mut()).zip(rv.iter_mut()).take(w) {
|
||||
let Some(p) = it.next() else { break };
|
||||
(*y, *u, *v) = (p[0], p[1], p[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
ctx.send_frame(frame).map_err(|x| e(&x))?;
|
||||
ctx.flush();
|
||||
let mut av1 = Vec::new();
|
||||
loop {
|
||||
match ctx.receive_packet() {
|
||||
Ok(mut p) if p.frame_type == FrameType::KEY => av1.append(&mut p.data),
|
||||
Ok(_) => {}
|
||||
Err(EncoderStatus::Encoded | EncoderStatus::LimitReached) => break,
|
||||
Err(x) => return Err(e(&x)),
|
||||
}
|
||||
}
|
||||
use avif_serialize::constants as c;
|
||||
let mut a = avif_serialize::Aviffy::new();
|
||||
a.set_matrix_coefficients(c::MatrixCoefficients::Bt2020Ncl)
|
||||
.set_transfer_characteristics(match transfer {
|
||||
HdrTransfer::Pq => c::TransferCharacteristics::Smpte2084,
|
||||
HdrTransfer::Hlg => c::TransferCharacteristics::Hlg,
|
||||
})
|
||||
.set_color_primaries(c::ColorPrimaries::Bt2020)
|
||||
.set_full_color_range(true);
|
||||
if transfer == HdrTransfer::Pq {
|
||||
a.set_content_light_level(cll.0, cll.1);
|
||||
}
|
||||
if let Some(exif) = meta.exif {
|
||||
a.set_exif(exif.to_vec());
|
||||
}
|
||||
Ok(a.to_vec(&av1, None, width, height, 10))
|
||||
craft_avif_encode::encode_avif_hdr(width, height, rgb, quality, speed, meta.exif, t).map_err(|e| Error::Encode(e.to_string()))
|
||||
}
|
||||
#[cfg(not(all(feature = "avif", not(target_arch = "wasm32"))))]
|
||||
{
|
||||
@@ -555,35 +440,6 @@ fn png_chunk(kind: [u8; 4], data: &[u8]) -> Vec<u8> {
|
||||
out
|
||||
}
|
||||
|
||||
/// 16-bit RGB(A) → 10-bit BT.601 full-range YCbCr planes (the matrix `ravif` uses for 8-bit input).
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
fn avif_10bit(enc: &ravif::Encoder, img: &EncodeImage, s: &[u16]) -> Result<Vec<u8>> {
|
||||
const K: [f32; 3] = [0.299, 0.587, 0.114];
|
||||
let n = img.width as usize * img.height as usize;
|
||||
let ch = img.channels as usize;
|
||||
let rgb = |c: &[u16]| -> [f32; 3] {
|
||||
let v = |x: u16| x as f32 * (1023.0 / 65535.0);
|
||||
match ch {
|
||||
1 | 2 => [v(c[0]); 3],
|
||||
_ => [v(c[0]), v(c[1]), v(c[2])],
|
||||
}
|
||||
};
|
||||
let planes = s.chunks_exact(ch).take(n).map(|c| {
|
||||
let [r, g, b] = rgb(c);
|
||||
let y = K[0] * r + K[1] * g + K[2] * b;
|
||||
let cb = (b - y) * (0.5 / (1.0 - K[2])) + 512.0;
|
||||
let cr = (r - y) * (0.5 / (1.0 - K[0])) + 512.0;
|
||||
[y, cb, cr].map(|v| v.round().clamp(0.0, 1023.0) as u16)
|
||||
});
|
||||
let alpha_at = |c: &[u16]| if img.has_alpha() { c[ch - 1] } else { u16::MAX };
|
||||
let has_alpha = s.chunks_exact(ch).take(n).any(|c| alpha_at(c) != u16::MAX);
|
||||
let alpha = has_alpha.then(|| s.chunks_exact(ch).take(n).map(move |c| ((alpha_at(c) as u32 * 1023 + 32767) / 65535) as u16));
|
||||
let r = enc
|
||||
.encode_raw_planes_10_bit(img.width as usize, img.height as usize, planes, alpha, ravif::PixelRange::Full, ravif::MatrixCoefficients::BT601)
|
||||
.map_err(|e| Error::Encode(e.to_string()))?;
|
||||
Ok(r.avif_file)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod hlg_tests {
|
||||
use super::*;
|
||||
|
||||
+129
-61
@@ -831,13 +831,15 @@ pub fn quantizer(quality: u8) -> usize {
|
||||
/// the samples as they come out (in order: no frame reordering).
|
||||
pub struct Av1Encoder {
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
ctx: rav1e::Context<u8>,
|
||||
/// Each frame sent so far: its duration (by input frame number).
|
||||
#[cfg_attr(not(all(feature = "avif", not(target_arch = "wasm32"))), allow(dead_code))]
|
||||
enc: craft_video::av1::LargeEncoder,
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
durations: Vec<u64>,
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
returned: usize,
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
failed: bool,
|
||||
width: usize,
|
||||
height: usize,
|
||||
seq_header: Option<Vec<u8>>,
|
||||
}
|
||||
|
||||
impl Av1Encoder {
|
||||
@@ -848,30 +850,12 @@ impl Av1Encoder {
|
||||
}
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
{
|
||||
use rav1e::prelude::*;
|
||||
let mut ec = EncoderConfig::with_speed_preset(c.speed.clamp(1, 10));
|
||||
ec.width = w;
|
||||
ec.height = h;
|
||||
ec.time_base = Rational::new(1, u64::from(c.fps));
|
||||
ec.bit_depth = 8;
|
||||
ec.chroma_sampling = ChromaSampling::Cs420;
|
||||
ec.pixel_range = PixelRange::Limited;
|
||||
ec.color_description = Some(ColorDescription {
|
||||
color_primaries: ColorPrimaries::BT709,
|
||||
transfer_characteristics: TransferCharacteristics::BT709,
|
||||
matrix_coefficients: MatrixCoefficients::BT709,
|
||||
});
|
||||
// in order, one shown frame per packet: samples map 1:1 to the frames sent
|
||||
ec.low_latency = true;
|
||||
let q = quantizer(c.quality);
|
||||
ec.quantizer = q;
|
||||
ec.min_quantizer = q.min(255) as u8;
|
||||
ec.min_key_frame_interval = 1;
|
||||
ec.max_key_frame_interval = 120;
|
||||
// tiles are what rav1e encodes in parallel (16 measured best for 1080p on 32 threads)
|
||||
ec.tiles = std::thread::available_parallelism().map_or(4, |n| n.get()).clamp(2, 16);
|
||||
let ctx: Context<u8> = Config::new().with_encoder_config(ec).new_context().map_err(|e| bad(format!("AV1: {e}")))?;
|
||||
Ok(Av1Encoder { ctx, durations: Vec::new(), width: w, height: h, seq_header: None })
|
||||
use craft_video::av1::{EncoderConfig, RateControl};
|
||||
let mut ec = EncoderConfig::new(w as u32, h as u32, c.fps, 1);
|
||||
ec.rate = RateControl::ConstantQ(quantizer(c.quality) as u8);
|
||||
ec.keyint = 120;
|
||||
let enc = craft_video::av1::LargeEncoder::with_exact_quantizer(&ec, c.speed).map_err(|e| bad(format!("AV1: {e}")))?;
|
||||
Ok(Av1Encoder { enc, durations: Vec::new(), returned: 0, failed: false, width: w, height: h })
|
||||
}
|
||||
#[cfg(not(all(feature = "avif", not(target_arch = "wasm32"))))]
|
||||
{
|
||||
@@ -885,10 +869,16 @@ impl Av1Encoder {
|
||||
(self.width, self.height)
|
||||
}
|
||||
|
||||
/// The configuration record for the container ([`av1_config`]), once the first sample (with
|
||||
/// the sequence header) has come out.
|
||||
/// The configuration record for the container (`av1C`), once the first sample has come out.
|
||||
pub fn config_record(&self) -> Option<Vec<u8>> {
|
||||
self.seq_header.as_ref().map(|s| av1_config(s))
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
{
|
||||
self.enc.av1c()
|
||||
}
|
||||
#[cfg(not(all(feature = "avif", not(target_arch = "wasm32"))))]
|
||||
{
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// Encode `rgba` (`width × height` of [`Self::size`]) shown for `periods` frame periods;
|
||||
@@ -898,17 +888,19 @@ impl Av1Encoder {
|
||||
let (y, u, v) = yuv420(rgba, self.width, self.height)?;
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
{
|
||||
let mut frame = self.ctx.new_frame();
|
||||
for (plane, (data, w)) in frame.planes.iter_mut().zip([(&y, self.width), (&u, self.width / 2), (&v, self.width / 2)]) {
|
||||
plane.copy_from_raw_u8(data, w, 1);
|
||||
if self.failed {
|
||||
return Err(bad("AV1 encoder failed earlier"));
|
||||
}
|
||||
let params = rav1e::prelude::FrameParameters {
|
||||
frame_type_override: if key { rav1e::prelude::FrameTypeOverride::Key } else { rav1e::prelude::FrameTypeOverride::No },
|
||||
..Default::default()
|
||||
};
|
||||
self.ctx.send_frame((frame, params)).map_err(|e| bad(format!("AV1: {e}")))?;
|
||||
let y16: Vec<u16> = y.into_iter().map(u16::from).collect();
|
||||
let u16_: Vec<u16> = u.into_iter().map(u16::from).collect();
|
||||
let v16: Vec<u16> = v.into_iter().map(u16::from).collect();
|
||||
let frame = craft_video::av1::Frame { y: &y16, u: &u16_, v: &v16, y_stride: self.width, uv_stride: self.width / 2 };
|
||||
self.durations.push(periods.max(1));
|
||||
self.drain()
|
||||
let packets = self.enc.push(&frame, key).map_err(|e| {
|
||||
self.failed = true;
|
||||
bad(format!("AV1: {e}"))
|
||||
})?;
|
||||
self.samples(packets)
|
||||
}
|
||||
#[cfg(not(all(feature = "avif", not(target_arch = "wasm32"))))]
|
||||
{
|
||||
@@ -921,33 +913,38 @@ impl Av1Encoder {
|
||||
pub fn finish(&mut self) -> Result<Vec<Sample>> {
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
{
|
||||
self.ctx.flush();
|
||||
self.drain()
|
||||
if self.failed {
|
||||
return Err(bad("AV1 encoder failed earlier"));
|
||||
}
|
||||
let packets = self.enc.finish().map_err(|e| {
|
||||
self.failed = true;
|
||||
bad(format!("AV1: {e}"))
|
||||
})?;
|
||||
let samples = self.samples(packets)?;
|
||||
if self.returned != self.durations.len() {
|
||||
self.failed = true;
|
||||
return Err(bad("AV1 encoder did not return every input frame"));
|
||||
}
|
||||
Ok(samples)
|
||||
}
|
||||
#[cfg(not(all(feature = "avif", not(target_arch = "wasm32"))))]
|
||||
Err(bad("AV1 video encoding is not available in this build"))
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
fn drain(&mut self) -> Result<Vec<Sample>> {
|
||||
use rav1e::prelude::*;
|
||||
let mut out = Vec::new();
|
||||
loop {
|
||||
match self.ctx.receive_packet() {
|
||||
Ok(p) => {
|
||||
let (data, seq) = to_sample_data(&p.data)?;
|
||||
if self.seq_header.is_none() {
|
||||
self.seq_header = seq;
|
||||
}
|
||||
let duration = usize::try_from(p.input_frameno).ok().and_then(|i| self.durations.get(i)).copied().unwrap_or(1);
|
||||
out.push(Sample { data, key: p.frame_type == FrameType::KEY, duration });
|
||||
}
|
||||
Err(EncoderStatus::Encoded) => {}
|
||||
Err(EncoderStatus::NeedMoreData | EncoderStatus::LimitReached) => break,
|
||||
Err(e) => return Err(bad(format!("AV1: {e}"))),
|
||||
}
|
||||
fn samples(&mut self, packets: Vec<craft_video::av1::BufferedPacket>) -> Result<Vec<Sample>> {
|
||||
let mut samples = Vec::with_capacity(packets.len());
|
||||
for packet in packets {
|
||||
let index = usize::try_from(packet.input_frame_number).ok();
|
||||
let duration = index.filter(|&i| i == self.returned).and_then(|i| self.durations.get(i)).copied();
|
||||
let Some(duration) = duration else {
|
||||
self.failed = true;
|
||||
return Err(bad("AV1 encoder returned an unknown or out-of-order frame"));
|
||||
};
|
||||
self.returned += 1;
|
||||
samples.push(Sample { data: packet.packet.data, key: packet.packet.keyframe, duration });
|
||||
}
|
||||
Ok(out)
|
||||
Ok(samples)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1141,7 +1138,8 @@ mod tests {
|
||||
out.extend(e.finish().unwrap());
|
||||
assert_eq!(out.len(), 4, "one sample per frame sent");
|
||||
assert!(out[0].key);
|
||||
assert_eq!(out.iter().map(|s| s.duration).sum::<u64>(), 56);
|
||||
assert!(out[3].key, "requested key frame");
|
||||
assert_eq!(out.iter().map(|s| s.duration).collect::<Vec<_>>(), [24, 1, 1, 30]);
|
||||
for s in &out {
|
||||
assert!(obus(&s.data).unwrap().iter().all(|(k, _)| *k != OBU_TEMPORAL_DELIMITER));
|
||||
}
|
||||
@@ -1155,4 +1153,74 @@ mod tests {
|
||||
let d = m.finish().unwrap().into_inner();
|
||||
assert_eq!(boxes(&d, 0..d.len()).len(), 3);
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
#[test]
|
||||
fn av1_buffers_a_large_frame_and_preserves_its_duration() {
|
||||
let c = VideoConfig { width: 4112, height: 16, fps: 30, quality: 60, speed: 10 };
|
||||
let mut encoder = Av1Encoder::new(&c).unwrap();
|
||||
let mut samples = encoder.push(&vec![[80, 120, 180, 255]; 4112 * 16], 7, true).unwrap();
|
||||
samples.extend(encoder.finish().unwrap());
|
||||
assert_eq!(samples.len(), 1);
|
||||
assert_eq!(samples[0].duration, 7);
|
||||
assert!(samples[0].key);
|
||||
assert!(encoder.config_record().is_some());
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
#[test]
|
||||
fn av1_preserves_frame_sizes_above_the_old_area_limit() {
|
||||
for (width, height) in [(5120, 2160), (4096, 4096)] {
|
||||
let cfg = VideoConfig { width, height, fps: 30, quality: 60, speed: 10 };
|
||||
let mut encoder = Av1Encoder::new(&cfg).unwrap();
|
||||
let mut samples = encoder.push(&vec![[80, 120, 180, 255]; width as usize * height as usize], 7, true).unwrap();
|
||||
samples.extend(encoder.finish().unwrap());
|
||||
assert_eq!(samples.len(), 1, "{width}x{height}");
|
||||
assert!(!samples[0].data.is_empty());
|
||||
assert_eq!(samples[0].duration, 7);
|
||||
assert!(samples[0].key);
|
||||
assert!(encoder.config_record().is_some());
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
#[test]
|
||||
fn av1_quality_100_preserves_the_exact_zero_quantizer() {
|
||||
assert_eq!(quantizer(100), 0);
|
||||
let image: Vec<[u8; 4]> = (0..64 * 48).map(|i| [(i * 13) as u8, (i * 41) as u8, (i * 73) as u8, 255]).collect();
|
||||
let cfg = VideoConfig { width: 64, height: 48, fps: 24, quality: 100, speed: 10 };
|
||||
let mut actual = Av1Encoder::new(&cfg).unwrap();
|
||||
let mut samples = actual.push(&image, 7, true).unwrap();
|
||||
samples.extend(actual.finish().unwrap());
|
||||
|
||||
let (y, u, v) = yuv420(&image, 64, 48).unwrap();
|
||||
let y: Vec<u16> = y.into_iter().map(u16::from).collect();
|
||||
let u: Vec<u16> = u.into_iter().map(u16::from).collect();
|
||||
let v: Vec<u16> = v.into_iter().map(u16::from).collect();
|
||||
let frame = craft_video::av1::Frame { y: &y, u: &u, v: &v, y_stride: 64, uv_stride: 32 };
|
||||
let mut ec = craft_video::av1::EncoderConfig::new(64, 48, 24, 1);
|
||||
ec.rate = craft_video::av1::RateControl::ConstantQ(0);
|
||||
ec.keyint = 120;
|
||||
let mut exact = craft_video::av1::LargeEncoder::with_exact_quantizer(&ec, 10).unwrap();
|
||||
let mut expected = exact.push(&frame, true).unwrap();
|
||||
expected.extend(exact.finish().unwrap());
|
||||
assert_eq!(samples.len(), 1);
|
||||
assert_eq!(samples[0].data, expected[0].packet.data);
|
||||
assert_eq!(samples[0].duration, 7);
|
||||
assert!(samples[0].key);
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "avif", not(target_arch = "wasm32")))]
|
||||
#[test]
|
||||
fn av1_speed_affects_normal_sized_frames() {
|
||||
let image: Vec<[u8; 4]> = (0..64 * 48).map(|i| [(i * 13) as u8, (i * 41) as u8, (i * 73) as u8, 255]).collect();
|
||||
let encode = |speed| {
|
||||
let c = VideoConfig { width: 64, height: 48, fps: 24, quality: 60, speed };
|
||||
let mut encoder = Av1Encoder::new(&c).unwrap();
|
||||
let mut samples = encoder.push(&image, 1, true).unwrap();
|
||||
samples.extend(encoder.finish().unwrap());
|
||||
samples.remove(0).data
|
||||
};
|
||||
assert_ne!(encode(1), encode(10), "AV1 speed must reach the shared encoder");
|
||||
}
|
||||
}
|
||||
@@ -51,23 +51,14 @@ fn metadata_in_final_feed_matches_builder() {
|
||||
box_bytes(&mut bytes, b"Exif", &exif_box);
|
||||
box_bytes(&mut bytes, b"xml ", b"<xmp/>");
|
||||
assert!(bytes.len() < 8192, "metadata must fit in the completing input chunk");
|
||||
let old = jxl_oxide::JxlImage::builder().read(bytes.as_slice()).unwrap();
|
||||
let old_exif = match old.aux_boxes().first_exif().unwrap() {
|
||||
jxl_oxide::AuxBoxData::Data(ex) => ex.payload().to_vec(),
|
||||
_ => panic!("builder must preserve Exif in its final feed"),
|
||||
};
|
||||
let old_xml = match old.aux_boxes().first_xml() {
|
||||
jxl_oxide::AuxBoxData::Data(xml) => xml.to_vec(),
|
||||
_ => panic!("builder must preserve XMP in its final feed"),
|
||||
};
|
||||
let decoded = decode(&bytes, DecodeOptions::default()).unwrap();
|
||||
assert_eq!(decoded.exif.as_deref(), Some(old_exif.as_slice()));
|
||||
assert_eq!(decoded.xmp.as_deref(), Some(std::str::from_utf8(&old_xml).unwrap()));
|
||||
assert_eq!(decoded.exif.as_deref(), Some(exif.as_slice()));
|
||||
assert_eq!(decoded.xmp.as_deref(), Some("<xmp/>"));
|
||||
assert_eq!(decoded.to_srgb8(), pixels);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn progressive_truncation_matches_builder() {
|
||||
fn progressive_truncation_matches_shared_decoder() {
|
||||
let pixels = Rgba8::from_fn(96, 64, |x, y| {
|
||||
let mut seed = (y * 96 + x + 1) as u32;
|
||||
let mut rgb = [0; 4];
|
||||
@@ -86,11 +77,16 @@ fn progressive_truncation_matches_builder() {
|
||||
.unwrap();
|
||||
let raw = codestream(&encoded);
|
||||
assert!(raw.len() > 4096, "fixture must exercise post-header feeds");
|
||||
for cut in [0, 1, 2, 12, 4095, 4096, 4097, raw.len() / 2, raw.len() - 1, raw.len()] {
|
||||
let bytes = &raw[..cut];
|
||||
// `finalize` permits partial images: rendering determines whether frame 0 is usable.
|
||||
let old_ok = jxl_oxide::JxlImage::builder().read(bytes).is_ok_and(|image| image.render_frame(0).is_ok());
|
||||
assert_eq!(decode(bytes, DecodeOptions::default()).is_ok(), old_ok, "lossless={lossless}, cut={cut}/{}", raw.len());
|
||||
for cut in [0, 1, 2, 12] {
|
||||
assert!(decode(&raw[..cut], DecodeOptions::default()).is_err(), "lossless={lossless}, cut={cut}/{}", raw.len());
|
||||
}
|
||||
// Progressive streams may contain a renderable partial frame. Preserve the
|
||||
// post-header feed-boundary cases instead of requiring every truncation to fail.
|
||||
for cut in [4095, 4096, 4097, raw.len() / 2, raw.len() - 1, raw.len()] {
|
||||
let bytes = &raw[..cut];
|
||||
let shared_ok = craft_jxl::decode_with_color(bytes, craft_jxl::DecodeLimits::default(), craft_jxl::OutputColor::LinearRec2020).is_ok();
|
||||
assert_eq!(decode(bytes, DecodeOptions::default()).is_ok(), shared_ok, "lossless={lossless}, cut={cut}/{}", raw.len());
|
||||
}
|
||||
assert!(decode(&raw, DecodeOptions::default()).is_ok(), "lossless={lossless}");
|
||||
}
|
||||
}
|
||||
@@ -670,6 +670,24 @@ fn avif_encode_native() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn avif_keeps_exif() {
|
||||
// The ravif path wrote EXIF; the shared encoder must keep it, for 8- and 16-bit input.
|
||||
let img = smooth(16, 12);
|
||||
let exif = minimal_exif(3);
|
||||
let meta = EncodeMeta { exif: Some(&exif), ..Default::default() };
|
||||
let wide: Vec<u16> = img.data.iter().flat_map(|p| p.map(|c| u16::from(c) * 257)).collect();
|
||||
for image in [EncodeImage::rgba8(&img), EncodeImage::new(16, 12, 4, Samples::U16(&wide))] {
|
||||
let r = encode_avif(&image, 70, 10, &meta);
|
||||
if cfg!(feature = "avif") {
|
||||
let b = r.unwrap();
|
||||
assert!(b.windows(exif.len()).any(|w| w == &exif[..]), "EXIF missing from the AVIF");
|
||||
} else {
|
||||
assert!(r.is_err());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn raw_routing() {
|
||||
let mut b = b"II*\0\x08\0\0\0".to_vec();
|
||||
@@ -962,23 +980,21 @@ fn jxl_alpha_and_gray() {
|
||||
#[test]
|
||||
#[cfg(feature = "jxl")]
|
||||
fn jxl_hdr_pq() {
|
||||
// linear Rec. 2020, SDR white = 1.0: the left half at SDR white, the right half four times brighter
|
||||
// linear Rec. 2020 input, with SDR white = 203 cd/m²; samples are encoded as BT.2020 PQ.
|
||||
let (w, h) = (64usize, 32usize);
|
||||
let px: Vec<f32> = (0..w * h).flat_map(|i| [if i % w < w / 2 { 1.0 } else { 4.0 }; 3]).collect();
|
||||
for lossless in [false, true] {
|
||||
let o = JxlOptions { lossless, quality: 95, colour: JxlColour::Rec2020Pq, ..Default::default() };
|
||||
let b = encode_jxl(&EncodeImage::new(w as u32, h as u32, 3, Samples::F32(&px)), &o, &EncodeMeta::default()).unwrap();
|
||||
// the file's own samples: PQ code values for 203 and 812 cd/m²
|
||||
let img = jxl_oxide::JxlImage::builder().read(std::io::Cursor::new(&b)).unwrap();
|
||||
let m = &img.image_header().metadata;
|
||||
assert_eq!(m.tone_mapping.intensity_target, 10_000.0);
|
||||
assert!(format!("{:?}", m.colour_encoding).contains("Pq"), "{:?}", m.colour_encoding);
|
||||
let r = img.render_frame(0).unwrap();
|
||||
let fb = r.image_all_channels();
|
||||
let at = |x: usize| fb.buf()[((h / 2) * w + x) * fb.channels() + 1];
|
||||
for (x, nits) in [(w / 4, HDR_REFERENCE_WHITE_NITS), (w * 3 / 4, 4.0 * HDR_REFERENCE_WHITE_NITS)] {
|
||||
let (got, want) = (at(x), lightcraft_codecs::encode::pq_encode(nits));
|
||||
assert!((got - want).abs() < 0.005, "lossless={lossless}: {nits} cd/m² written as {got}, want {want}");
|
||||
// DecoderDefault keeps the file's PQ transfer encoding, so compare against the PQ codes
|
||||
// for 203 and 812 cd/m² rather than linear-light input values.
|
||||
let dec = craft_jxl::decode(&b, craft_jxl::DecodeLimits::default()).unwrap();
|
||||
assert_eq!(dec.rendered_cicp, Some([9, 16, 0, 1]));
|
||||
let ch = dec.layout.channels();
|
||||
let at = |x: usize| dec.pixels[((h / 2) * w + x) * ch + 1];
|
||||
for (x, want) in [(w / 4, 0.5807f32), (w * 3 / 4, 0.7292f32)] {
|
||||
let got = at(x);
|
||||
assert!((got - want).abs() < 0.01, "lossless={lossless}: PQ code {got}, want {want}");
|
||||
}
|
||||
}
|
||||
// float samples are HDR only
|
||||
|
||||
@@ -67,7 +67,7 @@ rawnind-model = ["denoise", "lightcraft-denoise/rawnind-model", "lightcraft-deno
|
||||
# tests record why they skip (`cargo xtask ci` lists the skips)
|
||||
lightcraft-testkit = { workspace = true }
|
||||
# HDR JPEG XL tests read the file's colour encoding
|
||||
jxl-oxide = { workspace = true }
|
||||
craft-jxl = { workspace = true }
|
||||
# Lossless synthetic HEIC files (the import test; decoded when the codecs' `heif` feature is on).
|
||||
craft-heif = { workspace = true, features = ["testdata"] }
|
||||
libc = { workspace = true }
|
||||
|
||||
@@ -1128,16 +1128,15 @@ fn hdr_jxl_export_is_pq_rec2020() {
|
||||
s.execute("develop.hdr", &json!({"enabled": true, "maxEv": 2})).unwrap();
|
||||
let hdr = export_photo(&mut s, id, &o, 1).unwrap();
|
||||
let encoding = |b: &[u8]| {
|
||||
let img = jxl_oxide::JxlImage::builder().read(std::io::Cursor::new(b)).unwrap();
|
||||
let m = &img.image_header().metadata;
|
||||
(format!("{:?}", m.colour_encoding), m.bit_depth.bits_per_sample())
|
||||
let dec = craft_jxl::decode(b, craft_jxl::DecodeLimits::default()).unwrap();
|
||||
(dec.rendered_cicp, dec.bit_depth)
|
||||
};
|
||||
let (c, bits) = encoding(&hdr.bytes);
|
||||
assert!(c.contains("Bt2100") && c.contains("Pq"), "{c}");
|
||||
let (cicp, bits) = encoding(&hdr.bytes);
|
||||
assert_eq!(cicp, Some([9, 16, 0, 1]), "{cicp:?}");
|
||||
assert_eq!(bits, 16);
|
||||
// a photo without an HDR edit exports as an ordinary SDR file
|
||||
let (c, _) = encoding(&sdr.bytes);
|
||||
assert!(!c.contains("Pq"), "{c}");
|
||||
let (cicp, _) = encoding(&sdr.bytes);
|
||||
assert_ne!(cicp.map(|c| c[1]), Some(16), "{cicp:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -26,8 +26,8 @@ craft-image-codecs = { workspace = true }
|
||||
# tests record why they skip (`cargo xtask ci` lists the skips)
|
||||
lightcraft-testkit = { workspace = true }
|
||||
proptest = { workspace = true }
|
||||
zune-jpegxl = { workspace = true }
|
||||
zune-core = { workspace = true }
|
||||
craft-jxl = { workspace = true }
|
||||
jixel = { workspace = true }
|
||||
# Pinned CC0 corpus identities; not a product dependency.
|
||||
sha2 = { version = "0.10", default-features = false, features = ["std"] }
|
||||
# Peak-heap regression tests (tests/sr2_heap.rs); not a product dependency.
|
||||
|
||||
+49
-20
@@ -631,18 +631,47 @@ fn malformed_profile_look_tags_are_ignored() {
|
||||
|
||||
/// Lossless JPEG XL codestream of `px` (`w × h × cpp` interleaved), 16-bit unless `eight`.
|
||||
fn jxl_encode(px: &[u16], w: usize, h: usize, cpp: usize, eight: bool) -> Vec<u8> {
|
||||
use zune_core::bit_depth::BitDepth;
|
||||
use zune_core::colorspace::ColorSpace;
|
||||
use zune_core::options::EncoderOptions;
|
||||
let cs = if cpp == 1 { ColorSpace::Luma } else { ColorSpace::RGB };
|
||||
let (bytes, depth): (Vec<u8>, _) = if eight {
|
||||
(px.iter().map(|&v| v as u8).collect(), BitDepth::Eight)
|
||||
} else {
|
||||
(px.iter().flat_map(|v| v.to_ne_bytes()).collect(), BitDepth::Sixteen)
|
||||
};
|
||||
let mut out = Vec::new();
|
||||
zune_jpegxl::JxlSimpleEncoder::new(&bytes, EncoderOptions::new(w, h, cs, depth)).encode(&mut out).unwrap();
|
||||
out
|
||||
if cpp == 1 {
|
||||
// craft-jxl's public image encoder deliberately widens Gray to RGB. DNG RAW tiles need
|
||||
// a genuine single-plane codestream, so use jixel's grayscale encoder for these fixtures.
|
||||
let config = jixel::EncodeConfig::default().with_lossless(true);
|
||||
let u8_buf: Vec<u8> = if eight { px.iter().map(|&v| v as u8).collect() } else { Vec::new() };
|
||||
return if eight {
|
||||
jixel::encode_image_gray(&u8_buf, w, h, &config).unwrap()
|
||||
} else {
|
||||
jixel::encode_image_gray_16bit(px, w, h, &config).unwrap()
|
||||
};
|
||||
}
|
||||
let layout = craft_jxl::Layout::Rgb;
|
||||
let u8_buf: Vec<u8> = if eight { px.iter().map(|&v| v as u8).collect() } else { Vec::new() };
|
||||
let samples = if eight { craft_jxl::Samples::U8(&u8_buf) } else { craft_jxl::Samples::U16(px) };
|
||||
let img = craft_jxl::ImageRef { width: w as u32, height: h as u32, layout, samples };
|
||||
let opts = craft_jxl::EncodeOptions { lossless: true, ..Default::default() };
|
||||
craft_jxl::encode(&img, opts, &craft_jxl::Metadata::default()).unwrap()
|
||||
}
|
||||
|
||||
/// The encoder may return an ISO-BMFF container for a level-10 codestream. Extract its `jxlc`
|
||||
/// payload so the tile fixture can deliberately exercise the bare-codestream form too.
|
||||
fn bare_jxl_codestream(bytes: &[u8]) -> Vec<u8> {
|
||||
const SIGNATURE: &[u8] = &[0, 0, 0, 0x0c, b'J', b'X', b'L', b' ', 0x0d, 0x0a, 0x87, 0x0a];
|
||||
if !bytes.starts_with(SIGNATURE) {
|
||||
return bytes.to_vec();
|
||||
}
|
||||
let mut at = SIGNATURE.len();
|
||||
while let Some(end_header) = at.checked_add(8) {
|
||||
let Some(header) = bytes.get(at..end_header) else { break };
|
||||
let size = u32::from_be_bytes([header[0], header[1], header[2], header[3]]) as usize;
|
||||
if size < 8 {
|
||||
break;
|
||||
}
|
||||
let Some(end) = at.checked_add(size) else { break };
|
||||
let Some(box_bytes) = bytes.get(at..end) else { break };
|
||||
if &header[4..8] == b"jxlc" {
|
||||
return box_bytes[8..].to_vec();
|
||||
}
|
||||
at = end;
|
||||
}
|
||||
panic!("the JPEG XL encoder returned a container without a complete jxlc box");
|
||||
}
|
||||
|
||||
/// A bare codestream wrapped in the ISO-BMFF container (signature, `ftyp`, `jxlc`).
|
||||
@@ -674,7 +703,7 @@ fn jxl_tiled(px: &[u16], w: usize, h: usize, cpp: usize, bits: u16, cfa: bool, t
|
||||
}
|
||||
}
|
||||
}
|
||||
let cs = jxl_encode(&t, cw, ch, cpp, bits == 8);
|
||||
let cs = bare_jxl_codestream(&jxl_encode(&t, cw, ch, cpp, bits == 8));
|
||||
tiles.push(if i % 3 == 1 { jxl_container(&cs) } else { cs });
|
||||
}
|
||||
}
|
||||
@@ -773,21 +802,21 @@ fn a_jpeg_xl_tile_that_fails_is_an_error_for_the_image() {
|
||||
#[test]
|
||||
fn jpeg_xl_tiles_beyond_their_decode_budget_are_errors() {
|
||||
use lightcraft_raw::RawError;
|
||||
use zune_core::bit_depth::BitDepth;
|
||||
use zune_core::colorspace::ColorSpace;
|
||||
use zune_core::options::EncoderOptions;
|
||||
let (w, h) = (512, 512);
|
||||
let grey: Vec<u16> = (0..w * h).map(|i| ((i % w) * 97 + (i / w) * 31) as u16 & 0x0fff).collect();
|
||||
let with_alpha: Vec<u8> = grey.iter().flat_map(|&v| [v, 4095 - v]).flat_map(u16::to_ne_bytes).collect();
|
||||
let mut tile = Vec::new();
|
||||
zune_jpegxl::JxlSimpleEncoder::new(&with_alpha, EncoderOptions::new(w, h, ColorSpace::LumaA, BitDepth::Sixteen)).encode(&mut tile).unwrap();
|
||||
let with_alpha: Vec<u16> = grey.iter().flat_map(|&v| [v, 4095 - v]).collect();
|
||||
// The public craft-jxl image encoder widens GrayAlpha to RGBA. This budget fixture
|
||||
// specifically needs two encoded planes, not a four-plane layout mismatch.
|
||||
let config = jixel::EncodeConfig::default().with_lossless(true);
|
||||
let tile = jixel::encode_image_gray_alpha_16bit(&with_alpha, w, h, &config).unwrap();
|
||||
let one = |tile: Vec<u8>| {
|
||||
let mut raw = base_ifd(w, h, 12, 1, true);
|
||||
raw.set(t::COMPRESSION, Value::Short(vec![compression::JPEG_XL]));
|
||||
raw.set_image(ImageData::Tiles { tile_width: w as u32, tile_height: h as u32, tiles: vec![tile] });
|
||||
dng(raw, ByteOrder::Little)
|
||||
};
|
||||
assert!(matches!(decode(&one(tile)), Err(RawError::Corrupt(_))));
|
||||
let Err(RawError::Corrupt(error)) = decode(&one(tile)) else { panic!("the extra plane must exceed the tile budget") };
|
||||
assert!(!error.contains("colour planes"), "must fail the budget, not the fixture layout: {error}");
|
||||
assert_eq!(decode(&one(jxl_encode(&grey, w, h, 1, false))).unwrap().data, RawData::U16(grey));
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,12 @@
|
||||
"commit": "b77af389f30bb10de10d8436ca9b39fe94e3bb67",
|
||||
"dest": "flatpak-cargo/git/craft-libs-b77af38"
|
||||
},
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/storytold/craft-libs",
|
||||
"commit": "5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a",
|
||||
"dest": "flatpak-cargo/git/craft-libs-5ac7c96"
|
||||
},
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/storytold/craft-libs",
|
||||
@@ -41,6 +47,12 @@
|
||||
"commit": "478c50560d3c6fad3d613af2a30b35c3bc9f4c0f",
|
||||
"dest": "flatpak-cargo/git/craft-libs-478c505"
|
||||
},
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/storytold/craft-libs",
|
||||
"commit": "5c91598ccc86537a779f438d520fa6406c26efe6",
|
||||
"dest": "flatpak-cargo/git/craft-libs-5c91598"
|
||||
},
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/storytold/craft-libs",
|
||||
@@ -1741,6 +1753,24 @@
|
||||
"dest": "cargo/vendor-git/11a22760e699d74db2deeccbdb390b343ad010ce425dcb15451f0e14e45ff298/craft-i18n",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"commands": [
|
||||
"mkdir -p \"cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545\" && cp -r --reflink=auto \"flatpak-cargo/git/craft-libs-5ac7c96/crates/image-codecs\" \"cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545/craft-image-codecs\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "[package]\nname = \"craft-image-codecs\"\ndescription = \"Bounded, depth- and metadata-preserving codecs for flat raster image formats\"\nversion = \"0.1.0\"\nedition = \"2024\"\nlicense = \"MIT OR Apache-2.0\"\nrust-version = \"1.95\"\nrepository = \"https://github.com/storytold/craft-libs\"\n\n[lints.rust]\nunsafe_code = \"forbid\"\nunused_workspace_dependencies = \"allow\"\n\n[lints.rust.unexpected_cfgs]\nlevel = \"warn\"\ncheck-cfg = [\"cfg(craft_pdf_unicode_fixtures)\"]\n\n[lints.clippy]\ncognitive_complexity = \"deny\"\ntoo_many_arguments = \"deny\"\nunused_workspace_dependencies = \"allow\"\nwildcard_imports = \"deny\"\ndbg_macro = \"warn\"\ntodo = \"warn\"\n\n[features]\ncorpus = []\ndefault = []\nthreads = [\"ravif?/threading\", \"rav1e?/threading\"]\nsgi = []\nsunraster = []\navif = [\"image/avif\", \"dep:ravif\", \"dep:rav1e\", \"dep:avif-serialize\"]\nheif = [\"dep:craft-heif\"]\navif-decode = [\"dep:craft-video\", \"craft-video/av1-decode\"]\n\n[dependencies]\ncrc32fast = \"1.5\"\nthiserror = \"2\"\npng = \"0.18\"\nhalf = \"2\"\nserde_json = \"1\"\nimage-webp = \"0.2\"\nzune-jpeg = \"0.5\"\nzune-core = \"0.5\"\njpeg-encoder = \"0.6\"\n\n[dependencies.image]\nversion = \"0.25\"\ndefault-features = false\nfeatures = [\"png\", \"jpeg\", \"tiff\", \"gif\", \"bmp\", \"tga\", \"ico\", \"qoi\", \"hdr\"]\n\n[dependencies.tiff]\nversion = \"0.11\"\ndefault-features = false\nfeatures = [\"deflate\", \"fax\", \"jpeg\", \"lzw\"]\n\n[dependencies.exr]\nversion = \"1.73\"\ndefault-features = false\n\n[dependencies.flate2]\nversion = \"1.1.10\"\ndefault-features = false\nfeatures = [\"zlib-rs\", \"runtime_detection\"]\n\n[dependencies.craft-jpeg]\npath = \"crates/jpeg\"\n\n[dependencies.craft-metadata]\npath = \"crates/metadata\"\n\n[dependencies.craft-tiff]\npath = \"crates/tiff\"\n\n[dependencies.zune-jpegxl]\nversion = \"=0.5.2\"\ndefault-features = false\nfeatures = [\"std\"]\n\n[dependencies.craft-heif]\noptional = true\npath = \"crates/heif\"\n\n[dependencies.ravif]\nversion = \"0.13\"\ndefault-features = false\noptional = true\n\n[dependencies.rav1e]\nversion = \"0.8\"\ndefault-features = false\noptional = true\n\n[dependencies.avif-serialize]\nversion = \"0.8\"\noptional = true\n\n[dependencies.hayro-jpeg2000]\nversion = \"=0.3.5\"\ndefault-features = false\nfeatures = [\"std\", \"simd\"]\n\n[target.\"cfg(not(target_arch = \\\"wasm32\\\"))\".dependencies]\nrayon = \"1\"\n\n[target.\"cfg(not(target_arch = \\\"wasm32\\\"))\".dependencies.craft-video]\noptional = true\npath = \"crates/video\"\n\n[target.\"cfg(not(target_arch = \\\"wasm32\\\"))\".dependencies.exr]\nversion = \"1.73\"\ndefault-features = false\nfeatures = [\"rayon\"]\n\n[target.\"cfg(not(target_arch = \\\"wasm32\\\"))\".dev-dependencies.craft-video]\nfeatures = [\"av1-decode\"]\npath = \"crates/video\"\n\n[target.\"cfg(not(target_arch = \\\"wasm32\\\"))\".dev-dependencies.jxl-oxide]\nversion = \"=0.12.6\"\ndefault-features = false\nfeatures = [\"rayon\"]\n\n[dev-dependencies]\nproptest = \"1\"\n\n[dev-dependencies.image]\nversion = \"0.25\"\ndefault-features = false\nfeatures = [\"png\", \"jpeg\", \"tiff\"]\n\n[dev-dependencies.sha2]\nversion = \"0.10\"\ndefault-features = false\nfeatures = [\"std\"]\n\n[dev-dependencies.craft-media-testkit]\npath = \"crates/media-testkit\"\n",
|
||||
"dest": "cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545/craft-image-codecs",
|
||||
"dest-filename": "Cargo.toml"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": null, \"files\": {}}",
|
||||
"dest": "cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545/craft-image-codecs",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"commands": [
|
||||
@@ -1777,6 +1807,24 @@
|
||||
"dest": "cargo/vendor-git/cb31475a7a9d19c00f48b4c43603f2f1a464c6dce15da1d21bba4c653eeba6b2/craft-jpeg",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"commands": [
|
||||
"mkdir -p \"cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545\" && cp -r --reflink=auto \"flatpak-cargo/git/craft-libs-5ac7c96/crates/jpeg\" \"cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545/craft-jpeg\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "[package]\nname = \"craft-jpeg\"\ndescription = \"Clean-room JPEG decoder and 8-bit optimized baseline encoder (ITU-T T.81).\"\nversion = \"0.1.0\"\nedition = \"2024\"\nlicense = \"MIT OR Apache-2.0\"\nrust-version = \"1.95\"\nrepository = \"https://github.com/storytold/craft-libs\"\n\n[lints.rust]\nunsafe_code = \"forbid\"\nunused_workspace_dependencies = \"allow\"\n\n[lints.rust.unexpected_cfgs]\nlevel = \"warn\"\ncheck-cfg = [\"cfg(craft_pdf_unicode_fixtures)\"]\n\n[lints.clippy]\ncognitive_complexity = \"deny\"\ntoo_many_arguments = \"deny\"\nunused_workspace_dependencies = \"allow\"\nwildcard_imports = \"deny\"\ndbg_macro = \"warn\"\ntodo = \"warn\"\n\n[dependencies]\nthiserror = \"2\"\n\n[dependencies.rayon]\noptional = true\nversion = \"1\"\n\n[dev-dependencies]\njpeg-encoder = \"0.6\"\nzune-jpeg = \"0.5\"\njpeg-decoder = \"0.3\"\n\n[features]\ndefault = []\nparallel = [\"dep:rayon\"]\n",
|
||||
"dest": "cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545/craft-jpeg",
|
||||
"dest-filename": "Cargo.toml"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": null, \"files\": {}}",
|
||||
"dest": "cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545/craft-jpeg",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"commands": [
|
||||
@@ -1798,19 +1846,55 @@
|
||||
{
|
||||
"type": "shell",
|
||||
"commands": [
|
||||
"mkdir -p \"cargo/vendor-git/a51e2c3f46af71f1caed91009f88b4f9982db0c4152c6659d11967a7731b1ccc\" && cp -r --reflink=auto \"flatpak-cargo/git/craft-libs-b77af38/crates/jxl\" \"cargo/vendor-git/a51e2c3f46af71f1caed91009f88b4f9982db0c4152c6659d11967a7731b1ccc/craft-jxl\""
|
||||
"mkdir -p \"cargo/vendor-git/cb31475a7a9d19c00f48b4c43603f2f1a464c6dce15da1d21bba4c653eeba6b2\" && cp -r --reflink=auto \"flatpak-cargo/git/craft-libs-478c505/crates/jxl\" \"cargo/vendor-git/cb31475a7a9d19c00f48b4c43603f2f1a464c6dce15da1d21bba4c653eeba6b2/craft-jxl\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "[package]\nname = \"craft-jxl\"\ndescription = \"JPEG XL image decoding and encoding with bounded input and allocation tracking.\"\nversion = \"0.1.0\"\nedition = \"2024\"\nlicense = \"MIT OR Apache-2.0\"\nrust-version = \"1.95\"\nrepository = \"https://github.com/storytold/craft-libs\"\n\n[lints.rust]\nunsafe_code = \"forbid\"\nunused_workspace_dependencies = \"allow\"\n\n[lints.rust.unexpected_cfgs]\nlevel = \"warn\"\ncheck-cfg = [\"cfg(craft_pdf_unicode_fixtures)\"]\n\n[lints.clippy]\ncognitive_complexity = \"deny\"\ntoo_many_arguments = \"deny\"\nunused_workspace_dependencies = \"allow\"\nwildcard_imports = \"deny\"\ndbg_macro = \"warn\"\ntodo = \"warn\"\n\n[features]\ndefault = [\"decode\", \"encode\"]\ndecode = [\"dep:jxl-oxide\"]\nencode = [\"dep:jixel\"]\n\n[dependencies]\nthiserror = \"2\"\n\n[dependencies.jxl-oxide]\noptional = true\nversion = \"0.12\"\ndefault-features = false\n\n[dev-dependencies.craft-cms]\npath = \"crates/cms\"\n\n[target.\"cfg(not(target_arch = \\\"wasm32\\\"))\".dependencies.jixel]\noptional = true\nversion = \"=0.3.4\"\n",
|
||||
"dest": "cargo/vendor-git/a51e2c3f46af71f1caed91009f88b4f9982db0c4152c6659d11967a7731b1ccc/craft-jxl",
|
||||
"dest": "cargo/vendor-git/cb31475a7a9d19c00f48b4c43603f2f1a464c6dce15da1d21bba4c653eeba6b2/craft-jxl",
|
||||
"dest-filename": "Cargo.toml"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": null, \"files\": {}}",
|
||||
"dest": "cargo/vendor-git/a51e2c3f46af71f1caed91009f88b4f9982db0c4152c6659d11967a7731b1ccc/craft-jxl",
|
||||
"dest": "cargo/vendor-git/cb31475a7a9d19c00f48b4c43603f2f1a464c6dce15da1d21bba4c653eeba6b2/craft-jxl",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"commands": [
|
||||
"mkdir -p \"cargo/vendor-git/6f5ad8618176b3fc0aac703e6e74df7229b0350b4574c7edbe0bb86c53c1cb6c\" && cp -r --reflink=auto \"flatpak-cargo/git/craft-libs-5c91598/crates/media\" \"cargo/vendor-git/6f5ad8618176b3fc0aac703e6e74df7229b0350b4574c7edbe0bb86c53c1cb6c/craft-media\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "[package]\nname = \"craft-media\"\ndescription = \"Bit-level I/O, clean-room ISO BMFF (MP4), QuickTime (MOV) and Matroska (MKV, WebM) and MXF demuxers and muxers, and Ogg, AVI and MPEG-TS/PS demuxers.\"\nversion = \"0.1.0\"\nedition = \"2024\"\nlicense = \"MIT OR Apache-2.0\"\nrust-version = \"1.95\"\nrepository = \"https://github.com/storytold/craft-libs\"\n\n[package.metadata.docs.rs]\nall-features = true\n\n[lints.rust]\nunsafe_code = \"forbid\"\nunused_workspace_dependencies = \"allow\"\n\n[lints.rust.unexpected_cfgs]\nlevel = \"warn\"\ncheck-cfg = [\"cfg(craft_pdf_unicode_fixtures)\"]\n\n[lints.clippy]\ncognitive_complexity = \"deny\"\ntoo_many_arguments = \"deny\"\nunused_workspace_dependencies = \"allow\"\nwildcard_imports = \"deny\"\ndbg_macro = \"warn\"\ntodo = \"warn\"\n\n[features]\ndefault = [\"isobmff\"]\nbitstream = []\nisobmff = [\"bitstream\", \"dep:thiserror\"]\nmatroska = []\navi = []\nmxf = [\"dep:chrono\"]\nmpegts = []\nogg = []\nserde = [\"dep:serde\"]\n\n[dependencies.thiserror]\noptional = true\nversion = \"2\"\n\n[dependencies.serde]\noptional = true\nversion = \"1\"\nfeatures = [\"derive\"]\n\n[dependencies.chrono]\noptional = true\nversion = \"0.4.45\"\ndefault-features = false\nfeatures = [\"std\"]\n\n[dev-dependencies]\nproptest = \"1\"\nserde_json = \"1\"\n\n[dev-dependencies.craft-media-testkit]\npath = \"crates/media-testkit\"\n\n[[test]]\nname = \"fuzz\"\nrequired-features = [\"isobmff\"]\n\n[[test]]\nname = \"fuzz_matroska\"\nrequired-features = [\"matroska\"]\n\n[[test]]\nname = \"oracle_avi\"\nrequired-features = [\"avi\"]\n\n[[test]]\nname = \"oracle_avi_mux\"\nrequired-features = [\"avi\"]\n\n[[test]]\nname = \"oracle_demux\"\nrequired-features = [\"isobmff\"]\n\n[[test]]\nname = \"oracle_matroska\"\nrequired-features = [\"matroska\"]\n\n[[test]]\nname = \"oracle_mpegts\"\nrequired-features = [\"mpegts\"]\n\n[[test]]\nname = \"oracle_mux\"\nrequired-features = [\"isobmff\"]\n\n[[test]]\nname = \"oracle_mxf\"\nrequired-features = [\"mxf\"]\n\n[[test]]\nname = \"oracle_ogg\"\nrequired-features = [\"ogg\"]\n\n[[test]]\nname = \"roundtrip\"\nrequired-features = [\"isobmff\"]\n",
|
||||
"dest": "cargo/vendor-git/6f5ad8618176b3fc0aac703e6e74df7229b0350b4574c7edbe0bb86c53c1cb6c/craft-media",
|
||||
"dest-filename": "Cargo.toml"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": null, \"files\": {}}",
|
||||
"dest": "cargo/vendor-git/6f5ad8618176b3fc0aac703e6e74df7229b0350b4574c7edbe0bb86c53c1cb6c/craft-media",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"commands": [
|
||||
"mkdir -p \"cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545\" && cp -r --reflink=auto \"flatpak-cargo/git/craft-libs-5ac7c96/crates/metadata\" \"cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545/craft-metadata\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "[package]\nname = \"craft-metadata\"\ndescription = \"Photo metadata: EXIF, IPTC-IIM, XMP packets (read, write, merge) and GPX track logs, the blocks that carry them in JPEG, PNG, WebP, TIFF and CR3 files, and one model they all read into.\"\nversion = \"0.1.0\"\nedition = \"2024\"\nlicense = \"MIT OR Apache-2.0\"\nrust-version = \"1.95\"\nrepository = \"https://github.com/storytold/craft-libs\"\n\n[lints.rust]\nunsafe_code = \"forbid\"\nunused_workspace_dependencies = \"allow\"\n\n[lints.rust.unexpected_cfgs]\nlevel = \"warn\"\ncheck-cfg = [\"cfg(craft_pdf_unicode_fixtures)\"]\n\n[lints.clippy]\ncognitive_complexity = \"deny\"\ntoo_many_arguments = \"deny\"\nunused_workspace_dependencies = \"allow\"\nwildcard_imports = \"deny\"\ndbg_macro = \"warn\"\ntodo = \"warn\"\n\n[dependencies]\nquick-xml = \"0.41\"\n\n[dependencies.craft-tiff]\npath = \"crates/tiff\"\n\n[dependencies.serde]\nversion = \"1\"\nfeatures = [\"derive\"]\n\n[dependencies.chrono]\nversion = \"0.4.45\"\ndefault-features = false\nfeatures = [\"std\"]\n\n[dependencies.brotli-decompressor]\nversion = \"6\"\ndefault-features = false\nfeatures = [\"std\"]\n\n[dev-dependencies]\nproptest = \"1\"\nserde_json = \"1\"\n\n[dev-dependencies.brotli]\nversion = \"9\"\ndefault-features = false\nfeatures = [\"std\"]\n",
|
||||
"dest": "cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545/craft-metadata",
|
||||
"dest-filename": "Cargo.toml"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": null, \"files\": {}}",
|
||||
"dest": "cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545/craft-metadata",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
@@ -1939,6 +2023,24 @@
|
||||
"dest": "cargo/vendor-git/6fd0ceba5f4137be1fe00e9c031f810234e38df6f60195003fed7057c96f0aa1/craft-raw",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"commands": [
|
||||
"mkdir -p \"cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545\" && cp -r --reflink=auto \"flatpak-cargo/git/craft-libs-5ac7c96/crates/tiff\" \"cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545/craft-tiff\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "[package]\nname = \"craft-tiff\"\ndescription = \"TIFF and BigTIFF IFD reader and writer: every field type, the Exif/GPS/Interop pointer IFDs, maker-note IFDs, strip and tile layout.\"\nversion = \"0.1.0\"\nedition = \"2024\"\nlicense = \"MIT OR Apache-2.0\"\nrust-version = \"1.95\"\nrepository = \"https://github.com/storytold/craft-libs\"\n\n[lints.rust]\nunsafe_code = \"forbid\"\nunused_workspace_dependencies = \"allow\"\n\n[lints.rust.unexpected_cfgs]\nlevel = \"warn\"\ncheck-cfg = [\"cfg(craft_pdf_unicode_fixtures)\"]\n\n[lints.clippy]\ncognitive_complexity = \"deny\"\ntoo_many_arguments = \"deny\"\nunused_workspace_dependencies = \"allow\"\nwildcard_imports = \"deny\"\ndbg_macro = \"warn\"\ntodo = \"warn\"\n\n[dependencies]\nthiserror = \"2\"\n\n[dependencies.serde]\nversion = \"1\"\nfeatures = [\"derive\"]\n\n[dev-dependencies]\nproptest = \"1\"\n",
|
||||
"dest": "cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545/craft-tiff",
|
||||
"dest-filename": "Cargo.toml"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": null, \"files\": {}}",
|
||||
"dest": "cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545/craft-tiff",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"commands": [
|
||||
@@ -2011,6 +2113,24 @@
|
||||
"dest": "cargo/vendor-git/4765c8f813a43ec0005270c9f4b16bff2eb2e09aeb15e4230bcd10e5bba1c4ba/craft-update",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"commands": [
|
||||
"mkdir -p \"cargo/vendor-git/6f5ad8618176b3fc0aac703e6e74df7229b0350b4574c7edbe0bb86c53c1cb6c\" && cp -r --reflink=auto \"flatpak-cargo/git/craft-libs-5c91598/crates/video\" \"cargo/vendor-git/6f5ad8618176b3fc0aac703e6e74df7229b0350b4574c7edbe0bb86c53c1cb6c/craft-video\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "[package]\nname = \"craft-video\"\ndescription = \"Clean-room pure-Rust video codecs, one feature per codec: DNxHD/DNxHR, VP8, ProRes, H.264, HEVC, VP9, AV1, MPEG-4 Part 2.\"\nversion = \"0.1.0\"\nedition = \"2024\"\nlicense = \"MIT OR Apache-2.0\"\nrust-version = \"1.95\"\nrepository = \"https://github.com/storytold/craft-libs\"\n\n[package.metadata.docs.rs]\nall-features = true\n\n[lints.rust]\nunsafe_code = \"forbid\"\nunused_workspace_dependencies = \"allow\"\n\n[lints.rust.unexpected_cfgs]\nlevel = \"warn\"\ncheck-cfg = [\"cfg(craft_pdf_unicode_fixtures)\"]\n\n[lints.clippy]\ncognitive_complexity = \"deny\"\ntoo_many_arguments = \"deny\"\nunused_workspace_dependencies = \"allow\"\nwildcard_imports = \"deny\"\ndbg_macro = \"warn\"\ntodo = \"warn\"\n\n[features]\ndnx = []\napv = [\"apv-decode\", \"apv-encode\"]\napv-decode = [\"craft-media/bitstream\"]\napv-encode = [\"craft-media/bitstream\"]\nvp8 = [\"vp8-decode\", \"vp8-encode\"]\nvp8-decode = []\nvp8-encode = []\nmpeg2 = [\"mpeg2-decode\", \"mpeg2-encode\"]\nmpeg2-decode = []\nmpeg2-encode = [\"mpeg2-decode\"]\nmpeg4 = [\"mpeg4-encode\"]\nmpeg4-encode = [\"craft-media/bitstream\"]\nffv1 = []\nprores = [\"craft-media/bitstream\"]\nh264 = [\"h264-decode\", \"h264-encode\"]\nh264-decode = [\"craft-media/bitstream\"]\nh264-encode = [\"craft-media/isobmff\"]\nhevc = [\"hevc-decode\", \"hevc-encode\"]\nhevc-decode = [\"craft-media/bitstream\"]\nhevc-encode = [\"craft-media/isobmff\"]\nvp9 = [\"vp9-decode\", \"vp9-encode\"]\nvp9-decode = [\"craft-media/bitstream\"]\nvp9-encode = [\"craft-media/isobmff\"]\nav1 = [\"av1-decode\", \"av1-encode\"]\nav1-decode = []\nav1-encode = [\"craft-media/isobmff\"]\nav1-large-encode = [\"av1-encode\", \"dep:rav1e\"]\nthreads = [\"dep:rayon\", \"rav1e?/threading\"]\n\n[dependencies]\nthiserror = \"2\"\n\n[dependencies.craft-media]\npath = \"crates/media\"\ndefault-features = false\n\n[dependencies.rayon]\noptional = true\nversion = \"1\"\n\n[target.\"cfg(not(target_arch = \\\"wasm32\\\"))\".dependencies.rav1e]\nversion = \"0.8\"\ndefault-features = false\noptional = true\n\n[dev-dependencies.craft-media-testkit]\npath = \"crates/media-testkit\"\n\n[dev-dependencies.craft-media]\nfeatures = [\"avi\"]\npath = \"crates/media\"\ndefault-features = false\n\n[[test]]\nname = \"dnx\"\nrequired-features = [\"dnx\"]\n\n[[test]]\nname = \"apv\"\nrequired-features = [\"apv\"]\n\n[[test]]\nname = \"vp8\"\nrequired-features = [\"vp8-decode\"]\n\n[[test]]\nname = \"av1_decode\"\nrequired-features = [\"av1-decode\"]\n\n[[test]]\nname = \"h264_decode\"\nrequired-features = [\"h264-decode\"]\n\n[[test]]\nname = \"h264_encode\"\nrequired-features = [\"h264-encode\"]\n\n[[test]]\nname = \"hevc_decode\"\nrequired-features = [\"hevc-decode\"]\n\n[[test]]\nname = \"vp8_encode\"\nrequired-features = [\"vp8\"]\n\n[[test]]\nname = \"vp9_decode\"\nrequired-features = [\"vp9-decode\"]\n\n[[test]]\nname = \"mpeg4_encode\"\nrequired-features = [\"mpeg4-encode\"]\n\n[[test]]\nname = \"mpeg2\"\nrequired-features = [\"mpeg2-decode\"]\n\n[[test]]\nname = \"ffv1\"\nrequired-features = [\"ffv1\"]\n\n[[test]]\nname = \"prores\"\nrequired-features = [\"prores\"]\n\n[[test]]\nname = \"hevc\"\nrequired-features = [\"hevc-encode\"]\n\n[[test]]\nname = \"av1\"\nrequired-features = [\"av1\"]\n\n[[example]]\nname = \"vp8_fuzz\"\nrequired-features = [\"vp8-decode\"]\n\n[[example]]\nname = \"vp8_vp8dec\"\nrequired-features = [\"vp8-decode\"]\n\n[[example]]\nname = \"av1_av1dec\"\nrequired-features = [\"av1-decode\"]\n\n[[example]]\nname = \"h264_h264dec\"\nrequired-features = [\"h264-decode\"]\n\n[[example]]\nname = \"h264_h264enc_bench\"\nrequired-features = [\"h264-encode\"]\ntest = true\n\n[[example]]\nname = \"hevc_hevcdec\"\nrequired-features = [\"hevc-decode\"]\n\n[[example]]\nname = \"vp9_vp9dec\"\nrequired-features = [\"vp9-decode\"]\n",
|
||||
"dest": "cargo/vendor-git/6f5ad8618176b3fc0aac703e6e74df7229b0350b4574c7edbe0bb86c53c1cb6c/craft-video",
|
||||
"dest-filename": "Cargo.toml"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": null, \"files\": {}}",
|
||||
"dest": "cargo/vendor-git/6f5ad8618176b3fc0aac703e6e74df7229b0350b4574c7edbe0bb86c53c1cb6c/craft-video",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"commands": [
|
||||
@@ -10119,7 +10239,7 @@
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "[source.vendored-sources]\ndirectory = \"cargo/vendor\"\n\n[source.crates-io]\nreplace-with = \"vendored-sources\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=94777dcf7f8962476e96b049d08d22e25b9330c2\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-6fd0ceba5f4137be1fe00e9c031f810234e38df6f60195003fed7057c96f0aa1\"\nrev = \"94777dcf7f8962476e96b049d08d22e25b9330c2\"\n\n[source.git-vendor-6fd0ceba5f4137be1fe00e9c031f810234e38df6f60195003fed7057c96f0aa1]\ndirectory = \"cargo/vendor-git/6fd0ceba5f4137be1fe00e9c031f810234e38df6f60195003fed7057c96f0aa1\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=f0f4758c01581d79577b9bf5046c06f4e77b1f18\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-bc00bd22a20692df38f25839a8568cd55b90e379a41719721bbc0f04fe5e29f7\"\nrev = \"f0f4758c01581d79577b9bf5046c06f4e77b1f18\"\n\n[source.git-vendor-bc00bd22a20692df38f25839a8568cd55b90e379a41719721bbc0f04fe5e29f7]\ndirectory = \"cargo/vendor-git/bc00bd22a20692df38f25839a8568cd55b90e379a41719721bbc0f04fe5e29f7\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=c5a1cbfb5f9049f9270955caffb5bee5997aebf7\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-11a22760e699d74db2deeccbdb390b343ad010ce425dcb15451f0e14e45ff298\"\nrev = \"c5a1cbfb5f9049f9270955caffb5bee5997aebf7\"\n\n[source.git-vendor-11a22760e699d74db2deeccbdb390b343ad010ce425dcb15451f0e14e45ff298]\ndirectory = \"cargo/vendor-git/11a22760e699d74db2deeccbdb390b343ad010ce425dcb15451f0e14e45ff298\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=9dcbd90c7d16e1a668b3afa057e940e2db328b93\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-36bf00be069421f8a8a7428c4360efee8b4243207a59d7b566c6f48fc5918f61\"\nrev = \"9dcbd90c7d16e1a668b3afa057e940e2db328b93\"\n\n[source.git-vendor-36bf00be069421f8a8a7428c4360efee8b4243207a59d7b566c6f48fc5918f61]\ndirectory = \"cargo/vendor-git/36bf00be069421f8a8a7428c4360efee8b4243207a59d7b566c6f48fc5918f61\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=b77af389f30bb10de10d8436ca9b39fe94e3bb67\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-a51e2c3f46af71f1caed91009f88b4f9982db0c4152c6659d11967a7731b1ccc\"\nrev = \"b77af389f30bb10de10d8436ca9b39fe94e3bb67\"\n\n[source.git-vendor-a51e2c3f46af71f1caed91009f88b4f9982db0c4152c6659d11967a7731b1ccc]\ndirectory = \"cargo/vendor-git/a51e2c3f46af71f1caed91009f88b4f9982db0c4152c6659d11967a7731b1ccc\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=947dc5fb0ec436c0841f560eac0d65c6ad055ed4\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-eb100b17aaa74f1bccee5b69dce3d22ac29d6bc14b796a0a0b93237c93fcabbc\"\nrev = \"947dc5fb0ec436c0841f560eac0d65c6ad055ed4\"\n\n[source.git-vendor-eb100b17aaa74f1bccee5b69dce3d22ac29d6bc14b796a0a0b93237c93fcabbc]\ndirectory = \"cargo/vendor-git/eb100b17aaa74f1bccee5b69dce3d22ac29d6bc14b796a0a0b93237c93fcabbc\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=478c50560d3c6fad3d613af2a30b35c3bc9f4c0f\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-cb31475a7a9d19c00f48b4c43603f2f1a464c6dce15da1d21bba4c653eeba6b2\"\nrev = \"478c50560d3c6fad3d613af2a30b35c3bc9f4c0f\"\n\n[source.git-vendor-cb31475a7a9d19c00f48b4c43603f2f1a464c6dce15da1d21bba4c653eeba6b2]\ndirectory = \"cargo/vendor-git/cb31475a7a9d19c00f48b4c43603f2f1a464c6dce15da1d21bba4c653eeba6b2\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=0fd30aeb3e02207d9d4c7c601540d9da45abf8de\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-fafb086755da4e9bf32b4ac1b53a42a6017167d56ec0071462788465fa35eb30\"\nrev = \"0fd30aeb3e02207d9d4c7c601540d9da45abf8de\"\n\n[source.git-vendor-fafb086755da4e9bf32b4ac1b53a42a6017167d56ec0071462788465fa35eb30]\ndirectory = \"cargo/vendor-git/fafb086755da4e9bf32b4ac1b53a42a6017167d56ec0071462788465fa35eb30\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=bea6ed1ff031b81df2d64be470485c1ca808847e\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-32c3b4109a3afdabed8bce488e027fa99fcc1b06e4fbe9ee85802b6b73337040\"\nrev = \"bea6ed1ff031b81df2d64be470485c1ca808847e\"\n\n[source.git-vendor-32c3b4109a3afdabed8bce488e027fa99fcc1b06e4fbe9ee85802b6b73337040]\ndirectory = \"cargo/vendor-git/32c3b4109a3afdabed8bce488e027fa99fcc1b06e4fbe9ee85802b6b73337040\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=6e03f65bf45181db77ba6229716e6624db9eb25b\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-4765c8f813a43ec0005270c9f4b16bff2eb2e09aeb15e4230bcd10e5bba1c4ba\"\nrev = \"6e03f65bf45181db77ba6229716e6624db9eb25b\"\n\n[source.git-vendor-4765c8f813a43ec0005270c9f4b16bff2eb2e09aeb15e4230bcd10e5bba1c4ba]\ndirectory = \"cargo/vendor-git/4765c8f813a43ec0005270c9f4b16bff2eb2e09aeb15e4230bcd10e5bba1Line truncated
|
||||
"contents": "[source.vendored-sources]\ndirectory = \"cargo/vendor\"\n\n[source.crates-io]\nreplace-with = \"vendored-sources\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=94777dcf7f8962476e96b049d08d22e25b9330c2\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-6fd0ceba5f4137be1fe00e9c031f810234e38df6f60195003fed7057c96f0aa1\"\nrev = \"94777dcf7f8962476e96b049d08d22e25b9330c2\"\n\n[source.git-vendor-6fd0ceba5f4137be1fe00e9c031f810234e38df6f60195003fed7057c96f0aa1]\ndirectory = \"cargo/vendor-git/6fd0ceba5f4137be1fe00e9c031f810234e38df6f60195003fed7057c96f0aa1\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=f0f4758c01581d79577b9bf5046c06f4e77b1f18\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-bc00bd22a20692df38f25839a8568cd55b90e379a41719721bbc0f04fe5e29f7\"\nrev = \"f0f4758c01581d79577b9bf5046c06f4e77b1f18\"\n\n[source.git-vendor-bc00bd22a20692df38f25839a8568cd55b90e379a41719721bbc0f04fe5e29f7]\ndirectory = \"cargo/vendor-git/bc00bd22a20692df38f25839a8568cd55b90e379a41719721bbc0f04fe5e29f7\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=c5a1cbfb5f9049f9270955caffb5bee5997aebf7\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-11a22760e699d74db2deeccbdb390b343ad010ce425dcb15451f0e14e45ff298\"\nrev = \"c5a1cbfb5f9049f9270955caffb5bee5997aebf7\"\n\n[source.git-vendor-11a22760e699d74db2deeccbdb390b343ad010ce425dcb15451f0e14e45ff298]\ndirectory = \"cargo/vendor-git/11a22760e699d74db2deeccbdb390b343ad010ce425dcb15451f0e14e45ff298\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=9dcbd90c7d16e1a668b3afa057e940e2db328b93\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-36bf00be069421f8a8a7428c4360efee8b4243207a59d7b566c6f48fc5918f61\"\nrev = \"9dcbd90c7d16e1a668b3afa057e940e2db328b93\"\n\n[source.git-vendor-36bf00be069421f8a8a7428c4360efee8b4243207a59d7b566c6f48fc5918f61]\ndirectory = \"cargo/vendor-git/36bf00be069421f8a8a7428c4360efee8b4243207a59d7b566c6f48fc5918f61\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=b77af389f30bb10de10d8436ca9b39fe94e3bb67\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-a51e2c3f46af71f1caed91009f88b4f9982db0c4152c6659d11967a7731b1ccc\"\nrev = \"b77af389f30bb10de10d8436ca9b39fe94e3bb67\"\n\n[source.git-vendor-a51e2c3f46af71f1caed91009f88b4f9982db0c4152c6659d11967a7731b1ccc]\ndirectory = \"cargo/vendor-git/a51e2c3f46af71f1caed91009f88b4f9982db0c4152c6659d11967a7731b1ccc\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545\"\nrev = \"5ac7c9664c8d54aaf69d1bb826e187686c1a4e1a\"\n\n[source.git-vendor-9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545]\ndirectory = \"cargo/vendor-git/9100d311acc530b0286234c55b78dbdc0325d5e30950478c5c7864bfed7a4545\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=947dc5fb0ec436c0841f560eac0d65c6ad055ed4\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-eb100b17aaa74f1bccee5b69dce3d22ac29d6bc14b796a0a0b93237c93fcabbc\"\nrev = \"947dc5fb0ec436c0841f560eac0d65c6ad055ed4\"\n\n[source.git-vendor-eb100b17aaa74f1bccee5b69dce3d22ac29d6bc14b796a0a0b93237c93fcabbc]\ndirectory = \"cargo/vendor-git/eb100b17aaa74f1bccee5b69dce3d22ac29d6bc14b796a0a0b93237c93fcabbc\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=478c50560d3c6fad3d613af2a30b35c3bc9f4c0f\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-cb31475a7a9d19c00f48b4c43603f2f1a464c6dce15da1d21bba4c653eeba6b2\"\nrev = \"478c50560d3c6fad3d613af2a30b35c3bc9f4c0f\"\n\n[source.git-vendor-cb31475a7a9d19c00f48b4c43603f2f1a464c6dce15da1d21bba4c653eeba6b2]\ndirectory = \"cargo/vendor-git/cb31475a7a9d19c00f48b4c43603f2f1a464c6dce15da1d21bba4c653eeba6b2\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=5c91598ccc86537a779f438d520fa6406c26efe6\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-6f5ad8618176b3fc0aac703e6e74df7229b0350b4574c7edbe0bb86c53c1cb6c\"\nrev = \"5c91598ccc86537a779f438d520fa6406c26efe6\"\n\n[source.git-vendor-6f5ad8618176b3fc0aac703e6e74df7229b0350b4574c7edbe0bb86c53c1cb6c]\ndirectory = \"cargo/vendor-git/6f5ad8618176b3fc0aac703e6e74df7229b0350b4574c7edbe0bb86c53c1cb6c\"\n\n[source.\"https://github.com/storytold/craft-libs?rev=0fd30aeb3e02207d9d4c7c601540d9da45abf8de\"]\ngit = \"https://github.com/storytold/craft-libs\"\nreplace-with = \"git-vendor-fafb086755da4e9bf32b4ac1b53a42a6017167d56ec0071462788465fa35eb30\"\nrev = \"0fd30aeb3e02207d9d4c7c601540d9da45abf8de\"\n\n[source.git-vendor-fafb086755da4e9bf32b4ac1b53a42a6017167d56ec0071462788465fa35eb30]\ndirectory = \"cargo/vendor-git/fafb086755da4e9bf32b4ac1b53a42a6017167d56ec0071462788465fa35Line truncated
|
||||
"dest": "cargo",
|
||||
"dest-filename": "config"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user