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 uploading an image and using it in a post, users expect a webp representation for the correct source image to be generated by the towebp filter, and the correct image to be therefore displayed at the end of the chain.
Actual behavior
Instead, the towebp filter overwrites competing pseudo-duplicate images:
image0001.jpg becomes image0001-scaled.webp
image0001.jpegalso becomes image0001-scaled.webp
Steps to reproduce behavior
The problem is contained in the Image/Operation/ToWebp.php file, as well as its 1.x equivalent (it seems to have been copied over from 1.x in 2.x).
I noticed the same issue 1 hour ago with two files with the same name but with different extensions :
.i.e : velo 3.jpg and velo 3.png
The final name for the generated webp is velo-3.webp, so the second generated webp has overridden the first generated one
By doing the hotfix suggested by @raadegmbh, it will regenerate a new webp file with the original extension included, but there will be a lot of useless images in the uploads dir folders (the first generated webp without the extension included), so a clean of the uploads dir folders has to be done
Expected Behavior
When uploading an image and using it in a post, users expect a webp representation for the correct source image to be generated by the towebp filter, and the correct image to be therefore displayed at the end of the chain.
Actual behavior
Instead, the towebp filter overwrites competing pseudo-duplicate images:
Steps to reproduce behavior
The problem is contained in the Image/Operation/ToWebp.php file, as well as its 1.x equivalent (it seems to have been copied over from 1.x in 2.x).
A janky hotfix is to alter the filename function in line 31ff: to include the original source extension:
which immediately ameliorates the issue.
Notes
No response
What version of Timber are you using?
Timber 2.x and 1.x
What version of WordPress are you using?
Any version
What version of PHP are you using?
Any version
How did you install Timber?
Installed or updated Timber through Composer
The text was updated successfully, but these errors were encountered: