Open sdjnes opened 2 months ago
https://github.com/sdjnes/payload-png-bug
An Upload collection that accepts images does not preserve the original image when imageSizes key is present, even when formatOptions is not set.
imageSizes
formatOptions
Sometimes file size is larger when uploaded, other times smaller
This is most apparent with PNGs because the file sizes seem to vary a lot. This also occurs with JPEGs, but the filesize difference is minimal.
Without imageSize key (size is correct)
With imageSize key (size is incorrect in Payload)
Payload is not misreporting the filesize - the original image has been modified. If you download, it indeed has the 895KB filesize.
imageSizes: []
Observed on 2.22 and 2.25
None
Here is a sample image for testing - leaving this here for the team. Original size is 706 KB, uploads as 906 KB.
706 KB
906 KB
Link to reproduction
https://github.com/sdjnes/payload-png-bug
Describe the Bug
An Upload collection that accepts images does not preserve the original image when
imageSizes
key is present, even whenformatOptions
is not set.Sometimes file size is larger when uploaded, other times smaller
This is most apparent with PNGs because the file sizes seem to vary a lot. This also occurs with JPEGs, but the filesize difference is minimal.
Without imageSize key (size is correct)
With imageSize key (size is incorrect in Payload)
Payload is not misreporting the filesize - the original image has been modified. If you download, it indeed has the 895KB filesize.
To Reproduce
imageSizes
propertyimageSizes: []
)Payload Version
Observed on 2.22 and 2.25
Adapters and Plugins
None