I can't seem to merge 2 images for some reason and I have no clue what I'm doing wrong. This is still a bit new to me. here is the code I have:
$source = 'http://localhost:8888/develop/trunk/develop/wp-content/uploads/2012/07/card01-80x80.jpg';
$im = imagecreatetruecolor(200, 200);
$black = imagecolorallocate($im, 0, 0, 0);
// Make the background transparent
imagecolortransparent($im, $black);
$text_color = imagecolorallocate($im, 255, 255, 255);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagejpeg($im, WP_UPLOADS_PATH . 'post-image-generator/1.jpg');
//merge images
$thumb = imagecreatefromjpeg($source);
$destination = imagecreatefromjpeg(WP_UPLOADS_PATH . 'post-image-generator/1.jpg');
imagecopymerge($destination, $thumb, 0, 0, 0, 0, 0, 0, 100);
imagejpeg($destination, WP_UPLOADS_PATH . 'post-image-generator/1.jpg');
echo "
<style></style>
<img src='" . WP_UPLOADS_URL . 'post-image-generator/1.jpg' . "' />
";
imagedestroy($thumb);
imagedestroy($destination);
imagedestroy($im);
It generates the following:
but should also include the following image:
Any help is appreciated