#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>


int main(int argc, char *argv[]) {
    GError *gerror;
    GdkPixbuf *originalpb;
    char filename[64];

    gtk_set_locale();
    gtk_init(&argc, &argv);

    strcpy(filename, argv[1]);

    gerror = NULL;
    originalpb = gdk_pixbuf_new_from_file(filename, &gerror);

    if(gerror) {
        printf("error message: %s\n", gerror->message);
        exit(1);
    }

    printf("size: %d x %d\n",
            gdk_pixbuf_get_width(originalpb),
            gdk_pixbuf_get_height(originalpb));

    g_object_unref(originalpb);

    return 0;
}
