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