OxiPNG + threads PoC

This commit is contained in:
Ingvar Stepanyan
2020-04-25 14:28:16 +01:00
committed by Ingvar Stepanyan
parent 685558847f
commit 4c658b79ef
15 changed files with 398 additions and 68 deletions

8
codecs/oxipng/worker.js Normal file
View File

@@ -0,0 +1,8 @@
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 });