mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-17 19:19:47 +00:00
Add AVIF decoder to squoosh
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user