watermark, please help me to add watermark on this programming. please urgent
Started on the old forum in December 2012 · view the original in the archive · old links redirect here
<?php
$font_path = "arial.ttf"; // path to font file, download one
$font_size = 30; /// font size
$water_mark_text_2 = "My Watermark Text"; // watermark text
function watermark_image($oldimage_name, $new_image_name)
{
global $font_path, $font_size, $water_mark_text_2;
list($owidth,$oheight) = getimagesize($oldimage_name);
$width = $height = 300;
$image = imagecreatetruecolor($width, $height);
$image_src = imagecreatefromjpeg($oldimage_name);
imagecopyresampled($image, $image_src, 0, 0, 0, 0, $width, $height, $owidth, $oheight);
$blue = imagecolorallocate($image, 79, 166, 185);
imagettftext($image, $font_size, 0, 68, 190, $blue, $font_path, $water_mark_text_2);
imagejpeg($image, $new_image_name, 100);
imagedestroy($image);
unlink($oldimage_name);
return true;
}
?>
to use
<?php
watermark_image('Path to image to watermark', 'Path/Name to save the new image as');
?>
Mobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com
<?php $font_path = "arial.ttf"; // path to font file, download one $font_size = 30; /// font size $water_mark_text_2 = "My Watermark Text"; // watermark text function watermark_image($oldimage_name, $new_image_name) { global $font_path, $font_size, $water_mark_text_2; list($owidth,$oheight) = getimagesize($oldimage_name); $width = $height = 300; $image = imagecreatetruecolor($width, $height); $image_src = imagecreatefromjpeg($oldimage_name); imagecopyresampled($image, $image_src, 0, 0, 0, 0, $width, $height, $owidth, $oheight); $blue = imagecolorallocate($image, 79, 166, 185); imagettftext($image, $font_size, 0, 68, 190, $blue, $font_path, $water_mark_text_2); imagejpeg($image, $new_image_name, 100); imagedestroy($image); unlink($oldimage_name); return true; } ?>to use
<?php watermark_image('Path to image to watermark', 'Path/Name to save the new image as'); ?>
i has post this uploader file. can you please solve this issue with image and thumb, i mean i want to have watermark on main image and thumbs as well.
Attachments:
upload.txt
unlink($oldimage_name); will delete the old image
Mobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com