Updating oxi, adding interlace option (#1014)

This commit is contained in:
Jake Archibald
2021-05-13 14:22:19 +01:00
committed by GitHub
parent b9b6e57581
commit f0fb891498
13 changed files with 35 additions and 14 deletions

View File

@@ -40,9 +40,12 @@ export default async function encode(
options: EncodeOptions,
): Promise<ArrayBuffer> {
if (!wasmReady) {
wasmReady = threads().then((hasThreads: boolean) => hasThreads ? initMT() : initST());
wasmReady = threads().then((hasThreads: boolean) =>
hasThreads ? initMT() : initST(),
);
}
const optimise = await wasmReady;
return optimise(new Uint8Array(data), options.level).buffer;
return optimise(new Uint8Array(data), options.level, options.interlace)
.buffer;
}