Use a max-width when displaying images

* lisp/image-mode.el (image-toggle-display-image): Alway rescale images
to not be bigger than the current window.
parent 06e7319c
2014-08-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
* image-mode.el (image-toggle-display-image): Alway rescale images
to not be bigger than the current window.
2014-08-05 Eric Brown <brown@fastmail.fm> (tiny change)
* net/eww.el (eww-bookmarks-directory): New variable.
......
......@@ -638,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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment