Files
craft-libs/crates/heif/Cargo.toml
T
Dylan M. Taylor 5fc172eeb5 craft-heif: metadata feature, Exif/XMP items without heic-rs (#1055)
* craft-heif: a metadata feature that reads Exif and XMP without heic-rs

The decoder is now the default feature decode, and heic-rs and rayon are
optional. The new metadata feature adds items::read: the first Exif item
and the XMP mime item from the box structure alone (iinf, iloc, idat), with
limits on boxes, items, extents and item size, moved from LightCraft's
lightcraft-meta. Built with --no-default-features --features metadata the
crate has no heic-rs dependency and read_metadata is that reader; default
builds are unchanged. With both features a test checks that the two readers
agree on synthetic files.

* craft-heif: keep #[cfg(test)] on the test modules so clippy treats them as tests

#[cfg(all(test, feature = "decode"))] hid the test cfg from clippy's
allow-unwrap-in-tests, so the helpers in tests_icc.rs and tests_synthetic.rs
failed all-targets clippy. The modules now carry #[cfg(test)] and
#[cfg(feature = "decode")] as two attributes.
2026-11-11 21:58:39 -05:00

34 lines
1.5 KiB
TOML

[package]
name = "craft-heif"
description = "Optional HEIF/HEIC still-image decoder: heic-rs for the container and HEVC, libheif-matching colour conversion, panic-guarded."
version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
repository.workspace = true
[dependencies]
# Pure Rust, no unsafe. Pinned exactly: a young, single-owner crate that parses untrusted files;
# moving the pin is a reviewed change (re-run these tests and each app's HEIF corpus tests).
# heic-rs was chosen over the other permissive candidates (heif-oxide's HEVC decoder, rust_h265, follows FFmpeg's (LGPL)
# code structure; gamut-heic has no HEVC decoder of its own).
heic-rs = { version = "=0.1.4", default-features = false, features = ["std"], optional = true }
# The tiles of a HEIC photo decode in parallel on native; wasm stays single-threaded.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
heic-rs = { version = "=0.1.4", default-features = false, features = ["std", "parallel"], optional = true }
rayon = { workspace = true, optional = true }
[features]
default = ["decode"]
# The decoder (probe, decode, decode_thumbnail, read_metadata): heic-rs for the container and HEVC.
decode = ["dep:heic-rs", "dep:rayon"]
# `items`: the Exif and XMP items from the box structure alone, without heic-rs. Without `decode`,
# `read_metadata` is this reader.
metadata = []
# `craft_heif::testdata`: lossless synthetic HEIF files, for the tests of the crates above.
testdata = []
[lints]
workspace = true