Try the Demo

Magento

eCommerce Software for Online Growth

Magento Forum

Our new hosted solution for small & emerging businesses
   
Page 2 of 10
Avoid image compression with GD2
 
scree
Sr. Member
 
Avatar
Total Posts:  137
Joined:  2008-07-14
Linz
 

much better would be to extend the method of this class of course…

 Signature 

Pulpmedia GmbH | Social Media Marketing Agentur, Linz
Linzer Straße 1, A-4040 Linz
Austria

 
Magento Community Magento Community
Magento Community
Magento Community
 
lisali
Enthusiast
 
Avatar
Total Posts:  864
Joined:  2008-04-28
London, UK
 
scree - 11 September 2008 08:30 AM

Try to change the quality in

/app/code/core/Mage/Media/Model/File/Image.php

on line 168 from

$result imagejpeg($object->getTmpImage(), $object->getFilePath(true), 80);

to

$result imagejpeg($object->getTmpImage(), $object->getFilePath(true), 95);

Great, thanks for this. Best to put this in a local app/code/local… folder to prevent overwriting it when updating. Should be in the GUI backend.
Thanks!!

 Signature 

ExtraCall.com - UK Telecommunications & VOIP | SurveySam - Worldwide market research & surveys

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1636
Joined:  2007-12-14
Illinois, USA
 

Where would this go in the local folder since it’s parent folder is not in the core folder?

 Signature 

Creativity is falling in love with the world. – Dewitt Jones
Community Extensions: Pickup at Event/Multiple Flatrates + Minimum Quantity Required
I’m a very random person, catch me if you can: http://www.twitter.com/sherrierohde

 
Magento Community Magento Community
Magento Community
Magento Community
 
lisali
Enthusiast
 
Avatar
Total Posts:  864
Joined:  2008-04-28
London, UK
 

Hi sherrie,

maybe here:

app/code/local/Mage/Media/Model/File

?

 Signature 

ExtraCall.com - UK Telecommunications & VOIP | SurveySam - Worldwide market research & surveys

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1636
Joined:  2007-12-14
Illinois, USA
 

Ohhhh it is in the core folder now, sorry - I totally missed that, I thought we were still talking about the Gd2.php file from before. That’ll teach me to half-read something!

 Signature 

Creativity is falling in love with the world. – Dewitt Jones
Community Extensions: Pickup at Event/Multiple Flatrates + Minimum Quantity Required
I’m a very random person, catch me if you can: http://www.twitter.com/sherrierohde

 
Magento Community Magento Community
Magento Community
Magento Community
 
davidn
Jr. Member
 
Total Posts:  24
Joined:  2008-08-14
 

After upgrading to 1.1.6 my image compression settings were overwritten. So following these directions I went back and changed them again. This time though it has no effect. In fact the images are just being crushed, they look really bad. Has anyone else noticed this? Is there another way to adjust the compression?

Thanks
~David

 
Magento Community Magento Community
Magento Community
Magento Community
 
acstudios
Jr. Member
 
Total Posts:  14
Joined:  2008-08-19
 

Any solutions or suggestions on this with version 1.1.6?

 
Magento Community Magento Community
Magento Community
Magento Community
 
TheTwistedOne
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2008-09-20
 

I´m also having problems with this.

The mod described by Scree dosen´t seem to work in version 1.1.6

Help!!! images look terrible!

 
Magento Community Magento Community
Magento Community
Magento Community
 
TheTwistedOne
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2008-09-20
 

Ok, solution found for version 1.1.1 and above including 1.1.6

The code is in /lib/Varien/Image/Adapter/Gd2.php , PLEASE note if you are using 1.1.6 the line to change is 80, NOT 68.

00christian00 - 31 July 2008 05:22 AM

In version 1.1 the code has changed.
To up the quality change the line 68

call_user_func($this->_getCallback('output'), $this->_imageHandler$fileName);

to
if (IMAGETYPE_JPEG === $this->_fileType)call_user_func($this->_getCallback('output'), $this->_imageHandler$fileName,90);
        else 
        
call_user_func($this->_getCallback('output'), $this->_imageHandler$fileName);

90 is my quality,change to your preference.Remember to clear the image cache to test.

Remember 1.1.6 users change line 80

Many thanks to 00christian00 for this fix, you rock!

 
Magento Community Magento Community
Magento Community
Magento Community
 
acstudios
Jr. Member
 
Total Posts:  14
Joined:  2008-08-19
 

Hey TheTwistedOne!  This definitely worked.  Thanks for posting this up!

 
Magento Community Magento Community
Magento Community
Magento Community
 
TheTwistedOne
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2008-09-20
 

@AcStudios, i´m glad it helped.

Full credit should go to 00christian00 for working this one out.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kasper
Jr. Member
 
Total Posts:  29
Joined:  2007-11-11
Denmark
 

Nice tip, but how would you go about implementing this so that it wont get overwritten when updating magento?

 
Magento Community Magento Community
Magento Community
Magento Community
 
tilzinger
Sr. Member
 
Total Posts:  124
Joined:  2007-12-27
 
Kasper - 07 October 2008 11:48 PM

Nice tip, but how would you go about implementing this so that it wont get overwritten when updating magento?

Create a .txt file in the root of your site that says READMEWHENUPDATING and note the changes you need to make to core files. smile

And yes, a setting like this should most definitely be editable in the Admin area.

 
Magento Community Magento Community
Magento Community
Magento Community
 
doctorlogos
Sr. Member
 
Avatar
Total Posts:  178
Joined:  2008-05-06
 

@tilzinger, this feature in the Admin Area is crucial.

Dear Magento Team, take note!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
lisali
Enthusiast
 
Avatar
Total Posts:  864
Joined:  2008-04-28
London, UK
 

Agree. We need to be able to customise this in the admin.

Magento applies WEIRD image compressions. Also - has anyone noticed something strange happening when uploading PNG images? For one - their size gets BIGGER (2-3 times) in the frontend. And then there are some transparency issues.

 Signature 

ExtraCall.com - UK Telecommunications & VOIP | SurveySam - Worldwide market research & surveys

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 2 of 10
 
© Copyright 2012 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
701238 users|940 users currently online|497232 forum posts