We can't rescale if we don't have the article buffer in a window.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Wed, 1 Sep 2010 15:55:28 +0000 (17:55 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Wed, 1 Sep 2010 15:55:28 +0000 (17:55 +0200)
lisp/gnus-html.el

index 3ce3797..49e0ea6 100644 (file)
@@ -243,11 +243,12 @@ fit these criteria."
          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