Re: Image Bank with php & mysql!! ??!!
| From: | Hugh Bothwell | Date: | Mon, 30 Jul 2001 13:14:07 +0000 |
| Subject: | Re: Image Bank with php & mysql!! ??!! | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-10898@lists.php.net to get a copy of this message | ||
"Koutsogiannopoulos Karolos" <k.koutsogiannopoulos@ideal.gr> wrote in
message news:9FF400760CD3D311B3B000A0C9D440BC9688A0@exchange.internal...
> I wan't your opinion regarding a program i am constructing. It is about an
> image bank for graphic studios or anyone else who needs a program that can
> insert his pictures or descriptions of it and be able to make a fast and
> reliable search.
http://www.hotscripts.com/PHP/Scripts_and_Programs/Image_Galleries/more2.htm
l
> What would be best.? Inserting the pictures in the DB or in the file
system
I would keep the image name in the database; save the original image
in a dedicated directory with a numeric name like 4920185.jpg and
then the thumbnail either with a suffix (like 4920185b.jpg) or with the
same name in a thumbnails directory; store the number as the picture ID.
The numbers should be large and pseudorandom, ie you don't want
to make it easy for someone to write a script to leech all your
pictures (it'll still be possible, but harder). Maybe use the database
ID to seed a random number generator, and use the Nth generated
number?
Have a text field for keywords, a text field for description,
a price field?, the author's name, email, and homepage. If you put
the image directory below the web root directory, then the images
can only be accessed via a script, and you can restore the original
name at download (this solves the problem of name collisions).
If you're going to sell the pictures, you should allow a buyer more
than one download, in case they screw up or accidentally delete
it on their system; I would have a table for 'current purchases' with
a buyer ID and picture ID, and allow them something like access
for a week, up to 20 downloads of that image.
> ? Also notice that it is a reference db and not an actual bank. I mean
that
> there will be only photos of low quality and not the full picture which
> could be very large.
(shrug) as above, keep the images in the filesystem; then it
doesn't matter how large it is.