emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r101289: gnus-html.el (gnus-html-resc


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101289: gnus-html.el (gnus-html-rescale-image): Yet another try at getting the image sizing right.
Date: Thu, 02 Sep 2010 01:46:34 +0000
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101289
author: Lars Magne Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Thu 2010-09-02 01:46:34 +0000
message:
  gnus-html.el (gnus-html-rescale-image): Yet another try at getting the image 
sizing right.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-html.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2010-09-02 01:33:31 +0000
+++ b/lisp/gnus/ChangeLog       2010-09-02 01:46:34 +0000
@@ -3,6 +3,8 @@
        * gnus-html.el (gnus-html-wash-tags): Don't show images that are really
        small. They're probably tracking images.
        (gnus-html-wash-tags): Remove all <pre_int> place holders.
+       (gnus-html-rescale-image): Yet another try at getting the image sizing
+       right.
 
        * nntp.el (nntp-request-set-mark): Refuse to do marks if
        nntp-marks-file-name is nil.

=== modified file 'lisp/gnus/gnus-html.el'
--- a/lisp/gnus/gnus-html.el    2010-09-02 01:42:32 +0000
+++ b/lisp/gnus/gnus-html.el    2010-09-02 01:46:34 +0000
@@ -274,14 +274,16 @@
           (window-height (truncate (* gnus-max-image-proportion
                                       (- (nth 3 edges) (nth 1 edges)))))
           scaled-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))))
+      (when (> height window-height)
+       (setq image (or (create-image file 'imagemagick nil
+                                     :height window-height)
+                       image))
+       (when (> (car (image-size image t)) window-width)
+         (setq image (or
+                      (create-image file 'imagemagick nil
+                                    :width window-width)
+                      image))))
+      image)))
 
 (defun gnus-html-prune-cache ()
   (let ((total-size 0)
@@ -301,7 +303,6 @@
          (decf total-size (cadr file))
          (delete-file (nth 2 file)))))))
 
-
 (defun gnus-html-image-url-blocked-p (url blocked-images)
 "Find out if URL is blocked by BLOCKED-IMAGES."
   (let ((ret (and blocked-images


reply via email to

[Prev in Thread] Current Thread [Next in Thread]