Tinkeringmind Blog About

Linux shell script zum Hinzufügen von Metadaten mit Hilfe von exiftool

Veröffentlich am
for i in /path/images/*;

do
exiftool "$i"
echo "$i"

read -p 'iptc:Headline: ' headline
read -p 'xmp:Category: ' category
read -p 'iptc:Keywords (64 characters limit and seperate by comma): ' keywords
read -p 'iptc:Caption-Abstract: ' abstract

copyright_default="DEFAULT"
read -e -i "$copyright_default" -p "iptc:Copyright " copyright

byline_default="DEFAULT"
read -e -i "$byline_default" -p "iptc:Byline " byline

copyright_url="DEFAULT_URL"

if [ -z "$copyright" ]
then
      $copyright_url = ""
fi

exiftool -overwrite_original -iptc:Headline="$headline" -xmp:Headline="$headline" -xmp:Categories="$category" -iptc:Keywords="$keywords" -xmp:Keywords="$keywords" -iptc:Caption-Abstract="$abstract" -xmp:Caption="$abstract" -iptc:CopyrightNotice="$copyright" -xmp-cc:license="$copyright_url" -xmp:Author="$byline" -Artist="$byline" -iptc:By-line="$byline" -iptc:Contact="email@domain.com" "$i"

done