Imagecopy() Issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ziycon
    Contributor
    • Sep 2008
    • 384

    Imagecopy() Issue

    I have the below code, there are no errors and the images is being created but not with the watermark image.

    Can anyone suggest what might be going on here?

    Code:
    private function addWaterMark($fileIn) {
    	$stamp = imagecreatefrompng(WATERMARK_IMG);
    	$im = imagecreatefrompng($fileIn);
    
    	$marge_right = 10;
    	$marge_bottom = 10;
    	$sx = imagesx($stamp);
    	$sy = imagesy($stamp);
    
    	imagecopy($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp));
    }
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    It doesn't look like you saved the image that you created. The imagecopy function does not save the image, it only modifies the resource that was passed to it.

    Comment

    Working...