Closed Thread
Results 1 to 9 of 9

Thread: best way to store photos ?

  1. #1
    alrazy1 is offline Learning Programmer
    Join Date
    Feb 2010
    Posts
    38
    Rep Power
    0

    best way to store photos ?

    hello guys, i am wondering what is the best way to store photos ?,

    is it in a mysql table by using blob field ?

    is it by placing it in a directory and maybe using mysql tables to store links to that directory and photos files names but then i have to be sure i have deferent names in one directory....?!!

    i have read that its not good to store photos in directories because the maximum number of files in one directory is limited is that true ?

    what is the proper and pro. way to store photos and there thumbnails ?
    and how to produce a thumbnail from a givven photo is there a ready made tools and do we have to store it too in a database or just to generate it dynamically ??
    there is lot of questions in my mind...lool !!!!
    thanks.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    tossy's Avatar
    tossy is offline Programmer
    Join Date
    Aug 2008
    Posts
    199
    Rep Power
    14

    Re: best way to store photos ?

    I store all my photos on DVDs and CDs I would look at Staples, Wal Mart, and Target. You might be able to get them on sale at Best Buy. The price of writable DVDs has come way down, so you can get a pack of R+ for $20.
    Microsoft: "You've got questions. We've got dancing paperclips

  4. #3
    ChrisBie is offline Newbie
    Join Date
    Mar 2010
    Posts
    4
    Rep Power
    0

    Re: best way to store photos ?

    I assume that you are making a website.

    Storing data in database is easier to maintain.
    For thumbnails you can use ready scripts like:
    How to Create Thumbnail Images using PHP

    And, yes, if you would want to store them in files you'd have to assure that filenames are unique.

  5. #4
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: best way to store photos ?

    There is not a specific way your suppose to store photos. I have stored some photos in a database but that can get memory consuming... I think some databases use up to 4 copies of data to make it go so fast.

    I saw an icon website who had all their icons in one directory, however I am sure it was maintained by a database.

    When I'm just making a website the images are rarely over 50 I just throw them in a /images/ directory.

  6. #5
    alrazy1 is offline Learning Programmer
    Join Date
    Feb 2010
    Posts
    38
    Rep Power
    0

    Re: best way to store photos ?

    thank you for the help , i am wondering also if i have to store a thumbnail for each photo in a separated table or just generate it by using some php code ?
    also i am wondering what is faster to pull a photo from a database like mysql or from regular file system dir.... ?
    if i store all my photos in tables/database isnt the database would be too much big and slow because i will need to do queries and thumbnail calculations for each photo...is there a way to cach the table results and thumbnails to the hdd....?

  7. #6
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: best way to store photos ?

    The speed depends on how many you have in there. If you have a lot I'd just stick to a directory. If you wanna do a database since the thumbnail goes with the original image I would have a table like "id, display_name, photo, thumbnail" and save accordingly. If you want a directory system with a lot of photos I'd probably suggest while uploading rename it to the current date time (e.g. photo_03-03-2010_09-40-13.jpg) and then appending a "_thumb" before the ".jpg".

  8. #7
    alrazy1 is offline Learning Programmer
    Join Date
    Feb 2010
    Posts
    38
    Rep Power
    0

    Re: best way to store photos ?

    BlaineSch oK but what if you have 50,000,000 photos where and how we should store them and how we should create there thumbnails and do we have to store also there generated thumbnails and where .... ???!!!!
    and i am wondering also why should a mysql be a heavy thing on the webserver memory ??
    is it because of the huge tables/database or because the database will have to execute too much queries and the mysql server will consume lot of memory??? so what also if we store the same photos quantity in a regular directory then the file system operating system will consume the same load of memory to find or open any photo file *.jpeg for example !!!??????
    please let us know what is the best method to store our photos ?? maybe its a hybird of both the mysql and file system and some php code that help coordinate between the two ??
    i think its a confusing issue ???
    for example what is better ?
    if we have 10000000 photos ?
    to store them all in one mysql with deferent id's and categories ......?
    to store only there location in a file system in a mysql and to force a unique files names ??
    .............
    lets discuss all this....together

  9. #8
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: best way to store photos ?

    For a lot of files (which that is) I would store them in a directory with a unique name... hopefully they already have it. Depending on what your doing I probably would suggest putting the file locations in a database.

  10. #9
    alrazy1 is offline Learning Programmer
    Join Date
    Feb 2010
    Posts
    38
    Rep Power
    0

    Re: best way to store photos ?

    yes but storing your photos in a directory has a major disadvantage , becase all operating systems or file systems has a limit for the number of files in one directory i think its 65000 in windows......
    so what you will do when you have 65001 photos ??!!!
    isnt mysql is better because of that ??? maybe we should use some third party mysql catching objects or engine to reduce the mysql usage of both memory and processor ?????!!!!!!
    please advice.... i am not 100% sure what i should do....what is the best correct direction.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Delete all photos on a machine
    By CtownNightrider in forum General Programming
    Replies: 6
    Last Post: 01-07-2010, 04:41 PM
  2. Reconstruction of human head 3D model by photos
    By eXcept in forum General Programming
    Replies: 1
    Last Post: 02-17-2009, 08:32 AM
  3. Downloading photos from my remote server on to my PC
    By Roopa2332 in forum Database & Database Programming
    Replies: 2
    Last Post: 11-25-2007, 09:44 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts