Skip to content

Commit 6d0924e

Browse files
authored
fix: upload imageSizes forces original file uploads to be compressed (#11612)
### What? When the upload config contains imageSizes, we are forcing the image to be resized using sharp. This leads to lossy compression even when the formatOptions and no cropping or focal point selection was made. This change makes it possible to upload the original image, skipping compression while still using the imageSizes feature. ### Why? It should be possible to upload files without compression. ### How? Changes the conditions to remove imageSizes to determine if sharp image processing should be applied to the original image or not.
1 parent fc5876a commit 6d0924e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/payload/src/uploads/generateFileData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export const generateFileData = async <T>({
141141
let mime: string
142142
const fileHasAdjustments =
143143
fileSupportsResize &&
144-
Boolean(resizeOptions || formatOptions || imageSizes || trimOptions || file.tempFilePath)
144+
Boolean(resizeOptions || formatOptions || trimOptions || file.tempFilePath)
145145

146146
const sharpOptions: SharpOptions = {}
147147

0 commit comments

Comments
 (0)