After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 783534 - Show error message when fail to load placeholder icon
Show error message when fail to load placeholder icon
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-06-07 23:32 UTC by Robert Ancell
Modified: 2017-06-08 21:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
iconhelper: Show error if fail to load placeholder icon (1.20 KB, patch)
2017-06-07 23:32 UTC, Robert Ancell
accepted-commit_now Details | Review
icon-theme: Show filename attempted when icon fails to load (751 bytes, patch)
2017-06-08 00:09 UTC, Robert Ancell
needs-work Details | Review

Description Robert Ancell 2017-06-07 23:32:32 UTC
Created attachment 353366 [details] [review]
iconhelper: Show error if fail to load placeholder icon

In GtkIconHelper ensure_surface_for_gicon() gives a vague error message if it fails to load the placeholder icon. Attached patch shows the GError that causes the failure.
Comment 1 Robert Ancell 2017-06-07 23:34:58 UTC
Original error message:

Gtk:ERROR:gtkiconhelper.c:493:ensure_surface_for_gicon: assertion failed: (destination)

Message after patch:

Gtk:ERROR:gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Comment 2 Robert Ancell 2017-06-08 00:09:56 UTC
Created attachment 353367 [details] [review]
icon-theme: Show filename attempted when icon fails to load

Additional patch that shows the filename attempted:

Gtk:ERROR:gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Comment 3 Matthias Clasen 2017-06-08 20:42:37 UTC
Review of attachment 353366 [details] [review]:

sure
Comment 4 Matthias Clasen 2017-06-08 20:43:40 UTC
Review of attachment 353367 [details] [review]:

::: gtk/gtkicontheme.c
@@ +2308,3 @@
   pixbuf = gtk_icon_info_load_icon (icon_info, error);
+  if (error)
+    g_prefix_error (error, "Failed to load %s: ", icon_info->filename);

g_prefix_error is NULL-safe, no need for the if