1--TEST-- 2Test Imagick, readImageBlob 3--SKIPIF-- 4<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> 5--FILE-- 6<?php 7 8 9function readImageBlob() { 10 11 // Image blob borrowed from: 12 // http://www.techerator.com/2011/12/how-to-embed-images-directly-into-your-html/ 13 $base64 = "iVBORw0KGgoAAAANSUhEUgAAAM0AAAD 14 NCAMAAAAsYgRbAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5c 15 cllPAAAABJQTFRF3NSmzMewPxIG//ncJEJsldTou1jHgAAAARBJREFUeNrs2EEK 16 gCAQBVDLuv+V20dENbMY831wKz4Y/VHb/5RGQ0NDQ0NDQ0NDQ0NDQ0NDQ 17 0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0PzMWtyaGhoaGhoaGhoaGhoaGhoxtb0QGho 18 aGhoaGhoaGhoaGhoaMbRLEvv50VTQ9OTQ5OpyZ01GpM2g0bfmDQaL7S+ofFC6x 19 v3ZpxJiywakzbvd9r3RWPS9I2+MWk0+kbf0Hih9Y17U0nTHibrDDQ0NDQ0NDQ0 20 NDQ0NDQ0NTXbRSL/AK72o6GhoaGhoRlL8951vwsNDQ0NDQ1NDc0WyHtDTEhD 21 Q0NDQ0NTS5MdGhoaGhoaGhoaGhoaGhoaGhoaGhoaGposzSHAAErMwwQ2HwRQ 22 AAAAAElFTkSuQmCC"; 23 24 $imageBlob = base64_decode($base64); 25 26 $imagick = new Imagick(); 27 $imagick->readImageBlob($imageBlob); 28 29 $bytes = $imageBlob; 30 if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 31} 32 33readImageBlob() ; 34echo "Ok"; 35?> 36--EXPECTF-- 37Ok