Add AVIF decoder to squoosh

This commit is contained in:
Surma
2020-02-05 16:44:51 -08:00
committed by Ingvar Stepanyan
parent 34cb55978f
commit 02807aab32
9 changed files with 481 additions and 0 deletions

View File

@@ -82,6 +82,13 @@ async function webpDecode(data: ArrayBuffer): Promise<ImageData> {
return timed('webpDecode', () => decode(data));
}
async function avifDecode(data: ArrayBuffer): Promise<ImageData> {
const { decode } = await import(
/* webpackChunkName: "process-avif-dec" */
'../avif/decoder');
return decode(data);
}
const exports = {
mozjpegEncode,
quantize,
@@ -90,6 +97,7 @@ const exports = {
oxiPngEncode,
webpEncode,
webpDecode,
avifDecode,
};
export type ProcessorWorkerApi = typeof exports;