Jump to content

Compressed PNG file becomes bigger


tjtang

Recommended Posts

Question: How do I bypass PNG compression?

 

Problem: Using PS 1.6.0.9, under Admin > Preferences > Images > PNG Compression

 

I set PNG compression to 0 and then upload a PNG file of size 7 KB. The converted file comes out as 326 KB.

 

I suggest a feature - if PNG compression is set to 0, then don't convert the file.

 

Does anyone know how I can implement this?

 

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

Hi tjtang.

 

In some or most cases, PrestaShop needs to create multiple versions of an uploaded image, in various dimensions. When you resize a bitmap image, you must also recompress it in order to save it as a new file.

 

So, what you are proposing isn't a trivial task. It could be done in 2 ways, I think:

1. You would prepare offline versions of all the images in the appropriate dimension and modify PrestaShop so as to allow direct uploading of these images without processing them

2. You would again prepare the necessary offline versions of the images, upload only the largest of these images in PrestaShop, find out where and under what filenames PrestaShop creates the new images and replace them with your own

 

Alternatively, you could have a look at one modification that a member posted recently:

http://www.prestashop.com/forums/topic/340771-ps-1606-poor-quality-on-uploaded-images

It isn't exactly what you want, but it replaces the GD image library with the ImageMagick library which could lead to better image quality.

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...