rsvg_acquire_base64_resource (const char *data, GError ** error)
{
    GByteArray *array = NULL;
    gsize data_len, written_len;
    int state = 0;
    guint save = 0;

    rsvg_return_val_if_fail (data != NULL, NULL, error);

    while (*data)
        if (*data++ == ',')
            break;

    data_len = strlen (data);
    array = g_byte_array_sized_new (data_len / 4 * 3);
    written_len = g_base64_decode_step (data, data_len, array->data,
                                        &state, &save);
    g_byte_array_set_size (array, written_len);

    return array;
}
rsvg_acquire_base64_resource (const char *data, GError ** error)
{
    GByteArray *array = NULL;
    gsize data_len, written_len;
    int state = 0;
    guint save = 0;

    rsvg_return_val_if_fail (data != NULL, NULL, error);

    while (*data)
        if (*data++ == ',')
            break;

    data_len = strlen (data);
    array = g_byte_array_sized_new (data_len / 4 * 3);
    written_len = g_base64_decode_step (data, data_len, array->data,
                                        &state, &save);
    g_byte_array_set_size (array, written_len);

    return array;
}