note 108677 added to imagick.getcompression

From: Date: Wed, 16 May 2012 23:11:07 +0000
Subject: note 108677 added to imagick.getcompression
Groups: php.notes 
Request: Send a blank email to php-notes+get-188023@lists.php.net to get a copy of this message
The ImageMagick PHP function for getCompression returns an integer representing the value associated with the ImageMagick Compression constant. You'll get numbers from 0 to 13, each representing a different particular type of compression. If printed out, the ImageMagick constants for compression come out as... imagick::COMPRESSION_UNDEFINED 0 imagick::COMPRESSION_NO 1 imagick::COMPRESSION_BZIP 2 imagick::COMPRESSION_DXT1 3 imagick::COMPRESSION_DXT3 4 imagick::COMPRESSION_DXT5 5 imagick::COMPRESSION_FAX 6 imagick::COMPRESSION_GROUP4 7 imagick::COMPRESSION_JPEG 8 imagick::COMPRESSION_JPEG2000 9 imagick::COMPRESSION_LOSSLESSJPEG 10 imagick::COMPRESSION_LZW 11 imagick::COMPRESSION_RLE 12 imagick::COMPRESSION_ZIP 13 Every time I have used this, whether on a jpeg image, a png image, a gif image, or a bmp image, it has always returned '0' as a value. There's a good chance that this is simply a value that is set by means of get/set, as opposed to actually producing values for a given image. Some sample code : <?php // Author: holdoffhunger@gmail.com // Imagick Type // --------------------------------------------- $imagick_type = new Imagick(); // Open File // --------------------------------------------- $file_to_grab = "image_workshop_directory/test.bmp"; $file_handle_for_viewing_image_file = fopen($file_to_grab, 'a+'); // Grab File // --------------------------------------------- $imagick_type->readImageFile($file_handle_for_viewing_image_file); // Get Quantum Range // --------------------------------------------- $imagick_type_compression = $imagick_type->getCompression(); // Print Results // --------------------------------------------- print("<pre>"); print($imagick_type_compression); print("</pre>"); ?> ---- Server IP: 69.147.83.197 Probable Submitter: 68.9.137.178 ---- Manual Page -- http://www.php.net/manual/en/imagick.getcompression.php Edit -- https://master.php.net/note/edit/108677 Del: integrated -- https://master.php.net/note/delete/108677/integrated Del: useless -- https://master.php.net/note/delete/108677/useless Del: bad code -- https://master.php.net/note/delete/108677/bad+code Del: spam -- https://master.php.net/note/delete/108677/spam Del: non-english -- https://master.php.net/note/delete/108677/non-english Del: in docs -- https://master.php.net/note/delete/108677/in+docs Del: other reasons-- https://master.php.net/note/delete/108677 Reject -- https://master.php.net/note/reject/108677 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#188023) next »