Problems with Tkinter / Python - displaying JPEG.

Rich Somerfield rich_somerfield at
Tue Feb 20 12:15:59 CET 2001


I had Python 1.5 and Pil 0.3 as part of my Linux (SuSE6.4) installation, and
was trying to execute a Python Script that loaded and displayed images.  [I
use the Python1.5 distribution from PythonWare under windows, but wanted to
do development under Linux instead.]  However I encountered a problem when I
was trying to display a JPEG file (i have indicated the relavent line).

thebackgroundimage = thebackgroundimage.resize((canvaswidth, canvasheight))
******* thebackgroundimage = ImageTk.PhotoImage(thebackgroundimage) ********
thebackground = arena.create_image(0,0,image=thebackgroundimage)
middlex = canvaswidth
middley = canvasheight
locationx = middlex / 2
locationy = middley / 2
arena.move(thebackground, locationx, locationy)

The interpreter indicated that the parameter "PyPhotoImage" was not set and
a call was returning the wrong type (string / int).

I thought this might be a problem with an earlier version of PIL / Python /
Tkinter that didnt support JPEG files. So I downloaded Python2.0 and PIL
1.1.1.  Compiled them (after messing with the Makefiles), checked that I had
got the JPEG libraries (libjpeg).

However I get exactly the same error message.  Any ideas where the problem
is coming from?  Pil / Tkinter / Tk?


More information about the Python-list mailing list