Skip to content

v0.8.0 — WebAssembly bindings

Choose a tag to compare

@matyushkin matyushkin released this 09 Apr 06:05
· 351 commits to main since this release

What's new

WebAssembly support (wasm feature)

djvu-rs can now be compiled to WebAssembly via wasm-pack:

wasm-pack build --target bundler --features wasm

New public API:

  • WasmDocument::from_bytes(data: &[u8]) — parse a DjVu file
  • WasmDocument::page_count() — number of pages
  • WasmDocument::page(index: u32) — get a page handle
  • WasmPage::dpi() — native resolution
  • WasmPage::width_at(dpi) / height_at(dpi) — dimensions at target DPI
  • WasmPage::render(dpi)Uint8ClampedArray (RGBA pixels, ready for ImageData)

See examples/wasm/ for a complete drag-and-drop browser demo.

IW44 wavelet fix (v0.7.1)

Compact-plane reconstruction now starts the inverse wavelet at the correct scale (16/sub instead of always 16), fixing a 99.7% pixel mismatch on subsampled chroma planes.