Gallery work

Posted Posted 2/8/2010 10:06:19 PM

Over the past couple days, I've allocated a whopping half hour to a little work on the Gallery. I added a second folder ("Subsequent") of what the lab (read: "Living Room") looks like since I got bored and rearranged it a week or three ago, enhanced the image to display the first image by default instead of a blank image (which of course looked like an error, as it resolved to a tag like <img src="" />. Now I'm thinking I might want to change things up and pick a random image instead. Like I'm doing now with the taglines at the bottom of every page (look now).

Added filemask to pic lookups to remove Windows thumbnail files (i.e. thumbs.db), and enhanced the Tree so it fully expands to level n-1, where n is the maximum level of a given tree substructure. That is to say, it will fully expand all directories that have subdirectories, but will not expand a directory that contains only files.

The code for that last part was really simple, for the recursion-inclined:
 private void ExpandNonLeafNodes(TreeNode tn) {
  foreach (TreeNode tn2 in tn.ChildNodes)
   ExpandNonLeafNodes(tn2);
  if (Directory.Exists(tn.Value) && Directory.GetDirectories(tn.Value).Length > 0) tn.Expand(); else tn.Collapse(); }

I think this framework will work well for organizing my public-facing showoff pics, such as my many panoramas (which I haven't taken many of lately... not sure why... Probably because I've seen and recorded panos of all the touristy stuff in the Colorado Springs area... but I digress). Will endeavor to put some of the better ones up on the Gallery.

Next up: Automatic thumbnail generation. Currently it just resizes the existing files to fit the size I want them to fit, but I'd rather it automatically create a thumbnail pic of a digestable size (i.e. 800x600 or so) and use that for the display copy. As always, pics are clicky.



Project Codename MV8
Copyright © 2010 Kevin Connolly. All rights reserved.
Your request ate 39 of my milliseconds.