changeset 110098:3e3e1965a2c2

gnus-html.el: We can't rescale if we don't have the article buffer in a window.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Thu, 02 Sep 2010 00:13:51 +0000
parents 19dfa5177fdd
children 7a6012e13748
files lisp/gnus/gnus-html.el
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/gnus-html.el	Thu Sep 02 00:08:22 2010 +0000
+++ b/lisp/gnus/gnus-html.el	Thu Sep 02 00:13:51 2010 +0000
@@ -243,11 +243,12 @@
 	  nil)))))
 
 (defun gnus-html-rescale-image (image)
-  (if (not (fboundp 'imagemagick-types))
+  (if (or (not (fboundp 'imagemagick-types))
+	  (not (get-buffer-window (current-buffer))))
       image
     (let* ((width (car (image-size image t)))
 	   (height (cdr (image-size image t)))
-	   (edges (window-pixel-edges))
+	   (edges (window-pixel-edges (get-buffer-window (current-buffer))))
 	   (window-width (truncate (* gnus-max-image-proportion
 				      (- (nth 2 edges) (nth 0 edges)))))
 	   (window-height (truncate (* gnus-max-image-proportion