PIL Image.show() using eog doesn't work second time
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-imaging (Debian) |
New
|
Undecided
|
Unassigned | ||
python-imaging (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: python-imaging
This reports an issue with a fix for bug #67755. The fix done upstream in Debian (321658) does not work well for "eog". I attempted to reopen the Debian bug, but it is archived and cannot be reopened apparently. I started to reopen 67755, but decided a more precise bug report would be better. If this is incorrect protocol, I apologize.
--------
I'm using PIL 1.1.6 on Ubuntu jaunty, and noticed a problem with invoking im.show() more than once without closing the image viewing window. On this system, im.show() uses "eog" to view the images. If you do something like:
>>>im.show() # don't close the eog window
>>>im.show()
then the second im.show() causes an error. The actual images don't matter: they could be the same or different.
The two im.show() calls invoke Image._showxv() twice, which effectively does this:
os.system("(eog /tmp/tmp123; rm -f /tmp/tmp123)&")
os.system("(eog /tmp/tmp456; rm -f /tmp/tmp456)&")
However, eog is very clever and tries to reuse its first instance. So the second instantiation of eog exits immediately after notifying the first to display /tmp/tmp456. But then the file disappears out from under it.
The _showxv() code shows a similar problem already came up on OS X, and a "sleep 20" was inserted before the "rm". For eog, another, perhaps more elegant solution is to invoke eog as "eog -n", which always starts a new instance instead of reusing an existing one.
ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
Package: python-imaging 1.1.6-3ubuntu1
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: python-imaging
Uname: Linux 2.6.28-11-generic i686
This happens for gThumb, too