Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#5 Problem when trying to load a JPG into a msgbox

open-accepted
Stephen Ferg
5
2012-03-25
2012-03-25
Stephen Ferg
No

I'm working on Python 2.7 on Windows XP with latest free Python Imaging Libray (PIL 1.1.7) installed

Tracing through the code, i isolated the the following line in the bottonbox() function that is raising an exception -

pil_Image = PIL.Image.open(imageFilename)

Given the nature of the error message, i'm guessing there's some scope/access issue that's cropping up under platform conditions because a very minor re-juggling of imports & function calls as outlined below fixed this issue :-)

***** ORIGINAL
import PIL
***** MODIFIED
from PIL import Image, ImageTk

***** ORIGINAL
pil_Image = PIL.Image.open(imageFilename)
tk_Image = PIL.ImageTk.PhotoImage(pil_Image)

***** MODIFIED
pil_Image = Image.open(imageFilename)
tk_Image = ImageTk.PhotoImage(pil_Image)

Regards
Hariharan Srinath

Discussion

  • Stephen Ferg
    Stephen Ferg
    2012-03-25

    • labels: --> easygui applicaton
    • status: open --> open-accepted