PitchOu
Total Posts: 38
Joined: 2008-02-04
Villeneuve d'Ascq, France
Hi,
I would like to get a fine control on the quality of my product images. In others terms, I’d like not to use GD to compress my pictures.
Today I upload images in jpg 100% and I already setted the quality to something better than the default value (in lib/Varien/Image/Adapter/Gd2.php) but the result is not good for all image types (depending on the size, product, ...).
I would like to disable the Gd2 processing in the image caching system to replace it by a simple file copy ... in order to avoid any processing and keep a “human validated” quality
Any idea to do this properly ?
Thanks !
Posted: April 12 2008
| top
Mark_Kimsal
Total Posts: 186
Joined: 2007-09-12
Michigan, USA
Can you unload the GD module from the server? If that’s possible and practical (no other projects need it) then do it and search for my post about “gd got you down?” That post will show you how to compensate for a missing GD extension and use the regular images that you’ve uploaded.
Signature
There’s info on lots of custom modules in my Magento Group
http://www.magentocommerce.com/group/view/174
Need Upgrade help from 0.6, 0.7, and 0.8 available? P.M. me for details on CMS integration.
Posted: April 12 2008
| top
| # 1
PitchOu
Total Posts: 38
Joined: 2008-02-04
Villeneuve d'Ascq, France
Thanks for your reply. Unfortunately if I disable the php gd extension + delete image cache no more product is displayed in the shop.
I’ll need to look at the code, but I don’t really know how to manage this right.
Varien, any advise about the method ? Where would you make changes for this feature ?
Thanks !
Posted: April 13 2008
| top
| # 2
MagentoJoe
Total Posts: 127
Joined: 2007-08-31
I would also very much like to see an option in the admin-area where we could ajust the image-quality wanted for uploaded images.
Signature
Visit http://www.ecommerce-extensions.com for professional Magento templates and widgets.
Posted: April 13 2008
| top
| # 3
Lee Nugent
Total Posts: 12
Joined: 2008-03-27
I’d like to sort out the default image compression. I’m a strong believer that good images sell more products… GD2 settings currently dont cut the mustard!
Lee.
Posted: April 13 2008
| top
| # 4
PitchOu
Total Posts: 38
Joined: 2008-02-04
Villeneuve d'Ascq, France
If you use only jpg images, you can change the code like this in lib/Varien/Image/Adapter/Gd2.php :
Change
case IMAGETYPE_JPEG:
imagejpeg($this->_imageHandler, $fileName);
break;
to
case IMAGETYPE_JPEG:
imagejpeg($this->_imageHandler, $fileName, 95);
break;
To get a default compression of 95% instead of the default value (75%).
Hope it helps !
Posted: April 14 2008
| top
| # 5
sdb
Total Posts: 223
Joined: 2007-11-13
coastal California, USA
this is a great thing to know. i haven’t noticed any issues with the default 75%, but then again i use lineart instead of photos.
Signature
my preferred host: http://www.schostpro.com
Posted: April 16 2008
| top
| # 6
circa1977
Total Posts: 48
Joined: 2008-03-01
I actually don’t even see that supported in PHP documentation.
- Mark
Posted: June 1 2008
| top
| # 8
circa1977
Total Posts: 48
Joined: 2008-03-01
Thanks, Josh. That worked much better.
sherrie
Total Posts: 872
Joined: 2007-12-14
Illinois, USA
It looks so much better now! Thanks!
Signature
Creativity is falling in love with the world. – Dewitt Jones
Current Projects: Aqua Gear Direct & IHSA State Finals • Currently Running: PHP 5.2.5/MySQL 5.0.45/Magento 1.1.8 on HostGator
scree
Total Posts: 94
Joined: 2008-07-14
Linz
worked for me, but image upload is broken now.
Posted: September 11 2008
| top
| # 12
John R
Total Posts: 87
Joined: 2008-08-21
Did this change since the newest release?
case IMAGETYPE_JPEG : imagejpeg ( $this -> _imageHandler , $fileName ); break;
.. does not appear to be anywhere in Gd2.php ..
Posted: September 11 2008
| top
| # 13
scree
Total Posts: 94
Joined: 2008-07-14
Linz
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 );
Posted: September 11 2008
| top
| # 14
AngelEyes
Total Posts: 41
Joined: 2008-02-25
Scree,
Brilliant, thanks!
Posted: September 13 2008
| top
| # 15