mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-12 08:47:31 +00:00
Rebase fixes
This commit is contained in:
committed by
Ingvar Stepanyan
parent
198ad0fb1b
commit
8581785869
@@ -8,3 +8,7 @@
|
|||||||
/*
|
/*
|
||||||
Cross-Origin-Embedder-Policy: require-corp
|
Cross-Origin-Embedder-Policy: require-corp
|
||||||
Cross-Origin-Opener-Policy: same-origin
|
Cross-Origin-Opener-Policy: same-origin
|
||||||
|
# Origin trial for WebAssembly SIMD.
|
||||||
|
# ATTENTION: This one is configured for merge-v2-codecs--squoosh.netlify.app preview.
|
||||||
|
# For production squoosh.app, replace with AgoKiDqjr0GVPtrwV/vuVlrrSvbDa5Yb99s+q66ly816DrrAQ8Cdas33NgDtmhxM4BtDP9PEdyuxHPyTQHD5ZAcAAABUeyJvcmlnaW4iOiJodHRwczovL3NxdW9vc2guYXBwOjQ0MyIsImZlYXR1cmUiOiJXZWJBc3NlbWJseVNpbWQiLCJleHBpcnkiOjE2MDg2NzI5OTR9.
|
||||||
|
Origin-Trial: Anr6rjkQpYjMoR5pS5JZUJvCBZfYCHkrevHoDVENE+km6fqRscjRrsY0CWTKY0FH1KX+gv0aw/W2liJw8H58Uw8AAABteyJvcmlnaW4iOiJodHRwczovL21lcmdlLXYyLWNvZGVjcy0tc3F1b29zaC5uZXRsaWZ5LmFwcDo0NDMiLCJmZWF0dXJlIjoiV2ViQXNzZW1ibHlTaW1kIiwiZXhwaXJ5IjoxNjA5MzU3MTg5fQ==
|
||||||
|
|||||||
@@ -17,26 +17,17 @@ import { initEmscriptenModule } from 'features/worker-utils';
|
|||||||
import { simd } from 'wasm-feature-detect';
|
import { simd } from 'wasm-feature-detect';
|
||||||
|
|
||||||
import wasmUrl from 'url:codecs/webp/enc/webp_enc.wasm';
|
import wasmUrl from 'url:codecs/webp/enc/webp_enc.wasm';
|
||||||
|
|
||||||
import wasmUrlWithMTAndSIMD from 'url:codecs/webp/enc/webp_enc_simd.wasm';
|
import wasmUrlWithMTAndSIMD from 'url:codecs/webp/enc/webp_enc_simd.wasm';
|
||||||
import workerUrlWithSIMD from 'omt:codecs/webp/enc/webp_enc_simd.worker.js';
|
|
||||||
|
|
||||||
let emscriptenModule: Promise<WebPModule>;
|
let emscriptenModule: Promise<WebPModule>;
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
if (await simd()) {
|
if (await simd()) {
|
||||||
const webpEncoder = await import('codecs/webp/enc/webp_enc_simd');
|
const webpEncoder = await import('codecs/webp/enc/webp_enc_simd');
|
||||||
return initEmscriptenModule(
|
return initEmscriptenModule(webpEncoder.default, wasmUrlWithMTAndSIMD);
|
||||||
webpEncoder.default,
|
|
||||||
wasmUrlWithMTAndSIMD,
|
|
||||||
workerUrlWithSIMD,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
const webpEncoder = await import('codecs/webp/enc/webp_enc');
|
const webpEncoder = await import('codecs/webp/enc/webp_enc');
|
||||||
return initEmscriptenModule(
|
return initEmscriptenModule(webpEncoder.default, wasmUrl);
|
||||||
webpEncoder.default,
|
|
||||||
wasmUrl,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function encode(
|
export default async function encode(
|
||||||
|
|||||||
Reference in New Issue
Block a user