Icons in .ico format use a low quality version when disaplayed in unity-2d launcher

Bug #956714 reported by WenLong FENG
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
unity-2d
Invalid
Low
Unassigned
unity-2d (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

= Problem =

Under unity-2d .ico files do not display correctly in the launcher, they look pixelated and do not show the right colours. Under unity-3d they display correctly.

= Environment =

* Ubuntu 12.04 LTS (Precise)
* unity-2d 5.8.0-0ubuntu1

= Steps to reproduce =

1. Login to a unity-2d session
2. Download attachment ImageAndDesktopConfig.zip
3. Make a temp dir to store the data
        $ mkdir /tmp/lp956714-testing
        $ mv ~/Downloads/ImageAndDesktopConfig.zip /tmp/lp956714-testing
        $ cd /tmp/lp956714-testing/ && unzip ImageAndDesktopConfig.zip
4. Launch nautils, navigate to /tmp/lp956714-testing and drag the .desktop file to the launcher
5. Observe that icon is pixelated, logout and into unity-3d session to see icon correctly displayed

= Original text =

When set an ico file as desktop icon. it renders well on ubuntu 12.04 3D mode, but failed to display normally under 2d Mode. detailed configure file and screen shots provided in attachment.

The application configure file : /usr/share/applicatoins/LotusNotes8.5.desktop
The image : /opt/ibm/lotus/notes/notes.ico
The comparison between 2D and 3D mode : ss.png (It seems on 2d and 3d mode, ubuntu also render the png icon of firefox differently, but Lotus Notes has been changed most)

Revision history for this message
WenLong FENG (fengwl) wrote :
Jason Kairl (jdkairl)
affects: ubuntu → nautilus (Ubuntu)
affects: nautilus (Ubuntu) → unity-2d (Ubuntu)
Revision history for this message
Tom Ellis (tellis) wrote : Re: Icons in .ico format do not display correctly in the unity-2d launcher

Screenshot uploaded separately as ss.png.

To the far left, the unity-3d launcher with the icon correctly displayed is shown, to the right is the unity-2d launcher with the incorrect icon shown.

summary: - desktop icon (ICO format) display ugly under ubuntu 12.04 2D mode
- Compiz Core Bugs Bug #956713
+ Icons in .ico format do not display correctly in the unity-2d launcher
description: updated
Revision history for this message
Tom Ellis (tellis) wrote : apport information

ApportVersion: 1.95-0ubuntu1
Architecture: amd64
DistroRelease: Ubuntu 12.04
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120111)
Package: unity-2d 5.8.0-0ubuntu1
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=en_GB:en
 TERM=xterm
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 3.2.0-20.32-generic 3.2.12
Tags: third-party-packages precise unity-2d
Uname: Linux 3.2.0-20-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip libvirtd lpadmin plugdev sambashare sudo

tags: added: apport-collected precise third-party-packages unity-2d
Revision history for this message
Tom Ellis (tellis) wrote : Dependencies.txt

apport information

Revision history for this message
Launchpad Janitor (janitor) wrote : Re: Icons in .ico format do not display correctly in the unity-2d launcher

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity-2d (Ubuntu):
status: New → Confirmed
Revision history for this message
Tom Ellis (tellis) wrote :

I did a bit of debugging on the icon file.

