please help me to add watermark on images nd thumb
watermark, please help me to add watermark on this programming. please urgent
Collapse
X
-
watermark, please help me to add watermark on this programming. please urgent
Last edited by manavworld; 30.12.12, 17:03. -
PHP Code:<?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;
}
?>
PHP Code:<?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
-
Originally posted by kevk3v View PostPHP Code:<?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;
}
?>
PHP Code:<?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.Attached Files
Comment
-
unlink($oldimage_name);
will delete the old imageMobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com
Comment
Comment