downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Imagick::getImageBluePrimary> <Imagick::getImageBackgroundColor
[edit] Last updated: Fri, 25 May 2012

view this page in

Imagick::getImageBlob

(PECL imagick 2.0.0)

Imagick::getImageBlobRetourne la séquence d'images comme un blob

Description

string Imagick::getImageBlob ( void )

Implémente un formatage directe en mémoire. Il retourne la séquence d'images sous forme de chaîne. Le format de l'image détermine le format du BLOB retourné (GIF, JPEG, PNG, etc.). Pour retourner un format différent, utilisez la fonction Imagick::setImageFormat().

Valeurs de retour

Retourne une chaîne contenant les images.

Erreurs / Exceptions

Lance une exception ImagickException si une erreur survient.



add a note add a note User Contributed Notes Imagick::getImageBlob
Trevor 01-Dec-2011 03:41
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.)

 
show source | credits | stats | sitemap | contact | advertising | mirror sites