mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-14 09:39:15 +00:00
Update example.html (#827)
rawImage is a Uint8ClampedArray and doesn't have width and height property.
This commit is contained in:
@@ -29,7 +29,7 @@
|
|||||||
const rawImage = Module.zx_quantize(image.data, image.width, image.height, 1.0);
|
const rawImage = Module.zx_quantize(image.data, image.width, image.height, 1.0);
|
||||||
console.log('done');
|
console.log('done');
|
||||||
|
|
||||||
const imageData = new ImageData(new Uint8ClampedArray(rawImage.buffer), rawImage.width, rawImage.height);
|
const imageData = new ImageData(new Uint8ClampedArray(rawImage.buffer), image.width, image.height);
|
||||||
const canvas = document.createElement('canvas');
|
const canvas = document.createElement('canvas');
|
||||||
canvas.width = image.width;
|
canvas.width = image.width;
|
||||||
canvas.height = image.height;
|
canvas.height = image.height;
|
||||||
|
|||||||
Reference in New Issue
Block a user