Commit c486dd96 authored by Julien Danjou's avatar Julien Danjou Committed by Katsumi Yamaoka
Browse files

Revert "gnus-util: rewrite gnus-rescale-image".

parent adc0b793
......@@ -14,11 +14,6 @@
* nnimap.el (nnimap-retrieve-headers): Remove CRLF from the headers.
2010-12-17 Julien Danjou <>
* gnus-util.el (gnus-rescale-image): Allow to resize images even if
they are from file. Can also scale up.
2010-12-17 Andrew Cohen <>
* gnus-sum.el (gnus-summary-refer-thread): Simplify code. Restore
......@@ -1983,16 +1983,21 @@ empty directories from OLD-PATH."
"Rescale IMAGE to SIZE if possible.
SIZE is in format (WIDTH . HEIGHT). Return a new image.
Sizes are in pixels."
(when (fboundp 'imagemagick-types)
(if (or (not (fboundp 'imagemagick-types))
(not (get-buffer-window (current-buffer))))
(let ((new-width (car size))
(new-height (cdr size)))
(unless (= (cdr (image-size image t)) new-height)
(setcdr image (plist-put (cdr image) :type 'imagemagick))
(setcdr image (plist-put (cdr image) :height new-height)))
(unless (= (car (image-size image t)) new-width)
(setcdr image (plist-put (cdr image) :type 'imagemagick))
(setcdr image (plist-put (cdr image) :width new-width)))))
(when (> (cdr (image-size image t)) new-height)
(setq image (or (create-image (plist-get (cdr image) :data) 'imagemagick t
:height new-height)
(when (> (car (image-size image t)) new-width)
(setq image (or
(create-image (plist-get (cdr image) :data) 'imagemagick t
:width new-width)
(defun gnus-list-memq-of-list (elements list)
"Return non-nil if any of the members of ELEMENTS are in LIST."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment