pepperoni Posted January 22 Share Posted January 22 (edited) Hi guys, So I'm trying to achieve all my product images to use webp format, AND not create other unnecessary formats like jpg. I have tried two different things. 1. Having the 'Multiple image formats' Enabled in New & Experimental Features. and having chosen 'WebP' in Image Settings. With this configuration I confirm we can achieve webp image generation but at the same time it generates same images in jpg format too! That it not desirable for me, as I won't use the jpg files and it increases the account file size. 2. The second thing I tried is have the 'Multiple image formats' Disabled in New & Experimental Features. This makes the Image settings look a bit different. So here is what I have, Use WebP for all images. With this configuration, the system generates images only in one format. The funny thing is the format is weird. You get .jpg files but the images are not jpg encoded, they are webp encoded. Think of it as in the first option above you take a webp image and you just rename it to .jpg, ie my_image.webp -> my_image.jpg. What I'm trying to do is just get webp images (not any other formats). Second configuration above is very close. If only the generated images had .webp instead of .jpg. Can anyone point me in the right direction of what is the file responsible for the naming of the images? I can change the code myself. If someone had achieved similar thing using first configuration, then that I'd be fine with it too. Please shed some light if you know more. many thanks prestashop version 8.1.3 Edited January 22 by pepperoni (see edit history) Link to comment Share on other sites More sharing options...
endriu107 Posted January 22 Share Posted January 22 When you enable webp in your store you should regenerate images. New images will be with jpg extension byt their mime will be webp. Link to comment Share on other sites More sharing options...
pepperoni Posted January 22 Author Share Posted January 22 Hi endriu107, Thanks for the reply. Do you know how to change the jpg extension to webp please? I don't understand the logic of this. If an image is webp then it should have the webp mime. many thanks Link to comment Share on other sites More sharing options...
endriu107 Posted January 22 Share Posted January 22 5 minutes ago, pepperoni said: If an image is webp then it should have the webp mime. and it have that mime. Image extension is not important, prestashop by default save images with jpg extension but it really could be webp, png or avif. I think you want fix something what is not broken because ther is no reason to change extension when mime is correct. Link to comment Share on other sites More sharing options...
pepperoni Posted January 22 Author Share Posted January 22 Hi endriu107, Thanks again. We are getting to a different subject here. I'd like to know how to get the .webp file extension on images when I select webp in prestashop. Any idea which file(s) responsible for this please? many thanks Link to comment Share on other sites More sharing options...
endriu107 Posted January 22 Share Posted January 22 It is not possible. Link to comment Share on other sites More sharing options...
pepperoni Posted January 22 Author Share Posted January 22 That's a bad design. Link to comment Share on other sites More sharing options...
endriu107 Posted January 22 Share Posted January 22 15 minutes ago, pepperoni said: That's a bad design. Why? Link to comment Share on other sites More sharing options...
Luigi Donato Posted Saturday at 10:27 AM Share Posted Saturday at 10:27 AM (edited) On 1/22/2024 at 6:20 PM, endriu107 said: Why? Because Google PageSpeed request .webp format and .jpg is a negative SEO. And anyway the Mime remains Jpg, all this should be resolved, or at least it would be nice to understand where the file containing the Webp generation function is located, so that it can be repaired. Edited Saturday at 10:32 AM by Luigi Donato (see edit history) Link to comment Share on other sites More sharing options...
endriu107 Posted Saturday at 06:52 PM Share Posted Saturday at 06:52 PM @Luigi Donato Google PageSpeed request .webp file and mime of those file are webp and it's doesn't matter what extension file have. Link to comment Share on other sites More sharing options...
Mediacom87 Posted Monday at 11:36 PM Share Posted Monday at 11:36 PM As explained, you can use any extension you like, but no browser or search engine will read it. The only real information about the type of image to be displayed is the MIME type. Test your site with pagespeed and you won't get any errors on the image format, even if the extension is .jpg, if your image is in WebP. All CDNs that automatically transform images don't change the file extension at all, to avoid unnecessary processing and redirection errors, and yet it works perfectly. It's like DPI on images, it doesn't matter on the web. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now