summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2007-04-25 04:58:14 +0000
committerGlenn Morris <rgm@gnu.org>2007-04-25 04:58:14 +0000
commite0717d738dcdfb9f87d421048d5c1a1db97e2c84 (patch)
tree1c98f0d26f7a0f9d7c897ec787be60d769d7e6e6
parentebdaed17f4b48e115c49c9eac5bbc85631172be4 (diff)
downloademacs-e0717d738dcdfb9f87d421048d5c1a1db97e2c84.tar.gz
Mathias Dahl <mathias.dahl at gmail.com>:
(image-dired-display-image): Derive image-type from filename rather than assuming jpeg, in case no resizing was needed.
-rw-r--r--lisp/image-dired.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index ed330410d88..49c9832cbcf 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -1774,7 +1774,8 @@ should feel snappy enough.
If optional argument ORIGINAL-SIZE is non-nil, display image in its
original size."
(let ((new-file (expand-file-name image-dired-temp-image-file))
- width height command ret)
+ width height command ret
+ (image-type 'jpeg))
(setq file (expand-file-name file))
(if (not original-size)
(progn
@@ -1793,12 +1794,13 @@ original size."
shell-command-switch command))
(if (not (= 0 ret))
(error "Could not resize image")))
+ (setq image-type (image-type-from-file-name file))
(copy-file file new-file t))
(with-current-buffer (image-dired-create-display-image-buffer)
(let ((inhibit-read-only t))
(erase-buffer)
(clear-image-cache)
- (image-dired-insert-image image-dired-temp-image-file 'jpeg 0 0)
+ (image-dired-insert-image image-dired-temp-image-file image-type 0 0)
(goto-char (point-min))
(image-dired-update-property 'original-file-name file)))))