php - Base64 encoding error -
the image not showing upon clicking upload button, base64 encoding error.
the browser displaying binary codes.
$showimage = "images/".$_files['image']["name"]; $show = new imagick( $showimage ); $points = array( 0,0, 0,0, # top left 213,0, 213,20, # top right 213,160, 213,110, # bottom right 0,160, 0,160,# bottum left ); $show->setimagebackgroundcolor("#ffffff"); $show->setimagevirtualpixelmethod( imagick::virtualpixelmethod_background ); $show->distortimage( imagick::distortion_perspective, $points, true ); echo "<img src='$show'>"; ?>
try:
$imagedata = base64_encode($show->getimageblob); echo "<img src='data:image/png;base64,$imagedata'>";
Comments
Post a Comment