diff options
| author | Lars Magne Ingebrigtsen | 2010-09-02 00:13:51 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-09-02 00:13:51 +0000 |
| commit | e5e2587e9eb197028c11bd2f4f55c2b52692c580 (patch) | |
| tree | e9e414e24fadddad8e22b4a25d7f5505458861ed | |
| parent | 1ee093a370563552671337470f0991c97c09441f (diff) | |
| download | emacs-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.el | 5 |
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 |