Imagick::getImageCompression

(PECL imagick 3 >= 3.3.0)

Imagick::getImageCompressionGets the current image's compression type

Опис

public Imagick::getImageCompression(): int

Gets the current image's compression type.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Returns the compression constant

add a note

User Contributed Notes 3 notes

up
1
Mondragon
5 years ago
Example use:$im = new Imagick("mypicture.jpg");$ctype = $im->getImageCompression();if($ctype == Imagick::COMPRESSION_ZIP) echo "PNG file!";if($ctype == Imagick::COMPRESSION_JPEG) echo "JPG file!";if($ctype == Imagick::COMPRESSION_LZW) echo "GIF file!";All options:COMPRESSION_UNDEFINEDCOMPRESSION_NOCOMPRESSION_BZIPCOMPRESSION_FAXCOMPRESSION_GROUP4COMPRESSION_JPEGCOMPRESSION_JPEG2000COMPRESSION_LOSSLESSJPEGCOMPRESSION_LZWCOMPRESSION_RLECOMPRESSION_ZIPCOMPRESSION_DXT1COMPRESSION_DXT3COMPRESSION_DXT5COMPRESSION_ZIPSCOMPRESSION_PIZCOMPRESSION_PXR24COMPRESSION_B44COMPRESSION_B44ACOMPRESSION_LZMACOMPRESSION_JBIG1COMPRESSION_JBIG2The numbers for which those constants stand differ by version. So always use the constants.
up
-1
undoable at gmail dot com
12 years ago
This function is undefined. You must use getImageCompressionQuality() instead.
up
-1
alitrix at gmail dot com
7 years ago
This function is added in version 3.3.0 and above
To Top