summaryrefslogtreecommitdiff
path: root/gtk/tools
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-10-18 07:46:52 -0500
committerMatthias Clasen <mclasen@redhat.com>2019-10-18 08:53:23 -0500
commit3c219bf968fe698269e54896715066acba23db16 (patch)
tree085a3c072e9fdeb6868e3218a6b736e6687c03d1 /gtk/tools
parentc3de5e36246bc82f8eab4afc840945d3c976e441 (diff)
downloadgtk+-3c219bf968fe698269e54896715066acba23db16.tar.gz
Add another symbolic pixbuf helper
Diffstat (limited to 'gtk/tools')
-rw-r--r--gtk/tools/gdkpixbufutils.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gtk/tools/gdkpixbufutils.c b/gtk/tools/gdkpixbufutils.c
index a572f48a82..ae2684adb2 100644
--- a/gtk/tools/gdkpixbufutils.c
+++ b/gtk/tools/gdkpixbufutils.c
@@ -426,6 +426,27 @@ gtk_make_symbolic_pixbuf_from_resource (const char *path,
}
GdkPixbuf *
+gtk_make_symbolic_pixbuf_from_path (const char *path,
+ int width,
+ int height,
+ double scale,
+ GError **error)
+{
+ char *data;
+ gsize size;
+ GdkPixbuf *pixbuf;
+
+ if (!g_file_get_contents (path, &data, &size, error))
+ return NULL;
+
+ pixbuf = gtk_make_symbolic_pixbuf_from_data (data, size, width, height, scale, error);
+
+ g_free (data);
+
+ return pixbuf;
+}
+
+GdkPixbuf *
gtk_make_symbolic_pixbuf_from_file (GFile *file,
int width,
int height,