From 5743912da6caf75288e72038a42ecd919941bc5c Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Fri, 24 Jul 2026 15:56:28 +0100 Subject: [PATCH] Trim image codec features in the CLI and Python crates vtracer only decodes input, but image's default features pulled a full AV1 encoder (ravif/rav1e) and OpenEXR into the CLI binary and the Python wheel. Restrict to decode-only input formats (png, jpeg, gif, bmp, webp, tiff, ico, pnm, tga, qoi). The release binary drops from ~3.23 MB to ~2.46 MB and builds faster; supported inputs are unchanged in practice (avif decode was never in image's defaults anyway). --- crates/vtracer-cli/Cargo.toml | 5 ++++- crates/vtracer-py/Cargo.toml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/vtracer-cli/Cargo.toml b/crates/vtracer-cli/Cargo.toml index c6b42e6..d4cc3e8 100644 --- a/crates/vtracer-cli/Cargo.toml +++ b/crates/vtracer-cli/Cargo.toml @@ -17,5 +17,8 @@ path = "src/main.rs" [dependencies] vtracer = { version = "1.0.0-alpha.1", path = "../vtracer" } visioncortex.workspace = true -image = "0.25" +# Decode-only: trimmed to real input formats (drops the AV1 encoder + OpenEXR). +image = { version = "0.25", default-features = false, features = [ + "png", "jpeg", "gif", "bmp", "webp", "tiff", "ico", "pnm", "tga", "qoi", +] } clap = { version = "4", features = ["derive"] } diff --git a/crates/vtracer-py/Cargo.toml b/crates/vtracer-py/Cargo.toml index c413f26..f674e24 100644 --- a/crates/vtracer-py/Cargo.toml +++ b/crates/vtracer-py/Cargo.toml @@ -19,5 +19,8 @@ crate-type = ["cdylib"] [dependencies] vtracer = { version = "1.0.0-alpha.1", path = "../vtracer" } -image = "0.25" +# Decode-only: trimmed to real input formats (drops the AV1 encoder + OpenEXR). +image = { version = "0.25", default-features = false, features = [ + "png", "jpeg", "gif", "bmp", "webp", "tiff", "ico", "pnm", "tga", "qoi", +] } pyo3 = { version = "0.26", features = ["extension-module", "abi3-py38"] }