I am working on setting up a CDN for my media uploads and have set up the uploads collection with various sizes. I have removed the height attribute so that the images preserve their aspect ratio.
The generated files each have a different filename pattern. For example
filename-1200x374.jpg
and
filename-1200x854.jpg
I would like to change the filename to only include the width like
filename-1200.jpg
so that I can generate the correct srcset for each image from the filename string.
Is there a way to do this? Thanks!
Currently, it is not possible to customize the appending of the dimensions to the filename.
Ok thank you for the response. I have found another solution that does not require generating the URL. But I believe this would be a value addition at some point in the future.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.