PIL + show() + Vista
mail at timgolden.me.uk
Fri Nov 30 11:34:53 CET 2007
Méta-MCI (MVP) wrote:
> I have found the problem. On Vista, the Windows-Photo-Galery (soft
> default displayer) don't wait. Even with START /WAIT (in Image.py &
> _showxv), it don't wait.
> Then, like the preview don't wait, the (next) "DEL" run prior the end of
> the launch of the software ; and Windows-Photo-Galery don't found the
> I don't have a good solution. For force view of image, it's possible to
> delete the "DEL /F %s" part ; but that will involve many BMP/temporary
I was going to suggest using FindExecutable to find out whatever
your system uses to show pictures... but then I tried it out and
found out that the association is actually via the shimgvw DLL.
So I suppose you'll have to special-case that.
filepath = r"c:\temp\test.jpg"
res, exe = win32api.FindExecutable (filepath)
if exe.endswith ("shimgvw.dll"):
cmd = "rundll32.exe %s,ImageView_Fullscreen %s" % (exe, filepath)
cmd = "%s %s" % (exe, filepath)
On my XP machine this waits for the ImageViewer to return.
Be interesting to see if that's different under Vista. At
least it offers you a little more control, perhaps?
More information about the Python-list