mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-17 11:09:41 +00:00
Create Uint8ClampedArray from C++
This commit is contained in:
committed by
Ingvar Stepanyan
parent
c39383333f
commit
1f35c40d3f
@@ -15,9 +15,5 @@ export async function process(data: ImageData, opts: QuantizeOptions): Promise<I
|
||||
:
|
||||
module.quantize(data.data, data.width, data.height, opts.maxNumColors, opts.dither);
|
||||
|
||||
const imgData = new ImageData(new Uint8ClampedArray(result.buffer), result.width, result.height);
|
||||
|
||||
module.free_result(imgData.data.byteOffset);
|
||||
|
||||
return imgData;
|
||||
return new ImageData(new Uint8ClampedArray(result), data.width, data.height);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user