Mercurial > pidgin
diff src/gtkconv.c @ 12601:e63fb8e9f4ac
[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 <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Wed, 21 Dec 2005 18:43:39 +0000 |
parents | e856f985a0b9 |
children | 71299d63801d |
line wrap: on
line diff
--- 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)