views:

138

answers:

1

I am wondering if including image thumbnail information in the model makes sense. Like specifying what sizes of thumbnails you would like to be created. Thumbnail directory. Etc.

Also when working with thumbnails and a database, Is it advisable to store all created thumbnails as new records in the database. Say you have Image record would you then create a one-to-many to Thumbnail records?

+1  A: 

I think its the "right" way to do it, if you wanted to go down the route of storing all the thumbnails in the database for whatever reason (maybe you need to store data with them all?).

Personally, I've always found naming the files according to some scheme such that they can be worked out from the primary key of the image record and the size is good enough.

benlumley