views:

22

answers:

1

Hi ,

I'm going to design a database for an image gallery in ASP.NET Web App . Because of some reasons I've decided to store the image in Data Base , Not the address .

In the application i need two or more different size and weight image for each image that the admin insert .For instance , One of them is small and lightweight thumbnail , and the other is Original big one .

My question is : Should i have two column ( one for lightweight and small thumbnail and one for big and full size one ) in DataBase Or Is there any way i could load different size and wight image from Big and original image column ?

Hope i could get it across .

Thank you

+2  A: 

Though you have decided to store image in database it is really bad for performance so please use some caching.

Now answer: YES you can scale down original image to show a thumbnail but if your user does not need to view each original image for which thumbnail is shown you may be burdening db server to get full image. In this case storing both thumbnail and original will be better.

If you show full image for every thumbnail then you can simply download full image and get thumbnail from it. To get thumbnail use this function:

Image thumb = fullImage.GetThumbnailImage(50, 50, null, new System.IntPtr());
TheVillageIdiot
@TheVillageIdiot: Thank you , I decided store image in DB Because of this article , http://research.microsoft.com/apps/pubs/default.aspx?id=64525
Mostafa
@Mostafa: Jim Gray's paper you refer is a great paper, but it refers to accessing a BLOB from a database client. In case of ASP the image is actually accessed from a web client and has to be proxied through by ASP, something not taken into account in the "To BLOB or Not to BLOB" paper. Because of this, for WWW apps is in egenral more efficient to store the image in the file system and return a link to the image, so that the image download goes straight to the file, bypassing all ASP processing.
Remus Rusanu