Using .xpm icons on desktop may draw huge icon

Bug #1061037 reported by Martin Vysny
450
This bug affects 126 people
Affects Status Importance Assigned to Milestone
gdk-pixbuf
Fix Released
Medium
gdk-pixbuf (Gentoo Linux)
Fix Released
Medium
gdk-pixbuf (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Using attached Eclipse .xpm icon as a desktop launcher icon will draw HUGE icon :-) Please see the screenshot attached. This problem started manifesting on Ubuntu 12.10 (just upgraded today), on Ubuntu 12.04 the icon was drawn correctly.

Revision history for this message
Martin Vysny (vyzivus) wrote :
Revision history for this message
Martin Vysny (vyzivus) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in debconf (Ubuntu):
status: New → Confirmed
Revision history for this message
Damian (daimonpoland) wrote :

Exactly same problem for me (Eclipse icon + Ubuntu 12.10). Wanted to report it but as I can see it's already reported :)

Revision history for this message
In , Samuel-bauer (samuel-bauer) wrote :

when loading images with gdk_pixbuf_new_from_file_at_size, xpm files won't be handled correctly (they aren't resized).

This snippet of code:
#include <gdk/gdk.h>
#include <stdio.h>
#define SIZE 16

int main(int argc, char *argv[]) {
 GdkPixbuf *pixbuf;
 GError *err = NULL;
 char *file;

 if(argc > 1)
  file = argv[1];

 g_type_init();
 pixbuf = gdk_pixbuf_new_from_file_at_size ((gchar*)file, SIZE, SIZE, &err);
 if(err != NULL)
  printf("error\n");
 if(gdk_pixbuf_get_width(pixbuf) != SIZE || gdk_pixbuf_get_height(pixbuf) != SIZE)
  printf("%s %d %d\n", file, gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height(pixbuf));
 return(0);
}
doesn't produce any output when reverting to gdk-pixbuf-2.24.0-r1, when it's noisy with last stable gdk-pixbuf (no error though image not resized).

I don't know if this wouldn't better be reported upstream.

Reproducible: Always

Expected Results:
xpm image should be resized when loaded so.

Revision history for this message
In , Rafał Mużyło (galtgendo) wrote :

While your use of gdk_pixbuf_new_from_file_at_size is according to docs not quite correct, it indeed seems to be an upstream bug.

Revision history for this message
In , Samuel-bauer (samuel-bauer) wrote :

In reply to comment #1

I should be specific on the point that I did test on square images, else whatever the output will be noisy cause aspect ratio is preseved. But maybe you meant about something else (this snippet of code has just been quickly copied from another project for test purposes)

Revision history for this message
Nepomuk Seiler (nepomuk-seiler) wrote :

Same here. Ubuntu 12.10 64bit. All Eclipse xpm icons (even from non-eclipse distributions like Typesafe IDE)

Revision history for this message
In , Rafał Mużyło (galtgendo) wrote :

@comment 2:
I've mostly meant this fragment: "Note that the returned pixbuf may be smaller than width x height, if the aspect ratio requires it."

Revision history for this message
Jacob Rigby (jacobcrigby) wrote :

+1 Confirm. Ubuntu 12.10 x64. When I use "Resize Icon" in the right-click context menu, the shortcut arrow changes size, but the icon itself does not. It takes up a full 1/8th of my desktop.

Revision history for this message
Jacob Rigby (jacobcrigby) wrote :

Screenshot of icon next to dash, with smaller icons near it for comparison.

Revision history for this message
In , Samuel-bauer (samuel-bauer) wrote :

In reply to comment #3

Ok, output would be noisy every case when aspect ratio of the image isn't 1:1 any case, but still any xpm image aren't resized through this call.

Maybe somebody would fill a bug on the gnome bugtracker ?

Revision history for this message
In , Alexandre Rostovtsev (tetromino) wrote :

