Describe the Bug
When you upload an image to Payload, smaller resolution versions of the image are also generated (provided you have configured this). Then you need to save.
If you edit the image after saving and replace it with a PDF, all images with the adjusted resolution are deleted, but the link in the database remains.
Link to the code that reproduces this issue
i cant push the repo - i will add the media collection
Reproduction Steps
- Upload an Image (configure also imageSizes)
- Save the image
- Edit image and delete the upload
- replace the upload with an pdf
--> The images will be deleted on disk but the image size entry will be keept in database
Which area(s) are affected?
Not sure
Environment Info
Binaries:
Node: 22.16.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
payload: 3.80.0
next: 16.2.1
@payloadcms/db-mongodb: 3.80.0
@payloadcms/email-nodemailer: 3.80.0
@payloadcms/graphql: 3.80.0
@payloadcms/next/utilities: 3.80.0
@payloadcms/payload-cloud: 3.80.0
@payloadcms/plugin-search: 3.80.0
@payloadcms/richtext-lexical: 3.80.0
@payloadcms/translations: 3.80.0
@payloadcms/ui/shared: 3.80.0
react: 19.2.4
react-dom: 19.2.4
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Enterprise
Available memory (MB): 64957
Available CPU cores: 14
Describe the Bug
When you upload an image to Payload, smaller resolution versions of the image are also generated (provided you have configured this). Then you need to save.
If you edit the image after saving and replace it with a PDF, all images with the adjusted resolution are deleted, but the link in the database remains.
Link to the code that reproduces this issue
i cant push the repo - i will add the media collection
Reproduction Steps
--> The images will be deleted on disk but the image size entry will be keept in database
Which area(s) are affected?
Not sure
Environment Info