yekis Posted December 18, 2007 Share Posted December 18, 2007 when i preview my php file in a browser, no image appears...don't know what's wrong with my code....tnx <?php { header ("Content-type: image/png"); //define images $background = imagecreatefrompng("background.png"); $overlay = imagecreatefrompng("logo.png"); imagecopymerge($background, $overlay, 0,0,0,0,480,360,100); imagepng($background,"",100); imagedestroy($background); } ?> [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/82132-simple-imagecopymerge-code-just-dont-know-whats-wrong/ Share on other sites More sharing options...
dbillings Posted December 18, 2007 Share Posted December 18, 2007 are your images stored in the same directory as the file? If not you'll need to include the correct path. <?php $background = imagecreatefrompng("images/background.png"); ?> Link to comment https://forums.phpfreaks.com/topic/82132-simple-imagecopymerge-code-just-dont-know-whats-wrong/#findComment-417369 Share on other sites More sharing options...
yekis Posted December 18, 2007 Author Share Posted December 18, 2007 yes they are saved in the same directory...here's the exact "error" i get when i preview my file in the ff: browsers 1. internet explorer (see attachment) 2. firefox..the screen simply dislays the url in the window http://localhost/delete2.php [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/82132-simple-imagecopymerge-code-just-dont-know-whats-wrong/#findComment-417381 Share on other sites More sharing options...
~n[EO]n~ Posted December 18, 2007 Share Posted December 18, 2007 try this <?php header ("Content-type: image/png"); $background = imagecreatefrompng("background.png"); $insert = imagecreatefrompng("logo.png"); imagecopymerge($background, $insert, 0, 0, 0, 0, 480, 360, 30); imagepng($background); imagedestroy($background); ?> Link to comment https://forums.phpfreaks.com/topic/82132-simple-imagecopymerge-code-just-dont-know-whats-wrong/#findComment-417435 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.