[Digikam-users] workflow for deleting not wanted RAW-Files

ruediger ruedbi at yahoo.de
Mon Aug 23 22:50:49 BST 2010

Am 22.08.2010 23:12, schrieb Micha Neubauer:
> Hello everybody!
> Just a short question on my workflow, since I guess that there is a nicer and faster way
> than I am doing it. Here it comes:
> I always take a RAW and a JPG copy of each picture with my camera because I want to have a
> RAW copy of my good picures. Then I download the pictures in digiKam and delete all the
> crap I took.
> During this process I don't want to scrall through every picture twice (and have to delete
> twice) so I only look at the JPGS (by activating the filter at the bottom of the DK
> window).
> After this process is done I still have all the crap RAW files of which I deleted the
> jpgs. Then I go manually through the folder and delete every RAW file of which I do not
> have the corresponded JPG because, of course I don't want to keep a RAW copy of the crap
> photos I took. Then I copy the RAW files of the good fotos into another folder and store
> them away because at the moment I just want to backup my phots as RAW files but don't need
> them for now.
> But this process sometimes takes quite a long time and there is also the danger of
> deleting the wrong RAW files just by accident when doing it fast and annoyed by this boring
> work. So now I guess there must be a way of automating this within DK.
how I do it:
- "delete to trash" the unwanted jpegs
- write a small script that searches through the trash folder for jpegs 
and deletes the raw files with the same basename; then delete the jpeg 
in the trash (or move both to another, private trash)
like this (bash script):
files=$(/bin/ls -1 *.jpg )
for i in $files
     DNG=`basename $i .jpg`.dng
     JPG=`basename $i`
     find -L $PROOT -name $DNG -exec mv -fv {} $TRASH \;
     find -L $PROOT -name $JPG -exec mv -fv {} $TRASH \;    # doublettes
     rm -f $DIGIKAM_TRASH/$i

> But this it not all. The ideal solution is a little more complex:
> Since I even don't want to keep the RAW files of ALL photos of which I keep the JPGs I am
> even looking for the possibility to for example to delete all RAW files of which I do not
> have a corresponding JPEG rated lower than 4 or with or without a certain tag. Sometimes
> you want to keep bad picutres just for memorizing moments but which do not justify
> occupying the momeory with big RAW files.
> Anybody can help me with that? It would also be helpful to hear (or read) how other people
> deal with this problem. I guess I am not the only one wanting RAW-Files of only a
> selection of the photos they took.
> thanks a lot in andvance
> micha
like this:
cd whereyourjpegsare
files=$(find -maxdepth 1 -name "*.jpg")
for i in $files
     rating=`exiftool -f -rating $i | awk  '{print $3}'`
     if [ $rating == "-" ]
     if [ $rating -lt $min_rating ]
       DNG=`basename $i .jpg`.dng
       find -L $DIGIKAM_ROOT -name $DNG -exec mv -fv {} $TRASH \;

use at your own risk ;-)

More information about the Digikam-users mailing list