Page 1 of 1

Image Cache - different compression level, Progressive JPEG?

Posted: Wed Jun 15, 2016 2:33 am
by tjonnyc
I'm trying to optimize my new site using several online tools, including WebPageTest.org.
One common thread in most reports: images could be further compressed, and Progressive JPEG is recommended.

So, questions:

1.) Is it possible to set a different compression level? If so, where & how?

2.) Is it possible to use Progressive JPEGs as the output?

3.) Is it possible to disable image caching COMPLETELY, and use pre-optimized JPGs?

Re: Image Cache - different compression level, Progressive J

Posted: Wed Jun 15, 2016 3:11 am
by AlexDW
1. Better if you prepared images before upload in Opencart (use Photoshop or similar software for this)
In Opencart you can set image compression value manually in file system\library\image.php

in line

Code: Select all

public function save($file, $quality = 90) {
where 90 - image compression value (by default and recommended)

2. Yes, to add Progressive JPEGs also in this file system\library\image.php

before line

Code: Select all

imagejpeg($this->image, $file, $quality);
add this

Code: Select all

imageinterlace($this->image, true);
3. Not recommended

PS: after change 1-2 need to clear images cache folder