From 658924a722f4a71a0ab379eb09f0c78acc11df45 Mon Sep 17 00:00:00 2001 From: David Warner Date: Thu, 4 Apr 2024 14:29:43 +1100 Subject: [PATCH] Fix image buffer length check --- src/ImageHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImageHandler.js b/src/ImageHandler.js index 782f653..dd073af 100644 --- a/src/ImageHandler.js +++ b/src/ImageHandler.js @@ -193,7 +193,7 @@ export function encodeImage(image) { console.log("Image loaded"); // no need to resize if (image.mime === 'image/jpeg' && img.width <= 1400 && img.height <= 1400 - || image.mime === 'image/png' && image.imageBuffer.size < 100000 ) { + || image.mime === 'image/png' && image.imageBuffer.length < 100000 ) { resolve(image); } else { console.log("Resizing image");