Re: Watermark with GD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 9:19 AM -0400 10/31/10, Gary wrote:
I was sure that the images were being stored and called from the images
folder and not directly from the DB, that is until tedd brought it up.  I
did have an issue of getting the images to show in the beginning, however I
solved it by inserting the path in the call from the DB.  I am wondering now
if they are stored in both locations.

Gary

Gary:

Both locations? I think you are confusing yourself.You either have the images stored in the database OR the file system, but not both.

However, I think you have the images stored as files within the file directory, such as:

http://yourdomain.com/images/picture1.jpg

Now, in your database you should have only the path name stored (i.e., images/picture1.jpg) and not the image. However, I usually only store the file names and NOT the path. That way I can move the images to where ever I want and only change their reference in the HTML.

To recap, to show any image you use the HTML img tag, such as:

<img src="images/picture1.jpg">

To tie this statement to a database, you need to pull out the image name (or file path) from the database and use that. Something like this:

$query = "SELECT file_name FROM pictures WHERE id = '$id' ";
$result = mysql_query($query) or die();
$row = mysql_fetch_array($result);
$file_name = $row['file_name'];

And then in the HTML you would use:

<img src="images/<?php echo($file_name);?>">

If you can get to this part, then we can deal with placing a watermark on the image before showing it.

Please let me know when you get this part to work.

Cheers,

tedd

PS: There is no need to use a LONG BLOB in your database -- that's just a waste of space.

--
-------
http://sperling.com/

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux