diff lisp/gnus/mm-decode.el @ 78006:a8c400af8ac9

Merge from gnus--rel--5.10 Patches applied: * emacs--devo--0 (patch 725, 740-741, 749, 768, 777, 786, 788-789, 792) - Merge from gnus--rel--5.10 - Update from CVS - Merge from emacs--rel--22, gnus--rel--5.10 * gnus--rel--5.10 (patch 217-229) - Update from CVS - Merge from emacs--devo--0, emacs--rel--22 Revision: emacs@sv.gnu.org/emacs--rel--22--patch-44
author Miles Bader <miles@gnu.org>
date Thu, 14 Jun 2007 10:02:55 +0000
parents e3694f1cb928
children 24202b793a08 e9f94688a064
line wrap: on
line diff
--- a/lisp/gnus/mm-decode.el	Wed Jun 13 19:08:44 2007 +0000
+++ b/lisp/gnus/mm-decode.el	Thu Jun 14 10:02:55 2007 +0000
@@ -1371,18 +1371,19 @@
 (defun mm-image-fit-p (handle)
   "Say whether the image in HANDLE will fit the current window."
   (let ((image (mm-get-image handle)))
-    (if (fboundp 'glyph-width)
-	;; XEmacs' glyphs can actually tell us about their width, so
-	;; lets be nice and smart about them.
-	(or mm-inline-large-images
-	    (and (< (glyph-width image) (window-pixel-width))
-		 (< (glyph-height image) (window-pixel-height))))
-      (let* ((size (image-size image))
-	     (w (car size))
-	     (h (cdr size)))
-	(or mm-inline-large-images
-	    (and (< h (1- (window-height))) ; Don't include mode line.
-		 (< w (window-width))))))))
+    (or (not image)
+	(if (fboundp 'glyph-width)
+	    ;; XEmacs' glyphs can actually tell us about their width, so
+	    ;; lets be nice and smart about them.
+	    (or mm-inline-large-images
+		(and (<= (glyph-width image) (window-pixel-width))
+		     (<= (glyph-height image) (window-pixel-height))))
+	  (let* ((size (image-size image))
+		 (w (car size))
+		 (h (cdr size)))
+	    (or mm-inline-large-images
+		(and (<= h (1- (window-height))) ; Don't include mode line.
+		     (<= w (window-width)))))))))
 
 (defun mm-valid-image-format-p (format)
   "Say whether FORMAT can be displayed natively by Emacs."