Using .xpm icons on desktop may draw huge icon

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

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.

Martin Vysny (vyzivus) wrote :
Launchpad Janitor (janitor) wrote :

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

Changed in debconf (Ubuntu):
status: New → Confirmed
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 :)

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];

 pixbuf = gdk_pixbuf_new_from_file_at_size ((gchar*)file, SIZE, SIZE, &err);
 if(err != NULL)
 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));
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.

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.

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)

Nepomuk Seiler (nepomuk-seiler) wrote :

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

@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."

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.

Jacob Rigby (jacobcrigby) wrote :

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

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 ?

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

Thorsten Hirsch (t-hirsch) wrote :

Same here in Gnome 3.6 (Gnome PPA version).

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.

Onal Zengin (neonalz) wrote :

Also icon in launcher is pixelated. See attached please.

ADHDTux (adhdtux) wrote :

Same here after today's upgrade to 12.10 x64.

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.

Andy Scott (travega) wrote :

I have the same issue with all .xpm icons.

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:
Into this:

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

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

Peter Parapounsky (bocluc) wrote :

This bug affects also the IBM Installation Manager.

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
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.

tags: added: quantal raring xpm
affects: debconf (Ubuntu) → gdk-pixbuf (Ubuntu)
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 :)

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.

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

agama (agama-pro) wrote :

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

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

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.

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.

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:

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

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

Israel Dahl (israeldahl) wrote :
Is my duplicate of this.

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

Adolfo Jayme (fitojb) on 2014-01-08
Changed in gdk-pixbuf (Ubuntu):
status: Triaged → Fix Committed
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

Created attachment 367512

Patch based on upstream fix to this issue see

Created attachment 367516

As requested, an epatch'd ebuild.

Should be fixed in 2.30.5

Changed in gdk-pixbuf (Gentoo Linux):
status: Unknown → Fix Released
Israel Dahl (israeldahl) wrote :

This bug is no longer present in Trusty

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  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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