GNU/Linux


This is my workflow to develop RAW pictures from my Canon 40D. My aim is to keep all RAW files, which allows to repeat the process. To minimize repeated work, I want to tag pictures as early as possible; in the RAW converter in my case.

  1. Download the pictures from the camera. This is done by the following script. It put the pictures under $FOLDER/yyyymm/yyyymmdd/yyyymmdd-hhmmss-XX where XX is a counter for pictures with the exact same time including seconds. Furthermore, it creates a hard link of the files also in $FOLDER/backup/yyyymm/yyyymmdd/ so files can be deleted and still a backup is available, which does not take any additional space. These backup files can be deleted from time to time. Update: The renaming options in digikam have increased since I wrote that script, so you can also use digikam for that (except the simple backup mechanism).
    #!/bin/bash
    
    extension=CR2
    FOLDER=/home/sebschub/Dokumente/Bilder/RAW
    
    extensionLC=`echo $extension | tr "[:upper:]" "[:lower:]"`
    
    echo Getting RAW files from camera
    
    mkdir $FOLDER/temp
    cd $FOLDER/temp
    
    echo Temporary saving to $FOLDER/temp
    
    gphoto2 --get-all-raw-data
    
    for i in *.$extensionLC; do
        # Datum fuer Dateinamen
        date_stamp=`exiftool -DateTimeOriginal -d "%Y%m%d-%H%M%S" $i`
        yyyymmdd_hhmmss=$(expr substr "`echo $date_stamp`" 22 36)
    
        # Datum fuer Verzeichnisse mit Bindestrichen
        date_stamp=`exiftool -DateTimeOriginal -d "%Y-%m-%d" $i`
        yyyymmdd=$(expr substr "`echo $date_stamp`" 22 32)
        yyyymm=$(expr substr "`echo $yyyymmdd$`" 1 7)
    
        mkdir -p ../$yyyymm/$yyyymmdd
        mkdir -p ../backup/$yyyymm/$yyyymmdd
    
        unique_num=1
        i_renamed="../$yyyymm/$yyyymmdd/$yyyymmdd_hhmmss-`printf "%02i" $unique_num`.$extensionLC"
    
        # falls Datei mit gleichem Datum und Zeit vorhanden sind,
        # unique_num hochzaehlen (zwei Ziffern, aber ne cam mit mehr als
        # 99 fps waer schon geil ;)
        while [ -e $i_renamed ]; do
    	unique_num=$[$unique_num+1]
    	i_renamed="../$yyyymm/$yyyymmdd/$yyyymmdd_hhmmss-`printf "%02i" $unique_num`.$extensionLC"
        done
    
        mv $i $i_renamed
    
        # hard link als Backup erzeugen, so dass im Hauptordner ohne
        # Probleme geloescht werden kann
    
        i_renamed_backup="../backup/$yyyymm/$yyyymmdd/$yyyymmdd_hhmmss-`printf "%02i" $unique_num`.$extensionLC"
        ln $i_renamed $i_renamed_backup
        echo "$i -> $i_renamed"
    done
    
    cd ..
    
    rmdir $FOLDER/temp
    echo Removing temporary folder $FOLDER/temp
    
    echo FINISHED
    
  2. Geotag pictures. I use geotag for that. Be sure to set it to use xmp files to save that. Just to be sure. Update: Tagging can also be done in digikam, but saving to XMP sidecar files for exchanging information with bibble is not supported yet. There is a wish in the bugtracker, though. Once it is implemented, tagging should be also possible in digikam which, at the moment, would be a lot more convenient that it is in bibble 5.
  3. Use bibble 5 to develop raws. It should have read the geotags automatically. I enter all information of the pictures here, delete not wanted, rate them … At the moment, tagging is not really comfortable but as mentioned I want tags etc as deep as possible in the workflow. I include a tag in all pictures which describe the event of the picture. This tag will be used to sort the jpgs in digikam and on the disk (e.g. Event; Birthday Peter 36th). Finally, the generated jpgs are put in a temporary folder.
  4. Sort pictures using the Event tag. This is done by the following script (the new jpgs are arguments of that script). Update: I fixed a bug of a not removed ‘,’ at the end of the folder and decided to sort pictures like $YEAR/$DATE event.:
    #!/bin/bash 
    
    SORTTAG="Ereignis"
    SEP="|"
    
    TARGET="/home/sebschub/Dokumente/Bilder/Sammlung"
    
    
    MVARG="-v"
    INTERACTIVE="true"
    SUCCESS="true"
    while :; do case "$1" in
    	--help)
    	    echo "Usage: `basename $0` [-f] file1.jpg [file2.jpg...]" >&2
    	    exit 0
    	    ;;
    	-f)
    	    INTERACTIVE="false"
    	    shift 1
    	    ;;
    	"")      # No more args - done
                break
                ;;
    	*)
    	    i="$1"
    	    shift 1
    	    if [[ $INTERACTIVE == "true" ]]; then
    		MVARG="$MVARG -i"
    		INTERACTIVE="false"
    	    fi
    	    case $i in
    		*.jpg|*.JPG|*.jpeg|*.JPEG)
    		    # get date and year only
    		    date_stamp=`exiftool -DateTimeOriginal -d "%Y-%m-%d" $i`
    		    yyyymmdd=$(expr substr "`echo $date_stamp`" 22 33)
    		    yyyy=$(expr substr "`echo $yyyymmdd`" 1 4)
            # get HierarchicalSubject with (at least) $SORTTAG beginning with either ": " or ", "
    		    temp=`exiftool -HierarchicalSubject $i | \
    			grep --only-matching --color=never -e "\(, \|: \)$SORTTAG.*"`
    		    end=$(expr length "`echo $temp`")
        # remove the two beginning characters and Ereignis|
    		    temp=$(expr substr "`echo $temp`" 12 $end)
        # if "," still in string remove rest
    		    end=$(expr index "`echo $temp`" ,)
    		    if [ $end -ne 0 ]; then
    			end=$[$end-1]
    			temp=$(expr substr "`echo $temp`" 1 $end)
    		    fi
    		    echo "Ereignis: $temp"
    		    folder=`echo $temp | sed -e 's?/?_?g' -e 's?|?/?g'`
    		    folder="$TARGET/$yyyy/$yyyymmdd $folder"
    		    
    		    mkdir -p "$folder"
    		    mv $MVARG  $i "$folder/$i"
    		    ;;
    		*)
    		    echo "$i is (probably) no jpeg, canceling"
    		    SUCCESS="false"
    		    break
    		    ;;
    	    esac
    	    if [[ $SUCCESS == "false" ]]; then
    		break
    	    fi
    	    ;;
        esac done
        
        echo FINISHED
  5. Use digikam to view the pictures. digikam should import all the pictures. There is some minor information that is not read correctly (or saved correctly by bibble?) but most of the things just work.

