summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-util.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-09-26 15:47:06 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-09-26 15:47:15 +0200
commit8e46cf4ba8c1992f52059cf530f5919f9fc33305 (patch)
tree90b2e4f91a2a0b54667c847c326eec153197e9e0 /lisp/gnus/gnus-util.el
parent74abba27fd8cba91a10ada8b7949a3df3dfce546 (diff)
downloademacs-8e46cf4ba8c1992f52059cf530f5919f9fc33305.tar.gz
emacs-8e46cf4ba8c1992f52059cf530f5919f9fc33305.tar.bz2
emacs-8e46cf4ba8c1992f52059cf530f5919f9fc33305.zip
Fix recent gnus-rescale-image change
* lisp/gnus/gnus-util.el (gnus-rescale-image): Don't bug out on non-graphical Emacs versions.
Diffstat (limited to 'lisp/gnus/gnus-util.el')
-rw-r--r--lisp/gnus/gnus-util.el20
1 files changed, 11 insertions, 9 deletions
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index dc779d04874..3cf364fff8b 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -1610,15 +1610,17 @@ 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."
- (let ((new-width (car size))
- (new-height (cdr size)))
- (when (> (cdr (image-size image t)) new-height)
- (setq image (create-image (plist-get (cdr image) :data) nil t
- :max-height new-height)))
- (when (> (car (image-size image t)) new-width)
- (setq image (create-image (plist-get (cdr image) :data) nil t
- :max-width new-width)))
- image))
+ (if (not (display-graphic-p))
+ image
+ (let ((new-width (car size))
+ (new-height (cdr size)))
+ (when (> (cdr (image-size image t)) new-height)
+ (setq image (create-image (plist-get (cdr image) :data) nil t
+ :max-height new-height)))
+ (when (> (car (image-size image t)) new-width)
+ (setq image (create-image (plist-get (cdr image) :data) nil t
+ :max-width new-width)))
+ image)))
(defun gnus-recursive-directory-files (dir)
"Return all regular files below DIR.