From 369d6f45a064bc9541ccea6c6594bcfa967dc9d2 Mon Sep 17 00:00:00 2001 From: Jake Archibald Date: Fri, 20 Oct 2023 09:11:35 +0100 Subject: [PATCH] No need to cache QOI stuff separately --- src/features/encoders/qoi/worker/qoiEncode.ts | 5 ++--- src/sw/to-cache.ts | 8 -------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/features/encoders/qoi/worker/qoiEncode.ts b/src/features/encoders/qoi/worker/qoiEncode.ts index 52b5425f2..ef671b432 100644 --- a/src/features/encoders/qoi/worker/qoiEncode.ts +++ b/src/features/encoders/qoi/worker/qoiEncode.ts @@ -10,15 +10,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import type { QoiModule } from 'codecs/qoi/enc/qoi_enc'; +import qoiEncoder, { QoiModule } from 'codecs/qoi/enc/qoi_enc'; import type { EncodeOptions } from '../shared/meta'; import { initEmscriptenModule } from 'features/worker-utils'; let emscriptenModule: Promise; async function init() { - const qoiEncoder = await import('codecs/qoi/enc/qoi_enc.js'); - return initEmscriptenModule(qoiEncoder.default); + return initEmscriptenModule(qoiEncoder); } export default async function encode( diff --git a/src/sw/to-cache.ts b/src/sw/to-cache.ts index e241737e1..49afaf073 100644 --- a/src/sw/to-cache.ts +++ b/src/sw/to-cache.ts @@ -26,7 +26,6 @@ import * as featuresWorker from 'entry-data:../features-worker'; // Decoders (some are feature detected) import * as avifDec from 'entry-data:codecs/avif/dec/avif_dec'; import * as webpDec from 'entry-data:codecs/webp/dec/webp_dec'; -import * as qoiDec from 'entry-data:codecs/qoi/dec/qoi_dec'; // AVIF import * as avifEncMt from 'entry-data:codecs/avif/enc/avif_enc_mt'; @@ -41,9 +40,6 @@ import * as jxlEnc from 'entry-data:codecs/jxl/enc/jxl_enc'; import * as oxiMt from 'entry-data:codecs/oxipng/pkg-parallel/squoosh_oxipng'; import * as oxi from 'entry-data:codecs/oxipng/pkg/squoosh_oxipng'; -// QOI -import * as qoiEnc from 'entry-data:codecs/qoi/enc/qoi_enc'; - // WebP import * as webpEncSimd from 'entry-data:codecs/webp/enc/webp_enc_simd'; import * as webpEnc from 'entry-data:codecs/webp/enc/webp_enc'; @@ -112,7 +108,6 @@ export const theRest = (async () => { if (!supportsAvif) addWithDeps(avifDec); if (!supportsWebP) addWithDeps(webpDec); - addWithDeps(qoiDec); // AVIF if (supportsThreads) { @@ -137,9 +132,6 @@ export const theRest = (async () => { addWithDeps(oxi); } - // QOI - addWithDeps(qoiEnc); - // WebP if (supportsSimd) { addWithDeps(webpEncSimd);