summaryrefslogtreecommitdiff
path: root/lisp/image-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r--lisp/image-mode.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index de6bb85bcb6..76a64220413 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -90,6 +90,8 @@ otherwise it defaults to t, used for times when the buffer is not displayed."
(defun image-mode-window-put (prop val &optional winprops)
(unless (consp winprops) (setq winprops (image-mode-winprops winprops)))
+ (unless (eq t (car winprops))
+ (image-mode-window-put prop val t))
(setcdr winprops (cons (cons prop val)
(delq (assq prop (cdr winprops)) (cdr winprops)))))
@@ -636,8 +638,14 @@ was inserted."
(string-make-unibyte
(buffer-substring-no-properties (point-min) (point-max)))
filename))
- (type (image-type file-or-data nil data-p))
- (image (create-image file-or-data type data-p))
+ (edges (window-inside-pixel-edges
+ (get-buffer-window (current-buffer))))
+ (type (if (fboundp 'imagemagick-types)
+ 'imagemagick
+ (image-type file-or-data nil data-p)))
+ (image (create-image file-or-data type data-p
+ :max-width (- (nth 2 edges) (nth 0 edges))
+ :max-height (- (nth 3 edges) (nth 1 edges))))
(inhibit-read-only t)
(buffer-undo-list t)
(modified (buffer-modified-p))