note 96836 modified in function.imagick-setcompressionquality by danbrown
| From: | danbrown@php.net | Date: | Fri, 19 Mar 2010 15:31:51 +0000 |
| Subject: | note 96836 modified in function.imagick-setcompressionquality by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-167212@lists.php.net to get a copy of this message | ||
A note for people who just couldn't get this working..
With PHP 5.1.6, the below works:
<?php
$img->setCompression(Imagick::COMPRESSION_JPEG);
$img->setCompressionQuality(80);
?>
However, with higher versions of PHP (I tried on PHP 5.2.10), the code has no effect (and there are
no exceptions or warnings thrown by Imagick as well).
The code that works instead is:
<?php
$img->setImageCompression(Imagick::COMPRESSION_JPEG);
$img->setImageCompressionQuality(80);
?>
and this is backwards compatible (Works on PHP 5.1.6 as well as 5.2.10)
--was--
A note for people who just couldn't get this working..
With PHP 5.1.6, the below works:
$img->setCompression(Imagick::COMPRESSION_JPEG);
$img->setCompressionQuality(80);
However, with higher versions of PHP (I tried on PHP 5.2.10), the code has no effect (and there are
no exceptions or warnings thrown by Imagick as well).
The code that works instead is:
$img->setImageCompression(Imagick::COMPRESSION_JPEG);
$img->setImageCompressionQuality(80);
and this is backwards compatible (Works on PHP 5.1.6 as well as 5.2.10)
http://php.net/manual/en/function.imagick-setcompressionquality.php