From: Stefan Kangas Date: Sun, 24 Oct 2021 10:26:39 +0000 (+0200) Subject: Don't hard-code image-dired thumbnail type X-Git-Tag: emacs-29.0.90~3671^2~450 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6b0a1b4fdf4331eb302b6af310989e2981dcd1c5;p=emacs.git 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. --- diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 863cd0fde2f..19bd97192d7 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))