PitchOu
Total Posts: 39
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.
Posted: April 12 2008
| top
| # 1
PitchOu
Total Posts: 39
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
Roy Andre
Total Posts: 209
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.silverthemes.com for professional Magento themes and Magento widgets
Visit http://www.trollweb.no , Norways first and only Magento Professional Partner
Posted: April 13 2008
| top
| # 3
Lee Nugent
Total Posts: 25
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: 39
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: 65
Joined: 2008-03-01
I actually don’t even see that supported in PHP documentation.
- Mark
Signature
. . . . . . . . . . . . . . . . .
Mark J. Reeves
Principal, Technology
| @circa1977
Posted: June 1 2008
| top
| # 8
Shpigford
Total Posts: 171
Joined: 2007-09-03
Denver, CO
circa1977, make sure you are modifying imagejpeg() and NOT imagecreatefromjpeg().
Signature
Hi, my name is Josh.
Posted: June 9 2008
| top
| # 9
circa1977
Total Posts: 65
Joined: 2008-03-01
Thanks, Josh. That worked much better.
Signature
. . . . . . . . . . . . . . . . .
Mark J. Reeves
Principal, Technology
| @circa1977
John R
Total Posts: 90
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: 137
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 );
Signature
Pulpmedia GmbH | Social Media Marketing Agentur, Linz
Linzer Straße 1, A-4040 Linz
Austria
Posted: September 11 2008
| top
| # 14
AngelEyes
Total Posts: 74
Joined: 2008-02-25
Scree,
Brilliant, thanks!
Posted: September 13 2008
| top
| # 15