modern-pdf-lib / decodeJpegWasm
Function: decodeJpegWasm()
decodeJpegWasm(
jpegBytes):JpegDecodeResult|undefined
Defined in: src/wasm/jpeg/bridge.ts:196
Decode JPEG bytes to raw pixel data using the WASM decoder.
The WASM module returns a flat byte array with layout: [width_u32_le, height_u32_le, channels_u8, ...pixels].
Parameters
jpegBytes
Uint8Array
JPEG-encoded image data.
Returns
JpegDecodeResult | undefined
Decoded pixel data with metadata, or undefined if WASM is not available or decoding failed.