2021-10-30 23:14:10 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Add a exif-comment to all JPEG-Files from this directory and all subdirectorys
|
|
|
|
#
|
2021-11-01 17:16:20 +00:00
|
|
|
# (c) by Ulf Bartholomäus ub1x@gmx.net
|
2021-10-30 23:14:10 +00:00
|
|
|
VERSION="make_exif-name.sh Version 0.0.2 from 23.10.2005"
|
|
|
|
#
|
|
|
|
# Input: comment text
|
|
|
|
# Output: changed files
|
|
|
|
#
|
|
|
|
# Changes:
|
|
|
|
# 0.0.2: comment as parameter from commandline
|
|
|
|
# 0.0.1: generation
|
|
|
|
#
|
|
|
|
|
|
|
|
COMMENTSTEXT=$*
|
|
|
|
JPEGFILEFILTER=*.jpg
|
|
|
|
|
|
|
|
# trap is executed if script breaks
|
|
|
|
trap "echo '*** TRAP ***' ; exit" ERR
|
|
|
|
|
|
|
|
# check if command exists else break
|
|
|
|
which exiftran > /dev/null || echo "exiftran not found!" || exit;
|
|
|
|
|
|
|
|
echo "Write Comment: <"${COMMENTSTEXT}">"
|
|
|
|
# for each file in JPEGFILEFILTER do
|
|
|
|
# exiftran - transform digital camera jpeg images and use the libexif-Library
|
|
|
|
# -i Enable inplace editing of the images.
|
|
|
|
# -b Create a backup file when doing inplace editing.
|
|
|
|
# -p Preserve timestamps (atime + mtime) when doing inplace editing.
|
|
|
|
# -c <text> Set jpeg comment tag to <text>.
|
|
|
|
find . -type f -name "${JPEGFILEFILTER}" -exec exiftran -ibp -c "${COMMENTSTEXT}" {} \;
|