views:

43

answers:

2

I am building a Photo centric website. I wanna learn how to store photos on disk as well as database. diff sized thumb nails.. etc. Can some one guide me with the same ?

+3  A: 

Look at imagemagick. Oh - And you shouldn't store images in a database. Use a file on disk, possibly with a name generated from an id in the database.

troelskn
Good answer. Imagemagick is certainly the way to go. If your database is getting really huge think about your file organization on disk. You maybe want to store files in different directories, not all in one.
GorillaPatch
:( i was asking about the organisation on the disk itself :(
Harsha M V
Any suggestion on reading on how to organise photos on disk
Harsha M V
I don't understand what you mean by "organise photos on disk". Stick them as files in a folder, and name them from an id in the database.
troelskn
i was asking on the best way to oraganise the folders. since a single image will have 3-4 versions in different sizes.
Harsha M V
A: 

I found this to work for me

The best way to Organise photos for a web app is

  1. Either Store the File names Seo friendly or use a UUID
  2. store the original photos at one place just incase u plan to change the layout and need to resize them to different sizes
  3. Make seperate folders for differnt image sizes like 200x400, 150x150 or xlarge, large, medium, small etc.
  4. store the respective images with the filename u chose from step 1 as it is. no need of renaming it.
  5. referencing is much easier. all you have do is. refernce a file and make sure its from the correct folder.

Thanks Santosh for helping me out.

Harsha M V