You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When imageSizes is set in the collection upload config, all metadata is stripped from all image sizes, including the original image. When imageSizes is removed from the collection upload config, the metadata is preserved in the image since no transformations are done.
I believe this is due to sharp stripping all metadata by default, and when uploading multiple image sizes, the "original" image is recreated with sharp with no formatting or transformations applied, thus stripping the metadata.
Possible solutions may be to use keepMetadata or withMetadata to preserve the metadata for images, or upload the original image without using sharp.
Link to reproduction
https://github.com/hjbugajski/payload-3.0-stripped-metadata
Payload Version
3.0.0-beta.55
Node Version
20.14.0
Next.js Version
15.0.0-rc.0
Describe the Bug
When
imageSizes
is set in the collectionupload
config, all metadata is stripped from all image sizes, including the original image. WhenimageSizes
is removed from the collectionupload
config, the metadata is preserved in the image since no transformations are done.I believe this is due to
sharp
stripping all metadata by default, and when uploading multiple image sizes, the "original" image is recreated with sharp with no formatting or transformations applied, thus stripping the metadata.Possible solutions may be to use
keepMetadata
orwithMetadata
to preserve the metadata for images, or upload the original image without usingsharp
.Reproduction Steps
Steps
Media.ts
Video
output_file.mp4
Adapters and Plugins
No response
The text was updated successfully, but these errors were encountered: