Alpha release of the SmugMug Image Handler

I have spent the last couple days testing and using what I call the “Smug Mug Image Handler”. The code is still what I would consider Alpha release quality but it does work :) What is the SmugMug Image Handler? It’s a .NET Handler page that loads image data from SmugMug (via their API) and displays it as an image on your site. (See the previous post for reasons why I started working on this.)

Here are the current features implemented:
  • Ability to load images from Smug Mug using the Smug Mug API.
  • Support for loading all of the currently supported image sizes.
  • The Handler attempts to block “Image Hotlinking” using a white list referrer mechanism. The code allows only NULL referrers or domains which are on the white list to load images with the handler.
Here are a few of the known issues:
  • The code only supports jpeg images.
  • The referrer mechanism/”hotlink protection” (mentioned above) may be overly protective. I am still looking at the right way to solve this issue.
  • The code does not use any filesystem caching at the moment. If your browser didn’t cache the image data then it’s loading the content fresh from SmugMug each time.
  • The code only supports login via password hash at the moment. I will add login with username/password if people need this.
Interested? Great – here is what you need to know to use the code.
  1. The code is licensed under the BSD license.
  2. To use the code you must add the following items to your web.config file:

    <add key="SmugMugPwdHash" value="" />
    <add key="SmugMugUserID" value="" />
    <add key="SmugMugApiKey" value="" />
    <add key="ImageHandlerReferrerWhiteList" value="yourwebsitegoeshere.com|google.com|bloglines.com" />

  3. Each key should be fairly self explanatory. Please note that the WhiteList key values must be separated by a “pipe” symbol “|”
  4. The Zip File contains a web.config file. You can safely delete this and just add the keys above to your own web.config. I left the web.config in the zip just for demonstration purposes.
  5. To use the Image Handler you specify the image options via a query string:

    ImageHandler.ashx?imageid=[imageid]&imagekey=[imagekey]&size=[size]

    Size can be one of: tiny, thumb, small, medium, large, xlarge, xxlarge, xxxlarge, original

You can download the current code here. Please use at your own risk – as mentioned above this is not release quality. I would appreciate any feedback you have if you end up using the code!

Playing with the SmugMug API

I have been toying with the notion of having SmugMug power the “gallery” needs I may have as a photographer. This leaves me with a problem though. How do I host images at SmugMug and also at this blog without having duplicate copies in both places. Ideally I would like to solve this without turning on external links to my images. I spent some time this weekend working on a solution. I have created a .net handler page that loads the image content from SmugMug (via their API) and displays it here.

Example:
Homestead in Eastern Montana

As soon as I can test this a bit – I will release the code here on the site for others to use and enjoy :)


- Jason

7 (+) Years late to the party

The Title for my first post says it all. I am a bit late to this whole “blogging thing”. The question I am sure you’re asking yourself is why start a blog now? It’s a great question. My honest response is that I have been thinking about doing this for years but for one reason or another I just never seem to find the time. I know – that doesn’t answer your question though.

Why start a blog now?
The answer to this question is found in a few needs/wants I have in my life right now. You could call these my goals with this blog:
  • I need to find a voice other than what I explore in my professional life.
  • I want to share my passion about photography and I want to dialog with other people that share this passion.
  • I want to find additional ways of sharing my photographic work. This sounds similar to the previous item; however I feel these two goals are distinct. Sharing my passion means sharing and dialoging about the “art” of being a photographer. Sharing my work means sharing the product of what I am currently working on.
Now you know “why”. Let me explain the “what”. What should you expect from this blog?
This is also a good question. There are two areas of my life right now that I am very passionate about; Development and Photography (or Photography and Development). I want to use this blog to explore photography and occasionally its intersection with the development arts.

Now you know why and what to expect. Let me briefly cover what this blog is not.
This blog is not a forum for me to discuss my career or my employer. This is my personal blog. It deals with things I find personally interesting or with topics that I am passionate about.

I hope you enjoy your time here.

- Jason.