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).

About these ads