At 3:05 PM -0400 10/29/10, Gary wrote:
I am trying to get the watermark to work, however I am having a problem in
that the image is being called from a database (image sits in images file).
The script in question is this
$image = imagecreatefromjpeg($_GET['src']);
However it produces an error message of
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: Filename
cannot be empty in /home/content/a/l/i/alinde52/html/imagesDetail.php on
line 233
I have tried various methods, for example: ($_GET ['images/'] or ($_GET
['images/$row_WADAimages["image_id"]].
Can anyone shed some light on this for me.
Thank you
Gary
Gary:
Several things.
1. Getting an image from a database? You mean that you are getting
the path of the image in the file system, right?
Side note: You could place the image inside the database using a BLOB
and do away with the path all together. That has the benefit of being
portable -- you simply move the database to where ever you want it.
The downside is that the database becomes very large, but no more so
that the file system. There are pro's and con's in storing actual
images in a database.
2. Using a GET is not the way to get the path. Instead, you have to
retrieve the path from the database table where the path is stored --
and that requires a MySQL query similar to "SELECT * FROM <database>
WHERE id=<whatever>". There are lot's of examples of how to pull data
from a database.
3. After getting the path, then you can create the watermark like so:
http://webbytedd.com/b/watermark/
Hope this helps,
tedd
--
-------
http://sperling.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php