Re: Simple GDK app segfaults for unknown reason



Laszls Monda schrieb:
Hi List,

I've just written a simple GDK application that basically converts an
input JPEG image to a BMP using a Pixbuf.

Unfortunately it segfaults.

----8<----

#include <gtk/gtk.h>

int main(int argc, char *argv[])
{
    gdk_init(&argc, &argv);

    GError **error = NULL;
    GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file("input.jpg", error);

What is the value of **error here? In case of no error, is the
return value pixbuf == NULL?

    gdk_pixbuf_save(pixbuf, "output.bmp", "bmp", error);

Is bmp supported (determine it with gdk_pixbuf_get_formats () - see
documentation)


    return 0;
}

----8<----

Could someone here explain why does it segfault?


Cheers,

Andy




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]