summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2018-03-01 15:35:53 +0000
committerRichard Hughes <richard@hughsie.com>2018-03-01 15:35:58 +0000
commitfe3fe8e4209843a2b42a0bb9751f32498b794b51 (patch)
tree0ab80c58877e697d4a253ce0019858218075641c
parent6183cf7cdf014f1149c516a054f1f877804604ad (diff)
downloadappstream-glib-fe3fe8e4209843a2b42a0bb9751f32498b794b51.tar.gz
Don't abort the build if pngquant fails
Sometimes it returns a return code 25088 (which is 0x6200) which isn't an error code in rwpng.h -- we can't really trust pngquant so just log the warning.
-rw-r--r--libappstream-builder/asb-app.c9
-rw-r--r--libappstream-builder/asb-utils.c4
2 files changed, 9 insertions, 4 deletions
diff --git a/libappstream-builder/asb-app.c b/libappstream-builder/asb-app.c
index b44f091..dba76e8 100644
--- a/libappstream-builder/asb-app.c
+++ b/libappstream-builder/asb-app.c
@@ -161,6 +161,7 @@ asb_app_save_resources (AsbApp *app, AsbAppSaveFlags save_flags, GError **error)
const gchar *tmpdir;
g_autofree gchar *filename = NULL;
g_autofree gchar *size_str = NULL;
+ g_autoptr(GError) error_local = NULL;
/* don't save some types of icons */
icon = g_ptr_array_index (icons, i);
@@ -190,8 +191,12 @@ asb_app_save_resources (AsbApp *app, AsbAppSaveFlags save_flags, GError **error)
return FALSE;
/* optimize the icon */
- if (!asb_utils_optimize_png (filename, error))
- return FALSE;
+ if (!asb_utils_optimize_png (filename, &error_local)) {
+ asb_package_log (priv->pkg,
+ ASB_PACKAGE_LOG_LEVEL_WARNING,
+ "Failed to optimize icon: %s",
+ error_local->message);
+ }
/* set new AppStream compatible icon name */
asb_package_log (priv->pkg,
diff --git a/libappstream-builder/asb-utils.c b/libappstream-builder/asb-utils.c
index b14f411..8b52179 100644
--- a/libappstream-builder/asb-utils.c
+++ b/libappstream-builder/asb-utils.c
@@ -307,8 +307,8 @@ asb_utils_optimize_png (const gchar *filename, GError **error)
g_set_error (error,
AS_APP_ERROR,
AS_APP_ERROR_FAILED,
- "failed to run %s: %s",
- argv_str, standard_error);
+ "failed to run %s: %s (%i)",
+ argv_str, standard_error, exit_status);
return FALSE;
}
return TRUE;