emacs-diffs
[Top][All Lists]
Advanced

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

master 6b0a1b4: Don't hard-code image-dired thumbnail type


From: Stefan Kangas
Subject: master 6b0a1b4: Don't hard-code image-dired thumbnail type
Date: Sun, 24 Oct 2021 06:27:13 -0400 (EDT)

branch: master
commit 6b0a1b4fdf4331eb302b6af310989e2981dcd1c5
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Don't hard-code image-dired thumbnail type
    
    * lisp/image-dired.el (image-dired-insert-thumbnail): Detect thumbnail
    image type instead of hard-coding it.
---
 lisp/image-dired.el | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 863cd0f..19bd971 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -543,11 +543,7 @@ Create the thumbnails directory if it does not exist."
                           (file-attribute-modification-time
                            (file-attributes file))))
       (image-dired-create-thumb file thumb-file))
-    (create-image thumb-file)
-;;     (list 'image :type 'jpeg
-;;           :file thumb-file
-;;       :relief image-dired-thumb-relief :margin image-dired-thumb-margin)
-    ))
+    (create-image thumb-file)))
 
 (defun image-dired-insert-thumbnail (file original-file-name
                                      associated-dired-buffer)
@@ -556,10 +552,7 @@ Add text properties ORIGINAL-FILE-NAME and 
ASSOCIATED-DIRED-BUFFER."
   (let (beg end)
     (setq beg (point))
     (image-dired-insert-image file
-                        ;; TODO: this should depend on the real file type
-                        (if (memq image-dired-thumbnail-storage
-                                  '(standard standard-large))
-                            'png 'jpeg)
+                        (image-type-from-file-header file)
                         image-dired-thumb-relief
                         image-dired-thumb-margin)
     (setq end (point))



reply via email to

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