I am trying to write a small php function to take an image and apply a watermark type image on top of the image and them save them as 1 image, this code runs with 0 errors b
Here's a tutorial on how to make it from a watermark using a transparent PNG image: http://www.sitepoint.com/article/watermark-images-php/
I've used that before and it works. The issue with the code you have is probably that you're trying to generate a jpeg, but the file extension is a gif, so it's not rendering correctly. Could be be wrong though.
If it's just not saving out a final image, then that's just a permissions problem with the folder. In which case, you most likely have to set the folder to 777 via chmod.
I think you need to change this (here is a simple tutorial http://www.cafewebmaster.com/image-watermark-php):
//Add watermark to the image
if (!(imagecopy($image, $watermark, $watermark_x, $watermark_y, 0, 0, $watermark_w,
$watermark_h)))
with:
//Add watermark to the image
if (!(imagecopymerge($image, $watermark, $watermark_x, $watermark_y, 0, 0, $watermark_w,
$watermark_h, 100)))
or use wideImage ;)