Wes Hardaker's KPhotoAlbum Modifications and Plans

Table of Contents

About Me

I'm a amateur photographer trying to turn professional. I've been shooting pictures (mostly nature) for years. If you have a moment, please browse my photographs on Captured On Earth and let me know what you think! My work on kphotoalbum is sponsored by my photographic efforts.

I'm also a coder and a hacker who believes the greatest ability of a computer, and particularly open source software, is that the user has the power to make it more helpful than when they first sat down in front of it. IE, if it doesn't do quite what you want it to? You change it!


I use kphotoalbum to manage my pictures. I mean, that's what it's for right? But… I use many other systems too. I have a web server that auto-spools images from a directory structure. I examine images in full-screen and classify them only there (since the smaller category assignment screens aren't large enough to do most quality-based assignments). I save pictures, edit a copy, and then "prefer" that one to the original (and my web system recognizes the back-ups and ignores them). I move entire sets of files around based on kphotoalbum markups and category assignments.

I want kphotoalbum to handle a lot of the external things I currently run scripts for. I want it to help me manage not just the pictures, but how they're stored on disk. Much of this is possible with small extensions to kphotoalbum. These, then, are my plans and success stories for accomplishing the few extensions that I need (not just want, but need) in order to make kphotoalbum work for me in the environment I need to operate in.

Additions to Kphotoalbum itself (or plans thereof)

These are only the proposals/patches that haven't yet been applied into the development SVN branch for kphotoalbum itself. To see a list of accepted patch, go to the next section.

TODO Single line info box?

When doing evaluation, it might be helpful to shrink the current one

Could do this in a number of ways, including a long short box, etc

Auto-movable box (e.g. into blank space as best as possible)

TODO away mode: import straight from xml later

Patches now in the KPhotoAlbum code base

STARTED Category selectors in full-screen

  • Status: Mostly complete (works well; other usability features are likely)
  • Patch: viewerbindings.patch
  • Committed in r1074974

This is done with a patch that allows category specifiers to be turned on such that typing the first few letters of a category in the full screen mode will select the category once a best match is found. It starts using the "Token" category as normal, so the current behavior is the same: type a "Token" letter and it'll assign or remove that token.

To switch categories, type a '/' character followed by the category name components (e.g. "Locations", "People", …) until a best match is found.

The top of the info box has been modified to display the current category that is accepting input once you change it away from the default category of "Tokens".

As an example, consider the following:

  • Tokens
    • A..Z
  • Keywords
    • Good
    • Bad
    • Boring
  • People
    • George
    • Fred
  • Places
    • Internet

Then typing "/k" will shift the input selection from "Tokens" to "Keywords" (since K is unique). After that, typing "g" will assign the "good" keyword immediately to the image. Typing "b" will show B{ad,oring} in the info box and typing "a" or "o" next will complete the match and assign the result to the image. Typing "/p" will work similarly and show the partial category match "P{eople,laces} so you can type "e" or "l" to complete "People" or "Places" respectively.

Support for exact entry of tokens

If you want to completely specify something, the '"' character can be used to do exact typing. End the typing with the "," key (since [ENTER] is bound to switching window displays).

This actually allows you to completely type '"Flower,' to get a completely new Keyword typed from scratch. (after which "F" or 'f' will match it).

This feature also helps if you have both "boa" and "board" defined since typing "boa" will wait for you to keep entering more text wondering if you want board. Thus typing '"boa,' will match just "boa".

Support for always starting with a category selection

If you type two '/'s in a row it will toggle between two different modes. The default mode described above and a second mode where after every match of an item within a category it'll go back to selecting a category itself. That way you can continually select both categories and items within categories if you need to constantly shift back and forth between categories. It'll still do the fastest match possible so that typing "kbo" will still match "Keywords/Boring" in the example set above.

Support for quick-key assignments

If the current input is blank (ie, you're not in the middle of selecting anything) and you hit a function key (F1-F35) or a number key from 1-5 it will assign the last matched assignment to that key. This is useful for quickly assigning quick-keys to items frequently repeating in your current set of images. It remembers both the category and the category item. These quick-keys are only remembered until the viewer window is closed.

To reset the keys you just exit the viewer and re-enter. There is no support for doing a "replacement" (ie, once it's assigned there is no way to reassign it to something else until you leave the viewer).

DONE Multiple versions of an image

I frequently need to make backup copies of images as I crop, etc, them. I always want to keep the original so I tend to leave the imgNNNN.jpg files alone and create a imgNNNN-fixed.jpg file or sometimes imgNNNN-fixedN.jpg file.

But, this brings up multiple copies of the image under kphotoalbum when I really only want to see 1 most of the time. Additionally, if the new one is better (as it should be) and the original had a bunch of annotations then I need to manually transfer them to the new image. And, my personal preference is to remove the annotations from the original copy as well because I generally don't want to find it when searching (I want to find the newer one instead).

So, to achieve this I've modified kphotoalbum to:

  1. look for modified files with a specified prefix (this is done by using a regular expression match to search for the original; thus my two entries in the configuration settings for the above would be: -fixed[0-9]*.jpg and .jpg which will tell kphotoalbum that any time it finds a file with -fixedN in it to look for the original without the -fixedN in it.
  2. Optionally copy all the annotation data from the original to the newly found modified version.
  3. Optionally remove the annotations from the original after copying them to the modified version.
  4. Optionally stack the images together so that the newer one is on top and the original is hidden in the stack.
  5. Add a new menu set for invoking an external program to make a copy first (again, this is done via regexps so that my settings to auto-produce a -fixed file are .jpg and -fixed.jpg).

The settings for all of this are placed under the general tab.

STARTED Full screen filters

Many times I want to see what a image looks like after applying some filters. The most common one would be something like converting to grayscale to see it as a black/white photograph. However, the only ways to do this in KPA by default are to save it as a B/W through the menus (destroying the original) or to use an external program like gimp to create a new copy.

This patch fixes that and adds a new "filters" menu to the full-screen viewer (right-clock on the screen to get the menu) and allows you to apply some simple filters (like grayscaling it).

other things I'd like it to do but haven't implemented

  • TODO option to save a copy
  • TODO maybe move filter code to a Filter class structure or something
  • TODO more filters

STARTED Run-any-command and self defined commands

DONE Add a menu item for "Open With…"

DONE Add a pop-up dialog with a box to enter a command to run.

  • The dialog will prompt for a command to run, which can contain a %all for a list of files to include (ie, the selections). Including a %each will cause it to be invoked multiple times, once per file.

TODO Add key bindings for frequent used commands

DONE Add a viewer function to remove the current image

One thing I frequently want to do is compare 10 pictures or so and find the best of the 10. But invariably it ends up being a choice between #2 and #8 which 5 other annoying pictures to cycle through in between. Sure, I could go back to the selection window and select only the final few I had narrowed it down to. But wouldn't it be easier to do that directly in the viewer?

So I ended up binding the "Delete" key to doing just this: remove the current image from the list of images that the viewer is currently displaying. Thus, as I slowly narrow down my choices I can remove the ones in between to allow me to toggle back and forth between what was #2 and #8 without any of the others in between.

External scripts I use for maintance

DONE kphototokenmove

  • State "DONE" 2009-02-06 Fri 15:16

This is the script I use to move images in the file space based on kphotoalbum tags. It actually both moves the files and modifies the index.xml file to rename them within it. Example usage with it's default mode of operating on Tokens and moving everything with the "G" token to the "good" sub-directory and "R" to the "rainbows" sub-directory.

> kphototokenmove -c index.xml -m G=good,R=rainbows

DONE kphotomerge

  • State "DONE" 2009-01-06 Tue 20:53

This script merges two kphotoalbum index.xml files together (usually one becoming the parent of some newer one placed in a sub-directory from pictures imported from somewhere else). I find this easier and less prone to errors than the import/export features of KPhotoAlbum itself. It's also a gazillion times faster. Plus or minus a gazillion.

DONE kphototemplate

  • State "DONE" 2009-01-25 Sun 13:05

kphototemplate is designed to create a new and empty index.xml file from an original one that is full of images. It very simply reads in the original file (specified with the -c switch), removes the images from it but leaves all the category names and information, and then writes back out a new copy (specified with the -C switch).

Date: 2010-01-14 19:08:36 PST

HTML generated by org-mode 6.34a in emacs 21