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
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.