I am working on a database design for a basic photo gallery which each user can upload several images.
Right now here is what I have:
photo_gallery
photo_id - image - sort_order - user_id
1 - test.jpg - 1 - 1
2 - another_photo.jpg - 2 - 1
And then on my folder structure I would create a new folder like so: images/photo-gallery/ and store the images in there. Now, should I create a folder for each user_id and store their specific images in that folder/
So in this case: images/photo-gallery/1/test.jpg and all of user 1's photos will be there?
Also for re-sizing, I am thinking about using smart image resizer so I can just store the original photo, and if I want to resize it to a certain size, I can just call it using the script like: /image.php?width=200&height=200&image=test.jpg.
Should I be hashing these file names? Am I missing anything else? Any suggestions on how to improve this?
Thanks!