note 100368 added to function.imagick-setresolution
| From: | carter dot sharon at gmail dot com | Date: | Mon, 11 Oct 2010 18:07:31 +0000 |
| Subject: | note 100368 added to function.imagick-setresolution | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-173145@lists.php.net to get a copy of this message | ||
If you are reading or creating a new image and want to set the resolution you need to set the Image
Units. Undefined image units will cause imagick to use the default resolution (72x72).
<?php
$img = new Imagick();
$img->setResolution(300,300);
$img->newimage(100,100,'none');
$img->setImageFormat('png');
// imagick::RESOLUTION_UNDEFINED imagick::RESOLUTION_PIXELSPERINCH
imagick::RESOLUTION_PIXELSPERCENTIMETER
$img->setImageUnits(imagick::RESOLUTION_PIXELSPERINCH);
print_r($img->identifyImage());
?>
Output
Array (
[resolution] => Array ( [x] => 300 [y] => 300 )
[units] => PixelsPerInch
)
----
Server IP: 69.147.83.197
Probable Submitter: 196.40.47.129
----
Manual Page -- http://www.php.net/manual/en/function.imagick-setresolution.php
Edit -- https://master.php.net/note/edit/100368
Del: integrated -- https://master.php.net/note/delete/100368/integrated
Del: useless -- https://master.php.net/note/delete/100368/useless
Del: bad code -- https://master.php.net/note/delete/100368/bad+code
Del: spam -- https://master.php.net/note/delete/100368/spam
Del: non-english -- https://master.php.net/note/delete/100368/non-english
Del: in docs -- https://master.php.net/note/delete/100368/in+docs
Del: other reasons-- https://master.php.net/note/delete/100368
Reject -- https://master.php.net/note/reject/100368
Search -- https://master.php.net/manage/user-notes.php