Photo Album Tech Specs#

Just a quick rundown of how the photo album is implemented... Basically you have a hierarchical structure leading to a series of pictures: Collection -> AlbumGroup -> Album -> Series -> Pictures. A Picture is pretty obvious right? An Album is a set of pictures about one topic. But there's a level in between called a Series, which logically groups pictures within the same album. For instance, an album could be about one trip, and each series represents pictures taken by someone else. If there's only one series, it's not displayed to make it easier to browse the album. Now you can group these albums together in an Album Group which is basically just another higher level view. I used it to group the albums by year. The same goes for a Collection, but if you don't need this level (which I don't) you can turn it off so it won't be visible.

In retrospect, it probably would have been better to be able to define a recursive tree with arbitrarily deep nesting but well, I didn't. Maybe in a next 'version' ;-) In general, I hacked the code up pretty quickly so it's all not that pretty I'm afreaid (meaning: I won't open source it :-) )

Now for the implementation: it's a single ASP.NET custom control which uses an xml file to define the hierarchy explained above. Each level has some properties like title, description, date, keywords (not used yet), the path of how to get there, the thumbnail to be used and the security roles which are allowed to see this item. ("What, I can't see everything?!" - uhm yeah that's right :-p ). Some other advanced features: thumbnails can be created on the fly and cached on disk, and the date and time the picture was taken can be extracted from the EXIF meta data stored in the file. This all happens on startup of course, not on every request. The security aspect uses the current principal to define which roles it has - and that's where it plugs nicely into dasBlog because if you're logged in it sets that current principal automatically with the role defined in its configuration file. This means I can hand out individual logins on my blog to people I trust not to send the secret pictures around ;-)

Now of course, you're not supposed to enter every single picture in the xml file because well - that would take forever in my case... It can use filters (like *.* or *.jpg) to add all files in a directory. And the other levels (series, album, ...) will also be filled in automatically from the directory structure if you don't specify anything yourself.

I'll probably expand the photo album some more later on. As I mentioned I want to do something with keywords so you can search for pictures or have an alternative index like the cross reference on Mark Pilgrim's excellent photo album (this is where I stole the idea of course). Implementing it wouldn't be so hard actually, it's more a perseverance test to see if I could keep up adding keywords to each and every picture...

For now, there are two minor bugs I know of... If there's an album with one series, then the series won't be displayed as I mentioned before. But it will show up in the breadcrumb (navigation) above. I'll probably fix this sometime. The second one is trickier: when you're browsing the photo album, each level displays how many items are below it. For example: there are 3 albums in 2000, or 11 pictures in a certain series. Well that's certainly true but if you go look into it, it may actually be less depending on your security role. So if you see less pictures than expected - then you know you're missing out on something great :-) I could fix this too but it would have a runtime performance penalty.

Anyway, that's pretty much all there is to it I guess. All comments and suggestions welcome of course!

Comments are closed.
All content © 2012, Jelle Druyts
On this page

Recent Photos
www.flickr.com
This is a Flickr badge showing public photos from Jelle Druyts. Make your own badge here.
Advertising
Top Picks
Statistics
Total Posts: 350
This Year: 0
This Month: 0
This Week: 0
Comments: 530
Archives
Sitemap
Disclaimer
This is my personal website, not my boss', not my mother's, and certainly not the pope's. My personal opinions may be irrelevant, inaccurate, boring or even plain wrong, I'm sorry if that makes you feel uncomfortable. But then again, you don't have to read them, I just hope you'll find something interesting here now and then. I'll certainly do my best. But if you don't like it, go read the pope's blog. I'm sure it's fascinating.

Powered by:
newtelligence dasBlog 2.0.7226.0

Sign In