chancecorbeil Posted November 1, 2011 Share Posted November 1, 2011 I am experiencing what appears to be a reoccurring issue with many people. I upload a product image as a png with a transparent background. Prestashop then displays these images with a solid white background after it converts them to a jpeg. Looking through previous posts, someone will solve the problem, an upgrade comes along, and the edited file becomes worthless. Does anyone have an updated image.inc.php? Or maybe some other solution where I can display my products with a transparent background? What I need is the image.inc.php file for prestashop 1.4.3 I am willing to upgrade if you have a different versions php. Thank you. Link to comment Share on other sites More sharing options...
phrasespot Posted November 2, 2011 Share Posted November 2, 2011 If you upload a PNG image, then although the created images will have JPG extension, the images themselves are still PNG and you can confirm this with a hex editor. Because browsers are forgiving of mislabelled extensions, even if the image is served with content type image/jpeg by the server, it will be treated as png by the browser with the end result of preservation of transparency. Here is an example: The original PNG image (all non-black areas are transparent) After upload, this image is renamed and its extension is changed to jpg by prestashop. The next capture shows the original and the renamed/mis-extensioned image used in an HTML document. The background is given a color to show the transparency of both images. So if you prepare your images as PNGs transparency will work. If you're thinking this is a bad way to handle images, I am with you 100%, I know of no other software which handles images in this way. I suspect this because jpg is hardcoded throughout and reckon will be corrected sooner or later. Meanwhile, just upload pngs. Link to comment Share on other sites More sharing options...
luijt99 Posted December 19, 2011 Share Posted December 19, 2011 Problem with the PNG files are that the Watermark module doesn't work.. Anyone has a fix for that? Link to comment Share on other sites More sharing options...
Reza-sony Posted February 17, 2012 Share Posted February 17, 2012 I have the same problem , transparency PNGs (mean product image, not watermark image) don`t work along side watermark module . Then I decided to use GIFs as product image , but it still wont work . Link to comment Share on other sites More sharing options...
globosoftware.net Posted July 16, 2012 Share Posted July 16, 2012 I'm same problem. The module watermark doesn't work with PNG( image of products). Anyone fixed????? Many thanks! Link to comment Share on other sites More sharing options...
dawb Posted December 2, 2012 Share Posted December 2, 2012 Has anyone found a fix for this having the same issue with 1.5.2? Link to comment Share on other sites More sharing options...
dawb Posted December 6, 2012 Share Posted December 6, 2012 If you have a solid colour that your images will be on you can use jpeg's and change the background colour that is added when they are generated in the imagemanager.php class eg imagecolorallocate($dest_image, 249, 250, 250) usually imagecolorallocate($dest_image, 255, 255, 255) 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