Re: tkinter, loading image error, TclError: couldn't recognize data in image file "C:/users/me/desktop/images/blob4.jpg"



On Sun, 29 Jun 2008 13:34:37 +0200, defn noob <circularfunc@xxxxxxxx> wrote:

from Tkinter import *
import os

master = Tk()
w = Canvas(master, width=800, height=600)

print os.path.exists('C:/me/saftarn/desktop/images/blob4.jpg')

im = PhotoImage(file = 'C:/users/saftarn/desktop/images/blob4.jpg')
[snip]

True

Traceback (most recent call last):
File "C:/Python25/Progs/ImageVideoSearch/imId.py", line 9, in
<module>
im = PhotoImage(file = 'C:/users/me/desktop/images/blob4.jpg')
File "C:\Python25\lib\lib-tk\Tkinter.py", line 3270, in __init__
Image.__init__(self, 'photo', name, cnf, master, **kw)
File "C:\Python25\lib\lib-tk\Tkinter.py", line 3226, in __init__
self.tk.call(('image', 'create', imgtype, name,) + options)
TclError: couldn't recognize data in image file "C:/users/me/desktop/
images/blob4.jpg"




it has worked before opening and displaying a file like this, anything
to do with python 2.52, upgraded from 2.5.1

Did it? Because AFAIK, tcl/tk has never natively recognized any other image format than PPM/PGM and GIF... No JPG, no PNG...
--
python -c "print ''.join([chr(154 - ord(c)) for c in 'U(17zX(%,5.zmz5(17l8(%,5.Z*(93-965$l7+-'])"
.



Relevant Pages

  • Re: Unpack When?
    ... " A locked record is a big WE ARE STOPPING YOU FROM USING THIS ... master record at the same time. ... Now I try to separate issues with file design such as never put fast moving ...
    (comp.databases.pick)
  • Re: z An Example Of Your RACIST Posts
    ... of clubs off in your *ass* that I was carrying for you little *master*. ... Duane don't like dem white devils! ... to *KIDS*! ...
    (comp.security.firewalls)
  • Re: Brit sociologits banned words list
    ... Martin Ambuhl wrote: ... are a rather perverse misreading of what the Policy Press guidelines ... [snip very long quote] ... heard a woman said to be a master of anything. ...
    (alt.usage.english)
  • Buffer Overflow with Python 2.5 on Vista in import site
    ... is working with and a string on encountering the bad path. ... snipped the first dump and only print the one with the traceback: ... [snip a load of null bytes] ... File "C:\Python25\lib\site.py", line 206, in addsitepackages ...
    (comp.lang.python)
  • Re: Cannot understand error message
    ... IDLE did not offer a full traceback just a pop-up. ... from the Python shell would have get you the full ...
    (comp.lang.python)