0

I am trying to get a png image to display using imagecreatefrompng, but when I keep getting this: What imagecreatefrompng returns

Here is my code:

$img = 'stamp.png';
$img = imagecreatefrompng($img);
header('Content-type: image/png');
imagepng($img);
imagedestroy($img);
4
  • Is this your ENTIRE code?
    – Steve
    Mar 17, 2014 at 22:48
  • I have the standard <!doctype html> and <?php> code as well Mar 17, 2014 at 22:51
  • Thats your problem, you dont embed image data into html do you, html is just text. Remove the html
    – Steve
    Mar 17, 2014 at 22:54
  • If you are still confused, edit your question to show the complete php file, and i'll post an answer
    – Steve
    Mar 17, 2014 at 23:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.