GNU bug report logs - #52200
29.0.50; image-dired-cmd-create-standard-thumbnail-options

Previous Next

Package: emacs;

Reported by: Peter Münster <pm <at> a16n.net>

Date: Tue, 30 Nov 2021 16:25:01 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52200 in the body.
You can then email your comments to 52200 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#52200; Package emacs. (Tue, 30 Nov 2021 16:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Peter Münster <pm <at> a16n.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 30 Nov 2021 16:25:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Peter Münster <pm <at> a16n.net>
To: Emacs Bugs <bug-gnu-emacs <at> gnu.org>
Subject: 29.0.50; image-dired-cmd-create-standard-thumbnail-options
Date: Tue, 30 Nov 2021 17:24:02 +0100
[Message part 1 (text/plain, inline)]
Hi,

I'm a bit confused about
image-dired-cmd-create-standard-thumbnail-options:

- It seems, that it's not used with pngcrush or pngnq, so this test is
  perhaps useless:
  (unless (or image-dired-cmd-pngcrush-program
              image-dired-cmd-pngnq-program) ...
- If gm is used, then the "convert" command should be added.

The attached patch works for me, but probably I'm missing something...

-- 
           Peter
[my.patch (text/x-patch, inline)]
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 47a44a4a60..159f6a3b97 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -302,19 +302,17 @@ image-dired-cmd-optipng-options
   :link '(url-link "man:optipng(1)"))
 
 (defcustom image-dired-cmd-create-standard-thumbnail-options
-  (append '("-size" "%wx%h" "%f[0]")
-          (unless (or image-dired-cmd-pngcrush-program
-                      image-dired-cmd-pngnq-program)
-            (list
-             "-set" "Thumb::MTime" "%m"
-             "-set" "Thumb::URI" "file://%f"
-             "-set" "Description" "Thumbnail of file://%f"
-             "-set" "Software" (emacs-version)))
-          '("-thumbnail" "%wx%h>" "png:%t"))
+  (let ((opts (list "-size" "%wx%h" "%f[0]"
+              "-set" "Thumb::MTime" "%m"
+              "-set" "Thumb::URI" "file://%f"
+              "-set" "Description" "Thumbnail of file://%f"
+              "-set" "Software" (emacs-version)
+              "-thumbnail" "%wx%h>" "png:%t")))
+      (if (executable-find "gm") (cons "convert" opts) opts))
   "Options for creating thumbnails according to the Thumbnail Managing Standard.
 Available format specifiers are the same as in
 `image-dired-cmd-create-thumbnail-options', with %m for file modification time."
-  :version "26.1"
+  :version "29.1"
   :type '(repeat (string :tag "Argument")))
 
 (defcustom image-dired-cmd-rotate-original-program
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52200; Package emacs. (Thu, 09 Dec 2021 02:02:02 GMT) Full text and rfc822 format available.

Message #8 received at 52200 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Peter Münster <pm <at> a16n.net>
Cc: 52200 <at> debbugs.gnu.org
Subject: Re: bug#52200: 29.0.50;
 image-dired-cmd-create-standard-thumbnail-options
Date: Wed, 8 Dec 2021 18:01:50 -0800
Peter Münster <pm <at> a16n.net> writes:

> I'm a bit confused about
> image-dired-cmd-create-standard-thumbnail-options:
>
> - It seems, that it's not used with pngcrush or pngnq, so this test is
>   perhaps useless:
>   (unless (or image-dired-cmd-pngcrush-program
>               image-dired-cmd-pngnq-program) ...

I think the intention is that we shouldn't insert those text fields
twice.  See the removed code in commit 36b9973dec65 and also
`image-dired-cmd-pngcrush-options'.

Perhaps we could make this unconditional, but then what should we do
about `image-dired-cmd-pngcrush-options'?  Should the options be removed
from there?

> - If gm is used, then the "convert" command should be added.

Yes, I think you are right.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52200; Package emacs. (Fri, 14 Jan 2022 08:00:02 GMT) Full text and rfc822 format available.

Message #11 received at 52200 <at> debbugs.gnu.org (full text, mbox):

From: Peter Münster <pm <at> a16n.net>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 52200 <at> debbugs.gnu.org
Subject: Re: bug#52200: 29.0.50;
 image-dired-cmd-create-standard-thumbnail-options
Date: Fri, 14 Jan 2022 08:59:44 +0100
[Message part 1 (text/plain, inline)]
On Wed, Dec 08 2021, Stefan Kangas wrote:

> Perhaps we could make this unconditional, but then what should we do
> about `image-dired-cmd-pngcrush-options'?  Should the options be removed
> from there?

I don't know...


>> - If gm is used, then the "convert" command should be added.
>
> Yes, I think you are right.

Ok, could you add this part of the patch then please?

TIA,
-- 
           Peter
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52200; Package emacs. (Thu, 15 Sep 2022 18:01:02 GMT) Full text and rfc822 format available.

Message #14 received at 52200 <at> debbugs.gnu.org (full text, mbox):

From: Peter Münster <pm <at> a16n.net>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 52200 <at> debbugs.gnu.org
Subject: Re: bug#52200: 29.0.50;
 image-dired-cmd-create-standard-thumbnail-options
Date: Thu, 15 Sep 2022 19:59:57 +0200
And here the same patch for the latest master:

diff --git a/lisp/image/image-dired-external.el b/lisp/image/image-dired-external.el
index 223d881bcf..fcf2e2edb6 100644
--- a/lisp/image/image-dired-external.el
+++ b/lisp/image/image-dired-external.el
@@ -128,15 +128,13 @@ image-dired-cmd-optipng-options
   :link '(url-link "man:optipng(1)"))
 
 (defcustom image-dired-cmd-create-standard-thumbnail-options
-  (append '("-size" "%wx%h" "%f[0]")
-          (unless (or image-dired-cmd-pngcrush-program
-                      image-dired-cmd-pngnq-program)
-            (list
-             "-set" "Thumb::MTime" "%m"
-             "-set" "Thumb::URI" "file://%f"
-             "-set" "Description" "Thumbnail of file://%f"
-             "-set" "Software" (emacs-version)))
-          '("-thumbnail" "%wx%h>" "png:%t"))
+  (let ((opts (list "-size" "%wx%h" "%f[0]"
+                    "-set" "Thumb::MTime" "%m"
+                    "-set" "Thumb::URI" "file://%f"
+                    "-set" "Description" "Thumbnail of file://%f"
+                    "-set" "Software" (emacs-version)
+                    "-thumbnail" "%wx%h>" "png:%t")))
+    (if (executable-find "gm") (cons "convert" opts) opts))
   "Options for creating thumbnails according to the Thumbnail Managing Standard.
 Available format specifiers are the same as in
 `image-dired-cmd-create-thumbnail-options', with %m for file modification time."

-- 
           Peter




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52200; Package emacs. (Fri, 16 Sep 2022 00:40:02 GMT) Full text and rfc822 format available.

Message #17 received at 52200 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Peter Münster <pm <at> a16n.net>
Cc: 52200 <at> debbugs.gnu.org
Subject: Re: bug#52200: 29.0.50;
 image-dired-cmd-create-standard-thumbnail-options
Date: Thu, 15 Sep 2022 17:39:26 -0700
close 52200 29.1
thanks

Peter Münster <pm <at> a16n.net> writes:

> And here the same patch for the latest master:

Sorry for the delay here.  Your patch LGTM and works for me, so I've
pushed it to master (commit 7ec31d3222).  Thanks.




bug marked as fixed in version 29.1, send any further explanations to 52200 <at> debbugs.gnu.org and Peter Münster <pm <at> a16n.net> Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 16 Sep 2022 00:40:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 14 Oct 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 187 days ago.

Previous Next


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