aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2010-09-02 00:13:51 +0000
committerKatsumi Yamaoka2010-09-02 00:13:51 +0000
commite5e2587e9eb197028c11bd2f4f55c2b52692c580 (patch)
treee9e414e24fadddad8e22b4a25d7f5505458861ed
parent1ee093a370563552671337470f0991c97c09441f (diff)
downloademacs-e5e2587e9eb197028c11bd2f4f55c2b52692c580.tar.gz
emacs-e5e2587e9eb197028c11bd2f4f55c2b52692c580.zip
gnus-html.el: We can't rescale if we don't have the article buffer in a window.
-rw-r--r--lisp/gnus/gnus-html.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el
index 3ce379748e0..49e0ea62949 100644
--- a/lisp/gnus/gnus-html.el
+++ b/lisp/gnus/gnus-html.el
@@ -243,11 +243,12 @@ fit these criteria."
243 nil))))) 243 nil)))))
244 244
245(defun gnus-html-rescale-image (image) 245(defun gnus-html-rescale-image (image)
246 (if (not (fboundp 'imagemagick-types)) 246 (if (or (not (fboundp 'imagemagick-types))
247 (not (get-buffer-window (current-buffer))))
247 image 248 image
248 (let* ((width (car (image-size image t))) 249 (let* ((width (car (image-size image t)))
249 (height (cdr (image-size image t))) 250 (height (cdr (image-size image t)))
250 (edges (window-pixel-edges)) 251 (edges (window-pixel-edges (get-buffer-window (current-buffer))))
251 (window-width (truncate (* gnus-max-image-proportion 252 (window-width (truncate (* gnus-max-image-proportion
252 (- (nth 2 edges) (nth 0 edges))))) 253 (- (nth 2 edges) (nth 0 edges)))))
253 (window-height (truncate (* gnus-max-image-proportion 254 (window-height (truncate (* gnus-max-image-proportion