Decoding Raw 0xFF0A Codestreams and Boxed JPEG XL Files in Browsers Without Native JXL
Bridging Desktop Browser JPEG XL Support Gaps via Single-Threaded libjxl WASM
Most Chromium and Blink desktop builds do not decode image/jxl natively, leaving designers and archival workflows unable to open .jxl photography or modular lossless graphics directly in web apps. JPEG XL files exist in two distinct framing formats under ISO/IEC 18181: ultra-compact naked codestreams starting with magic bytes 0xFF 0x0A, and ISO BMFF boxed containers starting with 0x0000000C 4A584C20 that wrap jxlc or partial jxlp codestream chunks alongside EXIF and ICC boxes.
Our sniffer distinguishes both JXL framing classes at the bit level, reassembles split jxlp boxes when needed, and feeds the bitstream to single-threaded @jsquash/jxl/decode inside the isolated Worker. Decoded RGBA8 pixels preserve straight extra-channel alpha values and serialize through our Rust squoosh_png WebAssembly encoder accompanied by a cryptographic pixel SHA-256 digest.
- Zero SharedArrayBuffer or Cross-Origin-Embedder-Policy headers required.
- Distinguishes raw-codestream (0xFF0A) from boxed isobmff-container signatures before WASM allocation.
- Computes deterministic RGBA8 pixel digests to verify bit-exact modular JXL reconstruction.