🔒 Repository is read-only – file editing is disabled.

PaganLinux/tmp-pixbuf-formats.c main

15 linii Raw ← Powrót
123456789101112131415
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <stdio.h>
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;
}