aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Danjou2010-12-20 22:12:30 +0000
committerKatsumi Yamaoka2010-12-20 22:12:30 +0000
commitc486dd9609b90cc9f731db8d459afc25d571e446 (patch)
treec6873d718ddaca8a0a66a7fc17198a0ad6577ffb
parentadc0b7934703173b0f351a44181a6317dcf59acf (diff)
downloademacs-c486dd9609b90cc9f731db8d459afc25d571e446.tar.gz
emacs-c486dd9609b90cc9f731db8d459afc25d571e446.zip
Revert "gnus-util: rewrite gnus-rescale-image".
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/gnus-util.el21
2 files changed, 13 insertions, 13 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index c79a6d7f219..42327335286 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -14,11 +14,6 @@
14 14
15 * nnimap.el (nnimap-retrieve-headers): Remove CRLF from the headers. 15 * nnimap.el (nnimap-retrieve-headers): Remove CRLF from the headers.
16 16
172010-12-17 Julien Danjou <julien@danjou.info>
18
19 * gnus-util.el (gnus-rescale-image): Allow to resize images even if
20 they are from file. Can also scale up.
21
222010-12-17 Andrew Cohen <cohen@andy.bu.edu> 172010-12-17 Andrew Cohen <cohen@andy.bu.edu>
23 18
24 * gnus-sum.el (gnus-summary-refer-thread): Simplify code. Restore 19 * gnus-sum.el (gnus-summary-refer-thread): Simplify code. Restore
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 50292f4ff76..fa4bf076a30 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -1983,16 +1983,21 @@ empty directories from OLD-PATH."
1983 "Rescale IMAGE to SIZE if possible. 1983 "Rescale IMAGE to SIZE if possible.
1984SIZE is in format (WIDTH . HEIGHT). Return a new image. 1984SIZE is in format (WIDTH . HEIGHT). Return a new image.
1985Sizes are in pixels." 1985Sizes are in pixels."
1986 (when (fboundp 'imagemagick-types) 1986 (if (or (not (fboundp 'imagemagick-types))
1987 (not (get-buffer-window (current-buffer))))
1988 image
1987 (let ((new-width (car size)) 1989 (let ((new-width (car size))
1988 (new-height (cdr size))) 1990 (new-height (cdr size)))
1989 (unless (= (cdr (image-size image t)) new-height) 1991 (when (> (cdr (image-size image t)) new-height)
1990 (setcdr image (plist-put (cdr image) :type 'imagemagick)) 1992 (setq image (or (create-image (plist-get (cdr image) :data) 'imagemagick t
1991 (setcdr image (plist-put (cdr image) :height new-height))) 1993 :height new-height)
1992 (unless (= (car (image-size image t)) new-width) 1994 image)))
1993 (setcdr image (plist-put (cdr image) :type 'imagemagick)) 1995 (when (> (car (image-size image t)) new-width)
1994 (setcdr image (plist-put (cdr image) :width new-width))))) 1996 (setq image (or
1995 image) 1997 (create-image (plist-get (cdr image) :data) 'imagemagick t
1998 :width new-width)
1999 image)))
2000 image)))
1996 2001
1997(defun gnus-list-memq-of-list (elements list) 2002(defun gnus-list-memq-of-list (elements list)
1998 "Return non-nil if any of the members of ELEMENTS are in LIST." 2003 "Return non-nil if any of the members of ELEMENTS are in LIST."