Imagick::getImageCompression

(PECL imagick 3 >= 3.3.0)

Imagick::getImageCompression現在の画像の圧縮形式を取得する

説明

public Imagick::getImageCompression(): int

現在の画像の圧縮形式を取得します。

パラメータ

この関数にはパラメータはありません。

戻り値

圧縮形式を表す定数を返します。

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