GNOME Bugzilla – Bug 785447
After updating gdk-pixbuf2, *.ico format support seems broken
Last modified: 2017-07-28 08:39:33 UTC
Created attachment 356424 [details] Reproducer code I have updated gdk-pixbuf2-2.36.6-1.fc25.x86_64 to gdk-pixbuf2-2.36.7-1.fc25.x86_64 (on Fedora). Tray icons and notifications using icons in *.ico format stopped working correctly. They are in incorrect scale and color palette. See attached screenshots and reproducer code.
Created attachment 356425 [details] Reproducer icon
Created attachment 356426 [details] Actual result
Created attachment 356427 [details] Expected result
Downstream bug: https://bugzilla.redhat.com/show_bug.cgi?id=1475286
Looks like a regression in one of those patches: https://bugzilla.gnome.org/show_bug.cgi?id=776040 First thing would be to figure out which one of the patches breaks it, then integrate the icon into the test suite, and fix that broken commit. My guess is this fixes it: diff --git a/gdk-pixbuf/io-ico.c b/gdk-pixbuf/io-ico.c index 12f0a5880..5b3646cb3 100644 --- a/gdk-pixbuf/io-ico.c +++ b/gdk-pixbuf/io-ico.c @@ -203,9 +203,9 @@ compare_direntry_scores (gconstpointer a, const struct ico_direntry_data *ib = b; /* Backwards, so largest first */ - if (ib->ImageScore > ia->ImageScore) + if (ib->ImageScore < ia->ImageScore) return -1; - else if (ib->ImageScore < ia->ImageScore) + else if (ib->ImageScore > ia->ImageScore) return 1; return 0; } (fixing commit 99508c712d50e691328f47ce137cdbfa48b2d2e7)
Created attachment 356428 [details] [review] ico: Fix icon quality sorting Despite the inherited comment, commit 99508c7 sorted the icons by increasing instead of decreasing quality.
Created attachment 356429 [details] [review] tests: Add test case for ICO quality sorting bug
Attachment 356428 [details] pushed as d6a0233 - ico: Fix icon quality sorting Attachment 356429 [details] pushed as 9ac5cc0 - tests: Add test case for ICO quality sorting bug
Thanks for quick fix. It seems to work fine.