malmal 0.5.1

Upload scanner for images, SVG, PDF and PostScript files
Documentation
[package]
name = "malmal"
description = "Upload scanner for images, SVG, PDF and PostScript files"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
authors.workspace = true
readme = "../../README.md"
keywords = ["malware", "scanner", "upload", "security", "antivirus"]
categories = ["parsing", "command-line-utilities"]

[dependencies]
aes = "0.8"
brotli-decompressor = "6.3"
image = { version = "0.25.10", default-features = false, optional = true, features = [
    "bmp",
    "gif",
    "ico",
    "jpeg",
    "png",
    "tiff",
    "webp",
] }
md-5 = "0.10"
memchr = "2.8.3"
miniz_oxide = "0.9.1"
moxcms = { version = "0.8.1", optional = true }
png = { version = "0.18.1", optional = true }
quick-xml = { version = "0.42.0", default-features = false }
serde.workspace = true
sha2.workspace = true
zune-core = { version = "0.5.3", optional = true, default-features = false }
zune-jpeg = { version = "0.5.15", optional = true }
yara-x = { version = "1.23.0", default-features = false, optional = true, features = [
    "constant-folding",
    "exact-atoms",
    "fast-regexp",
    "hash-module",
    "elf-module",
    "math-module",
    "pe-module",
    "string-module",
] }
# The `pe` module of `yara-x` 1.23 uses `rsa::Pkcs1v15Sign`, which `rsa`
# 0.10.0 puts behind a feature `yara-x` does not turn on.
rsa = { version = "0.10.0", default-features = false, features = ["pkcs1v15"], optional = true }
# With fixes to JPEG reconstruction not yet released upstream; see
# third_party/README.md.
jxl-oxide = { package = "malmal-jxl-oxide", path = "../../third_party/jxl-oxide", version = "0.12.6", default-features = false, features = ["image"], optional = true }
svg-hush = { version = "0.9", optional = true }
hayro = { version = "0.9", optional = true }
tiff = { version = "0.11.2", optional = true, features = ["webp"] }
gif = { version = "0.14.2", optional = true }
# With a flag that stops decoding at a deadline; see third_party/README.md.
filmcraft-av1 = { package = "malmal-filmcraft-av1", path = "../../third_party/filmcraft-av1", version = "0.9.0", optional = true, default-features = false, features = ["threads"] }
ruzstd = { version = "0.9.1", optional = true }
lzma-rs = { version = "0.3.0", optional = true }

[features]
# YARA rule matching. Off by default: it adds a WebAssembly runtime and
# several megabytes to the binary.
yara = ["dep:yara-x", "dep:rsa"]
# Rebuilding raster images from their pixels (`malmal::cdr`). Off by
# default: it adds the decoders and encoders of the `image` crate, which
# already depends on the others.
cdr = [
    "dep:image",
    "dep:jxl-oxide",
    "dep:moxcms",
    "dep:png",
    "dep:tiff",
    "dep:gif",
    "dep:filmcraft-av1",
    "dep:ruzstd",
    "dep:lzma-rs",
    "dep:zune-core",
    "dep:zune-jpeg",
]

# With `cdr`, also filtering SVG files down to what draws a picture.
cdr-svg = ["cdr", "dep:svg-hush"]

# With `cdr`, also rendering each page of a PDF and writing a new one that
# holds nothing but the pictures of the pages.
cdr-pdf = ["cdr", "dep:hayro"]

[lints.rust]
# Set by cargo-fuzz.
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(fuzzing)", "cfg(docsrs)"] }

[dev-dependencies]
base64 = "0.22"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]