[package]
name = "djvu-rs"
version = "0.4.0"
edition = "2024"
rust-version = "1.88"
license = "MIT"
description = "Pure-Rust DjVu decoder written from the DjVu v3 public specification"
repository = "https://github.com/matyushkin/djvu-rs"
documentation = "https://docs.rs/djvu-rs"
readme = "README.md"
keywords = ["djvu", "decoder", "document", "image", "pdf"]
categories = ["parser-implementations", "multimedia::images", "encoding"]
publish = true
exclude = [
    ".cargo/config.toml",
    "tests/corpus/*",
    "tests/golden/*",
    "tests/fixtures/*",
    "references/*",
    "benches/*",
    "fuzz/*",
    "scripts/*",
    "BENCHMARKS_RESULTS.md",
    "BENCHMARKS.md",
]

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

[dependencies]
thiserror = "2"
wide = "0.7"
# Used by the djvu CLI binary. Will move to a separate djvu-cli crate in v0.2.
clap = { version = "4", features = ["derive"], optional = true }
png = { version = "0.17", optional = true }
zip = { version = "2", optional = true }
miniz_oxide = { version = "0.8", optional = true }
zune-jpeg = { version = "0.5", optional = true }
tiff = { version = "0.9", optional = true }
jpeg-encoder = { version = "0.6", optional = true }
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"], optional = true }

[features]
default = ["std"]
std = ["dep:clap", "dep:png", "dep:zip", "dep:miniz_oxide", "dep:zune-jpeg", "dep:jpeg-encoder"]
jpeg = ["dep:zune-jpeg"]
tiff = ["dep:tiff", "std"]
async = ["dep:tokio", "std"]

[dev-dependencies]
criterion = "0.5"
assert_cmd = "2"
predicates = "3"
tempfile = "3"

[[bin]]
name = "djvu"
path = "src/bin/djvu.rs"
required-features = ["std"]

[[bench]]
name = "codecs"
harness = false

[[bench]]
name = "render"
harness = false

[[bench]]
name = "document"
harness = false
