From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#51515: image-use-external-converter should fall back to another converter if one fails Date: Sat, 30 Oct 2021 09:21:46 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26901"; mail-complaints-to="usenet@ciao.gmane.io" To: 51515@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 30 18:22:17 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgr7W-0006dp-Bu for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Oct 2021 18:22:14 +0200 Original-Received: from localhost ([::1]:45842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgr7T-0007Vy-Sx for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Oct 2021 12:22:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgr7K-0007U9-99 for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2021 12:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46750) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgr7K-0007bH-0e for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2021 12:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mgr7J-0004uI-Qm for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2021 12:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Oct 2021 16:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51515 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163561091518846 (code B ref -1); Sat, 30 Oct 2021 16:22:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Oct 2021 16:21:55 +0000 Original-Received: from localhost ([127.0.0.1]:58296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgr7D-0004tu-8r for submit@debbugs.gnu.org; Sat, 30 Oct 2021 12:21:55 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:48782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgr78-0004tY-Jv for submit@debbugs.gnu.org; Sat, 30 Oct 2021 12:21:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgr78-0007Ca-Eg for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2021 12:21:50 -0400 Original-Received: from mail-pf1-f172.google.com ([209.85.210.172]:37482) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgr76-0007Zk-JF for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2021 12:21:50 -0400 Original-Received: by mail-pf1-f172.google.com with SMTP id y20so1449179pfi.4 for ; Sat, 30 Oct 2021 09:21:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=OHLaXFYVItsmUPC+9OqmJ3QV6HafnIjfmncRCwslfNc=; b=WWEpEWqvhVu88zagjAHkm0dhXWNp4J7OsPF+ducyimiAiLd46YNPVhRDdjVXCmCxzA KIO9/yRUt6+7hYAUJJP7LjVEgga4NxvflxCakjC4Yp+cBmmpQt3hCvthyO3UleubDCwO /+b0r5ZGamQBDZHiwZopQYzhI3yyq1HRNsPBuX8Jn6OBnTbuDCGG4XWRmHKd1te6Wf0K u13baMSQ7ju9DBjfpAn3qjekLV2gtA1TOtrr9KM/esO7FKiD2Cv/JqHxbS4icMfLjA8y ZZa6kesBXdYfCrFUhDeGVMU84F4yBGVCeuj/WDi/xMw6bl7ENYveletxb5BK9MSEO+fm R7eg== X-Gm-Message-State: AOAM530eDcJ+KpMRajoi7Gad0c6bRc+JBQy1/Ku/qahjpJ6cUGcSb4qv j09j+iV+D20nxTJXvIUC5dOdXwKcfL0Z0YbV8NnoOrd8 X-Google-Smtp-Source: ABdhPJwKQ41bms11hIMQGFidP1uzDua7HMZxUWmdNTrB49dVjzKYFoRVIBPnjs7Phvv4EA0raTidse1F0FqX0mCBwtY= X-Received: by 2002:a63:370c:: with SMTP id e12mr13344874pga.359.1635610907256; Sat, 30 Oct 2021 09:21:47 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 30 Oct 2021 09:21:46 -0700 Received-SPF: pass client-ip=209.85.210.172; envelope-from=stefankangas@gmail.com; helo=mail-pf1-f172.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:218627 Archived-At: (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 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.