joecooper Posted August 7, 2007 Share Posted August 7, 2007 a mod please delete my other post coz i think i got everyone confused with it. i have this code: header("Content-type: image/png"); imagepng("image.png"); it should return an image thats called image.png on the server, but it just comes up with the image box with a cross... what is it im doing wrong? http://joeyjoe.co.uk/wallpaper/getpaper.php Link to comment https://forums.phpfreaks.com/topic/63803-solved-image-with-php/ Share on other sites More sharing options...
Barand Posted August 7, 2007 Share Posted August 7, 2007 When you use imagepng($image), $image needs to be a gd-created image and not an image file <?php header("Content-type: image/png"); $im = imagecreatefrompng('path/to/image.png'); imagepng($im); imagedestroy($im); ?> Place on page with <img src="image.php"> Link to comment https://forums.phpfreaks.com/topic/63803-solved-image-with-php/#findComment-317976 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.