mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-19 12:08:57 +00:00
Simplify memory management for other C++ codecs
This commit is contained in:
committed by
Ingvar Stepanyan
parent
97931bad22
commit
93cbe557cd
@@ -11,9 +11,7 @@
|
||||
Module.onRuntimeInitialized = async _ => {
|
||||
console.log('Version:', Module.version().toString(16));
|
||||
const image = await loadFile('../../example.webp');
|
||||
const result = Module.decode(image);
|
||||
const imageData = new ImageData(new Uint8ClampedArray(result.buffer), result.width, result.height);
|
||||
Module.free_result();
|
||||
const imageData = Module.decode(image);
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.width = result.width;
|
||||
canvas.height = result.height;
|
||||
|
||||
Reference in New Issue
Block a user