# HG changeset patch # User Richard Laager # Date 1135190619 0 # Node ID e63fb8e9f4accbdc5d64224303a9284102a2d0dd # Parent e856f985a0b9518694f6083adc5ab6b21719ab94 [gaim-migrate @ 14935] Jason LeBrun wrote to gaim-devel: "I have found a small quirk in the way gdk_pixbuf_loader works. When you are using it without signalling, the proper way to use it is to call gdk_pixbuf_loader_close *before* calling gdk_pixbuf_loader_get_animation or gdk_pixbuf_loader_get_pixbuf. The call to gdk_pixbuf_loader_close signals that no more writes will be occuring. In particular, this affects images that are less than 1k in size. If gdk_pixbuf_loader_close is not called before _get_animation, the loader will not return anything unless it has received more than 1k of data (the file type sniffing buffer size) or it has been closed. So, the proper order of calls for loaders in the gtk*.c code is: gdk_pixbuf_loader_new(); gdk_pixbuf_loader_write(); gdk_pixbuf_loader_close(); gdk_pixbuf_loader_get_animation();" I know we fixed a bug by changing this in one place. I've gone through and updated the rest. committer: Tailor Script diff -r e856f985a0b9 -r e63fb8e9f4ac src/gtkaccount.c --- a/src/gtkaccount.c Wed Dec 21 18:36:19 2005 +0000 +++ b/src/gtkaccount.c Wed Dec 21 18:43:39 2005 +0000 @@ -573,11 +573,11 @@ gdk_pixbuf_loader_write(loader, data, st.st_size, NULL); g_free(data); } + gdk_pixbuf_loader_close(loader, NULL); pixbuf = gdk_pixbuf_loader_get_pixbuf(loader); width = gdk_pixbuf_get_width(pixbuf); height = gdk_pixbuf_get_height(pixbuf); format = gdk_pixbuf_loader_get_format(loader); - gdk_pixbuf_loader_close(loader, NULL); g_object_unref(G_OBJECT(loader)); #endif pixbuf_formats = gdk_pixbuf_format_get_extensions(format); diff -r e856f985a0b9 -r e63fb8e9f4ac src/gtkblist.c --- a/src/gtkblist.c Wed Dec 21 18:36:19 2005 +0000 +++ b/src/gtkblist.c Wed Dec 21 18:43:39 2005 +0000 @@ -2061,10 +2061,10 @@ loader = gdk_pixbuf_loader_new(); data = gaim_buddy_icon_get_data(icon, &len); gdk_pixbuf_loader_write(loader, data, len, NULL); + gdk_pixbuf_loader_close(loader, NULL); buf = gdk_pixbuf_loader_get_pixbuf(loader); if (buf) g_object_ref(G_OBJECT(buf)); - gdk_pixbuf_loader_close(loader, NULL); g_object_unref(G_OBJECT(loader)); if (buf) { diff -r e856f985a0b9 -r e63fb8e9f4ac src/gtkconv.c --- a/src/gtkconv.c Wed Dec 21 18:36:19 2005 +0000 +++ b/src/gtkconv.c Wed Dec 21 18:43:39 2005 +0000 @@ -5506,10 +5506,10 @@ loader = gdk_pixbuf_loader_new(); gdk_pixbuf_loader_write(loader, data, len, NULL); + gdk_pixbuf_loader_close(loader, &err); anim = gdk_pixbuf_loader_get_animation(loader); if (anim) g_object_ref(G_OBJECT(anim)); - gdk_pixbuf_loader_close(loader, &err); g_object_unref(loader); if (!anim)