]> git.plutz.net Git - shellwiki/commitdiff
bugfix: handle white space in filenames for image conversion
authorPaul Hänsch <paul@plutz.net>
Thu, 7 Mar 2024 15:40:50 +0000 (16:40 +0100)
committerPaul Hänsch <paul@plutz.net>
Thu, 7 Mar 2024 15:40:50 +0000 (16:40 +0100)
handlers/40_attachment.sh

index fc0b0f983ff00aee3a0787c1e38761315d973697..bddaa47105f11433f58925864836cc4c1795471e 100755 (executable)
@@ -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