From 296a2a72c6837ddc90a372b5bc6aea95a9bf82be Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Tue, 31 Jan 2012 18:01:25 +0100 Subject: [PATCH] resources: compiler: Make to-pixbuf failure fatal Bug #669123. --- gio/glib-compile-resources.c | 12 +++++++++--- gio/gresource.c | 9 +++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gio/glib-compile-resources.c b/gio/glib-compile-resources.c index f677cb5..93938f8 100644 --- a/gio/glib-compile-resources.c +++ b/gio/glib-compile-resources.c @@ -302,13 +302,19 @@ end_element (GMarkupParseContext *context, real_file = g_strdup (tmp_file); } - if (to_pixdata && gdk_pixbuf_pixdata == NULL) - g_printerr ("GDK_PIXBUF_PIXDATA not set and gdk-pixbuf-pixdata not found in path; skipping to-pixdata preprocessing.\n"); - if (to_pixdata && gdk_pixbuf_pixdata != NULL) + if (to_pixdata) { gchar *argv[4]; int status, fd, argc; + if (gdk_pixbuf_pixdata == NULL) + { + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, + "to-pixbuf preprocessing requested but GDK_PIXBUF_PIXDATA " + "not set and gdk-pixbuf-pixdata not found in path"); + goto cleanup; + } + tmp_file2 = g_strdup ("resource-XXXXXXXX"); if ((fd = g_mkstemp (tmp_file2)) == -1) { diff --git a/gio/gresource.c b/gio/gresource.c index 150eb5d..f177a85 100644 --- a/gio/gresource.c +++ b/gio/gresource.c @@ -68,16 +68,17 @@ G_DEFINE_BOXED_TYPE (GResource, g_resource, g_resource_ref, g_resource_unref) * preprocess attribute to a comma-separated list of preprocessing options. * The only options currently supported are: * - * xml-stripblanks which will use xmllint to strip + * xml-stripblanks which will use xmllint to strip * ignorable whitespace from the xml file. For this to work, the XMLLINT * environment variable must be set to the full path to the xmllint executable, or xmllint * must be in the PATH; otherwise the preprocessing step is skipped. * - * to-pixdata which will use gdk-pixbuf-pixdata to convert + * to-pixdata which will use gdk-pixbuf-pixdata to convert * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside - * the resource file, rather than an (uncompressed) copy if it. For this to work, the gdk-pixbuf-pixdata + * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata * program must be in the PATH, or the GDK_PIXBUF_PIXDATA environment variable must be - * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the preprocessing step is skipped. + * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will + * abort. * * Resource bundles are created by the glib-compile-resources program * which takes an xml file that describes the bundle, and a set of files that the xml references. These -- 2.7.4