mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-25 20:14:31 +01:00
jxl-oxide decompresses brob (Brotli Exif/XMP) boxes into a buffer its AllocTracker does not count, so a 54-byte box expanded to 64 MiB of XMP and a larger one can ask for gigabytes before any pixel limit applies. decode now inflates every brob box under one 8 MiB budget per file, rewrites it as the plain box it wraps and drops boxes past the budget, nested or broken ones. Files without a brob box are not copied.
29 lines
809 B
TOML
29 lines
809 B
TOML
[package]
|
|
name = "craft-jxl"
|
|
description = "JPEG XL image decoding and encoding with bounded input and allocation tracking."
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version.workspace = true
|
|
repository.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[features]
|
|
default = ["decode", "encode"]
|
|
decode = ["dep:jxl-oxide", "dep:brotli-decompressor"]
|
|
encode = ["dep:jixel"]
|
|
|
|
[dependencies]
|
|
jxl-oxide = { workspace = true, optional = true }
|
|
# Bounds the Brotli-compressed metadata boxes before jxl-oxide inflates them (see brob.rs).
|
|
brotli-decompressor = { version = "5", optional = true }
|
|
thiserror = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
craft-cms = { workspace = true }
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
jixel = { workspace = true, optional = true }
|