Skip to content

Commit

Permalink
Align encoder with jxl
Browse files Browse the repository at this point in the history
  • Loading branch information
jakearchibald committed Oct 20, 2023
1 parent 921888c commit 0b330cd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/features/decoders/qoi/worker/qoiDecode.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { QOIModule } from 'codecs/qoi/dec/qoi_dec';
import qoiDecoder, { QOIModule } from 'codecs/qoi/dec/qoi_dec';
import { initEmscriptenModule, blobToArrayBuffer } from 'features/worker-utils';

let emscriptenModule: Promise<QOIModule>;

export default async function decode(blob: Blob): Promise<ImageData> {
if (!emscriptenModule) {
const decoder = await import('codecs/qoi/dec/qoi_dec');
emscriptenModule = initEmscriptenModule(decoder.default);
emscriptenModule = initEmscriptenModule(qoiDecoder);
}

const [module, data] = await Promise.all([
Expand Down

0 comments on commit 0b330cd

Please sign in to comment.