If neither load nor begin_load are available fall back to load_animation
Sun Nov 9 23:07:05 2003 Matthias Clasen <maclas@gmx.de> * gdk-pixbuf-io.c (_gdk_pixbuf_generic_image_load): If neither load nor begin_load are available fall back to load_animation and use gdk_pixbuf_animation_get_static_image() to obtain a pixbuf. Inefficient, but at least doesn't crash.
This commit is contained in:
		
				
					committed by
					
						
						Matthias Clasen
					
				
			
			
				
	
			
			
			
						parent
						
							0af9579ea2
						
					
				
				
					commit
					95f163d7d2
				
			@ -1,3 +1,10 @@
 | 
			
		||||
Sun Nov  9 23:07:05 2003  Matthias Clasen  <maclas@gmx.de>
 | 
			
		||||
 | 
			
		||||
	* gdk-pixbuf-io.c (_gdk_pixbuf_generic_image_load): If neither
 | 
			
		||||
	load nor begin_load are available fall back to load_animation 
 | 
			
		||||
	and use gdk_pixbuf_animation_get_static_image() to obtain a 
 | 
			
		||||
	pixbuf. Inefficient, but at least doesn't crash.
 | 
			
		||||
 | 
			
		||||
Sun Nov  9 21:56:20 2003  Matthias Clasen  <maclas@gmx.de>
 | 
			
		||||
 | 
			
		||||
	* queryloaders.c (write_loader_info): New function to write 
 | 
			
		||||
 | 
			
		||||
@ -647,11 +647,14 @@ _gdk_pixbuf_generic_image_load (GdkPixbufModule *module,
 | 
			
		||||
	guchar buffer[4096];
 | 
			
		||||
	size_t length;
 | 
			
		||||
	GdkPixbuf *pixbuf = NULL;
 | 
			
		||||
	GdkPixbufAnimation *animation = NULL;
 | 
			
		||||
	gpointer context;
 | 
			
		||||
 | 
			
		||||
	if (module->load != NULL)
 | 
			
		||||
		return (* module->load) (f, error);
 | 
			
		||||
	
 | 
			
		||||
	if (module->begin_load != NULL) {
 | 
			
		||||
		
 | 
			
		||||
		context = module->begin_load (NULL, prepared_notify, NULL, &pixbuf, error);
 | 
			
		||||
	
 | 
			
		||||
		if (!context)
 | 
			
		||||
@ -677,6 +680,22 @@ _gdk_pixbuf_generic_image_load (GdkPixbufModule *module,
 | 
			
		||||
		return pixbuf;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	if (module->load_animation != NULL) {
 | 
			
		||||
		animation = (* module->load_animation) (f, error);
 | 
			
		||||
		if (animation != NULL) {
 | 
			
		||||
			pixbuf = gdk_pixbuf_animation_get_static_image (animation);
 | 
			
		||||
 | 
			
		||||
			g_object_ref (pixbuf);
 | 
			
		||||
 | 
			
		||||
			g_object_unref (animation);
 | 
			
		||||
			
 | 
			
		||||
			return pixbuf;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * gdk_pixbuf_new_from_file:
 | 
			
		||||
 * @filename: Name of file to load.
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user