Commit a4eb1b83 authored by Christian Persch's avatar Christian Persch

Remove unused function

parent 95c35971
......@@ -179,70 +179,52 @@ _rsvg_acquire_xlink_href_resource (const char *href, const char *base_uri, GErro
return arr;
}
GdkPixbuf *
rsvg_pixbuf_new_from_href (const char *href, const char *base_uri, GError ** error)
cairo_surface_t *
rsvg_cairo_surface_new_from_href (const char *href,
const char *base_uri,
GError **error)
{
GByteArray *arr;
GdkPixbufLoader *loader;
GdkPixbuf *pixbuf = NULL;
int res;
cairo_surface_t *surface;
arr = _rsvg_acquire_xlink_href_resource (href, base_uri, error);
if (arr) {
GdkPixbufLoader *loader;
GdkPixbuf *pixbuf = NULL;
int res;
loader = gdk_pixbuf_loader_new ();
res = gdk_pixbuf_loader_write (loader, arr->data, arr->len, error);
g_byte_array_free (arr, TRUE);
if (!res) {
gdk_pixbuf_loader_close (loader, NULL);
g_object_unref (loader);
return NULL;
}
if (!gdk_pixbuf_loader_close (loader, error)) {
g_object_unref (loader);
return NULL;
}
if (arr == NULL)
return NULL;
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
if (!pixbuf) {
g_object_unref (loader);
g_set_error (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_FAILED,
_
("Failed to load image '%s': reason not known, probably a corrupt image file"),
href);
return NULL;
}
loader = gdk_pixbuf_loader_new ();
g_object_ref (pixbuf);
res = gdk_pixbuf_loader_write (loader, arr->data, arr->len, error);
g_byte_array_free (arr, TRUE);
if (!res) {
gdk_pixbuf_loader_close (loader, NULL);
g_object_unref (loader);
return pixbuf;
return NULL;
}
return NULL;
}
if (!gdk_pixbuf_loader_close (loader, error)) {
g_object_unref (loader);
return NULL;
}
cairo_surface_t *
rsvg_cairo_surface_new_from_href (const char *href,
const char *base_uri,
GError **error)
{
GdkPixbuf *pixbuf;
cairo_surface_t *surface;
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
pixbuf = rsvg_pixbuf_new_from_href (href, base_uri, error);
if (pixbuf == NULL)
if (!pixbuf) {
g_object_unref (loader);
g_set_error (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_FAILED,
_("Failed to load image '%s': reason not known, probably a corrupt image file"),
href);
return NULL;
}
surface = rsvg_cairo_surface_from_pixbuf (pixbuf);
g_object_unref (pixbuf);
g_object_unref (loader);
return surface;
}
......
......@@ -53,8 +53,6 @@ void rsvg_preserve_aspect_ratio (unsigned int aspect_ratio, double width,
gchar *rsvg_get_file_path (const gchar * filename, const gchar * basedir);
GdkPixbuf *rsvg_pixbuf_new_from_href (const char *href, const char *base_uri, GError ** error);
cairo_surface_t *rsvg_cairo_surface_new_from_href (const char *href, const char *base_uri, GError ** error);
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment