changeset 25955:3daaee890b1e

(prepare_image_for_display): Don't try to load image if loading it failed before. (lookup_image, prepare_image_for_display): Remember if loading the image failed. (xpm_load): Add missing UNBLOCK_INPUT.
author Gerd Moellmann <gerd@gnu.org>
date Sat, 09 Oct 1999 19:47:16 +0000
parents ab0d41b6f746
children 6f9d624b1ba7
files src/xfns.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Sat Oct 09 19:46:41 1999 +0000
+++ b/src/xfns.c	Sat Oct 09 19:47:16 1999 +0000
@@ -5819,8 +5819,8 @@
 
   /* If IMG doesn't have a pixmap yet, load it now, using the image
      type dependent loader function.  */
-  if (img->pixmap == 0)
-    img->type->load (f, img);
+  if (img->pixmap == 0 && !img->load_failed_p)
+    img->load_failed_p = img->type->load (f, img) == 0;
 }
      
 
@@ -6066,16 +6066,15 @@
   /* If not found, create a new image and cache it.  */
   if (img == NULL)
     {
-      int loading_failed_p;
-      
       img = make_image (spec, hash);
       cache_image (f, img);
-      loading_failed_p = img->type->load (f, img) == 0;
+      img->load_failed_p = img->type->load (f, img) == 0;
+      xassert (!interrupt_input_blocked);
 
       /* If we can't load the image, and we don't have a width and
 	 height, use some arbitrary width and height so that we can
 	 draw a rectangle for it.  */
-      if (loading_failed_p)
+      if (img->load_failed_p)
 	{
 	  Lisp_Object value;
 
@@ -7088,6 +7087,7 @@
       if (!STRINGP (file))
 	{
 	  image_error ("Cannot find image file %s", specified_file, Qnil);
+	  UNBLOCK_INPUT;
 	  return 0;
 	}