# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
rust-version = "1.88"
name = "djvu-rs"
version = "0.26.0"
build = false
exclude = [
    ".cargo/config.toml",
    "tests/corpus/*",
    "tests/golden/*",
    "tests/fixtures/*",
    "references/*",
    "benches/*",
    "fuzz/*",
    "scripts/*",
    "BENCHMARKS_RESULTS.md",
    "BENCHMARKS.md",
]
publish = true
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Pure-Rust DjVu codec — decode and encode DjVu documents. MIT licensed, no GPL dependencies."
documentation = "https://docs.rs/djvu-rs"
readme = "README.md"
keywords = [
    "djvu",
    "decoder",
    "document",
    "image",
    "pdf",
]
categories = [
    "parser-implementations",
    "multimedia::images",
    "encoding",
]
license = "MIT"
repository = "https://github.com/matyushkin/djvu-rs"

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

[features]
async = [
    "dep:tokio",
    "dep:async-stream",
    "dep:futures-core",
    "std",
]
cli = [
    "pdf",
    "dep:clap",
    "dep:zip",
    "dep:flate2",
]
default = ["std"]
epub = [
    "std",
    "dep:zip",
    "dep:flate2",
]
experimental = [
    "std",
    "djvu-jb2/experimental",
]
image = [
    "dep:image",
    "std",
]
iw44-probe = [
    "std",
    "djvu-iw44/iw44-probe",
]
jpeg = ["dep:zune-jpeg"]
mmap = [
    "dep:memmap2",
    "std",
]
ocr-neural = ["std"]
ocr-neural-candle = ["ocr-neural"]
ocr-onnx = [
    "dep:tract-onnx",
    "std",
]
ocr-tesseract = [
    "dep:tesseract",
    "std",
]
parallel = [
    "dep:rayon",
    "std",
    "djvu-bzz/parallel",
    "djvu-iw44/parallel",
    "djvu-jb2/parallel",
]
pdf = [
    "std",
    "dep:miniz_oxide",
    "dep:jpeg-encoder",
]
serde = ["dep:serde"]
std = [
    "dep:png",
    "dep:zune-jpeg",
    "djvu-zp/std",
    "djvu-bzz/std",
    "djvu-iff/std",
    "djvu-bitmap/std",
    "djvu-jb2/std",
    "djvu-pixmap/std",
    "djvu-iw44/std",
]
tiff = [
    "dep:tiff",
    "std",
]
wasm = [
    "dep:wasm-bindgen",
    "dep:js-sys",
    "std",
]
wasm-threads = [
    "wasm",
    "parallel",
    "dep:wasm-bindgen-rayon",
]

[lib]
name = "djvu_rs"
crate-type = [
    "cdylib",
    "rlib",
]
path = "src/lib.rs"

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

[[example]]
name = "async_lazy_first_page"
path = "examples/async_lazy_first_page.rs"
required-features = ["async"]

[[example]]
name = "bzz_encode_diag"
path = "examples/bzz_encode_diag.rs"

[[example]]
name = "c5_compress_bench"
path = "examples/c5_compress_bench.rs"

[[example]]
name = "cold_open_bench"
path = "examples/cold_open_bench.rs"
required-features = [
    "mmap",
    "parallel",
]

[[example]]
name = "diagnose_iw44_quality"
path = "examples/diagnose_iw44_quality.rs"

[[example]]
name = "diff_djvulibre"
path = "examples/diff_djvulibre.rs"

[[example]]
name = "diff_fuzz"
path = "examples/diff_fuzz.rs"

[[example]]
name = "encode_quality_djbz"
path = "examples/encode_quality_djbz.rs"
required-features = ["experimental"]

[[example]]
name = "encode_quality_iw44"
path = "examples/encode_quality_iw44.rs"

[[example]]
name = "encode_quality_jb2"
path = "examples/encode_quality_jb2.rs"

[[example]]
name = "extract_text"
path = "examples/extract_text.rs"

[[example]]
name = "fg_bicubic_quality"
path = "examples/fg_bicubic_quality.rs"

[[example]]
name = "fgbz_mediancut_harness"
path = "examples/fgbz_mediancut_harness.rs"

[[example]]
name = "info"
path = "examples/info.rs"

[[example]]
name = "interop_encode"
path = "examples/interop_encode.rs"

[[example]]
name = "interop_pixdiff"
path = "examples/interop_pixdiff.rs"

[[example]]
name = "iw44_band_probe"
path = "examples/iw44_band_probe.rs"
required-features = ["iw44-probe"]

[[example]]
name = "iw44_chunking_lever"
path = "examples/iw44_chunking_lever.rs"

[[example]]
name = "iw44_chunking_sweep"
path = "examples/iw44_chunking_sweep.rs"

[[example]]
name = "jb2_crosssize_b1probe"
path = "examples/jb2_crosssize_b1probe.rs"
required-features = ["experimental"]

[[example]]
name = "jb2_despeckle"
path = "examples/jb2_despeckle.rs"

[[example]]
name = "jb2_lossy_b0"
path = "examples/jb2_lossy_b0.rs"
required-features = ["std"]

[[example]]
name = "jb2_same_size_a0"
path = "examples/jb2_same_size_a0.rs"
required-features = ["experimental"]

[[example]]
name = "jb2_same_size_a2"
path = "examples/jb2_same_size_a2.rs"
required-features = ["experimental"]

[[example]]
name = "jb2_same_size_a3_auto"
path = "examples/jb2_same_size_a3_auto.rs"
required-features = ["experimental"]

[[example]]
name = "jb2_same_size_a3_density_sweep"
path = "examples/jb2_same_size_a3_density_sweep.rs"
required-features = ["experimental"]

[[example]]
name = "mask_aa_crops"
path = "examples/mask_aa_crops.rs"

[[example]]
name = "mask_aa_quality"
path = "examples/mask_aa_quality.rs"

[[example]]
name = "ocr_qa"
path = "examples/ocr_qa.rs"

[[example]]
name = "pdf_dct_probe"
path = "examples/pdf_dct_probe.rs"

[[example]]
name = "pdf_g4_export"
path = "examples/pdf_g4_export.rs"
required-features = ["pdf"]

[[example]]
name = "pdf_g4_probe"
path = "examples/pdf_g4_probe.rs"

[[example]]
name = "pdf_memory_probe"
path = "examples/pdf_memory_probe.rs"
required-features = ["pdf"]

[[example]]
name = "pgo_train"
path = "examples/pgo_train.rs"

[[example]]
name = "probe_tiff_streaming_memory"
path = "examples/probe_tiff_streaming_memory.rs"
required-features = ["tiff"]

[[example]]
name = "profile_iw44"
path = "examples/profile_iw44.rs"

[[example]]
name = "profile_iw44_encode"
path = "examples/profile_iw44_encode.rs"

[[example]]
name = "quality_harness"
path = "examples/quality_harness.rs"

[[example]]
name = "render_page"
path = "examples/render_page.rs"

[[example]]
name = "thumbnail_grid_quality"
path = "examples/thumbnail_grid_quality.rs"

[[example]]
name = "txtz_ocr_demo"
path = "examples/txtz_ocr_demo.rs"
required-features = ["pdf"]

[[test]]
name = "cli_encode"
path = "tests/cli_encode.rs"

[[test]]
name = "cli_encode_image_formats"
path = "tests/cli_encode_image_formats.rs"

[[test]]
name = "cli_info"
path = "tests/cli_info.rs"

[[test]]
name = "cli_merge_split_bzz"
path = "tests/cli_merge_split_bzz.rs"

[[test]]
name = "cli_ocr"
path = "tests/cli_ocr.rs"

[[test]]
name = "cli_render"
path = "tests/cli_render.rs"

[[test]]
name = "cli_render_format"
path = "tests/cli_render_format.rs"

[[test]]
name = "cli_render_layers"
path = "tests/cli_render_layers.rs"

[[test]]
name = "cli_text"
path = "tests/cli_text.rs"

[[test]]
name = "codec_bzz"
path = "tests/codec_bzz.rs"

[[test]]
name = "codec_jb2_iw44"
path = "tests/codec_jb2_iw44.rs"

[[test]]
name = "document_and_render"
path = "tests/document_and_render.rs"

[[test]]
name = "encode_size_regression"
path = "tests/encode_size_regression.rs"

