emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 6498a1a 1/2: Add support for pngquant to image-dired


From: Stefan Kangas
Subject: master 6498a1a 1/2: Add support for pngquant to image-dired
Date: Sun, 24 Oct 2021 13:51:33 -0400 (EDT)

branch: master
commit 6498a1a3ad82c52045c07a4b2009a1ffd641dce6
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Add support for pngquant to image-dired
    
    * lisp/image-dired.el (image-dired-cmd-pngnq-program)
    (image-dired-cmd-pngnq-options): Add support for pngquant.
    Prefer, in this order: pngquant, pngnq-s9, pngnq-s for reasons of
    speed and how actively maintained the projects seem to be.
---
 lisp/image-dired.el | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 6d94624..13b2e5b 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -245,16 +245,23 @@ is replaced by the file name of the temporary file."
   :type '(repeat (string :tag "Argument")))
 
 (defcustom image-dired-cmd-pngnq-program
-  (or (executable-find "pngnq")
-      (executable-find "pngnq-s9"))
-  "The file name of the `pngnq' program.
+  ;; Prefer pngquant to pngnq-s9 as it is faster on my machine.
+  ;;   The project also seems more active than the alternatives.
+  ;; Prefer pngnq-s9 to pngnq as it fixes bugs in pngnq.
+  ;; The pngnq project seems dead (?) since 2011 or so.
+  (or (executable-find "pngquant")
+      (executable-find "pngnq-s9")
+      (executable-find "pngnq"))
+  "The file name of the `pngquant' or `pngnq' program.
 It quantizes colors of PNG images down to 256 colors or fewer
 using the NeuQuant algorithm."
-  :version "26.1"
+  :version "29.1"
   :type '(choice (const :tag "Not Set" nil) file))
 
 (defcustom image-dired-cmd-pngnq-options
-  '("-f" "%t")
+  (if (executable-find "pngquant")
+      '("--ext" "-nq8.png" "%t") ; same extension as "pngnq"
+    '("-f" "%t"))
   "Arguments to pass `image-dired-cmd-pngnq-program'.
 Available format specifiers are the same as in
 `image-dired-cmd-create-thumbnail-options'."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]