aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen <[email protected]>2010-09-02 00:08:22 +0000
committerKatsumi Yamaoka <[email protected]>2010-09-02 00:08:22 +0000
commit1ee093a370563552671337470f0991c97c09441f (patch)
tree5f5fe6cbb48e318500e596fddbc6c77bc38ef472
parent075843d346ec303963e065a8fe61a98a4210dc16 (diff)
gnus-html.el: Try to get the rescaling logic right for images that are just wide and not tall.
-rw-r--r--lisp/gnus/ChangeLog2
-rw-r--r--lisp/gnus/gnus-html.el13
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)