Menu

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

v 0.96
fixed
5
2015-02-05
2012-03-25
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
     
  • Robert Lugg

    Robert Lugg - 2014-11-16

    Thank you for the report Hariharan. This change appears to have already been made and will certainly appear in the 0.97 release.

     
  • Robert Lugg

    Robert Lugg - 2014-11-18
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     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 -
    
    • status: open-accepted --> open-fixed
    • Group: --> v 0.96
     
  • Robert Lugg

    Robert Lugg - 2015-02-05
    • status: open-fixed --> fixed
     

Log in to post a comment.