From 568b1592bacd27eb3e2b9d9dd87ccb73c2650bd3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Mon, 9 Oct 2023 10:54:06 +0200 Subject: [PATCH] case insensitive attachment suffixes --- handlers/40_attachment.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/handlers/40_attachment.sh b/handlers/40_attachment.sh index 5ea36e9..fc0b0f9 100755 --- a/handlers/40_attachment.sh +++ b/handlers/40_attachment.sh @@ -35,15 +35,15 @@ attachment_convert(){ elif [ -f "$cachepath" ]; then printf %s "$attpath" return 0 - elif ! mkdir -p -- "${cachepath%/*}" && touch "$cachepath"; then + elif ! mkdir -p -- "${cachepath%/*}" && touch -- "$cachepath"; then printf %s "$attpath" return 0 fi case $attpath in - *.jpg|*.jpeg|*.png) + *.[jJ][pP][gG]|*.[jJ][pP][eE][gG]|*.[pP][nN][gG]) read junk junk res junk <<-EOF - $(identify "$attpath") + $(identify -- "$attpath") EOF if [ "${res%x*}" -gt 2048 ]; then convert "$attpath" -resize 1920x-2 -quality 85 "$cachepath" @@ -53,7 +53,7 @@ attachment_convert(){ printf %s "$cachepath" return 0 ;; - *.webm|*.mp4|*.mkv|*.avi) + *.[wW][eE][bB][mM]|*.[mM][pP]4|*.[mM][kK][vV]|*.[aA][vV][iI]) res=$(ffprobe -show_entries stream=width "$attpath" 2>&-) res="${res#*width=}" res="${res%%${BR}*}" if [ "$res" -gt 1280 ]; then @@ -77,7 +77,7 @@ attachment_convert(){ printf %s "$attpath" return 0 ;; - *) printf "$attpath";; + *) printf %s "$attpath";; esac } -- 2.39.2