#include #include int main(void) { GSList *formats = gdk_pixbuf_get_formats(); int n = 0, png = 0; for (GSList *l = formats; l; l = l->next) { GdkPixbufFormat *f = (GdkPixbufFormat *)l->data; const char *name = gdk_pixbuf_format_get_name(f); gchar **exts = gdk_pixbuf_format_get_extensions(f); if (name) { n++; if (g_ascii_strcasecmp(name, "png") == 0) png++; } g_strfreev(exts); } printf("TOTAL_FORMATS=%d PNG_FORMATS=%d\n", n, png); return 0; }