Code for 9gag watermark
===

I want to add a watermark to the footer of my pics (example:

my code:

    	function inprint ($filename) 
	{
		$image = imagecreatefromjpeg($filename);
		$watermark= imagecreatefrompng("/images/temp/watermark.png"); 
		$imagesize = getimagesize($image);
		$watermarksize = getimagesize($watermark);
		$img = imagecreatetruecolor($imagesize[0], $imagesize[1] + $watermarksize[1]);
		imagecopy($img, $image, 0, 0, 0, 0, $imagesize[0], $imagesize[1]);
		imagecopy($img, $watermark, 0, $imagesize[1], 0, 0, $watermarksize[0], $watermarksize[1]);
		$this->image = $img;
	}

But it do not realy work, the image i get can't be shown on my homepage.

Before i call the function i save the Picture on my host

After the function inprint i save the filewith this:

    imagejpeg($this->image,$filename,$compression);


I cant realy find what is wrong, maybe someone can help  me :(