GNU bug report logs - #39994
27.0.90; Broken image-converter probe for imagemagick

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Mon, 9 Mar 2020 02:38:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 27.0.90

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 39994 <at> debbugs.gnu.org
Subject: bug#39994: 27.0.90; Broken image-converter probe for imagemagick
Date: Tue, 10 Mar 2020 00:43:44 +0200
>> Then I tried imagemagick, but image-converter said .ico format is unsupported.
>> Whereas running `convert -list format` outputs:
>>
>>    Format  Module    Mode  Description
>> -------------------------------------------------------------------------------
>>       ICO* ICON      rw+   Microsoft icon
>>
>> So this patch adds the support for the 'Module' column to imagemagick probe:
>
> Ah, so some versions have an additional column in there?  My convert
> -list format outputs:
>
>       ICO* rw+   Microsoft icon

Maybe because my version is too old:
ImageMagick 6.9.7-4 Q16 x86_64 20170114

>>  (defvar image-converter--converters
>>    '((graphicsmagick :command ("gm" "convert") :probe ("-list" "format"))
>> -    (ffmpeg :command "ffmpeg" :probe "-decoders")
>> -    (imagemagick :command "convert" :probe ("-list" "format")))
>> +    (imagemagick :command "convert" :probe ("-list" "format"))
>> +    (ffmpeg :command "ffmpeg" :probe "-decoders"))
>>    "List of supported image converters to try.")
>
> Was this part included by mistake?  It changes the order the converters
> are tested.

I propose to change the order because ffmpeg doesn't support too much
image formats, so it is less useful than imagemagick when both
imagemagick and ffmpeg are installed at the same time.

>>          ;; Lines look like
>>          ;; "      WPG* r--   Word Perfect Graphics".
>> -        (while (re-search-forward "^ *\\([A-Z0-9]+\\)\\*? +r" nil t)
>> +        (while (re-search-forward "^ *\\([A-Z0-9]+\\)\\*?\\(?: +[A-Z0-9]+\\)? +r" nil t)
>
> Look OK to me, but the comment should be amended to reflect the two
> different line formats it's now matching.

Oh, I haven't noticed the comment, I don't know why, now updated:

diff --git a/lisp/image/image-converter.el b/lisp/image/image-converter.el
index 0488a13d41..3d74b8b30c 100644
--- a/lisp/image/image-converter.el
+++ b/lisp/image/image-converter.el
@@ -149,8 +149,9 @@ image-converter--probe
       (when (re-search-forward "^-" nil t)
         (forward-line 1)
         ;; Lines look like
-        ;; "      WPG* r--   Word Perfect Graphics".
-        (while (re-search-forward "^ *\\([A-Z0-9]+\\)\\*? +r" nil t)
+        ;; "      WPG* r--   Word Perfect Graphics" or
+        ;; "      WPG* WPG       r--   Word Perfect Graphics".
+        (while (re-search-forward "^ *\\([A-Z0-9]+\\)\\*?\\(?: +[A-Z0-9]+\\)? +r" nil t)
           (push (downcase (match-string 1)) formats)))
       (nreverse formats))))
 




This bug report was last modified 4 years and 291 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.