| 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 |