Post by jdehlin » Tue Nov 22, 2011 12:19 pm

I've been searching and trying to figure out why I can't get png image compression to work for an opencart 1.5 site I'm working on.

On line 46 of library/image.php I modified the imagepng function to use compression 9 instead of the default 0 and it had no affect on my images. I deleted the images from the fileserver and they just repopulate with the exact same file size/quality.

Anyone know how I can get the file sizes of my images down? A 1000x750px image is over 2M and it's killing my load times.

Thank!

Newbie

Posts

Joined
Tue Nov 22, 2011 12:17 pm

Post by rph » Tue Nov 22, 2011 1:33 pm

You need to clear your image cache. Also, if you're actually displaying it at 1000x750 it's going to be big no matter what. At that size you're usually better off using jpeg.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by jdehlin » Wed Nov 23, 2011 5:02 am

Thanks for the quick reply!

I've completely cleared the image/cache folder and the images repopulate with the same byte-for-byte size whether I have the compression in the imagepng function on line 46 set to 0 or 9. I've actually commented out the imagepng function on line 46 and the images are still repopulated after clearing the image cache.

I can't seem to figure out what is generating the images (although I think its the resize() function on line 54 - 92) and how I might apply compression since there's no imagepng call in that function.

Does anyone have any ideas on how I might be able to get png image compression working for these images?

Thanks!

Newbie

Posts

Joined
Tue Nov 22, 2011 12:17 pm

Post by rph » Wed Nov 23, 2011 9:33 am

jdehlin wrote:I've actually commented out the imagepng function on line 46 and the images are still repopulated after clearing the image cache.
Then the first thing to do is make sure you're overwriting the file properly because disabled functions don't run.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by paddys_1 » Thu Apr 23, 2015 8:15 pm

You can easily increase your site speed by compressing images with the following extension.

http://www.opencart.com/index.php?route ... n_id=18138

It's enables you to compress all the existing images on your site and then automatically optimises any that you upload afterwards.

Image


User avatar
New member

Posts

Joined
Wed Jul 16, 2014 6:04 am
Who is online

Users browsing this forum: Bing [Bot], OSWorX and 40 guests