I have a working script that will upload and create thumbnails. I need to add 'ImageCopyMerge' to it but I can't get it to work. Here's the script, and I have a 'watermark.png' in the same directory as the code below.
PHP Code:
$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating.");
$destimg_2=imagecreatetruecolor($new_width_2,$new_height_2) or die("Problem In Creating.");
$srcimg=imagecreatefromjpeg($prod_img) or die('Problem In opening Source Image');
$srcimg_2=imagecreatefromjpeg($prod_img) or die('Problem In opening Source Image');
imagecopyresampled($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die('Problem In resizing');
imagecopyresampled($destimg_2,$srcimg_2,0,0,0,0,$new_width_2,$new_height_2,ImageSX($srcimg_2),ImageSY($srcimg_2)) or die('Problem In resizing');
imagejpeg($destimg,$prod_img_thumb,70) or die('Problem In saving');
imagejpeg($destimg_2,$prod_img,90) or die('Problem In saving');
imagedestroy($destimg);
imagedestroy($destimg_2);
}
|