/*
    Compile with:
gcc -Wall -o gdkpixbuftest2 gdkpixbuftest2.c $(pkg-config gtk+-2.0 --cflags --libs)
*/

#include <gtk/gtk.h>



int main (int argc, char *argv[])
{
    GdkPixbuf *pixbuf;
    gchar *filename;
    GError *error;

    gtk_init (&argc, &argv);
    if (argc != 2) {
        fprintf (stderr, "Please, specify the file to load as parameter!\n");
        return 1;
    }
    filename = argv[1];
    error = NULL;
    pixbuf = gdk_pixbuf_new_from_file (filename, &error);
    if (!pixbuf) {
        fprintf (stderr, "Cannot get pixbuf from file: %s.\n",
            error->message);
        g_error_free (error);
        return 3;
    }
    g_object_unref (pixbuf);
    fprintf (stdout, "All went ok!\n");
    return 0;
}

