0

Hi to all,
I am developing web application in kohana php farmework. I want to do water mark image in this application. There is no library available in kohana php for this issues.. Checked in plain php. Its working well. but that same function not working in kohana framework php. Its printing the current url. Please help to fix this issues soon

Thanks
saran
<snip>

Edited by ~s.o.s~: Snipped fake sig

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by saranraj.cmr2
0

Hi to all,
I am developing web application in kohana php farmework. I want to do water mark image in this application. There is no library available in kohana php for this issues.. Checked in plain php. Its working well. but that same function not working in kohana framework php. Its printing the current url. Please help to fix this issues soon

Thanks
saran
http://careerjobz.com

Can you explain how you water mark an image with plain php? Always thought you needed GIMP or Photoshop to do this. Really want to know how you can do it with php only.

0

Hi.. just run this code.. u need to include the image and arial.ttf font file.. i twill work well...
<?php

$SourceFile = 'saran.jpg';
//$DestinationFile = 'car.jpeg';
$WaterMarkText = ' Careerjobz.com';
watermarkImage ($SourceFile, $WaterMarkText, $DestinationFile);

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, 200, 370, $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);
};
?>

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.