Add another symbolic pixbuf helper

This commit is contained in:
Matthias Clasen 2019-10-18 07:46:52 -05:00
parent c3de5e3624
commit 3c219bf968
2 changed files with 26 additions and 0 deletions

View File

@ -63,6 +63,11 @@ GdkPixbuf *gtk_make_symbolic_pixbuf_from_file (GFile *file,
int height,
double scale,
GError **error);
GdkPixbuf *gtk_make_symbolic_pixbuf_from_path (const char *path,
int width,
int height,
double scale,
GError **error);
GdkPixbuf *gtk_make_symbolic_pixbuf_from_resource (const char *path,
int width,
int height,

View File

@ -425,6 +425,27 @@ gtk_make_symbolic_pixbuf_from_resource (const char *path,
return pixbuf;
}
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,