[Image-SIG] python with PIL : problem showing images in Win 7

Jean-Claude Arbaut jeanclaudearbaut at orange.fr
Thu Jun 30 18:23:35 CEST 2011


I just installed Python 2.7.2 and PIL 1.1.7. In pil-handbook.pdf there 
is a trivial example (slightly modified here to change image name):

import Image
im = Image.open("fruit.ppm")
im.show()

Everything runs well, except I get an error from Windows image viewer, 
saying the file has been deleted.
The problem seems to come from line 99 in ImageShow.py,
     return "start /wait %s && del /f %s" % (file, file)
Looks like the del doesn't wait for start to finish, hence the file 
doesn't exist when the viewer
is launched. If I try instead :
     return "start /wait %s" % file
Then the image is shown as expected. So there is a workaround, but the 
file is not
destroyed afterwards.

Is there a cleaner way to solve the problem, e.g. forcing a wait before 
del ?



More information about the Image-SIG mailing list