downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Imagick::setImageCompressionQuality> <Imagick::setImageCompose
[edit] Last updated: Fri, 25 May 2012

view this page in

Imagick::setImageCompression

(PECL imagick 2.0.0)

Imagick::setImageCompressionSets the image compression

Descrierea

bool Imagick::setImageCompression ( int $compression )

Parametri

compression

One of the COMPRESSION constants

Valorile întoarse

Întoarce TRUE în caz de succes.

Erori/Excepții

Emite ImagickException în caz de eroare.



add a note add a note User Contributed Notes Imagick::setImageCompression
snipes2083 [at] yahoo com 28-Mar-2010 10:03
Above it says "One of the COMPRESSION constants" for the parameters.  For any of you that found this confusing, you can find a list of the constants here:

Predefined Constants
http://www.php.net/manual/en/imagick.constants.php

As an example for working with a jpeg image:

<?php
    $image
= 'jpeg_image.jpg';
   
$comression_type = Imagick::COMPRESSION_JPEG;
   
   
$im = new Imagick($image);
   
$im->setImageCompression($compression_type);
?>

This class does not actually compress the images but rather sets the compression type that is going to be used. 

If you would like to see how to compress the image see:
Imagick::setImageCompressionQuality

 
show source | credits | sitemap | contact | advertising | mirror sites