I want to convert every PNG and JPEG to WebP on upload so that I can serve WebP and PNG/JPEG without requiring the user to upload a WebP version of every photo.
I want to save the WebP in the same folder with the same name, for example:
uploads/2022/09/image.png
uploads/2022/09/image.webp
How can I do this? Is there a hook I can use?
Is there a reason not to use imagewebp
for this?