From 349799ba1d026a18012520b9f2e1901a88ac467b Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Tue, 15 Feb 2022 13:25:46 +0100 Subject: libappstream-builder: Fix file paths in icon tarball dbd62f6e05 removed the WxH directory from the icon filenames, which were also used as-is for the paths in the icons tarball. However, if width and height are set on the icon, then it has to be inside a size-specific directory. With HiDPI enabled, it did even overwrite the non-HiDPI icon it saved just before because the filenames were the same. Add the subdirectory back in the resource handling code. --- libappstream-builder/asb-app.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libappstream-builder/asb-app.c b/libappstream-builder/asb-app.c index b7a14dc..fdbc100 100644 --- a/libappstream-builder/asb-app.c +++ b/libappstream-builder/asb-app.c @@ -145,6 +145,7 @@ asb_app_save_resources (AsbApp *app, AsbAppSaveFlags save_flags, GError **error) icons = as_app_get_icons (AS_APP (app)); for (i = 0; icons != NULL && i < icons->len; i++) { const gchar *tmpdir; + g_autofree gchar *dir = NULL; g_autofree gchar *filename = NULL; g_autofree gchar *size_str = NULL; g_autoptr(GError) error_local = NULL; @@ -165,7 +166,9 @@ asb_app_save_resources (AsbApp *app, AsbAppSaveFlags save_flags, GError **error) /* save to disk */ tmpdir = asb_package_get_config (priv->pkg, "IconsDir"); - filename = g_build_filename (tmpdir, + dir = g_strdup_printf ("%ix%i", as_icon_get_width (icon), + as_icon_get_height (icon)); + filename = g_build_filename (tmpdir, dir, as_icon_get_name (icon), NULL); if (!gdk_pixbuf_save (pixbuf, filename, "png", error, NULL)) -- cgit v1.2.1