1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

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

This commit is contained in:
Julien Danjou 2010-12-20 22:12:30 +00:00 committed by Katsumi Yamaoka
parent adc0b79347
commit c486dd9609
2 changed files with 13 additions and 13 deletions

View file

@ -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))))
image
(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)))))
image)
(when (> (cdr (image-size image t)) new-height)
(setq image (or (create-image (plist-get (cdr image) :data) 'imagemagick t
:height new-height)
image)))
(when (> (car (image-size image t)) new-width)
(setq image (or
(create-image (plist-get (cdr image) :data) 'imagemagick t
:width new-width)
image)))
image)))
(defun gnus-list-memq-of-list (elements list)
"Return non-nil if any of the members of ELEMENTS are in LIST."