X-Git-Url: https://piware.de/gitweb/?p=bin.git;a=blobdiff_plain;f=process-photos;fp=process-photos;h=14ee5b3eb6781e554135c7e1d2627845e413d295;hp=0000000000000000000000000000000000000000;hb=8248c11cc17fa2c6d65b9668405793bb91c040c5;hpb=a43b50452d80da21f1989701121d5bbbd66b28a5 diff --git a/process-photos b/process-photos new file mode 100755 index 0000000..14ee5b3 --- /dev/null +++ b/process-photos @@ -0,0 +1,18 @@ +#!/bin/sh +set -eu + +for f in *.jpg *.JPG; do + echo "$f" + chmod 644 "$f" + info="$(exiv2 -Pnv "$f")" + # copy tags to IPTC description (sigal) + tags=$(echo "$info" | sed -n 's/^subject *//p' | tr '[:upper:]' '[:lower:]') + if [ -n "$tags" ]; then + exiv2 -M"add Iptc.Application2.Caption String $tags" mo "$f" + fi + + # rename to EXIF date, if available + if echo "$info" | grep -q '^DateTime'; then + exiv2 mv "$f" + fi +done