static gboolean gegl_jpg_load_process (GeglOperation *operation, GeglBuffer *output, const GeglRectangle *result) { GeglChantO *o = GEGL_CHANT_PROPERTIES (operation); GeglRectangle rect={0,0}; gint problem; problem = gegl_jpg_load_query_jpg (o->path, &rect.width, &rect.height); if (problem) { g_warning ("%s failed to open file %s for reading.", G_OBJECT_TYPE_NAME (operation), o->path); return FALSE; } problem = gegl_jpg_load_buffer_import_jpg (output, o->path, 0, 0); if (problem) { g_warning ("%s failed to open file %s for reading.", G_OBJECT_TYPE_NAME (operation), o->path); return FALSE; } return TRUE; }
static gboolean gegl_jpg_load_process (GeglOperation *operation, GeglBuffer *output, const GeglRectangle *result, gint level) { GeglProperties *o = GEGL_PROPERTIES (operation); GFile *file = NULL; GError *err = NULL; gint status = -1; GInputStream *stream = gegl_gio_open_input_stream(o->uri, o->path, &file, &err); if (!stream) return FALSE; status = gegl_jpg_load_buffer_import_jpg(output, stream, 0, 0); g_input_stream_close(stream, NULL, NULL); if (err) { g_warning ("%s failed to open file %s for reading: %s", G_OBJECT_TYPE_NAME (operation), o->path, err->message); g_object_unref(stream); return FALSE; } g_object_unref(stream); return status != 1; }
static gboolean gegl_jpg_load_process (GeglOperation *operation, GeglBuffer *output, const GeglRectangle *result, gint level) { GeglChantO *o = GEGL_CHANT_PROPERTIES (operation); if (gegl_jpg_load_buffer_import_jpg (output, o->path, 0, 0)) { g_warning ("%s failed to open file %s for reading.", G_OBJECT_TYPE_NAME (operation), o->path); return FALSE; } return TRUE; }