commit 7802a08e57fa67877f94f256deaf84478f1f5f1f
parent ec5dbf41ed99f42f1d99102e2ecc3cc1d90ff036
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Mon, 8 Jun 2020 10:56:18 +0200
Add option to remove image metadata before upload
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/.local/bin/upload b/.local/bin/upload
@@ -28,6 +28,7 @@ show_help() {
echo " -h, --help show this message"
echo " -l, --list [QUERY] list previously uploaded files with optional QUERY"
echo " search string as filter"
+ echo " -m, --remove-metadata remove all exif metadata"
echo " -n, --notify also show diagnostic output with notify-send"
echo " -o, --gopher return gopher URI instead of http"
echo " -p, --public operate on public file directory (/${pubdir})"
@@ -80,6 +81,7 @@ add_resize() {
}
preprocess_file() {
+ [ "$removemetadata" = 1 ] && exiftool -all= "$1" >/dev/null
[ "$border" = 1 ] && add_border "$1" "$2"
[ "$resize" = 1 ] && add_resize "$1" "$2"
[ "$sharpen" = 1 ] && add_sharpening "$1" "$2"
@@ -173,6 +175,7 @@ get=0
delete=0
verbose=0
gopher=0
+removemetadata=0
while :; do
case "$1" in
-h|-\?|--help)
@@ -186,6 +189,9 @@ while :; do
-v|--verbose)
verbose=1
;;
+ -m|--remove-metadata)
+ removemetadata=1
+ ;;
-n|--notify)
notify=1
;;