Closed skeutmeier closed 10 months ago
Best way would be - to my opinion - removing the old WebP images, for instance from the shell by using find
of some kind. Likewise, you could also just use the CLI command of this module to regenerate the images again.
I'm closing this ticket due to inactivity. Feel free to reopen if needed.
About the CLI command : it is only available for 1 single picture.
In my case it was necessary to regenerate all files, because I wanted to test different quality when converting. Since default setting of the module is "Save in the same directory as the source", I wrote a small script to check if there is a source with the same name next to the .webp picture and delete the .webp in that case (this will help not to delete other .webp pictures that may have been added to the environment as a source, but were not converted).
Perhaps someone will find this useful ( In any case, it is advisable to make a backup of the media ) :
cd pub/media
find . -type f -name '*.webp' -exec bash -c 'for f; do base="${f%.*}"; source_file_jpg="${base}".jpg;source_file_jpeg="${base}".jpeg;source_file_png="${base}".png; if [ -f "$source_file_jpg" ] || [ -f "$source_file_png" ] || [ -f "$source_file_jpeg" ]; then rm "$f"; echo "$f"; fi; done' bash {} +
Cool option indeed. I'll try to squeeze this somewhere in the docs.
Hi,
What is the advised way to force a regeneration of images, for example if I change the quality settings in the backend?
Thank you