# 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.11.1"
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 decoder written from the DjVu v3 public specification"
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 = [
    "std",
    "dep:clap",
]
default = ["std"]
epub = ["std"]
image = [
    "dep:image",
    "std",
]
jpeg = ["dep:zune-jpeg"]
mmap = [
    "dep:memmap2",
    "std",
]
ocr-neural = [
    "dep:candle-core",
    "dep:candle-nn",
    "dep:tokenizers",
    "std",
]
ocr-onnx = [
    "dep:tract-onnx",
    "std",
]
ocr-tesseract = [
    "dep:tesseract",
    "std",
]
parallel = [
    "dep:rayon",
    "std",
]
serde = ["dep:serde"]
std = [
    "dep:png",
    "dep:zip",
    "dep:miniz_oxide",
    "dep:zune-jpeg",
    "dep:jpeg-encoder",
]
tiff = [
    "dep:tiff",
    "std",
]
wasm = [
    "dep:wasm-bindgen",
    "dep:js-sys",
    "std",
]

[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 = "extract_text"
path = "examples/extract_text.rs"

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

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

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

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

[[test]]
name = "cli_render_format"
path = "tests/cli_render_format.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 = "epub_conversion"
path = "tests/epub_conversion.rs"

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

[[test]]
name = "ocr_export"
path = "tests/ocr_export.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 = "serde_roundtrip"
path = "tests/serde_roundtrip.rs"

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

[dependencies.candle-core]
version = "0.8"
optional = true

[dependencies.candle-nn]
version = "0.8"
optional = true

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

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

[dependencies.image]
version = "0.24"
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.tokenizers]
version = "0.20"
optional = true

[dependencies.tokio]
version = "1"
features = [
    "rt",
    "rt-multi-thread",
    "macros",
]
optional = true

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

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

[dependencies.wide]
version = "0.7"

[dependencies.zip]
version = "2"
features = ["deflate"]
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.futures]
version = "0.3"

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

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

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

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