Page 1 of 1

Image Handling

Posted: Tue Oct 21, 2008 10:51 am
by Theory?
So I was reading this tutorial on Spoono about storing images in a database using Base64 encryption, but I was just wondering a few things. Does anyone know if this is an effective means of doing image persistence? I'm trying to build an image gallery for my girlfriend's website, she does photography and needs a portfolio site. They say on the site that it's good for using on avatars in forums, but I'm wondering if this is an effective means to persist large images that need to be accessed in bulk. It seems like this method would be cumbersome for this application and also slow. I had planned to simply store the locations of uploaded images into the DB and recall them that way, but if this is truly a more effective means to do this then I will.

Or maybe there's a better way?

Re: Storing Images in a Database

Posted: Tue Oct 21, 2008 10:58 am
by onion2k
Store the location of the file and put the image in the filesystem as you'd planned originally. It's a lot quicker and easier to do that than accessing them from a database.

Re: Storing Images in a Database

Posted: Fri Oct 24, 2008 8:44 pm
by josh
The reason its good for avatars on forums is you can limit avatars to something like 32 kb or 64kb, even then I'd put them in a separate table than the user table itself used for normal user operations. Then you could avoid file system image storage with reasonable performance hits. For a photography site I'd definitely use the filesystem and only store the photos meta data in the database

Re: Image Handling

Posted: Thu Oct 30, 2008 9:46 am
by Theory?
Thank you both. That was really helpful.

Now, here comes part two. I was wondering what the benefits, if any, would be to designing the gallery using XML instead of an RDBMS, or hell, maybe in conjunction with one. I figured using an XML doc to store the image location and all the EXIF metadata would give me greater flexibility for displaying the information, especially when it comes time to reuse this system in a different project. I did some research and so far I've found that most people who take this approach end up using Flash to display the images, which makes sense, but this project doesn't call for Flash, so maybe I could do a neat little Ajax type presentation.

Anyone have any experience designing a photo gallery like this?