From fe3fe8e4209843a2b42a0bb9751f32498b794b51 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 1 Mar 2018 15:35:53 +0000 Subject: 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. --- libappstream-builder/asb-app.c | 9 +++++++-- libappstream-builder/asb-utils.c | 4 ++-- 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; -- cgit v1.2.1