[[test]]
name = "epub_conversion"
path = "tests/epub_conversion.rs"

[[test]]
name = "ffi"
path = "tests/ffi.rs"

[[test]]
name = "iff_emission_guard"
path = "tests/iff_emission_guard.rs"

[[test]]
name = "image_decoder"
path = "tests/image_decoder.rs"

[[test]]
name = "iw44_rate_target"
path = "tests/iw44_rate_target.rs"

[[test]]
name = "ocr_tesseract"
path = "tests/ocr_tesseract.rs"

[[test]]
name = "panic_free_corpus"
path = "tests/panic_free_corpus.rs"

[[test]]
name = "pdf_conversion"
path = "tests/pdf_conversion.rs"

[[test]]
name = "phase4_annotations"
path = "tests/phase4_annotations.rs"

[[test]]
name = "phase4_text"
path = "tests/phase4_text.rs"

[[test]]
name = "proptest_codecs"
path = "tests/proptest_codecs.rs"

[[test]]
name = "serde_roundtrip"
path = "tests/serde_roundtrip.rs"

[[test]]
name = "text_serialize"
path = "tests/text_serialize.rs"

[dependencies.async-stream]
version = "0.3"
optional = true

[dependencies.clap]
version = "4"
features = ["derive"]
optional = true

[dependencies.djvu-bitmap]
version = "0.26.0"
default-features = false

[dependencies.djvu-bzz]
version = "0.26.0"
default-features = false

[dependencies.djvu-iff]
version = "0.26.0"
default-features = false

[dependencies.djvu-iw44]
version = "0.26.0"
default-features = false

[dependencies.djvu-jb2]
version = "0.26.0"
default-features = false

[dependencies.djvu-pixmap]
version = "0.26.0"
default-features = false

[dependencies.djvu-zp]
version = "0.26.0"
default-features = false

[dependencies.flate2]
version = "1"
features = ["rust_backend"]
optional = true
default-features = false

[dependencies.futures-core]
version = "0.3"
optional = true

[dependencies.image]
version = "0.25"
optional = true
default-features = false

[dependencies.jpeg-encoder]
version = "0.6"
optional = true

[dependencies.js-sys]
version = "0.3"
optional = true

[dependencies.memmap2]
version = "0.9"
optional = true

[dependencies.miniz_oxide]
version = "0.8"
optional = true

[dependencies.png]
version = "0.17"
optional = true

[dependencies.rayon]
version = "1"
optional = true

[dependencies.serde]
version = "1"
features = ["derive"]
optional = true

[dependencies.tesseract]
version = "0.15"
optional = true

[dependencies.thiserror]
version = "2"

[dependencies.tiff]
version = "0.9"
optional = true

[dependencies.tokio]
version = "1"
features = [
    "rt",
    "macros",
    "io-util",
    "sync",
]
optional = true

[dependencies.tract-onnx]
version = "0.21"
optional = true

[dependencies.wasm-bindgen]
version = "0.2"
optional = true

[dependencies.wasm-bindgen-rayon]
version = "1.3"
optional = true

[dependencies.wide]
version = "0.7"

[dependencies.zip]
version = "2"
features = [
    "deflate-flate2",
    "flate2",
]
optional = true
default-features = false

[dependencies.zune-jpeg]
version = "0.5"
optional = true

[dev-dependencies.assert_cmd]
version = "2"

[dev-dependencies.criterion]
version = "0.5"

[dev-dependencies.flate2]
version = "1"
features = ["rust_backend"]
default-features = false

[dev-dependencies.futures]
version = "0.3"

[dev-dependencies.jpeg-encoder]
version = "0.6"

[dev-dependencies.libc]
version = "0.2"

[dev-dependencies.miniz_oxide]
version = "0.8"

[dev-dependencies.predicates]
version = "3"

[dev-dependencies.proptest]
version = "1"

[dev-dependencies.serde_json]
version = "1"

[dev-dependencies.tempfile]
version = "3"

[dev-dependencies.zip]
version = "2"
features = [
    "deflate-flate2",
    "flate2",
]
default-features = false

[profile.bench]
lto = "fat"
codegen-units = 1

[profile.release]
lto = "fat"
codegen-units = 1
