Ich bin darum gebeten worden ein Script zu schreiben mit dem man Fotos auswählt und mit einem Exif Kommentar versehen kann.
Vielleicht kann es ja mal jemand gebrauchen.
Das ganze abspeichern in eine Datei (ec.sh) und mit sh ec.sh ausführen.
Keine Sorge es arbeitet mit grafischen Dialogen.
#!/bin/bash
exiv2="/usr/bin/exiv2"
file="/usr/bin/file"
zenity="/usr/bin/zenity"
function setError() {
$zenity --error --text=$1
}
function getDependencies() {
if [ ! -e $1 ]
then
package=`echo $1 | sed 's@/usr/bin/@@g'`
echo "You have to install the package \"$package\" first!"
exit 1
fi
}
# check what we need
getDependencies $exiv2
getDependencies $file
getDependencies $zenity
# comment-dialog
comment=$($zenity --entry --title="Text for the comment" --text="Text for the comment:")
if [ $? -eq 1 ]
then
exit 1
fi
# picture-dialog
pictures=$($zenity --file-selection --multiple);
if [ $? -eq 1 ]
then
exit 1
fi
IFS='|'
for field in $pictures
do
# writeable?
if [ ! -w $field ]
then
setError "$field not writeable!"
continue
fi
# JPEG?
if [ ! `$file $field | /bin/grep "JPEG image data"` ]
then
setError "$field doesn't look like a JPEG!"
continue
fi
echo "write comment: \"$comment\" in file: \"$field\""
$exiv2 -M"set Exif.Photo.UserComment $comment" $field
done | $zenity --progress --pulsate --auto-close
$zenity --info --text="Done writing comments."