From: Gustav Eek Date: Sat, 5 Feb 2022 06:59:15 +0000 (+0100) Subject: [exiv2-export] Inital on picture export script X-Git-Url: https://git.g-eek.se/?a=commitdiff_plain;h=b0e0bf0eff6ea5b1d6f145935131f5b3d4a48efe;p=users%2Fgustav%2Fscripts.git [exiv2-export] Inital on picture export script --- 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