<?php
string public Imagick::getImageBlob();
?>
<?php
// Run this exercise to see the ImageBlob
$imagick = new Imagick();
$jpgfn = PATH2IMGW . '/jpg/wizard.jpg';
$imagick->readImage($jpgfn);
$strg = $imagick->getImageBlob();
echo $strg;
?>
<?php
// Run this exercise to see another ImageBlob
$imagick = new Imagick();
$giffn = PATH2IMGW . '/gif/E 01 01.gif';
$imagick->readImage($giffn);
$strg = $imagick->getImageBlob();
echo $strg;
?>
<?php
// Run this exercise to see one more ImageBlob
$imagick = new Imagick();
$pngfn = PATH2IMGW . '/png/wizard1.png';
$imagick->readImage($pngfn);
$strg = $imagick->getImageBlob();
echo $strg;
?>
<?php
$path = PATH2IMGW . '/others/IMG_0703.jpg';
$imagick = new Imagick($path);
$imagick->readImage($path);
$strg = $imagick->getImageBlob();
echo $strg;
?>
<?php
$imagick = new Imagick();
$jpgfn = PATH2IMGW . '/jpg/aa.jpg';
$str1img = 'img/jpg/aa1.jpg';
$imagick->readImage($jpgfn);
$strg = $imagick->getImageBlob();
// Reads the STRING of getImageBlob() with the PHP GD library
$img = imagecreatefromstring($strg);
imagejpeg($img, $str1img);
echo basename($str1img); ?>
<br><br>The image created by the use of this STRING:
<br><br>
<img src="<?php echo $str1img; ?>"
alt="<?php echo $str1img; ?>"
title="<?php echo $str1img; ?>">
<?php
// Create a new imagick object
$imagick = new Imagick();
$pngfn = PATH2IMGW . '/gif/E 01 01.gif';
$str2img = 'img/png/E 01 01.png';
$imagick->readImage($pngfn);
$strg = $imagick->getImageBlob();
// Reads the STRING of getImageBlob() with the PHP GD library
$img = imagecreatefromstring($strg);
imagepng($img, $str2img);
echo basename($str2img); ?>
<br><br>The image created by the use of this STRING:
<br><br>
<img src="<?php echo $str2img; ?>"
alt="<?php echo $str2img; ?>"
title="<?php echo $str2img; ?>">
<?php
// Create a new imagick object
$imagick = new Imagick();
$pngfn = PATH2IMGW . '/png/wizard.png';
$str3img = 'img/png/wizard3.png';
$imagick->readImage($pngfn);
$strg = $imagick->getImageBlob();
// Reads the STRING of getImageBlob() with the PHP GD library
$img = imagecreatefromstring($strg);
imagepng($img, $str3img);
echo basename($str3img); ?>
<br><br>The image created by the use of this STRING:
<br><br>
<img src="<?php echo $str3img; ?>"
alt="<?php echo $str3img; ?>"
title="<?php echo $str3img; ?>">