$ identify notes.ico
notes.ico[0] ICO 48x48 48x48+0+0 4-bit DirectClass 42.2KB 0.000u 0:00.000
notes.ico[1] ICO 32x32 32x32+0+0 4-bit DirectClass 42.2KB 0.000u 0:00.000
notes.ico[2] ICO 16x16 16x16+0+0 4-bit DirectClass 42.2KB 0.000u 0:00.000
notes.ico[3] ICO 48x48 48x48+0+0 8-bit DirectClass 42.2KB 0.000u 0:00.000
notes.ico[4] ICO 32x32 32x32+0+0 8-bit DirectClass 42.2KB 0.000u 0:00.000
notes.ico[5] ICO 16x16 16x16+0+0 8-bit DirectClass 42.2KB 0.000u 0:00.000
notes.ico[6] ICO 64x64 64x64+0+0 32-bit DirectClass 42.2KB 0.000u 0:00.000
notes.ico[7] ICO 48x48 48x48+0+0 32-bit DirectClass 42.2KB 0.000u 0:00.000
notes.ico[8] ICO 32x32 32x32+0+0 32-bit DirectClass 42.2KB 0.000u 0:00.000
notes.ico[9] ICO 16x16 16x16+0+0 32-bit DirectClass 42.2KB 0.000u 0:00.000

$ convert notes.ico notes.png
$ ls
notes-0.png notes-1.png notes-2.png notes-3.png notes-4.png notes-5.png notes-6.png notes-7.png notes-8.png notes-9.png

This gives me all of those in separate .png files, it seems like the unity-2d launcher is loading the first one by default
"notes.ico[0] ICO 48x48 48x48+0+0 4-bit" (notes-0.png) instead of the 32-bit version, hence the pixelated
graphics and odd colours.

If I remove the 4-bit png's and reassemble the ico file, under the unity-2d launcher it correctly loads the right icon:
$ rm notes-0.png notes-1.png notes-2.png
$ convert png8:notes-3.png png8:notes-4.png png8:notes-5.png png32:notes-6.png png32:notes-7.png png32:notes-8.png png32:notes-9.png notes.ico
- right click on notes icon and select "Unlock from launcher"
- follow step four in bug description to re-add the desktop file

Unity-3d's launcher seems to select a icon from the .ico with a better colour depth by default.

Revision history for this message
Tom Ellis (tellis) wrote :

I also found a mention that the .ico standard is not part of the Freedesktop.org Icon Theme Specification:
http://standards.freedesktop.org/icon-theme-spec/latest/ar01s02.html
https://wiki.archlinux.org/index.php/Desktop_Entries

However, it does appear that Unity-2d's launcher does by default launch the wrong icon colour depth over Unity-3d - so it seems there is certainly an issue here.

tags: added: css-sponsored-p
Revision history for this message
Ritesh Khadgaray (khadgaray) wrote :

This is a bug (?) with qml, and not unity 2D. I have attached a trivial test case for this.

Revision history for this message
WenLong FENG (fengwl) wrote :

Hi All,
Thanks for finding out a root cause :)
As for the bug of qml, shall I create another bug report to QML or should I keep follow up with current one, thanks.

Revision history for this message
Michał Sawicz (saviq) wrote :

Would be great, guys, if one of you would report that to https://bugreports.qt-project.org/ and add a link here to follow.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Ritesh your code sample works perfectly here. Can you share your notes.ico file?

Revision history for this message
Tom Ellis (tellis) wrote :

The notes.ico file is in the zip file, but here it is separately anyway.

Thanks for the help all.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Works for me here

Revision history for this message
Michał Sawicz (saviq) wrote :

I can confirm - it does seem to select a low quality version.

summary: - Icons in .ico format do not display correctly in the unity-2d launcher
+ Icons in .ico format use a low quality version when disaplayed in
+ unity-2d launcher
Changed in unity-2d:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Ritesh Khadgaray (khadgaray) wrote :

Hi Michał Sawicz

From the code, I do see qt reads the and displays the first image in the list. A workaround would be to list the high res icon first in the image list. This seems to be an expected behaviour.

 Alternatively, we could write an icon extension ( such as http://doc.qt.nokia.com/4.7-snapshot/declarative-cppextensions-imageprovider.html ) for Unity 2D to load the highest res icon for the given display. I am not familiar with qml enough to know if this can be done without writing an extension .

 Any thoughts on qml here ?

Cheers
ritz

Changed in unity-2d:
status: Confirmed → Invalid
Changed in unity-2d (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.