Skip to content

Commit

Permalink
fix file resize bug
Browse files Browse the repository at this point in the history
  • Loading branch information
toBeOfUse committed Jan 4, 2024
1 parent 2c2ab5e commit 0898f88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function setUpUpload(app){
// get metadata to figure out edge lengths:
const metadata = await sharp(req.file.path).metadata();
const targetHeight = Math.min(Math.round(maxEventPhotoWidth / eventPhotoAR), metadata.height);
const targetWidth = targetHeight * eventPhotoAR;
const targetWidth = Math.round(targetHeight * eventPhotoAR);

// Resize and crop the image
const buffer = await sharp(req.file.path)
Expand Down

0 comments on commit 0898f88

Please sign in to comment.