Jump to content

How disable prestashop image compression


seog

Recommended Posts

Hi

 

I had compressed with good software my all product images due to SEO purposes and the absurd image compression of Prestashop has worsened the quality of images and especially has multiplied by x 3 the size of all images

 
How can I disable fully the .jpeg compression in Prestashop when I upload a csv?
Link to comment
Share on other sites

Probably not easy without creating other issues. The file ./classes/ImageManager.php would be your friend.

The problem is: This class does creation and resizing for all kind of images. Resizing always means, a new image is created. And for JPEG it means, there is a compression needed in order to create the image.

 

In terms of product images, there are several versions and sizes created after uploading. They are named like

-home_default.jpg

-large_default.jpg

-mendium_default.jpg

-thickbox_default.jpg

plus the original version.

 

The PHP function called is named imagejpeg. It's call is appx. on line 550.

 

The better solution could be to change the .tpl files related to image display and there grab the original file instead of the prestashop default, which is a resized image. However, if you would forget to resize your image before upload, the size displayed would be the original size then.

Edited by Scully (see edit history)
Link to comment
Share on other sites

Hi Scully@

 

Thank you for your answer,

 

Do you know say me what could be the right path for load only my original images without PS compression (uncompression) in product page ?

The original code is src="{$img_prod_dir}{$lang_iso}-default-large_default.jpg"

 

 

best regards

Link to comment
Share on other sites

 

The path does not change. Try this with just leaving the fixed part away. Check the source code of product page if the image wouln't show up.

src="{$img_prod_dir}{$lang_iso}.jpg"

Sorry it dont work, I tried also others changes unsucessfully

Link to comment
Share on other sites

This code load same image uncompressed... Tested in product.tpl

 

If you get load product image with different codes/variables, it always will be uncompressed

 

The issue I think is in htacces rewrite rule:

RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
xxxxxx
xxx
xxx
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...