ui/gtk/image.c

changeset 565
54a97e543389
parent 563
6fc93c3b91c9
child 578
950d2e38957b
equal deleted inserted replaced
564:5c08f99b2a09 565:54a97e543389
344 UIEXPORT int ui_image_load_data(UiGeneric *obj, const void *imgdata, size_t size) { 344 UIEXPORT int ui_image_load_data(UiGeneric *obj, const void *imgdata, size_t size) {
345 GBytes *bytes = g_bytes_new_static(imgdata, size); 345 GBytes *bytes = g_bytes_new_static(imgdata, size);
346 GInputStream *in = g_memory_input_stream_new_from_bytes(bytes); 346 GInputStream *in = g_memory_input_stream_new_from_bytes(bytes);
347 GError *error = NULL; 347 GError *error = NULL;
348 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_stream(in, NULL, &error); 348 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_stream(in, NULL, &error);
349 g_object_unref(bytes);
350 g_object_unref(in); 349 g_object_unref(in);
351 if(!pixbuf) { 350 if(!pixbuf) {
352 return 1; 351 return 1;
353 } 352 }
354 353

mercurial