Re: Images and MySQL - please help
| From: | hugh danaher | Date: | Wed, 17 Apr 2002 09:17:49 +0000 |
| Subject: | Re: Images and MySQL - please help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-93307@lists.php.net to get a copy of this message | ||
It should be possible to do exactly what you want using the image functions
in php. You can get an image add text and then save the image in a
directory (or database I guess). Because adding a "stamp" takes
milliseconds, why not just do the operation when it's needed and erase it
when you're done. this way, you need only one database.
The bare bones of it would look something like this:
<?php
header("content-type: image/png");
$image=imagecreatefrompng("./images/xymap.png");
$font="fonts/arial.ttf";
$x="100";
$y="100";
$red=imagecolorallocate($image,255,100,100);
imagettftext($image, 8, 0,$x, $y, $red, $font, "text");
imagepng($image,"./images2/xvmap.png");
ImageDestroy($image);
header("location: map.htm");
?>
Hope this helps,
Hugh
----- Original Message -----
From: "DrTebi" <drtebi@yahoo.com>
To: <php-db@lists.php.net>; <php-general@lists.php.net>
Sent: Tuesday, April 16, 2002 11:11 PM
Subject: [PHP] Images and MySQL - please help
> Hi,
> I am trying to do this:
> - I have an image stored in database 'A'
> - a php script should load this image, and "stamp" it with a watermark
> - then the php script should save the new image (with the watermark)
> in database 'B' ...
>
> How can I do this? I guess somehow I have to buffer the output, manipulate
> the buffer by adding the watermark, and then "insert" the image into the
> database.
>
> Is this possible? Any ideas?
>
> Thanks!
> DrTebi
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>