]> git.g-eek.se Git - users/gustav/scripts.git/commitdiff
[exiv2-export] Inital on picture export script
authorGustav Eek <gustav.eek@fripost.org>
Sat, 5 Feb 2022 06:59:15 +0000 (07:59 +0100)
committerGustav Eek <gustav.eek@fripost.org>
Sat, 5 Feb 2022 06:59:15 +0000 (07:59 +0100)
Makefile
exiv2-export [new file with mode: 0755]

index 74365ebbf2192fb27529d2511f1eda94d424ff60..d09fb69de5443e1bd255377628fe0e400192021f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,7 @@ SCRIPTS = \
   confluence-tk \
   event-participant \
   exiv2-common-edits \
+  exiv2-export \
   folkets \
   ip-check \
   json2yaml \
diff --git a/exiv2-export b/exiv2-export
new file mode 100755 (executable)
index 0000000..a41e8d3
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script that exports photos which have rating
+#
+# SYNOPSIS
+#
+#    exiv2-export -t TARGET [FILES]
+#
+
+SCALE="-scale 25%"
+
+if [[ $1 != "-t" ]]; then
+    echo "Must provide target." 1>&2
+    exit 1
+fi
+shift
+trg="$1"
+shift
+
+while [ -n "$1" ]; do
+    f="$1"
+    shift
+    if [ -z "$(exiv2 -K Exif.Image.Rating  "$f")" ]; then continue; fi
+    convert "$f" ${SCALE} "$trg/$(basename ${f/.JPG/.25.JPG})"
+done