flashraw 0.1.0

Extremely fast, safe RAW image decoding: DNG, CR2, CR3, NEF, ARW, RAF, RW2, ORF, PEF and more
Documentation

flashraw

Fast, safe camera RAW decoding in Rust: DNG, CR2, CR3, NEF, ARW, RAF, RW2, ORF, PEF and more, with bounds-checked parsing, configurable Limits for untrusted files, multithreaded CPU decoding, an optional GPU backend and the same API compiled to WebAssembly, Python and C.

[dependencies]
flashraw = "0.1"
use flashraw::{DecodeOptions, FlashRaw, OutputFormat};

fn main() -> flashraw::Result<()> {
    let raw = FlashRaw::open_path("photo.CR3")?;                 // headers only, memory-mapped
    println!("{} {}x{}", raw.metadata().camera(), raw.metadata().width, raw.metadata().height);
    let frame = raw.decode(DecodeOptions { output: OutputFormat::Rgba8, ..Default::default() })?;
    println!("{} bytes of RGBA8", frame.as_u8().map_or(0, |d| d.len()));
    Ok(())
}

Of the 2,016 files in the raw.pixls.us corpus, 1,980 decode (98.2%); the other 36 are valid files in formats that are not supported yet (28 Nikon High Efficiency NEF, Light L16, Casio CAM, JPEG-in-DNG), see docs/formats.md.