Inhaltsverzeichnis

Exiftools

Mit exiftools kann man jede Exif-Information von Bildern bearbeiten.

Installation

Die tools werden einfach mittels folgendem Befehl installiert:

apt-get install libimage-exiftool-perl

Anwendung

exiftool ist recht mächtig, die Syntax und viele Beispiele findet man in den manpages.

Beispiele

Hier einige Anwendungsbeispiele.

Alle Tags

Um alle Tags auszulesen, hängt man eine der folgenden Optionen an:

-list               # list all tag names
-list -EXIF:All     # list all EXIF tags
-list -xmp:time:all # list all XMP tags relating to time
-listw -XMP-dc:All  # list all writable XMP-dc tags
-listf              # list all supported file extensions
-listr              # list all recognized file extensions
-listwf             # list all writable file extensions
-listg1             # list all groups in family 1
-listd              # list all deletable groups
-listx -EXIF:All    # list database of EXIF tags in XML format
-listx -XMP:All -s  # list short XML database of XMP tags

Erstellungsdatum auslesen

exiftool -p '$DateTimeOriginal' <DATEINAME>

Hier noch ein kleines Script welches Dateien umbenennt (Das Erstellungsdatum wird dem Dateinamen vorangestellt).

#!/bin/bash
 
find -name "*.jpg" | while read PIC; do
PIC1=`echo "$PIC" | sed 's!^\./!!g'`
DATE=$(exiftool -p '$DateTimeOriginal' "$PIC" 2>/dev/null | sed 's/[: ]//g')
DATE1=$(exiftool -p '$DateTimeOriginal' "$PIC" 2>/dev/null | sed 's/[:]//g' | sed 's/[ ]/_/g')
exiftool -p '$DateTimeOriginal' "$PIC" 2>/dev/null
if [ $?==0 ]; then
touch -t $(echo $DATE | sed 's/\(..$\)/\.\1/') "$PIC" 2>/dev/null
mv -i $PIC $(dirname $PIC)/"$DATE1"-"$PIC1" 2>/dev/null
fi
done

Dateien umbenennen (rename)