mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-13 17:27:09 +00:00
Fall through to built-in decoding
This commit is contained in:
@@ -113,7 +113,11 @@ async function decodeImage(
|
|||||||
}
|
}
|
||||||
// If none of those work, let’s see if Web Codecs API is available
|
// If none of those work, let’s see if Web Codecs API is available
|
||||||
if (await WebCodecs.isTypeSupported(mimeType)) {
|
if (await WebCodecs.isTypeSupported(mimeType)) {
|
||||||
return await abortable(signal, WebCodecs.decode(blob, mimeType));
|
let result;
|
||||||
|
try {
|
||||||
|
result = await abortable(signal, WebCodecs.decode(blob, mimeType));
|
||||||
|
return result;
|
||||||
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
// Otherwise fall through and try built-in decoding for a laugh.
|
// Otherwise fall through and try built-in decoding for a laugh.
|
||||||
return await abortable(signal, builtinDecode(blob));
|
return await abortable(signal, builtinDecode(blob));
|
||||||
|
|||||||
Reference in New Issue
Block a user