Reputation: 29
I use imagemagick to show picture in php by this code:
$img=new Imagick('C:/xampp/htdocs/img/core.png');
echo $img;
Instead of showing picture I see some code in browser like this:
w�zƿ�sr3���������)I0�C���۱�
How can I fix this?
Upvotes: 0
Views: 61
Reputation:
You need to tell the browser you issuing and image first and add the appropriate headers:
header('Content-type: image/png');
echo $image;
Upvotes: 2