Singleshot development

After months of inactivity, I finally got back to working on Singleshot this weekend. Following up from my last work experimenting with virtual items, I revamped how dispatching works. All requests (except for cached image requests) now go through a single CGI entry point. sscgi.py now dispatches to an action handler named action_name.py where name is ‘view’, ‘resize’, etc. I also added rules in the .htaccess file to dispatch requests for paths that do not exist as files or directories to a ‘virtual’ action handler. The virtual action handler now handles the by-tag requests I defined in my last session. I’ve been unhappy with Singleshot’s use of Cheetah for a long time and have been experimenting with simpleTAL as a replacement. The CVS HEAD still has the code for the Cheetah templating but uses simpleTAL and some newly defined templates.

I rearranged the image processing (resizing) a little and defined a way for the PIL-based image processor to have apply filters (loaded from singleshot/filters/name.py). The idea is one could define a filter that added a border (or even more complex filters) and use Singleshot to automatically apply and cache various sizes of it.

I ran into an annoying apparent-bug in PIL’s ITPC processing where it would only yield the first keyword from a file. This was a serious roadblock in my plan for using keywords to drive categorized albums in my web photo gallery. I spent some time confirming PIL was misbehaving for me, checked the next version’s ChangeLog for any mention of fixing this problem, and then decided to try to use XMP.

After a futile search for easy to integrate XMP-reading code for Python, I wrote my own crude parser so I could read XMP in Singleshot. I need to go back and unify the view of the various forms of metadata Singleshot can now read out of JPEGs (EXIF, ITPC, XMP). It still might be nice to figure out the problem with PIL’s ITPC keyword reading, but I no longer need to do so to proceed.

This seemed like a good place to checkpoint to CVS and consider my next steps:

  • Figure out how I’m going to define my hierarchy of virtual albums layered on top of Singleshot’s view of the filesystem.
  • Come up with some way to add context to an image view, so it’s possible to still navigate next/prev when viewing an image from the by-tag page.
  • Decide once and for all if I’m going to try to wedge pagination into Singleshot 2.0 .. and if so, how.