Skip to content

Commit

Permalink
No need to cache QOI stuff separately
Browse files Browse the repository at this point in the history
  • Loading branch information
jakearchibald committed Oct 20, 2023
1 parent 0b330cd commit 369d6f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/features/encoders/qoi/worker/qoiEncode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<QoiModule>;

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(
Expand Down
8 changes: 0 additions & 8 deletions src/sw/to-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down Expand Up @@ -112,7 +108,6 @@ export const theRest = (async () => {

if (!supportsAvif) addWithDeps(avifDec);
if (!supportsWebP) addWithDeps(webpDec);
addWithDeps(qoiDec);

// AVIF
if (supportsThreads) {
Expand All @@ -137,9 +132,6 @@ export const theRest = (async () => {
addWithDeps(oxi);
}

// QOI
addWithDeps(qoiEnc);

// WebP
if (supportsSimd) {
addWithDeps(webpEncSimd);
Expand Down

0 comments on commit 369d6f4

Please sign in to comment.