For example, I have a translucent banner measuring 1900 by 911 pixels. The image in png format is 577 kb, and in webp format is 128 kb. The banner consists of a slide show with three such images. On the banner alone I have a saving of over 1 MB.
The images would be generated only once. Then the script would only check if a given image size exists.
For example, the latest products.
tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)
Here it turns out that oscommerce also creates the miniatures of images. If only additional webp format creation is added to this function? Before displaying the path, you can check if the browser supports webp, for example, the following code:
if((isset($_SERVER['HTTP_ACCEPT']) === true) && (strstr($_SERVER['HTTP_ACCEPT'], 'image/webp') !== false)){
Thanks to the above script can pass the path to jpg or webp.
I'm already writing the script myself. I need information from You where to find the file with the tep_image function.