aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen <[email protected]>2010-09-02 01:46:34 +0000
committerKatsumi Yamaoka <[email protected]>2010-09-02 01:46:34 +0000
commitae682ff5aeacc6e99a76d567b487cd2fa0d9a4a9 (patch)
treea2331b874172c2223940ea33a173f80c573a5d59 /lisp
parentc9fc72fa5acddcdc670a2eb89a777f48fb031820 (diff)
gnus-html.el (gnus-html-rescale-image): Yet another try at getting the image sizing right.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/ChangeLog2
-rw-r--r--lisp/gnus/gnus-html.el19
2 files changed, 12 insertions, 9 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 4685373cf5..735536971e 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -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.
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el
index 6824fbf7d3..7e13a0bde9 100644
--- a/lisp/gnus/gnus-html.el
+++ b/lisp/gnus/gnus-html.el
@@ -274,14 +274,16 @@ fit these criteria."
(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 @@ fit these criteria."
(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