问题
I have Prestashop 1.4.9.0 installed with my PHP project. When I add a new product, I upload an image in PNG format, but when it is shown on the client side, the image is in JPG format.
How can you keep the image extension?
回答1:
At Back Office > Preferences > Images you have 3 options for "Image quality":
- Use JPEG
- Use PNG only if the base image is in PNG format
- Use PNG for all images
By default all the images are in JPEG (PNG are converted), so you can either choose to use the 2nd option (to not convert images) or the 3rd option - to convert the JPEG images to PNG.
回答2:
If you have try first answer (At Back Office > Preferences > Images you have 3 options for "Image quality":) it mast work, but you will see image extension .jpg. But if you will look to image code it will be png. If you need different extensions you need to change core and .htaccess.
回答3:
After changing the image pref in the CMS it should work. The images will still show as jpg but will keep the transparency properties of a png.
来源:https://stackoverflow.com/questions/26279192/prestashop-images