Sometimes the image conversation to Webp creates a file size larger than the original jpeg, png, etc.
Details here: https://developers.google.com/speed/webp/faq#can_a_webp_image_grow_larger_than_its_source_image
Can logic be added to the plugin to compare the files sizes and display the smaller file size of the two = 'image/jpeg' -vs- 'image/webp'
The whole point of using webp is for the small file size. If the new file is larger than the original, then it defeats the purpose.
As an example: I tested the plugin on nopCommerce 4.40 using the sample data.
See below file examples:
Original Sample File: 0000002_desktop_450.jpg = 13.8KB
Converted Sample File: 0000002_desktop_450.jpg.webp = 59.0KB
This is an example of the file size increasing after being converted from jpeg to webp.
Using this example, it would be ideal to respond with the original jpeg image as it is smaller file size.
Here is an example of a WordPress plugin that describe what I'm requesting.https://help.shortpixel.com/article/102-why-the-resulting-webp-images-are-bigger-than-the-original-png-files"we’ll implement them only if the final quality of the images won’t be affected."