note 109898 added to imagick.pingimage
| From: | Sergey | Date: | Sat, 01 Sep 2012 15:06:06 +0000 |
| Subject: | note 109898 added to imagick.pingimage | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-190397@lists.php.net to get a copy of this message | ||
If you don't sure whether the file exists or not or maybe it's broken, then you should use
try - catch construction. It prevents code fails, when code stops execution after call of pingImage
(if the file doesn't exist or it's broken).
<?php
$im = new Imagick();
try {
$im->pingImage('3.jpg');
}
catch(ImagickException $e) {
echo "image doesn't exist";
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 80.78.116.173
----
Manual Page -- http://www.php.net/manual/en/imagick.pingimage.php
Edit -- https://master.php.net/note/edit/109898
Del: integrated -- https://master.php.net/note/delete/109898/integrated
Del: useless -- https://master.php.net/note/delete/109898/useless
Del: bad code -- https://master.php.net/note/delete/109898/bad+code
Del: spam -- https://master.php.net/note/delete/109898/spam
Del: non-english -- https://master.php.net/note/delete/109898/non-english
Del: in docs -- https://master.php.net/note/delete/109898/in+docs
Del: other reasons-- https://master.php.net/note/delete/109898
Reject -- https://master.php.net/note/reject/109898
Search -- https://master.php.net/manage/user-notes.php