Hi,
I've been brainstorming for a while now about the proper way to store images uploaded by users. Optimisation is a big issue here and I'm looking forward to find a pattern to store images so that they would be accessible easily in the future.
First of all any image would be processed to create several thumbnails respecting different sizes, like 100x100 200x200 etc..
so any image is in fact 4 to 5 images named respecting the same convention {image-name}_{size}.jpg
Now for the most important part, how to store it, and by "how" I mean what directory architecture ? what database setup ?
Is it proper to create a directory for each user, like (...)/images/{user_id}/{image_name}_{size}.jpg or having multiple directories depending on users id is too much trouble ?
Is it better to create a directory for every category of images like profile_pics/ , banner and store any image referring to that category in there ?
I assume than storing every images in the same directory would turn rapidly into hell, so have any of you any thought of what would be the best directory architecture ?