PIL(Pillow) fails with PNG image


T

tastyminerals

Hi, I am getting an error when trying to use Pillow library to display
image PNG on a Tkinter Button widget. Here is my code.

|image= Image.open(os.path.join('icons','bulb.png')) # using PIL for png images
self.correctGuessImage= ImageTk.PhotoImage(image)

|>>>
|File "/home/user/Documents/temp.py", line222, in drawButtons
self.correctGuessImage= ImageTk.PhotoImage(image)
File "/usr/lib/python2.7/dist-packages/PIL/ImageTk.py", line121, in __init__
self.paste(image)
File "/usr/lib/python2.7/dist-packages/PIL/ImageTk.py", line171, in paste
im.load()
File "/usr/lib/python2.7/dist-packages/PIL/ImageFile.py", line192, in load
d= Image._getdecoder(self.mode, d, a, self.decoderconfig)
AttributeError: 'module' object has no attribute'_getdecoder'|||

While working fine under windows 7x64 it fails to work on Linux Mint
x64. I am getting this error running the same file. I installed
everything I could find with 'python','png' and 'tk' from the reps but
no effect. Any ideas why is this happening and how to fix this?

Pavel
 
Ad

Advertisements

J

John Gordon

In said:
d= Image._getdecoder(self.mode, d, a, self.decoderconfig)
AttributeError: 'module' object has no attribute'_getdecoder'|||

Do you have your own module named Image.py?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top