From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Benjamin Riefenstahl Newsgroups: gmane.emacs.bugs Subject: bug#56375: 28.1.50; Calling "convert" from thumbs.el is broken Date: Mon, 04 Jul 2022 02:04:44 +0200 Message-ID: <874jzxn3oj.fsf_-_@turtle-trading.net> References: <87czeln4ev.fsf@turtle-trading.net> Mime-Version: 1.0 Content-Type: text/x-diff Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20064"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1.50 (gnu/linux) To: 56375@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 04 02:05:29 2022 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 1o89ai-0004zv-9g for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Jul 2022 02:05:28 +0200 Original-Received: from localhost ([::1]:38592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o89ag-0005YB-IQ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Jul 2022 20:05:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o89aI-0005Xx-LZ for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2022 20:05:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51756) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o89aI-0001Iw-Ct for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2022 20:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o89aI-0003LL-4o for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2022 20:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Benjamin Riefenstahl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Jul 2022 00:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56375 X-GNU-PR-Package: emacs Original-Received: via spool by 56375-submit@debbugs.gnu.org id=B56375.165689309712837 (code B ref 56375); Mon, 04 Jul 2022 00:05:02 +0000 Original-Received: (at 56375) by debbugs.gnu.org; 4 Jul 2022 00:04:57 +0000 Original-Received: from localhost ([127.0.0.1]:45653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o89aC-0003Ky-JT for submit@debbugs.gnu.org; Sun, 03 Jul 2022 20:04:57 -0400 Original-Received: from odoacer.turtle-trading.net ([93.241.193.16]:45765) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o89a6-0003Kh-Va for 56375@debbugs.gnu.org; Sun, 03 Jul 2022 20:04:55 -0400 Original-Received: from zenobia.turtle-trading.net ([192.168.2.111]) by odoacer.turtle-trading.net with esmtp (Exim 4.80) (envelope-from ) id 1o89a0-0003Zy-Ff; Mon, 04 Jul 2022 02:04:44 +0200 Original-Received: from benny by zenobia.turtle-trading.net with local (Exim 4.94.2) (envelope-from ) id 1o89a0-001tDY-7E; Mon, 04 Jul 2022 02:04:44 +0200 In-Reply-To: (GNU bug Tracking System's message of "Sun, 03 Jul 2022 23:50:02 +0000") Content-Disposition: inline; filename=0001-lisp-thumbs.el-Fix-calling-the-convert-command.patch 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:236026 Archived-At: >From 7418e68266b9d593219c6a84be5d519844855f3a Mon Sep 17 00:00:00 2001 From: Benjamin Riefenstahl Date: Sun, 3 Jul 2022 15:52:13 -0700 Subject: [PATCH] lisp/thumbs.el: Fix calling the "convert" command * lisp/thumbs.el (thumbs-call-convert): Pass 'action-prefix' and 'action' as a combined parameter. Do not pass 'arg' if it is nil. (thumbs-modify-image): Do not pass "" as 'arg' to 'thumbs-call-convert'. (Bug#56375) --- lisp/thumbs.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lisp/thumbs.el b/lisp/thumbs.el index 3bf08dd6a5..e622bcedc4 100644 --- a/lisp/thumbs.el +++ b/lisp/thumbs.el @@ -215,16 +215,17 @@ thumbs-call-convert FILEOUT is the output file, ACTION is the command to send to convert. Optional arguments are: -ARG any arguments to the ACTION command, +ARG if non-nil, the argument of the ACTION command, OUTPUT-FORMAT is the file format to output (default is jpeg), ACTION-PREFIX is the symbol to place before the ACTION command (defaults to `-' but can sometimes be `+')." - (call-process thumbs-conversion-program nil nil nil - (or action-prefix "-") - action - (or arg "") - filein - (format "%s:%s" (or output-format "jpeg") fileout))) + (let ((action-param (concat (or action-prefix "-") action)) + (fileout-param (format "%s:%s" (or output-format "jpeg") fileout))) + (if arg + (call-process thumbs-conversion-program nil nil nil + action-param arg filein fileout-param) + (call-process thumbs-conversion-program nil nil nil + action-param filein fileout-param)))) (defun thumbs-new-image-size (s increment) "New image (a cons of width x height)." @@ -610,7 +611,7 @@ thumbs-modify-image (thumbs-call-convert (or old thumbs-current-image-filename) tmp action - (or arg "")) + arg) (save-excursion (thumbs-insert-image tmp 'jpeg 0)) (setq thumbs-current-tmp-filename tmp))) -- 2.30.2