mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-14 09:39:15 +00:00
Build webp
This commit is contained in:
@@ -10,14 +10,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { WebPModule } from 'codecs/webp/dec/webp_dec';
|
||||
import type { WebPModule } from 'codecs/webp/wasm_build/base/dec/webp_dec';
|
||||
import { initEmscriptenModule, blobToArrayBuffer } from 'features/worker-utils';
|
||||
|
||||
let emscriptenModule: Promise<WebPModule>;
|
||||
|
||||
export default async function decode(blob: Blob): Promise<ImageData> {
|
||||
if (!emscriptenModule) {
|
||||
const decoder = await import('codecs/webp/dec/webp_dec');
|
||||
const decoder = await import('codecs/webp/wasm_build/base/dec/webp_dec');
|
||||
emscriptenModule = initEmscriptenModule(decoder.default);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user