Imagick::getImageBlob

(No version information available, might be only in CVS)

Imagick::getImageBlob — Returns the image sequence as a blob

Описание

string Imagick::getImageBlob ( void )
Внимание

К настоящему времени эта функция еще не была документирована; для ознакомления доступен только список аргументов.

Implements direct to memory image formats. It returns the image sequence as a string. The format of the image determines the format of the returned blob (GIF, JPEG, PNG, etc.). To return a different image format, use Imagick::setImageFormat().

Возвращаемые значения

Returns a string containing the image. On failure, throws ImagickException.

Коментарии

Автор:
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.)
2011-12-02 01:41:01
http://php5.kiev.ua/manual/ru/function.imagick-getimageblob.html

    Поддержать сайт на родительском проекте КГБ