Problem with displaying jpegs

Raymond Hettinger othello at javanet.com
Wed May 9 11:02:58 EDT 2001


I can't get it to run at all under Py2.1 on Win98.  Any ideas on
how I can complete the installation?

  File "D:\python\tempViewer.py", line 20, in ?
    main()
  File "D:\python\tempViewer.py", line 18, in main
    viewer(root)
  File "D:\python\tempViewer.py", line 9, in __init__
    im.thumbnail((396,485))
  File "Image.py", line 732, in thumbnail
    self.load()
  File "d:\python\pil\ImageFile.py", line 125, in load
    self.load_prepare()
  File "d:\python\pil\ImageFile.py", line 175, in load_prepare
    self.im = Image.core.new(self.mode, self.size)
  File "Image.py", line 43, in __getattr__
    raise ImportError, "The _imaging C module is not installed"
ImportError: The _imaging C module is not installed

Thanks,

Raymond




Ralf Claus wrote:

> Moin Klaus,
> das sollte gehen.
>
> cu
>
> from Tkinter import *
> import Image
> import ImageTk
>
> class viewer:
>    def __init__(self,root):
>           file = 'C:\picture1.jpg'
>           im = Image.open(file)
>           im.thumbnail((396,485))
>           p = ImageTk.PhotoImage(im)
>           c = Label(root,image = p)
>           c.grid(row=0,column=0)
>           root.mainloop()
>
> def main():
>      root = Tk()
>      root.title("viewer")
>      viewer(root)
>
> if __name__ == "__main__": main()
>
> "Klaus Bruns" <Klaus.Bruns at teleatlas.com> schrieb im Newsbeitrag
> news:3AF6BABC.5CF6979F at teleatlas.com...
> > Hi there,
> >
> > I have a problem with displaying a jepg file using the modules Image and
> > ImageTk on a Windows NT system. Can someone help me please!
> > I tried this, but I get an error message:
> >
> > from Tkinter import *
> > import Image
> > import ImageTk
> >
> > class viewer:
> >     def __init__(self,root):
> >         file = "C:\picture1.jpg"
> >         im = Image.open(file)
> >         im.thumbnail((200,200))
> >         p = ImageTk.PhotoImage(im)
> >         c = Label(root,image = p)
> >         c.grid(row=0,column=0)
> >
> > def main():
> >
> >     root = Tk()
> >     root.title("viewer")
> >     viewer(root)
> >     root.mainloop()
> >
> > if __name__ == "__main__": main()
> >
> >
> > The error message is:
> > TclError: image "pyimage1" doesn't exist
> >
> > Thanks,
> >     Klaus
> >




More information about the Python-list mailing list