Update WebP2 binding code

This commit is contained in:
Ingvar Stepanyan
2020-11-20 22:52:28 +00:00
committed by Ingvar Stepanyan
parent 7266c94f52
commit 618a4d777b

View File

@@ -14,9 +14,9 @@ val decode(std::string image_in) {
if (status != WP2_STATUS_OK) {
return val::null();
}
return ImageData.new_(
Uint8ClampedArray.new_(typed_memory_view(buffer.stride * buffer.height, buffer.GetRow8(0))),
buffer.width, buffer.height);
return ImageData.new_(Uint8ClampedArray.new_(typed_memory_view(buffer.stride() * buffer.height(),
buffer.GetRow8(0))),
buffer.width(), buffer.height());
}
EMSCRIPTEN_BINDINGS(my_module) {