[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master c0ea1c8: ; Unbreak creating thumbnails in image-dired
From: |
Stefan Kangas |
Subject: |
master c0ea1c8: ; Unbreak creating thumbnails in image-dired |
Date: |
Sun, 24 Oct 2021 12:22:24 -0400 (EDT) |
branch: master
commit c0ea1c8863ea8d9b39a3810435eb4b67e91c2f91
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
; Unbreak creating thumbnails in image-dired
* lisp/image-dired.el (image-dired-insert-thumbnail): Unbreak
creating thumbnails after my previous commit.
---
lisp/image-dired.el | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 19bd971..6d94624 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -551,10 +551,19 @@ Create the thumbnails directory if it does not exist."
Add text properties ORIGINAL-FILE-NAME and ASSOCIATED-DIRED-BUFFER."
(let (beg end)
(setq beg (point))
- (image-dired-insert-image file
- (image-type-from-file-header file)
- image-dired-thumb-relief
- image-dired-thumb-margin)
+ (image-dired-insert-image
+ file
+ ;; Thumbnails are created asynchronously, so we might not yet
+ ;; have a file. But if it exists, it might have been cached from
+ ;; before and we should use it instead of our current settings.
+ (or (and (file-exists-p file)
+ (image-type-from-file-header file))
+ (and (memq image-dired-thumbnail-storage
+ '(standard standard-large))
+ 'png)
+ 'jpeg)
+ image-dired-thumb-relief
+ image-dired-thumb-margin)
(setq end (point))
(add-text-properties
beg end
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master c0ea1c8: ; Unbreak creating thumbnails in image-dired,
Stefan Kangas <=