LarpixClient/webroot/webp-worker.js
olcxja 95aaaa69ea
All checks were successful
Android Build / publish (push) Successful in 57s
Linux Build / publish (push) Successful in 53s
big updat:
- update dependencies
- add webp support and webp conversion for profile images
2026-07-02 22:40:46 +02:00

11 lines
431 B
JavaScript

import { encodeAnimation } from './wasm-webp/index.js';
self.onmessage = async (e) => {
let { targetWidth, targetHeight, webpFrames } = e.data;
try {
let webpUint8 = await encodeAnimation(targetWidth, targetHeight, true, webpFrames);
self.postMessage({ success: true, data: webpUint8 }, [webpUint8.buffer]);
} catch (err) {
self.postMessage({ success: false, error: err.toString() });
}
};