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>

Recommended Answers

All 4 Replies

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.

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);
};
?>

its k... but i want to do it in kohana php? thats it...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.