comparison src/gtkaccount.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 c8afbc1bf98b
comparison
equal deleted inserted replaced
12600:e856f985a0b9 12601:e63fb8e9f4ac
571 fread(data, 1, st.st_size, file); 571 fread(data, 1, st.st_size, file);
572 fclose(file); 572 fclose(file);
573 gdk_pixbuf_loader_write(loader, data, st.st_size, NULL); 573 gdk_pixbuf_loader_write(loader, data, st.st_size, NULL);
574 g_free(data); 574 g_free(data);
575 } 575 }
576 gdk_pixbuf_loader_close(loader, NULL);
576 pixbuf = gdk_pixbuf_loader_get_pixbuf(loader); 577 pixbuf = gdk_pixbuf_loader_get_pixbuf(loader);
577 width = gdk_pixbuf_get_width(pixbuf); 578 width = gdk_pixbuf_get_width(pixbuf);
578 height = gdk_pixbuf_get_height(pixbuf); 579 height = gdk_pixbuf_get_height(pixbuf);
579 format = gdk_pixbuf_loader_get_format(loader); 580 format = gdk_pixbuf_loader_get_format(loader);
580 gdk_pixbuf_loader_close(loader, NULL);
581 g_object_unref(G_OBJECT(loader)); 581 g_object_unref(G_OBJECT(loader));
582 #endif 582 #endif
583 pixbuf_formats = gdk_pixbuf_format_get_extensions(format); 583 pixbuf_formats = gdk_pixbuf_format_get_extensions(format);
584 584
585 if (str_array_match(pixbuf_formats, prpl_formats) && /* This is an acceptable format AND */ 585 if (str_array_match(pixbuf_formats, prpl_formats) && /* This is an acceptable format AND */