From 1ee093a370563552671337470f0991c97c09441f Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Thu, 2 Sep 2010 00:08:22 +0000 Subject: gnus-html.el: Try to get the rescaling logic right for images that are just wide and not tall. --- lisp/gnus/ChangeLog | 2 ++ lisp/gnus/gnus-html.el | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index b85a4ce1c9..09e7407a6c 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/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/gnus-html.el b/lisp/gnus/gnus-html.el index b6b4c50782..3ce379748e 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/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) -- cgit v1.2.3