Skip to content

Make images smaller using best-in-class codecs, right in the browser.

JavaScript

Update WebP2 binding code

Ingvar Stepanyan618a4d777bfc
diff --git a/codecs/wp2/dec/wp2_dec.cpp b/codecs/wp2/dec/wp2_dec.cpp
index 5ee45156..3a2f5c2a 100644
--- a/codecs/wp2/dec/wp2_dec.cpp
+++ b/codecs/wp2/dec/wp2_dec.cpp
@@ -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) {