For some reason when I try to send a header it is not working.
<?php
header ("Content-type: image/png");
$im = imagecreatefrompng('pic.png');
imagepng($im);
imagedestroy($im);
?>
This produces a CGI error and says it doesnt return a complete set of HTTP headers. (note: there are no spaces above the script)
However when I add
<head>
<meta http-equiv="Content-Type" content="image/png">
</head>
to the above the above script. Then suddenly it works! How can I get the header function to work?