Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i am having a problem with a Gtk.Image. I use the set_from_file() function to add the image to the Gtk.Image but the image is not displayed! Instead the broken icon is...

The image exist and i can open it with the default image viewer so its not corrupted.. I tried with Pixbuf also but i get the same result..

Any idea why the image appears corrupted and how to fix it?

share|improve this question
up vote 1 down vote accepted

Broken icon means that there is a problem with the path of the image you are trying to set.Your code is correct. It just can't find the image you want to use thus a broken image is displayed instead.

 image = gtk.Image()

In order to prevent mistakes from wrong paths, I suggest browsing with Nautilus at the image you want to use, right click on it -> Properties - > Basic : Location

share|improve this answer
But the image exist, example: the image must be /tmp/tmplMJf2g/The_Breaker_NW_c77[a-team].cbr/The_Breaker_NW77_001.png so i cd into the folder chris@chris-Aspire-5732Z:~$ cd /tmp/tmplMJf2g/The_Breaker_NW_c77[a-team].cbr/ chris@chris-Aspire-5732Z:/tmp/tmplMJf2g/The_Breaker_NW_c77[a-team].cbr$ ls The_Breaker_NW77_001.png as you can see the image exist... – Clepto Jul 24 '12 at 12:27
The image MAY exist but the path for the image you are writing is wrong.Where is that image anyway?Why don't you move it to the Desktop or something like that and use /home/user/Desktop/image.png ? that would make your life a lot easier – Rrj Jul 24 '12 at 14:44
i download the image to /tmp for short-life use and then its deleted, thats why i save it to /tmp...Any other idea? except changing folder...can i use something else to display an image? – Clepto Jul 24 '12 at 15:04
I told you that the problem is the path....the name of the file may be wrong. – Rrj Jul 24 '12 at 15:21
ok...thanks! i will mark you answer as solved – Clepto Jul 24 '12 at 15:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.