Michdd Posted October 12, 2008 Share Posted October 12, 2008 I've been looking for a tutorial on this, but I'm having a problem. I want to merge 2 different images from 2 URL's into 1 image. Link to comment https://forums.phpfreaks.com/topic/128053-merging-images/ Share on other sites More sharing options...
DarkWater Posted October 12, 2008 Share Posted October 12, 2008 Look up PHP's functions in the GD image library. Link to comment https://forums.phpfreaks.com/topic/128053-merging-images/#findComment-663097 Share on other sites More sharing options...
Michdd Posted October 12, 2008 Author Share Posted October 12, 2008 I tried this: <?php // Create image instances $dest = imagecreatefrompng('http://tfg.game-host.org/bin/tfgcwp?Arcitex.png'); $src = imagecreatefrompng('http://eoinfo.no-ip.org:8080/playercards.php?name=arcitex&card=1.png'); // Copy and merge imagecopymerge($dest, $src, 0, 0, 20, 20, 380, 128, 100); // Output and free free from memory header('Content-Type: image/png'); imagepng($dest); imagedestroy($dest); imagedestroy($src); ?> It's just showing a broken image. It's not working.. Link to comment https://forums.phpfreaks.com/topic/128053-merging-images/#findComment-663105 Share on other sites More sharing options...
micmania1 Posted October 12, 2008 Share Posted October 12, 2008 Warning: imagecreatefrompng() [function.imagecreatefrompng]: gd-png: fatal libpng error: Read Error: truncated data in ### on line 4 Warning: imagecreatefrompng() [function.imagecreatefrompng]: gd-png error: setjmp returns error condition in ### on line 4 Warning: imagecreatefrompng() [function.imagecreatefrompng]: 'http://tfg.game-host.org/bin/tfgcwp?Arcitex.png' is not a valid PNG file in ### on line 4 Warning: imagecopymerge(): supplied argument is not a valid Image resource in ### on line 8 Warning: Cannot modify header information - headers already sent by (output started at ###:4) in ### on line 11 Warning: imagepng(): supplied argument is not a valid Image resource in ### on line 12 Warning: imagedestroy(): supplied argument is not a valid Image resource in ### on line 14 I have no idea why, but i'm getting those error messages. Link to comment https://forums.phpfreaks.com/topic/128053-merging-images/#findComment-663259 Share on other sites More sharing options...
iversonm Posted October 12, 2008 Share Posted October 12, 2008 you sure you have the locations of your pictures correct, and are the permission set correctly(if required??) Link to comment https://forums.phpfreaks.com/topic/128053-merging-images/#findComment-663263 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.