DJ Mike's Tutorials: PHP

Imagemagick Functions


^

Imagick::readImageBlob

Description:
bool Imagick::readImageBlob ( string $image [, string $filename ] )

Reads image from a binary string
Parameters
image
String representing image as a blob
Return Values
Returns TRUE on success.
Errors/Exceptions
Throws ImagickException on error.

Example


<?
$url 
"http://eclecticdjs.com/mike/tutorials/php/imagemagick/examples_07/opossum.jpg";

# read image as a blob instead of from a file path
$blob file_get_contents("$url");
$image = new imagick();
$image->readImageBlob("$blob");

# round the corners
$image->roundcorners2020 );

# get the original image fomat
$format $image->getformat(); 

# write headers for original format 
header("content-type:image/$format");
echo 
"$image";
?>



^

Created by DJ Mike from Santa Barbara

DJ Mike


Dance Away Santa Barbara's Home Page
<a href="http://www.statcounter.com/" target="_blank"> <img src="http://c5.statcounter.com/counter.php?sc_project=1321035&java=0&security=da2193dc" alt="counter free hit invisible" border="0" /></a>