diff options
| -rw-r--r-- | lisp/gnus/gnus-util.el | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 6847d372cc5..dc779d04874 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el | |||
| @@ -1606,26 +1606,19 @@ empty directories from OLD-PATH." | |||
| 1606 | (ignore-errors | 1606 | (ignore-errors |
| 1607 | (set-file-modes filename mode))) | 1607 | (set-file-modes filename mode))) |
| 1608 | 1608 | ||
| 1609 | (declare-function image-size "image.c" (spec &optional pixels frame)) | ||
| 1610 | |||
| 1611 | (defun gnus-rescale-image (image size) | 1609 | (defun gnus-rescale-image (image size) |
| 1612 | "Rescale IMAGE to SIZE if possible. | 1610 | "Rescale IMAGE to SIZE if possible. |
| 1613 | SIZE is in format (WIDTH . HEIGHT). Return a new image. | 1611 | SIZE is in format (WIDTH . HEIGHT). Return a new image. |
| 1614 | Sizes are in pixels." | 1612 | Sizes are in pixels." |
| 1615 | (if (not (fboundp 'imagemagick-types)) | 1613 | (let ((new-width (car size)) |
| 1616 | image | 1614 | (new-height (cdr size))) |
| 1617 | (let ((new-width (car size)) | 1615 | (when (> (cdr (image-size image t)) new-height) |
| 1618 | (new-height (cdr size))) | 1616 | (setq image (create-image (plist-get (cdr image) :data) nil t |
| 1619 | (when (> (cdr (image-size image t)) new-height) | 1617 | :max-height new-height))) |
| 1620 | (setq image (or (create-image (plist-get (cdr image) :data) 'imagemagick t | 1618 | (when (> (car (image-size image t)) new-width) |
| 1621 | :height new-height) | 1619 | (setq image (create-image (plist-get (cdr image) :data) nil t |
| 1622 | image))) | 1620 | :max-width new-width))) |
| 1623 | (when (> (car (image-size image t)) new-width) | 1621 | image)) |
| 1624 | (setq image (or | ||
| 1625 | (create-image (plist-get (cdr image) :data) 'imagemagick t | ||
| 1626 | :width new-width) | ||
| 1627 | image))) | ||
| 1628 | image))) | ||
| 1629 | 1622 | ||
| 1630 | (defun gnus-recursive-directory-files (dir) | 1623 | (defun gnus-recursive-directory-files (dir) |
| 1631 | "Return all regular files below DIR. | 1624 | "Return all regular files below DIR. |