tedd wrote:
At 12:04 AM -0700 5/11/09, Michael A. Peters wrote:
That site is also coded in php so I'm guessing that the watermark is added using a php technology.

Can someone enlighten me on how that is done?

Also, while not php related, could someone enlighten me of a really good font to use for watermarking images?


Here's an example with code:




This is what I'm doing, it seems to work -

imageantialias($im, true);
$string="© " . $somestring;
$lbox=imageftbbox($fontsize, 0, $text_font, $string);
$color = imagecolorallocate ($im, 255,255,255);
$bcolor = imagecolorallocate ($im, 0,0,0);

imagefttext($im,$fontsize,0,($xcord - 1),$ycord,$bcolor,$text_font,$string);

imagefttext($im,$fontsize,0,($xcord + 1),$ycord,$bcolor,$text_font,$string);

imagefttext($im,$fontsize,0,$xcord,($ycord - 1),$bcolor,$text_font,$string);

imagefttext($im,$fontsize,0,$xcord,($ycord + 1),$bcolor,$text_font,$string);


header ("Content-type: image/jpeg");

where $impath is the filesystem path to where image is stored, $xcord is x coordinate, $ycord is y coordinate.

It does it very nicely.
(I changed font to helvetica - it seems to work a little better for this than lucida mono, largely because it isn't monospace).

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to