Nanojpeg compiled WebAssembly for ServiceWorker, 10KiB size uncompressed.
npm i --save nanojpeg-wasm
interface Result {
isGrey: boolean
width: number,
height: number,
data: Uint8Array,
}
declare function Decode(image: ArrayBuffer): Result;
Dependency:
- Clang LLVM
- Bynaryen
- Emscripten SDK
Dir /libc from https://github.com/harfbuzz/harfbuzzjs/tree/main/libc
https://github.com/harfbuzz/harfbuzzjs/blob/main/nanojpeg/build.sh