all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 39994@debbugs.gnu.org
Subject: bug#39994: 27.0.90; Broken image-converter probe for imagemagick
Date: Tue, 10 Mar 2020 00:43:44 +0200	[thread overview]
Message-ID: <87mu8p9mjj.fsf@mail.linkov.net> (raw)
In-Reply-To: <877dztopns.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 09 Mar 2020 10:15:03 +0100")

>> 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))))
 





  reply	other threads:[~2020-03-09 22:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09  0:09 bug#39994: 27.0.90; Broken image-converter probe for imagemagick Juri Linkov
2020-03-09  9:15 ` Lars Ingebrigtsen
2020-03-09 22:43   ` Juri Linkov [this message]
2020-03-14 12:02     ` Lars Ingebrigtsen
2020-03-15  0:00       ` Juri Linkov
2020-03-16  0:04         ` Juri Linkov
2020-03-29 23:16           ` Juri Linkov
2020-03-16  0:23         ` Juri Linkov
2020-08-02  7:56           ` Lars Ingebrigtsen
2020-08-02 23:31             ` Juri Linkov
2020-08-03  7:15               ` Lars Ingebrigtsen
2020-08-03 23:42                 ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mu8p9mjj.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=39994@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.