note 112876 added to imagick.pingimage
| From: | hello at digitalnature dot eu | Date: | Wed, 31 Jul 2013 23:41:18 +0000 |
| Subject: | note 112876 added to imagick.pingimage | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195841@lists.php.net to get a copy of this message | ||
Just a warning: don't use Eero Niemi's code (identifyImage with pingImage) if you just
want to get the image width and height, because it will actually be slower than reading the whole
image into memory - about 10x slower!
Correct code should be:
<?php
$image = new Imagick();
$image->pingImage($file);
$width = $image->getImageWidth();
$height = $image->getImageHeight();
?>
(this is around 15 times faster than reading the image in memory)
----
Server IP: 69.147.83.199
Probable Submitter: 79.113.248.16
----
Manual Page -- http://php.net/manual/en/imagick.pingimage.php
Edit -- https://master.php.net/note/edit/112876
Del: integrated -- https://master.php.net/note/delete/112876/integrated
Del: useless -- https://master.php.net/note/delete/112876/useless
Del: bad code -- https://master.php.net/note/delete/112876/bad+code
Del: spam -- https://master.php.net/note/delete/112876/spam
Del: non-english -- https://master.php.net/note/delete/112876/non-english
Del: in docs -- https://master.php.net/note/delete/112876/in+docs
Del: other reasons-- https://master.php.net/note/delete/112876
Reject -- https://master.php.net/note/reject/112876
Search -- https://master.php.net/manage/user-notes.php