I'm trying to customize the filenames of the images to use the srcset based on the width of images.
This looks a good solution but it's not working on Payload 2.26.0. Is this only for version 3?
generateImageName: ({ height, sizeName, extension, width }) => {
return
custom-${sizeName}-${height}-${width}.${extension}
},
Object literal may only specify known properties, and 'generateImageName' does not exist in type 'ImageSize'.
I’ve created a custom function that do this for Payload 2. I can post the code if someone is interested
Yes, it's a 3.0 specific feature.
https://payloadcms.com/docs/beta/upload/overview#custom-file-name-per-sizeStar
Discord
online
Get dedicated engineering support directly from the Payload team.