Subject: bug#51515: image-use-external-converter should fall back to another converter if one fails

From: Stefan Kangas <[email-masked]>
Date: Sat, 30 Oct 2021 09:21:46 -0700

(This was previously discussed in Bug#51381.)

Summary: When `image-use-external-converter' is non-nil, don't just give
         up if one fails, try another one.

I have both the GraphicsMagick and ImageMagick tools installed.  The IM
"convert" command supports .heif images, the GM "gm" command does not.

Now I do:

0. curl --output /tmp/C001.heic \
https://raw.githubusercontent.com/nokiatech/heif_conformance/master/conformance_files/C001.heic
1. emacs -Q --eval '(setq image-use-external-converter t)' /tmp/C001.heic

This gives the error message "Unknown image type", as "gm" can't convert
it.  It would be better if it could fall back to use "convert".

Lars Ingebrigtsen <[email-masked]> writes:

> We could re-probe the converters when something fails and then
> use the other converter, for instance?  Or we could just probe every
> time, but keep a table of what we've tried.
>
> Or we could probe all the converters at startup, and maintain a mapping
> of which converter does what -- that sounds cleanest.