[gnome-shell] texture-cache: remove unused base64 code path
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] texture-cache: remove unused base64 code path
- Date: Wed, 15 Oct 2014 01:56:25 +0000 (UTC)
commit 2dc41c944e3594bc0d9636d2515c50a1cbc4f88c
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Sep 18 17:05:04 2014 -0700
texture-cache: remove unused base64 code path
This was introduced in b0c6cf3f to support image data for web search
providers, which do not exist anymore. Just remove it.
https://bugzilla.gnome.org/show_bug.cgi?id=736936
src/st/st-texture-cache.c | 64 ---------------------------------------------
1 files changed, 0 insertions(+), 64 deletions(-)
---
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index c507c4b..8f9a68f 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -405,67 +405,6 @@ out:
return rotated_pixbuf;
}
-static GdkPixbuf*
-decode_image (const char *val)
-{
- int i;
- GError *error = NULL;
- GdkPixbuf *res = NULL;
- struct {
- const char *prefix;
- const char *mime_type;
- } formats[] = {
- { "data:image/x-icon;base64,", "image/x-icon" },
- { "data:image/png;base64,", "image/png" }
- };
-
- g_return_val_if_fail (val, NULL);
-
- for (i = 0; i < G_N_ELEMENTS (formats); i++)
- {
- if (g_str_has_prefix (val, formats[i].prefix))
- {
- gsize len;
- guchar *data = NULL;
- char *unescaped;
-
- unescaped = g_uri_unescape_string (val + strlen (formats[i].prefix), NULL);
- if (unescaped)
- {
- data = g_base64_decode (unescaped, &len);
- g_free (unescaped);
- }
-
- if (data)
- {
- GdkPixbufLoader *loader;
-
- loader = gdk_pixbuf_loader_new_with_mime_type (formats[i].mime_type, &error);
- if (loader &&
- gdk_pixbuf_loader_write (loader, data, len, &error) &&
- gdk_pixbuf_loader_close (loader, &error))
- {
- res = gdk_pixbuf_loader_get_pixbuf (loader);
- g_object_ref (res);
- }
- g_object_unref (loader);
- g_free (data);
- }
- }
- }
- if (!res)
- {
- if (error)
- {
- g_warning ("%s\n", error->message);
- g_error_free (error);
- }
- else
- g_warning ("incorrect data uri");
- }
- return res;
-}
-
static GdkPixbuf *
impl_load_pixbuf_file (const char *uri,
int available_width,
@@ -478,9 +417,6 @@ impl_load_pixbuf_file (const char *uri,
char *contents = NULL;
gsize size;
- if (g_str_has_prefix (uri, "data:"))
- return decode_image (uri);
-
file = g_file_new_for_uri (uri);
if (g_file_load_contents (file, NULL, &contents, &size, NULL, error))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]