From 2c6690f9def1a40b04bc8294f2dde0e63754fbd4 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Wed, 1 Sep 2010 17:51:24 +0200 Subject: [PATCH] Try to get the rescaling logic right for images that are just wide and not tall. --- lisp/ChangeLog | 2 ++ lisp/gnus-html.el | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4f515a106..54c24be32 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,8 @@ * gnus-html.el (gnus-html-put-image): Use the deleted text as the image alt text. + (gnus-html-rescale-image): Try to get the rescaling logic right for + images that are just wide and not tall. * gnus.el (gnus-string-or): Fix the syntax to not use eval or overshadow variable bindings. diff --git a/lisp/gnus-html.el b/lisp/gnus-html.el index b6b4c5078..3ce379748 100644 --- a/lisp/gnus-html.el +++ b/lisp/gnus-html.el @@ -256,11 +256,14 @@ fit these criteria." (when (> width window-width) (setq window-height (truncate (* window-height (/ (* 1.0 window-width) width))))) - (if (> height window-height) - (or (create-image file 'imagemagick nil - :height window-height) - image) - image)))) + (or + (cond ((> height window-height) + (create-image file 'imagemagick nil + :height window-height)) + ((> width window-width) + (create-image file 'imagemagick nil + :width window-width))) + image)))) (defun gnus-html-prune-cache () (let ((total-size 0) -- 2.25.1