Magento

eCommerce Software for Online Growth

Magento Forum

From setting up your store to managing your products, pages and promotions to generating detailed reports, the Magento User Guide empowers the user to utilize the platform for all of its vast capacity.
Available in eBook and Print formats – Download Now!!!
   
Avoid image compression with GD2
 
doctorlogos
Sr. Member
 
Avatar
Total Posts:  178
Joined:  2008-05-06
 

I only know that I prepare my images optimization with photoshop and fireworks.

We know that it´s a very good feature for beginners, who don´t know how to compress-resize images for the web. But, not usefull for me and the most of us, I´m sure.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cooldar
Member
 
Total Posts:  69
Joined:  2008-05-14
 

is there any easy way to reprocess those image already imported?

 Signature 

Jewelry
Jewelry Blog

 
Magento Community Magento Community
Magento Community
Magento Community
 
lisali
Guru
 
Avatar
Total Posts:  719
Joined:  2008-04-28
London, UK
 

Hi,

I’d also like to know if there’s a way to reprocess images already uploaded, or what cache needs to be deleted for images to be reprocessed? Also, what works in 1.2.1, in terms of disabling compression?

 Signature 

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

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1187
Joined:  2007-12-14
Illinois, USA
 

There’s a place to refresh your image cache in the Cache area on the admin panel.

 Signature 

Creativity is falling in love with the world. – Dewitt Jones
Community Extension: Pickup at Event/Multiple Flatrates

 
Magento Community Magento Community
Magento Community
Magento Community
 
justsuspension
Jr. Member
 
Total Posts:  16
Joined:  2008-07-01
 

I’ve been using this modification, and while it is importing the images, I can’t figure out how to get it to use the first image as the primary thumbnail, small, and base, and then just add the remaining images to the gallery.  Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
justsuspension
Jr. Member
 
Total Posts:  16
Joined:  2008-07-01
 

Whoops, had too many forum tabs open and posted in the wrong one.  Sorry!

 
Magento Community Magento Community
Magento Community
Magento Community
 
J.T.
Mentor
 
Avatar
Total Posts:  1447
Joined:  2008-08-07
 

For those wanting to accomplish this (reduced thumbnail image compression) in 1.2.x....

Scree’s code doesn’t seem to have any bearing on the front-end.

This, as posted by TheTwistedOne as adapted from 00christian00 does.

File: lib/Varien/Image/Adapter/Gd2.php
Line: 80

Comment out line 80:

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

Right below it, next line, add:

if ($this->_fileType === IMAGETYPE_JPEG{
    call_user_func
($this->_getCallback('output'), $this->_imageHandler$fileName99);
else {
    call_user_func
($this->_getCallback('output'), $this->_imageHandler$fileName); 
}

If slightly changed the code with no difference in working.

Note that I entered 99 which makes thumbnails roughly the size I had compressed them to myself. 100 makes the file bigger than the source. Anything below 99 greatly compresses again with the resulting blur. Find your own balance. Make sure to go to Cache Management and clear Image Cache.

NOTE: This edits a core file and any upgrade will overwrite this. As this is not in app/code I do not know a way of simply extending this with a local Module. If anyone does, please share.

 Signature 

It takes two to tango, so don’t blame Magento right away if things go tits-up!

Mage Quick FAQ
Q. Installation problems with localhost/xamp/wamp/whatever and/or missing php extensions, help!
A. Get Zend Server - Community Edition is free and will make things a lot easier on you now and when deploying to production

 
Magento Community Magento Community
Magento Community
Magento Community
 
M-L-N
Member
 
Total Posts:  35
Joined:  2009-02-15
 

i cant seem to find the gd2.php file.

where specific is it placed?

EDIT:

Found it smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
M-L-N
Member
 
Total Posts:  35
Joined:  2009-02-15
 

J.T.

This doesnt seems to work for me. My images are still blurry

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1187
Joined:  2007-12-14
Illinois, USA
 

Did you clear your image cache afterwards?

 Signature 

Creativity is falling in love with the world. – Dewitt Jones
Community Extension: Pickup at Event/Multiple Flatrates

 
Magento Community Magento Community
Magento Community
Magento Community
 
circa1977
Member
 
Total Posts:  65
Joined:  2008-03-01
 

I used the earlier method and just updated 1.2.1.1 using the method on this page. Works perfectly.

Question is: Can classes in /lib be extended so that this can be managed outside the Magento core, preserving upgradeability?

 Signature 

.  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
Mark J. Reeves
Principal, Technology
| @circa1977

 
Magento Community Magento Community
Magento Community
Magento Community
 
lisali
Guru
 
Avatar
Total Posts:  719
Joined:  2008-04-28
London, UK
 
circa1977 - 26 February 2009 06:26 PM

I used the earlier method and just updated 1.2.1.1 using the method on this page. Works perfectly.

Question is: Can classes in /lib be extended so that this can be managed outside the Magento core, preserving upgradeability?

I’d also love to be able to do this. Even better - to have an option for image compression in the admin.

 Signature 

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

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jothai
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2008-11-06
 

Hi out there!

I seem to have the same problem, but none of all these propositions do help at all.
My small and thumbnail images are absolutly blurred, while the big ones are all right. Even when I display the images with the right mouse button, it`s okay, but in the category and produkt pages they look really poor.

I changed the image.php,
I tried the change in the list.phtml,
I cleared the image cache every time,
I tried other jpg-sizes and other jpg-quality…

Please someone tell me what do do or what I slipped!

 
Magento Community Magento Community
Magento Community
Magento Community
 
zulusek
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2007-10-08
Czastary
 

Edit file
lib/Varien/Image/Adapter/Gd2.php

Line 80 should look:

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

Change this to:

//    call_user_func($this->_getCallback('output'), $this->_imageHandler, $fileName);
    if ($this->_fileType === IMAGETYPE_JPEG{
    call_user_func
($this->_getCallback('output'), $this->_imageHandler$fileName99);
else {
    call_user_func
($this->_getCallback('output'), $this->_imageHandler$fileName); 

    }

Then go to Admin->System->Cache and clear image cache. Till this moment your image should look good.

Theese steps works perfectly for me smile

 Signature 

--
Michal

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jothai
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2008-11-06
 

Well, done it all and again, but nothing changed. To be shure I cleared the image cache a several times, now instead of the blurred image it says: “Parse error: syntax error, unexpected T_PUBLIC in /var/www/web34/web/lib/Varien/Image/Adapter/Gd2.php on line 89”

Line 89: “public function display()”

what the...?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2010 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
177522 users|1157 users currently online|277044 forum posts