Skip to content

Commit

Permalink
Fix image buffer length check
Browse files Browse the repository at this point in the history
  • Loading branch information
Quppa authored Apr 4, 2024
1 parent aaa10fe commit 658924a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ImageHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 658924a

Please sign in to comment.