note 106725 added to function.imagick-getimageblob

From: Date: Thu, 01 Dec 2011 23:41:01 +0000
Subject: note 106725 added to function.imagick-getimageblob
Groups: php.notes 
Request: Send a blank email to php-notes+get-184843@lists.php.net to get a copy of this message
It seems that this method can return a zero-length string if faced with large-ish data. No exceptions are thrown. <?php $image = new Imagick(); if (!$image->newImage(1000,1,'white')) throw new Exception(); if (!$image->scaleImage(0,200)) throw new Exception(); print "Image size: {$image->getImageWidth()},{$image->getImageHeight()}\n"; if (!$image->setImageFormat("jpeg")) throw new Exception(); $a = $image->getImageBlob(); print "Rendered to ".strlen($a)." bytes\n"; ?> Restrict your output image size, or ensure that the blob you get back isn't empty. (Note that IM seems to be doing the work, it delays for some time. But there's no indication of any error anywhere.) ---- Server IP: 69.147.83.197 Probable Submitter: 92.30.20.162 ---- Manual Page -- http://www.php.net/manual/en/function.imagick-getimageblob.php Edit -- https://master.php.net/note/edit/106725 Del: integrated -- https://master.php.net/note/delete/106725/integrated Del: useless -- https://master.php.net/note/delete/106725/useless Del: bad code -- https://master.php.net/note/delete/106725/bad+code Del: spam -- https://master.php.net/note/delete/106725/spam Del: non-english -- https://master.php.net/note/delete/106725/non-english Del: in docs -- https://master.php.net/note/delete/106725/in+docs Del: other reasons-- https://master.php.net/note/delete/106725 Reject -- https://master.php.net/note/reject/106725 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#184843) next »