]> piware.de Git - bin.git/blob - process-photos
build-cockpit-toolbox: tasks container moved to ghcr.io
[bin.git] / process-photos
1 #!/bin/sh
2 set -eu
3
4 for f in *.JPG; do
5     mv "$f" "${f%JPG}jpg"
6 done
7
8 for f in *.jpg; do
9     echo "$f"
10     chmod 644 "$f"
11     info="$(exiv2 -Pnv "$f")"
12     # copy tags to IPTC description (sigal)
13     tags=$(echo "$info" | sed -n 's/^subject *//p' | tr '[:upper:]' '[:lower:]')
14     if [ -n "$tags" ]; then
15         exiv2 -M"add Iptc.Application2.Caption String $tags" mo "$f"
16     fi
17
18     # rename to EXIF date, if available
19     if echo "$info" | grep -q '^DateTime'; then
20         exiv2 mv "$f"
21     fi
22 done