~/perl/geotag_place.pl

trägt folgende Metadaten in die (Raw-)Dateien ein:

Darktable

Erwartet

HierarchicalSubject             : Where|Germany|Bavaria|Bad Reichenhall
Updaten vorhandener Bilder
#!/bin/bash
for f in ~/Bilder/2020/04/import/*ARW; do
    if [ ! $(exiftool -a $f | grep -i gps | wc -l) -lt 1 ]; then
        city=$(exiftool -a -s $f | egrep -i "^city" | awk -F ' : ' '{print $2}')
        if [ -z "$city" ]; then
            geotag_place.pl -v --overwritegps --overwritegeoplace --gpxdir ~/.gps $f
        fi
        city=$(exiftool -a -s $f | egrep -i "^city" | awk -F ' : ' '{print $2}')
        sublocation=$(exiftool -a $f | grep -i sub-location | awk -F ' : ' '{print $2}')
        country=$(exiftool -a -s $f | grep -i country-primarylocationname | awk -F ' : ' '{print $2}')
        state=$(exiftool -a -s $f | grep -i province-state | awk -F ' : ' '{print $2}')
        #echo " where|$country|$state|$city|$sublocation"
        targetfile=$f
        if [ -f "$f.xmp" ]; then
            targetfile=$f.xmp
        fi
        # echo $targetfile
        exiftool -HierarchicalSubject+="Where|$country|$state|$city|$sublocation" $targetfile
    fi
done