php - Embedding name into picture -
i have section of site user uploads picture , provide first , last name...
is there way there name can embedded there picture , saved?
a watermark fill needs :)
<?php function watermarkimage ($sourcefile, $watermarktext, $destinationfile) { list($width, $height) = getimagesize($sourcefile); $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($sourcefile); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width, $height); $black = imagecolorallocate($image_p, 0, 0, 0); $font = 'arial.ttf'; $font_size = 10; imagettftext($image_p, $font_size, 0, 10, 20, $black, $font, $watermarktext); if ($destinationfile<>'') { imagejpeg ($image_p, $destinationfile, 100); } else { header('content-type: image/jpeg'); imagejpeg($image_p, null, 100); }; imagedestroy($image); imagedestroy($image_p); }; ?>
source: http://www.phpjabbers.com/put-watermark-on-images-using-php-php20.html
Comments
Post a Comment