From: Lars Magne Ingebrigtsen Date: Thu, 2 Sep 2010 00:08:22 +0000 (+0000) Subject: gnus-html.el: Try to get the rescaling logic right for images that are just wide... X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~48^2~154 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1ee093a370563552671337470f0991c97c09441f;p=emacs.git gnus-html.el: Try to get the rescaling logic right for images that are just wide and not tall. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index b85a4ce1c93..09e7407a6c1 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 b6b4c507825..3ce379748e0 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)