unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
To: 56375@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	[thread overview]
Message-ID: <874jzxn3oj.fsf_-_@turtle-trading.net> (raw)
In-Reply-To: <handler.56375.B.165689216211384.ack@debbugs.gnu.org> (GNU bug Tracking System's message of "Sun, 03 Jul 2022 23:50:02 +0000")

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-lisp-thumbs.el-Fix-calling-the-convert-command.patch --]
[-- Type: text/x-diff, Size: 1985 bytes --]

From 7418e68266b9d593219c6a84be5d519844855f3a Mon Sep 17 00:00:00 2001
From: Benjamin Riefenstahl <b.riefenstahl@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






  parent reply	other threads:[~2022-07-04  0:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-03 23:48 bug#56375: 28.1.50; Calling "convert" from thumbs.el is broken Benjamin Riefenstahl
     [not found] ` <handler.56375.B.165689216211384.ack@debbugs.gnu.org>
2022-07-04  0:04   ` Benjamin Riefenstahl [this message]
2022-07-04 10:57     ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=874jzxn3oj.fsf_-_@turtle-trading.net \
    --to=b.riefenstahl@turtle-trading.net \
    --cc=56375@debbugs.gnu.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).