Skip to content

Commit

Permalink
fix: save resized image file when equal to upload size (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRibbens authored May 6, 2022
1 parent f361a44 commit 46f4bc2
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 @@ -49,7 +49,7 @@ export default async function resizeAndSave({
const { imageSizes, disableLocalStorage } = config.upload;

const sizes = imageSizes
.filter((desiredSize) => desiredSize.width < dimensions.width || desiredSize.height < dimensions.height)
.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 46f4bc2

Please sign in to comment.