From fdfe0310c6bc644da671b847120e0bd84d923634 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Thu, 7 Mar 2024 16:40:50 +0100 Subject: [PATCH] bugfix: handle white space in filenames for image conversion --- handlers/40_attachment.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/handlers/40_attachment.sh b/handlers/40_attachment.sh index fc0b0f9..bddaa47 100755 --- a/handlers/40_attachment.sh +++ b/handlers/40_attachment.sh @@ -42,9 +42,8 @@ attachment_convert(){ case $attpath in *.[jJ][pP][gG]|*.[jJ][pP][eE][gG]|*.[pP][nN][gG]) - read junk junk res junk <<-EOF - $(identify -- "$attpath") - EOF + res="$(identify -- "$attpath")" + res="${res% * * * * * *}" res="${res##* }" if [ "${res%x*}" -gt 2048 ]; then convert "$attpath" -resize 1920x-2 -quality 85 "$cachepath" else -- 2.39.2