Problem/Motivation
Since an update of the module, the webp derivates of images always contain the orginal file extension before the .webp extension in the filename. This isn't necessary and broke existing image optimization pipelines. So for example
Original filename: image.png
Webp derivate filename: image.png.webp
Instead the webp derivate filename should be image.webp
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | omit-original-file-extension_3203988_3.patch | 2.43 KB | s_leu |
Comments
Comment #2
s_leu commentedAttaching a patch that fixes this.
Comment #3
s_leu commentedFixed some code that got accidentally removed in the previous patch
Comment #4
michaellander commentedHow would you handle the situation where you upload:
example.jpg
example.png
If they both are in the same directory, and both generate an image style, how would you avoid filename collisions?
Comment #5
Phil Wolstenholme commentedThe current suffix approach also makes this sort of thing easier:
https://github.com/uhop/grunt-tight-sprite/wiki/Recipe:-serve-WebP-with-...
Comment #6
rar9 commentedD9.1.9 php 7.4.x
The patch #3 only seams to work partially.
The image are stored as described but all views using responsive images still look for images called .jpg.webp , so the image styles are all not found.
Comment #7
michaellander commentedI'm closing this as it's working as intended. If someone wants to come up with a way to solve filename collisions, then I'm open to reopening it, but I currently don't see a path forward.
Comment #8
sharique commentedTo answer your query of following file name
example.jpg
example.png
new images will get following name
example.webp
example_1.webp
renaming new file is handled by EXISTS_RENAME flag in file system Api.