note 108511 added to imagick.getquantumrange
| From: | holdoffhunger at gmail dot com | Date: | Wed, 02 May 2012 21:42:38 +0000 |
| Subject: | note 108511 added to imagick.getquantumrange | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187447@lists.php.net to get a copy of this message | ||
The getQuantumRange is a useful function, since many of the ImageMagick functions accept parameters
from 0 to a maximum of the Quantum Range. When getting a return value for this, it doesn't
return a string. It actually returns an array, with one type being a String
('quantumRangeLong') and the other type being a Long Int ('quantumRangeString').
Here's some sample code and the results, given a color, BMP file photograph that is 600x450
pixels...
<?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_quantum_range = $imagick_type->getQuantumRange();
// Print Results
// ---------------------------------------------
print("<pre>");
print_r($imagick_type_quantum_range);
print("</pre>");
?>
Output:
Array
(
[quantumRangeLong] => 65535
[quantumRangeString] => 65535
)
----
Server IP: 69.147.83.197
Probable Submitter: 68.9.137.178
----
Manual Page -- http://www.php.net/manual/en/imagick.getquantumrange.php
Edit -- https://master.php.net/note/edit/108511
Del: integrated -- https://master.php.net/note/delete/108511/integrated
Del: useless -- https://master.php.net/note/delete/108511/useless
Del: bad code -- https://master.php.net/note/delete/108511/bad+code
Del: spam -- https://master.php.net/note/delete/108511/spam
Del: non-english -- https://master.php.net/note/delete/108511/non-english
Del: in docs -- https://master.php.net/note/delete/108511/in+docs
Del: other reasons-- https://master.php.net/note/delete/108511
Reject -- https://master.php.net/note/reject/108511
Search -- https://master.php.net/manage/user-notes.php