emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 8e46cf4: Fix recent gnus-rescale-image change


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 8e46cf4: Fix recent gnus-rescale-image change
Date: Thu, 26 Sep 2019 09:47:21 -0400 (EDT)

branch: master
commit 8e46cf4ba8c1992f52059cf530f5919f9fc33305
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Fix recent gnus-rescale-image change
    
    * lisp/gnus/gnus-util.el (gnus-rescale-image): Don't bug out on
    non-graphical Emacs versions.
---
 lisp/gnus/gnus-util.el | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index dc779d0..3cf364f 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]