From b0e0bf0eff6ea5b1d6f145935131f5b3d4a48efe Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Sat, 5 Feb 2022 07:59:15 +0100 Subject: [PATCH] [exiv2-export] Inital on picture export script --- Makefile | 1 + exiv2-export | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 exiv2-export diff --git a/Makefile b/Makefile index 74365eb..d09fb69 100644 --- 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 index 0000000..a41e8d3 --- /dev/null +++ b/exiv2-export @@ -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 -- 2.39.2