]> git.eshelyaron.com Git - emacs.git/commitdiff
gnus-html.el: Try to get the rescaling logic right for images that are just wide...
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 2 Sep 2010 00:08:22 +0000 (00:08 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 2 Sep 2010 00:08:22 +0000 (00:08 +0000)
lisp/gnus/ChangeLog
lisp/gnus/gnus-html.el

index b85a4ce1c931dff580c7bcf0be5805447924d98e..09e7407a6c17933f9b9d803bc31a88beb16caa73 100644 (file)
@@ -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.
index b6b4c5078253135ab8b1da16b88e3da670646c11..3ce379748e04900bee08fc40722093188ae0e6b8 100644 (file)
@@ -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)