Auto watermark while image upload
by barkkathulla[ Edit ] 2013-08-03 17:25:49
You can simply add watermark text for your images by the below method:
function savegreeting($type,$filename, $image_type=IMAGETYPE_JPEG, $compression=75, $permissions=null) {
imagejpeg($this->image,$filename,$compression);
if( $permissions != null) {
chmod($filename,$permissions);
}
$name=$filename;
$copyright_path=HOME_PATH.'public/images/';
$src = imagecreatefrompng($copyright_path);
$dest = imagecreatefromjpeg($name);
/*imagealphablending($dest, true);
imagesavealpha($dest, true);*/
if($type=="large")
{
imagealphablending($dest, true);
imagesavealpha($dest, true);
imagecopy($dest, $src, 5, 550, 0, 0, 250, 50);
imagejpeg($dest,$filename);
}
}