Files
squoosh/codecs/oxipng/worker.js
Ingvar Stepanyan 4c658b79ef OxiPNG + threads PoC
2020-10-07 20:42:48 +01:00

9 lines
333 B
JavaScript

import initOxiPNG, { start_worker_thread } from './pkg/squoosh_oxipng.js';
addEventListener('message', async ({ data: [module, memory, threadPtr] }) => {
// console.log([module, memory, threadPtr]);
await initOxiPNG(module, memory);
// console.log('Starting', threadPtr);
start_worker_thread(threadPtr);
}, { once: true });