summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2018-03-09 10:24:47 +0000
committerRichard Hughes <richard@hughsie.com>2018-03-09 10:24:50 +0000
commit0c54573e420b25c201a016df829906c9aee45472 (patch)
treec645e0ff6f1efea6104d32f5c96f6146f22ce952
parent4acf78f426d2efb1beaa8bab74d506ea099fa5b3 (diff)
downloadappstream-glib-0c54573e420b25c201a016df829906c9aee45472.tar.gz
Always resize AppStream icons to fit the destination size
Padding is no longer being used as it makes the software center look bad. Lets make the application author look bad instead so they can fix the icon.
-rw-r--r--client/as-compose.c2
-rw-r--r--libappstream-builder/plugins/asb-plugin-desktop.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/client/as-compose.c b/client/as-compose.c
index 55b35b1..fecc752 100644
--- a/client/as-compose.c
+++ b/client/as-compose.c
@@ -86,6 +86,7 @@ add_icons (AsApp *app,
im = as_image_new ();
if (!as_image_load_filename_full (im, fn,
64, min_icon_size,
+ AS_IMAGE_LOAD_FLAG_ALWAYS_RESIZE |
AS_IMAGE_LOAD_FLAG_ONLY_SUPPORTED |
AS_IMAGE_LOAD_FLAG_SHARPEN,
error)) {
@@ -138,6 +139,7 @@ add_icons (AsApp *app,
g_debug ("trying to load %s", fn_hidpi);
if (!as_image_load_filename_full (im, fn_hidpi,
128, 128,
+ AS_IMAGE_LOAD_FLAG_ALWAYS_RESIZE |
AS_IMAGE_LOAD_FLAG_SHARPEN,
&error_local)) {
g_debug ("failed to load HiDPI icon: %s", error_local->message);
diff --git a/libappstream-builder/plugins/asb-plugin-desktop.c b/libappstream-builder/plugins/asb-plugin-desktop.c
index e41e3e9..0249966 100644
--- a/libappstream-builder/plugins/asb-plugin-desktop.c
+++ b/libappstream-builder/plugins/asb-plugin-desktop.c
@@ -56,7 +56,7 @@ asb_app_load_icon (AsbPlugin *plugin,
{
g_autoptr(AsImage) im = NULL;
g_autoptr(GError) error_local = NULL;
- AsImageLoadFlags load_flags = AS_IMAGE_LOAD_FLAG_NONE;
+ AsImageLoadFlags load_flags = AS_IMAGE_LOAD_FLAG_ALWAYS_RESIZE;
/* is icon in a unsupported format */
if (!asb_context_get_flag (plugin->ctx, ASB_CONTEXT_FLAG_IGNORE_LEGACY_ICONS))