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

@@ -8,6 +8,9 @@ export async function decodeImage(blob: Blob, processor: Processor): Promise<Ima
const mimeType = await sniffMimeType(blob);
try {
if (mimeType === 'image/avif') {
return await processor.avifDecode(blob);
}
if (mimeType === 'image/webp' && !(await webPSupported)) {
return await processor.webpDecode(blob);
}