unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52200: 29.0.50; image-dired-cmd-create-standard-thumbnail-options
@ 2021-11-30 16:24 Peter Münster
  2021-12-09  2:01 ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Münster @ 2021-11-30 16:24 UTC (permalink / raw)
  To: 52200


[-- Attachment #1.1: Type: text/plain, Size: 438 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: my.patch --]
[-- Type: text/x-patch, Size: 1447 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#52200: 29.0.50; image-dired-cmd-create-standard-thumbnail-options
  2021-11-30 16:24 bug#52200: 29.0.50; image-dired-cmd-create-standard-thumbnail-options Peter Münster
@ 2021-12-09  2:01 ` Stefan Kangas
  2022-01-14  7:59   ` Peter Münster
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Kangas @ 2021-12-09  2:01 UTC (permalink / raw)
  To: Peter Münster; +Cc: 52200

Peter Münster <pm@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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#52200: 29.0.50; image-dired-cmd-create-standard-thumbnail-options
  2021-12-09  2:01 ` Stefan Kangas
@ 2022-01-14  7:59   ` Peter Münster
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Münster @ 2022-01-14  7:59 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 52200

[-- Attachment #1: Type: text/plain, Size: 418 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-14  7:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30 16:24 bug#52200: 29.0.50; image-dired-cmd-create-standard-thumbnail-options Peter Münster
2021-12-09  2:01 ` Stefan Kangas
2022-01-14  7:59   ` Peter Münster

Code repositories for project(s) associated with this 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).