views:

16

answers:

1

What's the best-practice method of storing a user's uploaded pictures and it's corresponding thumbnails. I noticed Flickr uses filename distinctions like: http://farm5.static.flickr.com/1234/789456123a_s.jpg where _s.jpg describes the size of the image (_s.jpg = small, _m.jpg = medium...). However, does storing images like the following make sense?

/images/123456.jpg /images/small/123456.jpg /images/medium/123456.jpg

...therefore, it's easy to access different sizes by simply pre-pending the folder-size name

+1  A: 

Whatever works for you - pick a scheme and stick to it. As long as you're consistent, and document what you do, you should be fine.

tdammers
Thanx. Do you think it's necessary to add thumbnail information to the database? Or, is it enough to know the path to the original and then pre-pend folder names to get its thumbnail?
Andres
Depends on the scheme you pick, but generally, I'd prefer a scheme where the path and filename of the thumbnail can be deduced from the original filename, and doesn't need to be stored explicitly. Avoids redundancy.
tdammers