Skip to content

Commit

Permalink
fix: allows image resizing if either width or height is larger
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikrut committed Sep 22, 2021
1 parent df36a6e commit 8661115
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uploads/imageResizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default async function resizeAndSave(
const { imageSizes, disableLocalStorage } = config.upload;

const sizes = imageSizes
.filter((desiredSize) => desiredSize.width < dimensions.width)
.filter((desiredSize) => desiredSize.width < dimensions.width || desiredSize.height < dimensions.height)
.map(async (desiredSize) => {
const resized = await sharp(file)
.resize(desiredSize.width, desiredSize.height, {
Expand Down

0 comments on commit 8661115

Please sign in to comment.