document-graphics 0.1.6

Render graphics from untrusted documents to RGBA, with resource limits and isolated workers.
Documentation
[workspace]
resolver = "3"

[package]
name = "document-graphics"
version = "0.1.6"
edition = "2024"
rust-version = "1.90"
description = "Render graphics from untrusted documents to RGBA, with resource limits and isolated workers."
license = "MIT"
readme = "README.md"
documentation = "https://docs.rs/document-graphics"
repository = "https://github.com/garlab/document-graphics"
keywords = ["mermaid", "svg", "preview", "rendering"]
categories = ["rendering", "text-processing"]
include = ["src/**", "tests/**", "fonts/**", "README.md", "LICENSE", "Cargo.toml"]

[package.metadata.docs.rs]
all-features = true

[features]
default = []
sgf = []
chess = ["dep:cozy-chess"]
# Small, in-process PNG/JPEG thumbnails; no native framework or worker dependencies.
images = ["dep:image"]
# Region/animation decoding and broader SVG stay inside the disposable worker.
image-worker = ["images", "dep:png", "dep:serde", "dep:serde_json", "resvg/system-fonts", "image/gif", "image/webp", "image/bmp", "image/ico", "image/tiff", "image/pnm", "image/tga", "image/qoi"]
image-native = ["image-worker", "dep:core-graphics", "dep:core-foundation", "dep:foreign-types"]

[dependencies]
image = { version = "0.25", default-features = false, features = ["png", "jpeg"], optional = true }
png = { version = "0.18", optional = true }
serde = { version = "1", features = ["derive"], optional = true }
serde_json = { version = "1", optional = true }
cozy-chess = { version = "0.3.4", optional = true }
katex-native = "0.1"
mermaid-rs-renderer = { package = "document-graphics-mermaid", version = "=0.1.3", default-features = false }
resvg = { version = "0.45.1", default-features = false, features = ["text"] }
roxmltree = "0.20"

[target.'cfg(unix)'.dependencies]
libc = "0.2"

[target.'cfg(target_os = "macos")'.dependencies]
core-graphics = { version = "0.24", optional = true }
core-foundation = { version = "0.10", optional = true }
foreign-types = { version = "0.5", optional = true }

[dev-dependencies]
gif = "0.14"
tempfile = "3"

[lints.rust]
unsafe_op_in_unsafe_fn = "deny"

[lints.clippy]
dbg_macro = "warn"
todo = "warn"

[[test]]
name = "worker"
harness = false

[[test]]
name = "images"
harness = false
required-features = ["image-worker"]