]> git.eshelyaron.com Git - emacs.git/commitdiff
gnus-html.el: We can't rescale if we don't have the article buffer in a window.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 2 Sep 2010 00:13:51 +0000 (00:13 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 2 Sep 2010 00:13:51 +0000 (00:13 +0000)
lisp/gnus/gnus-html.el

index 3ce379748e04900bee08fc40722093188ae0e6b8..49e0ea62949917591d1f131a8e3a4b2abef77fa4 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