Integrate JXL decoder

This commit is contained in:
Surma
2020-02-06 14:31:27 -08:00
parent 57982e95c1
commit 7a4076156a
10 changed files with 483 additions and 2 deletions

View File

@@ -77,6 +77,13 @@ async function webpDecode(data: ArrayBuffer): Promise<ImageData> {
return decode(data);
}
async function jxlDecode(data: ArrayBuffer): Promise<ImageData> {
const { decode } = await import(
/* webpackChunkName: "process-jxl-dec" */
'../jxl/decoder');
return decode(data);
}
const exports = {
mozjpegEncode,
quantize,
@@ -85,6 +92,7 @@ const exports = {
optiPngEncode,
webpEncode,
webpDecode,
jxlDecode,
};
export type ProcessorWorkerApi = typeof exports;