Index: gnome-vfs-util.c
===================================================================
RCS file: /cvs/gnome/libgnomeui/libgnomeui/gnome-vfs-util.c,v
retrieving revision 1.21
diff -u -p -r1.21 gnome-vfs-util.c
--- gnome-vfs-util.c	10 Aug 2006 08:52:54 -0000	1.21
+++ gnome-vfs-util.c	16 Aug 2006 13:40:43 -0000
@@ -166,6 +166,9 @@ gnome_gdk_pixbuf_new_from_uri_at_scale (
     GnomeVFSFileSize bytes_read;
     GdkPixbufLoader *loader;
     GdkPixbuf *pixbuf;	
+    GdkPixbufAnimation *animation;
+    GdkPixbufAnimationIter *iter;
+    gboolean has_frame;
     SizePrepareContext info;
 
     g_return_val_if_fail (uri != NULL, NULL);
@@ -184,7 +187,10 @@ gnome_gdk_pixbuf_new_from_uri_at_scale (
         info.preserve_aspect_ratio = preserve_aspect_ratio;        
         g_signal_connect (loader, "size-prepared", G_CALLBACK (size_prepared_cb), &info);
     }
-    while (1) {
+
+    has_frame = FALSE;
+
+    while (!has_frame) {
 	result = gnome_vfs_read (handle,
 				 buffer,
 				 sizeof (buffer),
@@ -203,9 +209,15 @@ gnome_gdk_pixbuf_new_from_uri_at_scale (
 	    break;
 	}
 
-	if (gdk_pixbuf_loader_get_pixbuf (loader) != NULL) {
-		break;
+	animation = gdk_pixbuf_loader_get_animation (loader);
+	if (animation) {
+		iter = gdk_pixbuf_animation_get_iter (animation, 0);
+		if (!gdk_pixbuf_animation_iter_on_currently_loading_frame (iter)) {
+			has_frame = TRUE;
+		}
+		g_object_unref (iter);
 	}
+
     }
 
     gdk_pixbuf_loader_close (loader, NULL);
