bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#39994: 27.0.90; Broken image-converter probe for imagemagick


From: Juri Linkov
Subject: bug#39994: 27.0.90; Broken image-converter probe for imagemagick
Date: Mon, 16 Mar 2020 02:04:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

reopen 39994
tags 39994 - fixed
quit

>> We put imagemagick at the end because of the same reason we're
>> deprecating libmagick in Emacs -- imagemagick has had en enormous number
>> of exploitable bugs over the years.  Running external programs mitigates
>> this slightly, but it should remain the last option.
>
> Right.  I moved it up only because I was lazy to restart Emacs -
> currently customization of image-converter requires restarting Emacs,
> but it's not a big problem.

Sorry, I misremembered - actually it *is* a problem,
since handling customization is not yet implemented.

Here is a possible implementation:

diff --git a/lisp/image/image-converter.el b/lisp/image/image-converter.el
index 0488a13d41..4efae5c202 100644
--- a/lisp/image/image-converter.el
+++ b/lisp/image/image-converter.el
@@ -57,6 +57,10 @@ image-convert-p
   ;; Find an installed image converter.
   (unless image-converter
     (image-converter--find-converter))
+  ;; When image-converter was customized
+  (if (and image-converter (not image-converter-regexp))
+      (when-let ((formats (image-converter--probe image-converter)))
+        (setq image-converter-regexp (concat "\\." (regexp-opt formats) 
"\\'"))))
   (and image-converter
        (or (and (not data-p)
                 (string-match image-converter-regexp source))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]