If I ever have to change a tag or information, I go back to step 3. The script of 4 does the sorting automatically. In digikam, I do a Reread Metadata from Image(s).

This time I write about my new keyboard: the cherry evolution stream. I primarily decided to buy a new one because I wanted to switch to the US layout, which has it’s advantages when coding or just because I am used to write with the US layout at university. I bought it at keybo.de where it is possible to get almost every possible layout, they sent it very fast and payment was possible via bill so I can recommend that shop.

So far I have no problems with the keyboard, I quite like it. I plugged it into the keyboard PS/2 port (is there an advantage of using an USB port?) and it worked out of the box under linux. I use just the standard xorg kdb driver for X:
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection

although even auto-detection in never xorg versions should work. Only the multimedia buttons do not work without additional configuration but I did not expect that, where would be the fun? ;) So it was a rather easy task to get all the keycodes using xev and combine them with the appropriate actions. Add
keycode 160 = XF86AudioMute
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
keycode 144 = XF86AudioPrev
keycode 162 = XF86AudioPlay
keycode 153 = XF86AudioNext

to your .Xmodmap file (or wherever you thinks it’s best) and … run it through xmodmap:
xmodmap .Xmodmap .
To use the volume buttons you may want to install kmilo under kde.

My new mouse, the Logitech G5 refresh (edit: the one with 2 thumb buttons), works really nice under Linux. The only minor issue I had was that the direction of the horizontal scrolling was swapped. I solved this with the following code in my xorg.conf (xorg-server-1.3.0.0-r2, xf86-input-evdev-1.1.5-r2 as Gentoo packages, the appropriate evdev kernel modules have to be loaded):
Section "InputDevice"
Identifier "Mouse0"
Driver "evdev"
Option "CorePointer"
Option "Name" "Logitech USB Gaming Mouse"
Option "HWHEELRelativeAxisButtons" "7 6"
EndSection

No further setup is needed, all buttons and scroll wheel direction work out of the box; especially no xmodmap is needed. The dpi setting buttons work too. However, at the moment, one can only set the mouse to 400, 800 or 2000dpi. A customization will hopefully be possible when lomoco supports the G5.

Using the settings above let you scroll horizontally eg in konqueror or OpenOffice. Firefox sets it to “go back/forward one page” by default. To scroll, set mousewheel.horizscroll.withnokey.action and mousewheel.horizscroll.withnokey.numlines (edited, thanks to Deth for pointing out a mistake) to 1 in the about:config dialogue. The default behaviour is reached with ALT+wheel.

Although xev prints the thumb buttons’ pressing correctly, there isn’t any function yet AFAICS. Unfortunatly (for me) KDE cannot assign actions to mouse buttons. This is possible with xbindkeys, which is configured via .xbindkeysrc. Here is mine (edit: which sets actions for both thumb buttons):
"xvkbd -text "\[F13]""
b:8
"xvkbd -text "\[Control]\[Prior]""
b:9
"xvkbd -text "\[Control]\[Next]""
Control + b:9

xbindkeys, however, cannot assign simple key combinations but only shell commands so — you guessed it — another tool is needed: xvkbd. Now button 8 simulates a F13 which is not on my keyboard but can be assigned by KDE and button 9 gives a CTRL+PageUp, which cycles through the tabs in firefox; CTRL+Button9 does the obvious thing. I guess I’m happy now but, nonetheless, I hope KDE 4 makes the use of extra mouse buttons a bit easier.