fix: correct square image validation logic in resizeBase64Image (#25130)

The validation was comparing image height to itself instead of comparing height to width, causing the square check to always pass even for non-square images.

Co-authored-by: Dhairyashil Shinde <[email protected]>
This commit is contained in:
Emmanuel IsenahandDhairyashil Shinde authored and GitHub committed 2025-11-16 01:50:50 +05:30
1 parent 9e10dfd77b
commit d6f6be7d50
1 file changed
+1 -1
+1 -1
View File
@@ -26,7 +26,7 @@ export async function resizeBase64Image(
maxSize = 96 * 4,
} = opts ?? {};
const image = await jimp.read(buffer);
if (image.getHeight() !== image.getHeight()) {
if (image.getHeight() !== image.getWidth()) {
// this could be handled later
throw new Error("Image is not a square");
}