Jnerocorp Posted November 28, 2009 Share Posted November 28, 2009 Hello, I am using to external images to place one on top of the other but its not working correctly This image is to be on top: http://www.everyday-taichi.com/image-files/youtube-play.jpg This Image is to be on the bottom: http://img.youtube.com/vi/7Lfyk9yQPYk/default.jpg This is what I have so far but its like cutting away at the images: http://JneroCorp.com/test.php Here is the code I have: <?php $src = imagecreatefromjpeg( 'http://img.youtube.com/vi/7Lfyk9yQPYk/default.jpg' ); $dst = imagecreatefromjpeg( 'http://www.everyday-taichi.com/image-files/youtube-play.jpg' ); imagecopymerge( $dst, $src, 1, 1, 0, 0, 200, 200, 80 ); header( 'Content-type: image/jpeg' ); imagejpeg( $dst ); imagedestroy( $src ); imagedestroy( $dst ); ?> Link to comment https://forums.phpfreaks.com/topic/183220-gd-library-help-placing-an-image-ontop-of-an-image/ Share on other sites More sharing options...
Jnerocorp Posted November 28, 2009 Author Share Posted November 28, 2009 I am still unable to figure out how this is done -John Link to comment https://forums.phpfreaks.com/topic/183220-gd-library-help-placing-an-image-ontop-of-an-image/#findComment-966979 Share on other sites More sharing options...
abazoskib Posted November 28, 2009 Share Posted November 28, 2009 Its because your destination image is the smaller of the two. This looks good to me: $dst = imagecreatefromjpeg( 'http://img.youtube.com/vi/7Lfyk9yQPYk/default.jpg' ); $src = imagecreatefromjpeg( 'http://www.everyday-taichi.com/image-files/youtube-play.jpg' ); imagecopymerge( $dst, $src, 30, 20, 0, 0, 61, 44, 80 ); header( 'Content-type: image/jpeg' ); imagejpeg( $dst ); imagedestroy( $src ); imagedestroy( $dst ); Link to comment https://forums.phpfreaks.com/topic/183220-gd-library-help-placing-an-image-ontop-of-an-image/#findComment-967036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.