mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-14 01:37:26 +00:00
Update src/client/lazy-app/util/index.ts
Co-authored-by: Jake Archibald <jaffathecake@gmail.com>
This commit is contained in:
@@ -244,9 +244,9 @@ export async function builtinDecode(
|
|||||||
): Promise<ImageData> {
|
): Promise<ImageData> {
|
||||||
// If WebCodecs are supported, use that.
|
// If WebCodecs are supported, use that.
|
||||||
if (await WebCodecs.isTypeSupported(mimeType)) {
|
if (await WebCodecs.isTypeSupported(mimeType)) {
|
||||||
if (signal.aborted) return Promise.reject('Aborted');
|
assertSignal(signal);
|
||||||
try {
|
try {
|
||||||
return await WebCodecs.decode(blob, mimeType);
|
return await abortable(signal, WebCodecs.decode(blob, mimeType));
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
assertSignal(signal);
|
assertSignal(signal);
|
||||||
|
|||||||
Reference in New Issue
Block a user