(In reply to comment #4)
> Maybe somebody would fill a bug on the gnome bugtracker ?

https://bugzilla.gnome.org/show_bug.cgi?id=686514

Revision history for this message
Thorsten Hirsch (t-hirsch) wrote :

Same here in Gnome 3.6 (Gnome PPA version).

Revision history for this message
In , Samuel-bauer (samuel-bauer) wrote :

In reply to comment #5

Thank you for filling the bug supplying more accurate tests on the pixbuf size values, and for the responsiveness.

Would add that xpm image loaded through gtk_image_new_from_icon_name are correctly resized, it may could be helpful.

Revision history for this message
Onal Zengin (neonalz) wrote :

Also icon in launcher is pixelated. See attached please.

Revision history for this message
ADHDTux (adhdtux) wrote :

Same here after today's upgrade to 12.10 x64.

Revision history for this message
Peter van der Does (pdoes) wrote :

It's a problem with all .xpm icons. The icons are not resized to proper sizes. Google's Chrome icon is 32x32 xpm and that's what is shown.

It baffles me this behavior wasn't detected during the testing phase, or if it didn't happen during the testing phase a last minute update screwed it up.

Revision history for this message
Removed by request (removed3600631) wrote :

I have the same issue with all .xpm icons.

Revision history for this message
uygar.raf (uygar-raf) wrote :

If we copy the xpm file to ~/.local/share/icons and edit the relevant .desktop file as follows:

Change this:
Icon=/home/SomeUser/SomePath/SomeApp/SomeAppIcon.xpm
Into this:
Icon=SomeAppIcon

It all works out as expected.
Now, that's a weird bug, isn't it?

Revision history for this message
Emilian Dobre (emilian-dobre) wrote :

I did the same as uygar and the icons scaled down.

in my case i had issues with hplip in lubuntu start menu
so after changing "/usr/share/pixmaps/HPmenu.xpm" inside the .desktop files into simple "HPmenu"
resulted in the icons scaling down

Revision history for this message
Peter Parapounsky (bocluc) wrote :

This bug affects also the IBM Installation Manager.

Revision history for this message
Hongbo Liu (liuhb86) wrote :

Also affects launchers in the panel and menu entries in Xubuntu 12.10.

affects: debconf → gdk-pixbuf
Changed in gdk-pixbuf:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
Daniel (hackie) wrote :

Same problem with Xubuntu on raring (13.04, also with the eclipse icon.xpm). Previously I used 12.04 and everything was ok.
If I convert it to a .png using GIMP, everything looks fine.

Revision history for this message
Daniel (hackie) wrote :
tags: added: quantal raring xpm
affects: debconf (Ubuntu) → gdk-pixbuf (Ubuntu)
Revision history for this message
thefourtheye (thefourtheye) wrote :

There is a workaround.

mogrify -format png /home/thefourtheye/Downloads/Aptana_Studio_3/icon.xpm

I used the above mentioned command to convert it to a png file and set it to the icon.

It works :)

Revision history for this message
Jamin W. Collins (jcollins) wrote :

That's not a "workaround", it merely side steps the issue and is something that users will need to do for each and ever application that uses an xpm icon.

Yes, converting the icon to png format results in a normal sized icon. However, these very same xpm icons used to work fine. This is a regression in behavior and functionality.

Revision history for this message
Arkadiusz Dziób (arkadiusz.dziob) wrote :

Very annoying bug (Ubuntu 13.04).
I think someone random wrote code responsible for this and died just after submitting.

Revision history for this message
agama (agama-pro) wrote :

I have the same bug, but of gnome fallback.
This icon was ok of Ubuntu 12.10.

Revision history for this message
In , Samuel-bauer (samuel-bauer) wrote :

The bug has been confirmed upstream, so I suggest to add an epatch in the ebuild targetting the following patch.

https://bug686514.bugzilla-attachments.gnome.org/attachment.cgi?id=244569

I used to check if it works with through epatch_user, compile went through nicely, and gdk_pixbuf_new_from_file_at_size handles xpm file correctly.

Revision history for this message
Ralf Naujokat (ubuntu-ralf-naujokat) wrote :

Still no fix on this nearly one year old bug.

What's the point of reporting bugs, if no one cares??
There is not even one single answer, that looks like
if anyone has ever read this.

Revision history for this message
Vadim Peretokin (vperetokin) wrote :

Just a FYI, gdk-pixbuf developers don't use this for development. However, they are aware of the issue and someone else wrote a patch to fix it: https://bugzilla.gnome.org/show_bug.cgi?id=686514

Commenting on the fact that developers haven't responded here does no good as they don't even use launchpad.

Changed in gdk-pixbuf (Gentoo Linux):
importance: Unknown → Medium
Changed in gdk-pixbuf (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
Changed in gdk-pixbuf:
status: New → Fix Released
Revision history for this message
Rolf Prünte (fumoffu-deactivatedaccount) wrote :

Since this bug is now fixed upstream, can we expect a corrected version of gdk-pixbuf in 14.04?

Revision history for this message
Israel Dahl (israeldahl) wrote :

https://bugs.launchpad.net/ubuntu-themes/+bug/1265392
Is my duplicate of this.

If it is fixed upstream please let it trickle down here.
still present 14.04

Changed in gdk-pixbuf (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdk-pixbuf - 2.30.2-0ubuntu2

---------------
gdk-pixbuf (2.30.2-0ubuntu2) trusty; urgency=medium

  * debian/patches/fix-xpm-scaling.patch:
    - Fix XPM scaling (LP: #1061037)
 -- Robert Ancell <email address hidden> Wed, 08 Jan 2014 12:19:10 +1300

Changed in gdk-pixbuf (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
In , Nathanegge (nathanegge) wrote :

Created attachment 367512
files/gdk-pixbuf-2.26.4-xpm-scaling.patch

Patch based on upstream fix to this issue see https://bugzilla.gnome.org/attachment.cgi?id=244569

Revision history for this message
In , Nathanegge (nathanegge) wrote :

Created attachment 367516
gdk-pixbuf-2.26.4.ebuild

As requested, an epatch'd ebuild.

Revision history for this message
In , Pacho-gentoo (pacho-gentoo) wrote :

Should be fixed in 2.30.5

Changed in gdk-pixbuf (Gentoo Linux):
status: Unknown → Fix Released
Revision history for this message
Israel Dahl (israeldahl) wrote :

This bug is no longer present in Trusty

Revision history for this message
Swarnendu Biswas (swarna-cse) wrote :

I have this issue with Opera developer in Utopic with gnome 3 ppas.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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