seog Posted July 9, 2017 Share Posted July 9, 2017 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 More sharing options...
Scully Posted July 10, 2017 Share Posted July 10, 2017 (edited) 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 July 10, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
seog Posted July 10, 2017 Author Share Posted July 10, 2017 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 More sharing options...
Scully Posted July 10, 2017 Share Posted July 10, 2017 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" Link to comment Share on other sites More sharing options...
seog Posted July 12, 2017 Author Share Posted July 12, 2017 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 More sharing options...
Scully Posted July 12, 2017 Share Posted July 12, 2017 Didn't work isn't a poor answer. Did you get an error message? Did you check the source code? What does the source tell you? Link to comment Share on other sites More sharing options...
seog Posted July 12, 2017 Author Share Posted July 12, 2017 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 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