Skip to content

Commit d6f6be7

Browse files
fix: correct square image validation logic in resizeBase64Image (calcom#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 <93669429+dhairyashiil@users.noreply.github.com>
1 parent 9e10dfd commit d6f6be7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/lib/server/resizeBase64Image.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function resizeBase64Image(
2626
maxSize = 96 * 4,
2727
} = opts ?? {};
2828
const image = await jimp.read(buffer);
29-
if (image.getHeight() !== image.getHeight()) {
29+
if (image.getHeight() !== image.getWidth()) {
3030
// this could be handled later
3131
throw new Error("Image is not a square");
3232
}

0 commit comments

Comments
 (0)