Bug 532248 - The method show() fail !
Summary: The method show() fail !
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-imaging
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: José Matos
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-31 20:11 UTC by MERCIER Jonathan
Modified: 2010-01-15 16:28 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-01-15 16:28:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description MERCIER Jonathan 2009-10-31 20:11:00 UTC
dear sir, this little python code do'nt work !
The method show() fail !

$ python
Python 2.6 (r26:66714, Jul  4 2009, 17:37:13) 
[GCC 4.4.0 20090506 (Red Hat 4.4.0-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> from PIL import Image
>>> data = [[0, 0, 0, 0, 0, 0], [0, 255, 255, 255, 255, 0], [0, 0, 0, 0, 0, 0]]
>>> data=numpy.array(data)
>>> img =Image.new("L",(data.shape[1],data.shape[0]))
>>> img.putdata(list(data.flat))
>>> img.show()
(eog:28700): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

Comment 1 Dave Malcolm 2009-11-05 16:59:55 UTC
Have at look in /usr/lib/python2.6/site-packages/PIL/Image.py:show(), you'll see it's implemented using _showxv() at the bottom of that file.

It dumps the image to disk if necessary, then invokes "eog" (the gnome image viewer) on it, in order to view the image; that's what's issuing that error message.

The command line looks like this
(eog TEMPFILE; rm -f TEMPFILE)&

This might be a bug in eog, or a problem with PIL.  You'll need to figure out why it's failing.  Whilst the eog process is running you could look at its command line in /proc/PID/cmdline, locate the file and take a copy, then try to reproduce the problem by invoking eog manually.

Hope this is helpful.


Note You need to log in before you can comment on or make changes to this bug.