I have tried to convert binary data into an image format and then save this image in a folder. I am using imagesavealpha
function but it is not working.
My code is below:
<?php
$image_data=file_get_contents('Logo.png');
$encoded_image=base64_encode($image_data);
$decoded_image=base64_decode($encoded_image);
$im = imagecreatefromstring($decoded_image);
header('Content-Type: image/png');
imagepng($im);
$fileName ='/image/'.date('ymdhis').'.png';
imagealphablending($im,false);
imagesavealpha($im, true);
?>