Extending Windows Live Photo Gallery

Ah yes, readers, more talk about the photo gallery.  If you find this boring, you can go read about the Super Bowl bound Arizona Cardinals (I feel like I've entered another dimension as I type this).  Anyway, I rambled blogged about my digital photography workflow back in October and mentioned that Microsoft was working on a new release of their Live Photo Gallery.  I re-imaged my laptop a couple of weeks ago; because of this I had to get the newer version.  And so far, I like it even better than I liked the older version!  The biggest new feature with the latest version is people tagging.  This is something that may be familiar to Facebook users out there, but it was pretty new to me as a feature for a desktop application (I had used it in Facebook).  I started playing with it, and liked it almost immediately.  The auto-detection of faces probably needs some work - the software didn't recognize a lot of faces in my photos, but it does make it easy enough to tag people despite this. 

Thanks to this new feature, I have found that I can tweak my workflow a little bit.  Previously, I had been adding people in a photo as a "descriptive" tags - obviously there was no other way to tag them before this new version.  With the new version I have found that it is more useful to add people tags and remove people's names from the "descriptive" tags.  It just makes more sense within the confines of Live Photo Gallery.  However, there is one minor issue with regards to my workflow... Flickr auto-detects the descriptive tags when I upload pictures, but ignores the people tags.  And, of course, I do like my Flickr photos to have peoples' names in the tags.   So what do I do to get around this limitation?  Enter the plug-in architecture for Live Photo Gallery.

The other awesome feature of the new photo gallery is the ability to write plug-ins.  As it turns out, writing a Flickr plug-in was dead simple... there already was a sample plug-in available from Microsoft!  So, I downloaded this sample source code, compiled it, and tried it out within Photo Gallery.  First thing I noticed with this sample code that it fixed a bug from the "Publish to Flickr" option that was already part of Photo Gallery!  As I mentioned in my workflow post,

Unfortunately, that option has a bug - it enters the picture title into the Flickr's description field, and Flickr's title field is left with the picture's file name.  Until that is fixed, I need to use Flickr's website or Uploadr tool to upload the pictures. 

It seems to be that the latest version of Photo Gallery keeps this bug, but the sample code fixes it.  Go figure!  Anyway, I decided to play around with this sample code to see if I could take the people tags and add them as descriptive tags for Flickr.  Thanks to the source code for LiveUpload to Facebook, I was able to figure out the people tags pretty easily.  LiveUpload to Facebook keeps the people tags intact since it is supported in Facebook, and I do highly recommend it for Facebook users who upload a lot of pictures to Facebook photo galleries. Anyway, all I had to modify was the SessionLoadItemInfo method in the XmlHelper.cs class. 

    element = node.SelectSingleNode("KeywordSet") as XmlElement;
    if (element != null)
    {
        XmlNodeList list = element.SelectNodes("Keyword");
        if (list != null)
        {
            foreach (XmlNode keyword in list)
            {
                tags.Add(keyword.InnerText);
            }
        }
    }
    // JHunt - Add people tags as standard Flickr tags
    element = node.SelectSingleNode("PeopleRegionSet") as XmlElement;
    if (element != null)
    {
        XmlNodeList personTags = element.SelectNodes("PersonRegion");
        if (personTags != null)
        {
            foreach (XmlNode person in personTags)
            {
                string[] personNames = person.InnerText.Split(' ');
                string personName = personNames[0];
                // Use only the first inital of the last name for uploading to 
                // Flickr - this is for privacy.  This method isn't very robust 
                // since it does not account for people with two first names (
                // ie Billy Jean), but it does work for me
                if (personNames.Length > 1)
                {
                    personName += " " + personNames[1].ToUpper()[0];    
                }
                tags.Add(personName);
            }
        }
    }
    // End people tags enhancement

I haven't tried it out on a large scale, but it does look like I can use the sample code as my upload mechanism of choice for Flickr... I won't have to use the web interface for the uploads at all.  And, thanks to this ability, I can now use people tags instead of descriptive tags for the people in my photos.  After using the new Live Photo Gallery for the last couple of weeks, I think this is definitely the way to go.  Obviously, this enhancement isn’t very robust at all right now.  It does remove most of the person’s last name for privacy, but doesn’t account for public figures in a picture (for example, it would tag a photo “Barack O” instead of “Barack Obama”).  And, of course, it doesn’t account for a person with multiple first names.  It does meet my needs since I don’t know anyone with multiple first names, but I may work on accounting for these cases. 

Possibly Related Posts

  1. Digital photography workflow
  2. New photo gallery
  3. Considering an mp3 player

Comments are closed