GNU bug report logs - #56375
28.1.50; Calling "convert" from thumbs.el is broken

Previous Next

Package: emacs;

Reported by: Benjamin Riefenstahl <b.riefenstahl <at> turtle-trading.net>

Date: Sun, 3 Jul 2022 23:50:02 UTC

Severity: normal

Found in version 28.1.50

Fixed in version 29.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: Benjamin Riefenstahl <b.riefenstahl <at> turtle-trading.net>
To: 56375 <at> debbugs.gnu.org
Subject: bug#56375: 28.1.50; Calling "convert" from thumbs.el is broken
Date: Mon, 04 Jul 2022 02:04:44 +0200
[0001-lisp-thumbs.el-Fix-calling-the-convert-command.patch (text/x-diff, inline)]
From 7418e68266b9d593219c6a84be5d519844855f3a Mon Sep 17 00:00:00 2001
From: Benjamin Riefenstahl <b.riefenstahl <at> turtle-trading.net>
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





This bug report was last modified 2 years and 325 days ago.

Previous Next


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