}
static GdkPixbuf *
-load_symbolic_svg (const char *file_data,
- gsize file_len,
+load_symbolic_svg (const char *escaped_file_data,
int width,
int height,
double scale,
GdkPixbuf *pixbuf;
gchar *data;
gchar *svg_width, *svg_height;
- gchar *escaped_file_data;
if (width == 0)
width = icon_width * scale;
svg_width = g_strdup_printf ("%d", icon_width);
svg_height = g_strdup_printf ("%d", icon_height);
- escaped_file_data = g_base64_encode ((guchar *) file_data, file_len);
-
data = g_strconcat ("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
"<svg version=\"1.1\"\n"
" xmlns=\"http://www.w3.org/2000/svg\"\n"
" <xi:include href=\"data:text/xml;base64,", escaped_file_data, "\"/>\n"
"</svg>",
NULL);
- g_free (escaped_file_data);
g_free (svg_width);
g_free (svg_height);
GdkPixbuf *pixbuf = NULL;
int plane;
int icon_width, icon_height;
+ char *escaped_file_data;
/* Fetch size from the original icon */
{
g_object_unref (reference);
}
+ escaped_file_data = g_base64_encode ((guchar *) file_data, file_len);
+
for (plane = 0; plane < 3; plane++)
{
/* Here we render the svg with all colors solid, this should
* channels, with the color of the fg being implicitly
* the "rest", as all color fractions should add up to 1.
*/
- loaded = load_symbolic_svg (file_data, file_len, width, height, scale,
+ loaded = load_symbolic_svg (escaped_file_data, width, height, scale,
icon_width,
icon_height,
g_string,
g_object_unref (loaded);
}
+ g_free (escaped_file_data);
+
return pixbuf;
}