# HG changeset patch # User Glenn Morris # Date 1177477094 0 # Node ID 27c929c72d0890ec52a16e3b7d8d143bbe5c2fc5 # Parent cd48f62848182af2a8166f374bce3574ddb92022 Mathias Dahl : (image-dired-display-image): Derive image-type from filename rather than assuming jpeg, in case no resizing was needed. diff -r cd48f6284818 -r 27c929c72d08 lisp/image-dired.el --- a/lisp/image-dired.el Wed Apr 25 04:44:28 2007 +0000 +++ b/lisp/image-dired.el Wed Apr 25 04:58:14 2007 +0000 @@ -1774,7 +1774,8 @@ 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 @@ 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)))))