Hello community, here is the log from the commit of package appstream-glib for openSUSE:Factory checked in at 2014-11-05 16:26:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/appstream-glib (Old) and /work/SRC/openSUSE:Factory/.appstream-glib.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "appstream-glib" Changes: -------- --- /work/SRC/openSUSE:Factory/appstream-glib/appstream-glib.changes 2014-10-31 12:23:02.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.appstream-glib.new/appstream-glib.changes 2014-11-05 16:26:40.000000000 +0100 @@ -1,0 +2,6 @@ +Thu Oct 30 10:41:51 UTC 2014 - [email protected] + +- Update to 0.3.1.git.20141030.7a5f76a: + + No longer trip over extracting hardlinked files. + +------------------------------------------------------------------- Old: ---- appstream-glib-0.3.1.git.20141023.f8bf1b6.tar.xz New: ---- appstream-glib-0.3.1.git.20141030.7a5f76a.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ appstream-glib.spec ++++++ --- /var/tmp/diff_new_pack.0fApNg/_old 2014-11-05 16:26:41.000000000 +0100 +++ /var/tmp/diff_new_pack.0fApNg/_new 2014-11-05 16:26:41.000000000 +0100 @@ -20,7 +20,7 @@ %define _build_from_vcs 1 Name: appstream-glib -Version: 0.3.1.git.20141023.f8bf1b6 +Version: 0.3.1.git.20141030.7a5f76a Release: 0 Summary: AppStream Abstraction Library License: LGPL-2.1+ ++++++ appstream-glib-0.3.1.git.20141023.f8bf1b6.tar.xz -> appstream-glib-0.3.1.git.20141030.7a5f76a.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/client/as-util.c new/appstream-glib-0.3.1.git.20141030.7a5f76a/client/as-util.c --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/client/as-util.c 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/client/as-util.c 2014-10-30 11:39:29.000000000 +0100 @@ -785,6 +785,40 @@ } /** + * as_util_search: + **/ +static gboolean +as_util_search (AsUtilPrivate *priv, gchar **values, GError **error) +{ + GPtrArray *apps; + guint i; + _cleanup_object_unref_ AsStore *store = NULL; + + /* check args */ + if (g_strv_length (values) < 1) { + g_set_error_literal (error, + AS_ERROR, + AS_ERROR_INVALID_ARGUMENTS, + "Not enough arguments, " + "expected search terms"); + return FALSE; + } + + /* load system database */ + store = as_store_new (); + if (!as_store_load (store, AS_STORE_LOAD_FLAG_APP_INFO_SYSTEM, NULL, error)) + return FALSE; + apps = as_store_get_apps (store); + for (i = 0; i < apps->len; i++) { + AsApp *app; + app = g_ptr_array_index (apps, i); + if (as_app_search_matches_all (app, values)) + g_print ("%s\n", as_app_get_id (app)); + } + return TRUE; +} + +/** * as_util_install_icons: **/ static gboolean @@ -1484,6 +1518,32 @@ total, perc); } + /* specific kudos */ + total = 0; + for (i = 0; i < apps->len; i++) { + app = g_ptr_array_index (apps, i); + if (as_app_get_id_kind (app) != AS_ID_KIND_DESKTOP) + continue; + total++; + } + for (j = 1; j < AS_KUDO_KIND_LAST; j++) { + cnt = 0; + for (i = 0; i < apps->len; i++) { + app = g_ptr_array_index (apps, i); + if (!as_app_has_kudo_kind (app, j)) + continue; + cnt += 1; + } + perc = 0; + if (total > 0) + perc = 100.f * (gdouble) cnt / (gdouble) total; + g_string_append_printf (html, "<tr><td class=\"alt\">" + "<i>%s</i></td><td>%i</td>" + "<td class=\"thin\">%.1f%%</td></tr>\n", + as_kudo_kind_to_string (j), + cnt, perc); + } + /* addons with MetaInfo */ cnt = 0; for (i = 0; i < apps->len; i++) { @@ -2339,6 +2399,12 @@ _("Dumps the applications in the AppStream metadata"), as_util_dump); as_util_add (priv->cmd_array, + "search", + NULL, + /* TRANSLATORS: command description */ + _("Search for AppStream applications"), + as_util_search); + as_util_add (priv->cmd_array, "install", NULL, /* TRANSLATORS: command description */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/data/tests/Makefile.am new/appstream-glib-0.3.1.git.20141030.7a5f76a/data/tests/Makefile.am --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/data/tests/Makefile.am 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/data/tests/Makefile.am 2014-10-30 11:39:29.000000000 +0100 @@ -31,6 +31,7 @@ translated.appdata.xml \ usr/share/appdata/broken.appdata.xml \ usr/share/app-install/desktop/test.desktop \ + usr/share/app-install/icons/aequorea/iceweasel.png \ usr/share/app-install/icons/test.png \ usr/share/icons/hicolor/64x64/apps/test2.png \ usr/share/icons/hicolor/128x128/apps/test3.png \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/asb-app.c new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/asb-app.c --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/asb-app.c 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/asb-app.c 2014-10-30 11:39:29.000000000 +0100 @@ -267,6 +267,7 @@ /** * asb_app_save_resources: * @app: A #AsbApp + * @save_flags: #AsbAppSaveFlags, e.g. %ASB_APP_SAVE_FLAG_SCREENSHOTS * @error: A #GError or %NULL * * Saves to disk any resources set for the application. @@ -276,19 +277,20 @@ * Since: 0.1.0 **/ gboolean -asb_app_save_resources (AsbApp *app, GError **error) +asb_app_save_resources (AsbApp *app, AsbAppSaveFlags save_flags, GError **error) { AsbAppPrivate *priv = GET_PRIVATE (app); AsIcon *icon; AsScreenshot *ss; GdkPixbuf *pixbuf; - GPtrArray *icons; - GPtrArray *screenshots; + GPtrArray *icons = NULL; + GPtrArray *screenshots = NULL; guint i; /* any non-stock icon set */ - icons = as_app_get_icons (AS_APP (app)); - for (i = 0; i < icons->len; i++) { + if (save_flags & ASB_APP_SAVE_FLAG_ICONS) + icons = as_app_get_icons (AS_APP (app)); + for (i = 0; icons != NULL && i < icons->len; i++) { const gchar *tmpdir; _cleanup_free_ gchar *filename = NULL; _cleanup_free_ gchar *size_str = NULL; @@ -326,8 +328,9 @@ } /* save any screenshots */ - screenshots = as_app_get_screenshots (AS_APP (app)); - for (i = 0; i < screenshots->len; i++) { + if (save_flags & ASB_APP_SAVE_FLAG_SCREENSHOTS) + screenshots = as_app_get_screenshots (AS_APP (app)); + for (i = 0; screenshots != NULL && i < screenshots->len; i++) { ss = g_ptr_array_index (screenshots, i); if (!asb_app_save_resources_screenshot (app, ss, error)) return FALSE; @@ -363,7 +366,8 @@ pixbuf = as_image_save_pixbuf (im_src, width * scale, height * scale, - AS_IMAGE_SAVE_FLAG_PAD_16_9); + AS_IMAGE_SAVE_FLAG_PAD_16_9 | + AS_IMAGE_SAVE_FLAG_SHARPEN); im_tmp = as_image_new (); as_image_set_width (im_tmp, width * scale); as_image_set_height (im_tmp, height * scale); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/asb-app.h new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/asb-app.h --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/asb-app.h 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/asb-app.h 2014-10-30 11:39:29.000000000 +0100 @@ -60,6 +60,22 @@ void (*_asb_reserved8) (void); }; +/** + * AsbAppSaveFlags: + * @ASB_APP_SAVE_FLAG_NONE: Nothing to do + * @ASB_APP_SAVE_FLAG_ICONS: Save icons to disk + * @ASB_APP_SAVE_FLAG_SCREENSHOTS: Save screenshots to disk + * + * The flags to use when saving resources. + **/ +typedef enum { + ASB_APP_SAVE_FLAG_NONE, + ASB_APP_SAVE_FLAG_ICONS = 1, /* Since: 0.3.2 */ + ASB_APP_SAVE_FLAG_SCREENSHOTS = 2, /* Since: 0.3.2 */ + /*< private >*/ + ASB_APP_SAVE_FLAG_LAST, +} AsbAppSaveFlags; + GType asb_app_get_type (void); @@ -83,6 +99,7 @@ AsbPackage *asb_app_get_package (AsbApp *app); gboolean asb_app_save_resources (AsbApp *app, + AsbAppSaveFlags save_flags, GError **error); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/asb-context.c new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/asb-context.c --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/asb-context.c 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/asb-context.c 2014-10-30 11:39:29.000000000 +0100 @@ -673,7 +673,7 @@ AS_APP_SUBSUME_FLAG_NO_OVERWRITE); /* save all the screenshots to disk */ - return asb_app_save_resources (app_build, error); + return asb_app_save_resources (app_build, ASB_APP_SAVE_FLAG_SCREENSHOTS, error); } /** @@ -1029,12 +1029,14 @@ for (l = priv->apps; l != NULL; l = l->next) { app = AS_APP (l->data); - /* save icon and screenshots */ + /* save icon */ if (as_app_get_vetos(app)->len > 0) continue; if (!ASB_IS_APP (app)) continue; - if (!asb_app_save_resources (ASB_APP (app), error)) + if (!asb_app_save_resources (ASB_APP (app), + ASB_APP_SAVE_FLAG_ICONS, + error)) return FALSE; } return TRUE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/asb-self-test.c new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/asb-self-test.c --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/asb-self-test.c 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/asb-self-test.c 2014-10-30 11:39:29.000000000 +0100 @@ -371,7 +371,7 @@ "<name>Liberation</name>\n" "<summary>Open source versions of several commecial fonts</summary>\n" "<description><p>The Liberation Fonts are intended to be replacements for Times New Roman, Arial, and Courier New.</p></description>\n" - "<icon height=\"64\" width=\"64\" type=\"cached\">64x64/LiberationSerif.png</icon>\n" + "<icon height=\"64\" width=\"64\" type=\"cached\">LiberationSerif.png</icon>\n" "<project_license>GPL-2.0+</project_license>\n" "<url type=\"homepage\">http://people.freedesktop.org/</url>\n" "<screenshots>\n" @@ -420,7 +420,7 @@ "<name>App</name>\n" "<summary>A test application</summary>\n" "<description><p>Long description goes here.</p></description>\n" - "<icon height=\"64\" width=\"64\" type=\"cached\">64x64/app.png</icon>\n" + "<icon height=\"64\" width=\"64\" type=\"cached\">app.png</icon>\n" "<categories>\n" "<category>Profiling</category>\n" "<category>System</category>\n" @@ -500,7 +500,7 @@ "<source_pkgname>font</source_pkgname>\n" "<name>Liberation Serif</name>\n" "<summary>A Bold font from Liberation Serif</summary>\n" - "<icon height=\"64\" width=\"64\" type=\"cached\">64x64/LiberationSerif.png</icon>\n" + "<icon height=\"64\" width=\"64\" type=\"cached\">LiberationSerif.png</icon>\n" "<categories>\n" "<category>Addons</category>\n" "<category>Fonts</category>\n" @@ -570,7 +570,7 @@ "<source_pkgname>app</source_pkgname>\n" "<name>Console1</name>\n" "<summary>A console1 test application</summary>\n" - "<icon height=\"64\" width=\"64\" type=\"cached\">64x64/console1.png</icon>\n" + "<icon height=\"64\" width=\"64\" type=\"cached\">console1.png</icon>\n" "<categories>\n" "<category>ConsoleOnly</category>\n" "</categories>\n" @@ -597,7 +597,7 @@ "<source_pkgname>app</source_pkgname>\n" "<name>Console2</name>\n" "<summary>A console2 test application</summary>\n" - "<icon height=\"64\" width=\"64\" type=\"cached\">64x64/console2.png</icon>\n" + "<icon height=\"64\" width=\"64\" type=\"cached\">console2.png</icon>\n" "<categories>\n" "<category>ConsoleOnly</category>\n" "</categories>\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/asb-task.c new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/asb-task.c --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/asb-task.c 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/asb-task.c 2014-10-30 11:39:29.000000000 +0100 @@ -406,6 +406,14 @@ g_free (cache_id); } + /* save any screenshots early */ + if (array->len == 0) { + if (!asb_app_save_resources (ASB_APP (app), + ASB_APP_SAVE_FLAG_SCREENSHOTS, + error_not_used)) + return FALSE; + } + /* all okay */ asb_context_add_app (priv->ctx, app); nr_added++; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/asb-utils.c new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/asb-utils.c --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/asb-utils.c 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/asb-utils.c 2014-10-30 11:39:29.000000000 +0100 @@ -208,13 +208,30 @@ } /** + * asb_utils_sanitise_path: + * + * Converts various formats into an absolute path. + **/ +static gchar * +asb_utils_sanitise_path (const gchar *path) +{ + /* /usr/share/README -> /usr/share/README */ + if (path[0] == '/') + return g_strdup (path); + + /* ./usr/share/README -> /usr/share/README */ + if (path[0] == '.') + return g_strdup (path + 1); + + /* usr/share/README -> /usr/share/README */ + return g_strconcat ("/", path, NULL); +} + +/** * asb_utils_explode_file: **/ static gboolean -asb_utils_explode_file (struct archive_entry *entry, - const gchar *dir, - GPtrArray *glob, - GPtrArray *symlink_glob) +asb_utils_explode_file (struct archive_entry *entry, const gchar *dir) { const gchar *tmp; gchar buf[PATH_MAX]; @@ -226,36 +243,30 @@ if (archive_entry_pathname (entry) == NULL) return FALSE; - /* do we have to decompress this file */ - tmp = archive_entry_pathname (entry); - if (glob != NULL) { - if (tmp[0] == '/') { - path = g_strdup (tmp); - } else if (tmp[0] == '.') { - path = g_strdup (tmp + 1); - } else { - path = g_strconcat ("/", tmp, NULL); - } - if (asb_glob_value_search (glob, path) == NULL) - return FALSE; - } - /* update output path */ - g_snprintf (buf, PATH_MAX, "%s/%s", dir, tmp); + tmp = archive_entry_pathname (entry); + path = asb_utils_sanitise_path (tmp); + g_snprintf (buf, PATH_MAX, "%s%s", dir, path); archive_entry_update_pathname_utf8 (entry, buf); /* update hardlinks */ tmp = archive_entry_hardlink (entry); if (tmp != NULL) { - g_ptr_array_add (symlink_glob, asb_glob_value_new (tmp, "")); - g_snprintf (buf, PATH_MAX, "%s/%s", dir, tmp); + _cleanup_free_ gchar *path_link = NULL; + path_link = asb_utils_sanitise_path (tmp); + g_snprintf (buf, PATH_MAX, "%s%s", dir, path_link); + if (!g_file_test (buf, G_FILE_TEST_EXISTS)) { + g_warning ("%s does not exist, cannot hardlink", tmp); + return FALSE; + } archive_entry_update_hardlink_utf8 (entry, buf); } /* update symlinks */ tmp = archive_entry_symlink (entry); if (tmp != NULL) { - g_ptr_array_add (symlink_glob, asb_glob_value_new (tmp, "")); + _cleanup_free_ gchar *path_link = NULL; + path_link = asb_utils_sanitise_path (tmp); symlink_depth = asb_utils_count_directories_deep (path) - 1; back_up = asb_utils_get_back_to_root (symlink_depth); if (tmp[0] == '/') @@ -285,21 +296,82 @@ GPtrArray *glob, GError **error) { + const gchar *tmp; gboolean ret = TRUE; gboolean valid; gsize len; int r; struct archive *arch = NULL; + struct archive *arch_preview = NULL; struct archive_entry *entry; _cleanup_free_ gchar *data = NULL; - _cleanup_ptrarray_unref_ GPtrArray *symlink_glob = NULL; + _cleanup_hashtable_unref_ GHashTable *matches = NULL; /* load file at once to avoid seeking */ ret = g_file_get_contents (filename, &data, &len, error); if (!ret) goto out; - /* read anything */ + /* populate a hash with all the files, symlinks and hardlinks that + * actually need decompressing */ + arch_preview = archive_read_new (); + archive_read_support_format_all (arch_preview); + archive_read_support_filter_all (arch_preview); + r = archive_read_open_memory (arch_preview, data, len); + if (r) { + ret = FALSE; + g_set_error (error, + ASB_PLUGIN_ERROR, + ASB_PLUGIN_ERROR_FAILED, + "Cannot open: %s", + archive_error_string (arch_preview)); + goto out; + } + matches = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + for (;;) { + _cleanup_free_ gchar *path = NULL; + r = archive_read_next_header (arch_preview, &entry); + if (r == ARCHIVE_EOF) + break; + if (r != ARCHIVE_OK) { + ret = FALSE; + g_set_error (error, + ASB_PLUGIN_ERROR, + ASB_PLUGIN_ERROR_FAILED, + "Cannot read header: %s", + archive_error_string (arch_preview)); + goto out; + } + + /* get the destination filename */ + tmp = archive_entry_pathname (entry); + if (tmp == NULL) + continue; + path = asb_utils_sanitise_path (tmp); + if (glob != NULL) { + if (asb_glob_value_search (glob, path) == NULL) + continue; + } + g_hash_table_insert (matches, g_strdup (path), GINT_TO_POINTER (1)); + + /* add hardlink */ + tmp = archive_entry_hardlink (entry); + if (tmp != NULL) { + g_hash_table_insert (matches, + asb_utils_sanitise_path (tmp), + GINT_TO_POINTER (1)); + } + + /* add symlink */ + tmp = archive_entry_symlink (entry); + if (tmp != NULL) { + g_hash_table_insert (matches, + asb_utils_sanitise_path (tmp), + GINT_TO_POINTER (1)); + } + } + + /* decompress anything matching either glob */ arch = archive_read_new (); archive_read_support_format_all (arch); archive_read_support_filter_all (arch); @@ -313,10 +385,8 @@ archive_error_string (arch)); goto out; } - - /* decompress each file */ - symlink_glob = asb_glob_value_array_new (); for (;;) { + _cleanup_free_ gchar *path = NULL; r = archive_read_next_header (arch, &entry); if (r == ARCHIVE_EOF) break; @@ -331,7 +401,11 @@ } /* only extract if valid */ - valid = asb_utils_explode_file (entry, dir, glob, symlink_glob); + tmp = archive_entry_pathname (entry); + path = asb_utils_sanitise_path (tmp); + if (g_hash_table_lookup (matches, path) == NULL) + continue; + valid = asb_utils_explode_file (entry, dir); if (!valid) continue; r = archive_read_extract (arch, entry, 0); @@ -345,14 +419,11 @@ goto out; } } - - /* there are soft or hard links to explode too */ - if (symlink_glob->len > 0) { - ret = asb_utils_explode (filename, dir, symlink_glob, error); - if (!ret) - goto out; - } out: + if (arch_preview != NULL) { + archive_read_close (arch_preview); + archive_read_free (arch_preview); + } if (arch != NULL) { archive_read_close (arch); archive_read_free (arch); @@ -640,6 +711,9 @@ const AsbGlobValue *tmp; guint i; + g_return_val_if_fail (array != NULL, NULL); + g_return_val_if_fail (search != NULL, NULL); + /* invalid */ if (search == NULL) return NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/plugins/asb-plugin-appdata.c new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/plugins/asb-plugin-appdata.c --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/plugins/asb-plugin-appdata.c 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/plugins/asb-plugin-appdata.c 2014-10-30 11:39:29.000000000 +0100 @@ -51,7 +51,7 @@ plugin->priv->filenames = g_ptr_array_new_with_free_func (g_free); g_mutex_init (&plugin->priv->filenames_mutex); plugin->priv->session = soup_session_new_with_options (SOUP_SESSION_USER_AGENT, "createrepo_as", - SOUP_SESSION_TIMEOUT, 5000, + SOUP_SESSION_TIMEOUT, 10, NULL); soup_session_add_feature_by_type (plugin->priv->session, SOUP_TYPE_PROXY_RESOLVER_DEFAULT); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/plugins/asb-plugin-composite.c new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/plugins/asb-plugin-composite.c --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-builder/plugins/asb-plugin-composite.c 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-builder/plugins/asb-plugin-composite.c 2014-10-30 11:39:29.000000000 +0100 @@ -164,6 +164,11 @@ continue; found = g_hash_table_lookup (hash, tmp); if (found != NULL) { + /* ignore duplicates */ + if (g_strcmp0 (as_app_get_id (app), + as_app_get_id (found)) == 0) { + continue; + } asb_plugin_composite_app (app, found); continue; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-app.c new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-app.c --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-app.c 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-app.c 2014-10-30 11:39:29.000000000 +0100 @@ -82,6 +82,7 @@ gchar *icon_path; gchar *id_filename; gchar *id; + gchar *origin; gchar *project_group; gchar *project_license; gchar *metadata_license; @@ -252,6 +253,7 @@ g_free (priv->project_group); g_free (priv->project_license); g_free (priv->metadata_license); + g_free (priv->origin); g_free (priv->source_pkgname); g_free (priv->update_contact); g_free (priv->source_file); @@ -1207,6 +1209,23 @@ } /** + * as_app_get_origin: + * @app: a #AsApp instance. + * + * Gets the application origin. + * + * Returns: the origin string, or %NULL if unset + * + * Since: 0.3.2 + **/ +const gchar * +as_app_get_origin (AsApp *app) +{ + AsAppPrivate *priv = GET_PRIVATE (app); + return priv->origin; +} + +/** * as_app_get_source_file: * @app: a #AsApp instance. * @@ -1555,6 +1574,23 @@ } /** + * as_app_set_origin: + * @app: a #AsApp instance. + * @origin: the origin, e.g. "fedora-21" + * + * Sets the application origin. + * + * Since: 0.3.2 + **/ +void +as_app_set_origin (AsApp *app, const gchar *origin) +{ + AsAppPrivate *priv = GET_PRIVATE (app); + g_free (priv->origin); + priv->origin = g_strdup (origin); +} + +/** * as_app_set_icon_path: * @app: a #AsApp instance. * @icon_path: the local path. @@ -2379,6 +2415,35 @@ } /** + * as_app_subsume_icon: + **/ +static void +as_app_subsume_icon (AsApp *app, AsIcon *icon) +{ + AsAppPrivate *priv = GET_PRIVATE (app); + AsIcon *ic_tmp; + guint i; + + /* don't add a rubbish icon */ + if (as_icon_get_kind (icon) == AS_ICON_KIND_UNKNOWN) + return; + + /* does application already have this icon in this size */ + for (i = 0; i < priv->icons->len; i++) { + ic_tmp = AS_ICON (g_ptr_array_index (priv->icons, i)); + if (as_icon_get_height (ic_tmp) != as_icon_get_height (icon)) + continue; + if (as_icon_get_width (ic_tmp) != as_icon_get_width (icon)) + continue; + if (g_strcmp0 (as_icon_get_name (ic_tmp), as_icon_get_name (icon)) != 0) + continue; + return; + } + + as_app_add_icon (app, icon); +} + +/** * as_app_subsume_private: **/ static void @@ -2447,7 +2512,7 @@ /* icons */ for (i = 0; i < priv->icons->len; i++) { AsIcon *ic = g_ptr_array_index (priv->icons, i); - as_app_add_icon (app, ic); + as_app_subsume_icon (app, ic); } /* mimetypes */ @@ -2486,6 +2551,10 @@ if (priv->source_file != NULL) as_app_set_source_file (app, priv->source_file); + /* origin */ + if (priv->origin != NULL) + as_app_set_origin (app, priv->origin); + /* project_group */ if (priv->project_group != NULL) as_app_set_project_group (app, priv->project_group, -1); @@ -3427,6 +3496,51 @@ } /** + * as_app_node_parse_dep11_icons: + **/ +static gboolean +as_app_node_parse_dep11_icons (AsApp *app, GNode *node, GError **error) +{ + AsAppPrivate *priv = GET_PRIVATE (app); + const gchar *sizes[] = { "128x128", "64x64", "", NULL }; + guint i; + guint size; + _cleanup_object_unref_ AsIcon *ic_tmp = NULL; + + /* YAML files only specify one icon for various sizes */ + ic_tmp = as_icon_new (); + if (!as_icon_node_parse_dep11 (ic_tmp, node, error)) + return FALSE; + + /* find each size */ + for (i = 0; sizes[i] != NULL; i++) { + _cleanup_free_ gchar *path = NULL; + _cleanup_free_ gchar *size_name = NULL; + _cleanup_object_unref_ AsIcon *ic = NULL; + + size_name = g_build_filename (sizes[i], + as_icon_get_name (ic_tmp), + NULL); + path = g_build_filename (priv->icon_path, + size_name, + NULL); + if (!g_file_test (path, G_FILE_TEST_EXISTS)) + continue; + + /* only the first try is a HiDPI icon, assume 64px otherwise */ + size = (i == 0) ? 128 : 64; + ic = as_icon_new (); + as_icon_set_kind (ic, AS_ICON_KIND_CACHED); + as_icon_set_prefix (ic, priv->icon_path); + as_icon_set_name (ic, size_name, -1); + as_icon_set_width (ic, size); + as_icon_set_height (ic, size); + as_app_add_icon (app, ic); + } + return TRUE; +} + +/** * as_app_node_parse_dep11: * @app: a #AsApp instance. * @node: a #GNode. @@ -3507,11 +3621,8 @@ } if (g_strcmp0 (tmp, "Icon") == 0) { for (c = n->children; c != NULL; c = c->next) { - _cleanup_object_unref_ AsIcon *ic = NULL; - ic = as_icon_new (); - if (!as_icon_node_parse_dep11 (ic, c, error)) + if (!as_app_node_parse_dep11_icons (app, c, error)) return FALSE; - as_app_add_icon (app, ic); } continue; } @@ -3876,6 +3987,8 @@ if (as_utils_is_stock_icon_name (tmp)) { as_icon_set_name (icon, tmp, -1); as_icon_set_kind (icon, AS_ICON_KIND_STOCK); + } else { + as_icon_set_kind (icon, AS_ICON_KIND_LOCAL); } as_app_add_icon (app, icon); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-app.h new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-app.h --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-app.h 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-app.h 2014-10-30 11:39:29.000000000 +0100 @@ -245,6 +245,7 @@ const gchar *as_app_get_id (AsApp *app); const gchar *as_app_get_pkgname_default (AsApp *app); const gchar *as_app_get_source_pkgname (AsApp *app); +const gchar *as_app_get_origin (AsApp *app); const gchar *as_app_get_project_group (AsApp *app); const gchar *as_app_get_project_license (AsApp *app); const gchar *as_app_get_metadata_license (AsApp *app); @@ -284,6 +285,8 @@ AsAppState state); void as_app_set_trust_flags (AsApp *app, AsAppTrustFlags trust_flags); +void as_app_set_origin (AsApp *app, + const gchar *origin); void as_app_set_project_group (AsApp *app, const gchar *project_group, gssize project_group_len); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-icon.c new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-icon.c --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-icon.c 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-icon.c 2014-10-30 11:39:29.000000000 +0100 @@ -46,6 +46,7 @@ AsIconKind kind; gchar *name; gchar *prefix; + gchar *prefix_private; guint width; guint height; GdkPixbuf *pixbuf; @@ -87,6 +88,7 @@ g_bytes_unref (priv->data); g_free (priv->name); g_free (priv->prefix); + g_free (priv->prefix_private); G_OBJECT_CLASS (as_icon_parent_class)->finalize (object); } @@ -183,7 +185,7 @@ * as_icon_get_prefix: * @icon: a #AsIcon instance. * - * Gets the suggested prefix the icon, including file extension. + * Gets the suggested prefix of the icon. * * Returns: filename * @@ -193,6 +195,8 @@ as_icon_get_prefix (AsIcon *icon) { AsIconPrivate *priv = GET_PRIVATE (icon); + if (priv->prefix_private != NULL) + return priv->prefix_private; return priv->prefix; } @@ -437,8 +441,10 @@ "type", as_icon_kind_to_string (priv->kind), NULL); if (priv->kind == AS_ICON_KIND_CACHED && api_version >= 0.8) { - as_node_add_attribute_as_int (n, "width", priv->width); - as_node_add_attribute_as_int (n, "height", priv->height); + if (priv->width > 0) + as_node_add_attribute_as_int (n, "width", priv->width); + if (priv->height > 0) + as_node_add_attribute_as_int (n, "height", priv->height); } return n; } @@ -535,6 +541,7 @@ AsIconPrivate *priv = GET_PRIVATE (icon); const gchar *tmp; gint size; + gboolean prepend_size = TRUE; tmp = as_node_get_attribute (node, "type"); as_icon_set_kind (icon, as_icon_kind_from_string (tmp)); @@ -544,20 +551,41 @@ return FALSE; break; default: - g_free (priv->name); - priv->name = as_node_take_data (node); + + /* store the name without any prefix */ + tmp = as_node_get_data (node); + if (g_strstr_len (tmp, -1, "/") == NULL) { + as_icon_set_name (icon, tmp, -1); + } else { + _cleanup_free_ gchar *basename = NULL; + basename = g_path_get_basename (tmp); + as_icon_set_name (icon, basename, -1); + } /* width is optional, assume 64px if missing */ size = as_node_get_attribute_as_int (node, "width"); - if (size == G_MAXINT) + if (size == G_MAXINT) { size = 64; + prepend_size = FALSE; + } priv->width = size; /* height is optional, assume 64px if missing */ size = as_node_get_attribute_as_int (node, "height"); - if (size == G_MAXINT) + if (size == G_MAXINT) { size = 64; + prepend_size = FALSE; + } priv->height = size; + + /* only use the size if the metadata has width and height */ + if (prepend_size) { + g_free (priv->prefix_private); + priv->prefix_private = g_strdup_printf ("%s/%ix%i", + priv->prefix, + priv->width, + priv->height); + } break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-image.c new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-image.c --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-image.c 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-image.c 2014-10-30 11:39:29.000000000 +0100 @@ -562,7 +562,8 @@ return g_object_ref (priv->pixbuf); /* never scale up, just pad */ - if (pixbuf_width < width && pixbuf_height < height) { + if (pixbuf_width < width && pixbuf_height < height && + (flags & AS_IMAGE_SAVE_FLAG_BLUR) == 0) { pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height); gdk_pixbuf_fill (pixbuf, 0x00000000); @@ -581,7 +582,10 @@ pixbuf = gdk_pixbuf_scale_simple (priv->pixbuf, width, height, GDK_INTERP_HYPER); - as_pixbuf_sharpen (pixbuf, 1, -0.5); + if ((flags & AS_IMAGE_SAVE_FLAG_SHARPEN) > 0) + as_pixbuf_sharpen (pixbuf, 1, -0.5); + if ((flags & AS_IMAGE_SAVE_FLAG_BLUR) > 0) + as_pixbuf_blur (pixbuf, 5, 3); return pixbuf; } @@ -601,7 +605,10 @@ pixbuf_tmp = gdk_pixbuf_scale_simple (priv->pixbuf, tmp_width, tmp_height, GDK_INTERP_HYPER); - as_pixbuf_sharpen (pixbuf_tmp, 1, -0.5); + if ((flags & AS_IMAGE_SAVE_FLAG_SHARPEN) > 0) + as_pixbuf_sharpen (pixbuf_tmp, 1, -0.5); + if ((flags & AS_IMAGE_SAVE_FLAG_BLUR) > 0) + as_pixbuf_blur (pixbuf_tmp, 5, 3); gdk_pixbuf_copy_area (pixbuf_tmp, 0, 0, /* of src */ tmp_width, tmp_height, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-image.h new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-image.h --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-image.h 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-image.h 2014-10-30 11:39:29.000000000 +0100 @@ -86,6 +86,8 @@ typedef enum { AS_IMAGE_SAVE_FLAG_NONE = 0, /* Since: 0.1.6 */ AS_IMAGE_SAVE_FLAG_PAD_16_9 = 1, /* Since: 0.1.6 */ + AS_IMAGE_SAVE_FLAG_SHARPEN = 2, /* Since: 0.3.2 */ + AS_IMAGE_SAVE_FLAG_BLUR = 4, /* Since: 0.3.2 */ /*< private >*/ AS_IMAGE_SAVE_FLAG_LAST } AsImageSaveFlags; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-self-test.c new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-self-test.c --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-self-test.c 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-self-test.c 2014-10-30 11:39:29.000000000 +0100 @@ -1134,7 +1134,7 @@ ic = as_app_get_icon_default (app); g_assert (ic != NULL); g_assert_cmpstr (as_icon_get_name (ic), ==, "test"); - g_assert_cmpint (as_icon_get_kind (ic), ==, AS_ICON_KIND_CACHED); + g_assert_cmpint (as_icon_get_kind (ic), ==, AS_ICON_KIND_LOCAL); g_assert_cmpint (as_icon_get_width (ic), ==, 0); g_assert_cmpint (as_icon_get_height (ic), ==, 0); @@ -1781,6 +1781,7 @@ donor = as_app_new (); icon = as_icon_new (); as_icon_set_name (icon, "gtk-find", -1); + as_icon_set_kind (icon, AS_ICON_KIND_LOCAL); as_app_add_icon (donor, icon); as_app_set_state (donor, AS_APP_STATE_INSTALLED); as_app_add_pkgname (donor, "hal", -1); @@ -1815,7 +1816,7 @@ ic = as_app_get_icon_default (app); g_assert (ic != NULL); g_assert_cmpstr (as_icon_get_name (ic), ==, "gtk-find"); - g_assert_cmpint (as_icon_get_kind (ic), ==, AS_ICON_KIND_UNKNOWN); + g_assert_cmpint (as_icon_get_kind (ic), ==, AS_ICON_KIND_LOCAL); g_assert_cmpint (as_icon_get_width (ic), ==, 0); g_assert_cmpint (as_icon_get_height (ic), ==, 0); @@ -2404,6 +2405,7 @@ g_assert (app != NULL); g_assert_cmpstr (as_app_get_icon_path (app), ==, "/usr/share/app-info/icons/fedora-21"); + g_assert_cmpstr (as_app_get_origin (app), ==, "fedora-21"); } static void @@ -2950,6 +2952,7 @@ GError *error = NULL; gboolean ret; _cleanup_free_ gchar *filename = NULL; + _cleanup_free_ gchar *icon_root = NULL; _cleanup_object_unref_ AsStore *store = NULL; _cleanup_object_unref_ GFile *file = NULL; _cleanup_string_free_ GString *str = NULL; @@ -2979,8 +2982,9 @@ /* load store */ store = as_store_new (); filename = as_test_get_filename ("example.yml"); + icon_root = as_test_get_filename ("usr/share/app-install/icons"); file = g_file_new_for_path (filename); - ret = as_store_from_file (store, file, NULL, NULL, &error); + ret = as_store_from_file (store, file, icon_root, NULL, &error); g_assert_no_error (error); g_assert (ret); @@ -3003,6 +3007,7 @@ g_assert_cmpint (as_app_get_id_kind (app), ==, AS_ID_KIND_DESKTOP); g_assert_cmpstr (as_app_get_pkgname_default (app), ==, "iceweasel"); g_assert_cmpstr (as_app_get_name (app, "C"), ==, "Iceweasel"); + g_assert_cmpstr (as_app_get_origin (app), ==, "aequorea"); } static void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-store.c new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-store.c --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-store.c 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-store.c 2014-10-30 11:39:29.000000000 +0100 @@ -640,6 +640,7 @@ error_local->message); return FALSE; } + as_app_set_origin (app, priv->origin); as_store_add_app (store, app); } @@ -655,12 +656,15 @@ static gboolean as_store_load_yaml_file (AsStore *store, GFile *file, + const gchar *icon_root, GCancellable *cancellable, GError **error) { + AsStorePrivate *priv = GET_PRIVATE (store); GNode *app_n; GNode *n; const gchar *tmp; + _cleanup_free_ gchar *icon_path = NULL; _cleanup_yaml_unref_ GNode *root = NULL; /* load file */ @@ -682,14 +686,27 @@ } } + /* if we have an origin either from the YAML or _set_origin() */ + if (priv->origin != NULL) { + if (icon_root == NULL) + icon_root = "/usr/share/app-info/icons/"; + icon_path = g_build_filename (icon_root, + priv->origin, + NULL); + } + /* parse applications */ for (app_n = root->children->next; app_n != NULL; app_n = app_n->next) { _cleanup_object_unref_ AsApp *app = NULL; if (app_n->children == NULL) continue; app = as_app_new (); + if (icon_path != NULL) + as_app_set_icon_path (app, icon_path, -1); + as_app_set_source_kind (app, AS_APP_SOURCE_KIND_APPSTREAM); if (!as_app_node_parse_dep11 (app, app_n, error)) return FALSE; + as_app_set_origin (app, priv->origin); if (as_app_get_id (app) != NULL) as_store_add_app (store, app); } @@ -731,7 +748,8 @@ /* a DEP-11 file */ filename = g_file_get_path (file); if (g_strstr_len (filename, -1, ".yml") != NULL) - return as_store_load_yaml_file (store, file, cancellable, error); + return as_store_load_yaml_file (store, file, icon_root, + cancellable, error); /* an AppStream XML file */ root = as_node_from_file (file, @@ -1170,12 +1188,14 @@ * the icons manually if they are installed in /var/cache */ origin_fallback = g_path_get_basename (filename); tmp = g_strstr_len (origin_fallback, -1, ".xml"); + if (tmp == NULL) + tmp = g_strstr_len (origin_fallback, -1, ".yml"); if (tmp == NULL) { g_set_error (error, AS_STORE_ERROR, AS_STORE_ERROR_FAILED, "AppStream metadata name %s not valid, " - "expected .xml[.*]", + "expected .xml[.*] or .yml[.*]", filename); return FALSE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-utils-private.h new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-utils-private.h --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-utils-private.h 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-utils-private.h 2014-10-30 11:39:29.000000000 +0100 @@ -39,6 +39,9 @@ void as_pixbuf_sharpen (GdkPixbuf *src, gint radius, gdouble amount); +void as_pixbuf_blur (GdkPixbuf *src, + gint radius, + gint iterations); G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-utils.c new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-utils.c --- old/appstream-glib-0.3.1.git.20141023.f8bf1b6/libappstream-glib/as-utils.c 2014-10-23 14:42:56.000000000 +0200 +++ new/appstream-glib-0.3.1.git.20141030.7a5f76a/libappstream-glib/as-utils.c 2014-10-30 11:39:29.000000000 +0100 @@ -595,10 +595,10 @@ } /** - * as_pixbuf_box_blur_private: + * as_pixbuf_blur_private: **/ static void -as_pixbuf_box_blur_private (GdkPixbuf *src, GdkPixbuf *dest, gint radius, guchar *div_kernel_size) +as_pixbuf_blur_private (GdkPixbuf *src, GdkPixbuf *dest, gint radius, guchar *div_kernel_size) { gint width, height, src_rowstride, dest_rowstride, n_channels; guchar *p_src, *p_dest, *c1, *c2; @@ -708,10 +708,17 @@ } /** - * as_pixbuf_box_blur: + * as_pixbuf_blur: + * @src: the GdkPixbuf. + * @radius: the pixel radius for the gaussian blur, typical values are 1..3 + * @iterations: Amount to blur the image, typical values are 1..5 + * + * Blurs an image. Warning, this method is s..l..o..w... for large images. + * + * Since: 0.3.2 **/ -static void -as_pixbuf_box_blur (GdkPixbuf *src, gint radius, gint iterations) +void +as_pixbuf_blur (GdkPixbuf *src, gint radius, gint iterations) { gint kernel_size; gint i; @@ -729,7 +736,7 @@ div_kernel_size[i] = (guchar) (i / kernel_size); while (iterations-- > 0) - as_pixbuf_box_blur_private (src, tmp, radius, div_kernel_size); + as_pixbuf_blur_private (src, tmp, radius, div_kernel_size); } #define interpolate_value(original, reference, distance) \ @@ -758,7 +765,7 @@ _cleanup_object_unref_ GdkPixbuf *blurred = NULL; blurred = gdk_pixbuf_copy (src); - as_pixbuf_box_blur (blurred, radius, 3); + as_pixbuf_blur (blurred, radius, 3); width = gdk_pixbuf_get_width (src); height = gdk_pixbuf_get_height (src); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
