Skip to content

Commit

Permalink
Merge pull request #14 from Quppa/patch-1
Browse files Browse the repository at this point in the history
Fix PNG image buffer length check
  • Loading branch information
DominikPeters authored Apr 4, 2024
2 parents b399f23 + 658924a commit a7769ff
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 a7769ff

Please sign in to comment.