add better loading for profile settings and user profiles & add details bar
This commit is contained in:
parent
95aaaa69ea
commit
271c573fb4
16 changed files with 504 additions and 174 deletions
|
|
@ -1,11 +1,18 @@
|
|||
import { encodeAnimation } from './wasm-webp/index.js';
|
||||
import { encodeAnimation, decodeAnimation } from './wasm-webp/index.js';
|
||||
|
||||
self.onmessage = async (e) => {
|
||||
let { targetWidth, targetHeight, webpFrames } = e.data;
|
||||
let action = e.data.action || 'encode';
|
||||
try {
|
||||
let webpUint8 = await encodeAnimation(targetWidth, targetHeight, true, webpFrames);
|
||||
self.postMessage({ success: true, data: webpUint8 }, [webpUint8.buffer]);
|
||||
if (action === 'decode') {
|
||||
let decoded = await decodeAnimation(e.data.data, true);
|
||||
let transferables = decoded.map(f => f.data.buffer);
|
||||
self.postMessage({ success: true, data: decoded, action }, transferables);
|
||||
} else {
|
||||
let { targetWidth, targetHeight, webpFrames } = e.data;
|
||||
let webpUint8 = await encodeAnimation(targetWidth, targetHeight, true, webpFrames);
|
||||
self.postMessage({ success: true, data: webpUint8, action }, [webpUint8.buffer]);
|
||||
}
|
||||
} catch (err) {
|
||||
self.postMessage({ success: false, error: err.toString() });
|
||||
self.postMessage({ success: false, error: err.toString(), action });
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue