Code: Select all
$cmd = "convert 'inline:data:tiff;base64,".$image."' test.gif";
$dataurl = system($cmd);
Code: Select all
$cmd = "convert 'inline:data:tiff;base64,".$image."' test.gif";
$dataurl = system($cmd);
Code: Select all
<?php
$cmd = "convert $image JPG:-";
header("Content-type: image/jpeg");
passthru($cmd, $retval);
?>
Code: Select all
$imagedata= 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==';
// Decode image from base64
$image=base64_decode($imagedata);
// Create Imagick object
$im = new Imagick();
// Convert image into Imagick
$im->readimageblob($image);
$im->setImageFormat("png24");
$thumbnail = $im->getImageBlob();
echo '<img src=data:image/png;base64,'.base64_encode($thumbnail).' />';