Mailing List Archive

PIL: problem with im.show()
system configuration
Sun Solaris-2.6
python-1.5.2
PIL-1.0

in PIL/libImaging, the following step suggested in the installation works:
make check

in PIL/Scripts the following scripts were tried and worked:
python viewer.py lena.ppm
python thresholder.py lena.ppm
python enhancer.py lena.ppm
python painter.py lena.ppm

the following interactive process
>>> import Image
>>> im = Image.open("lena.ppm")
>>> print im.format, im.size, im.mode
PPM (128, 128) RGB
>>> im.show()
Traceback (innermost last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python1.5/site-packages/PIL/Image.py", line 694, in show
_showxv(self, title, command)
File "/usr/local/lib/python1.5/site-packages/PIL/Image.py", line 974, in _showxv
file = self._dump(format=format)
File "/usr/local/lib/python1.5/site-packages/PIL/Image.py", line 311, in _dump
file = file + "." + format
TypeError: illegal argument type for built-in operation
>>>

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Kinter tmk@mayo.edu 507-284-4981
Mayo Foundation Rochester MN 55905 USA
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PIL: problem with im.show() [ In reply to ]
Tom Kinter wrote:

> system configuration
> Sun Solaris-2.6
> python-1.5.2
> PIL-1.0
>
>
> File "/usr/local/lib/python1.5/site-packages/PIL/Image.py", line 311, in _dump
> file = file + "." + format
> TypeError: illegal argument type for built-in operation
> >>>
>

I had the same problem on a Linux box when I was creating an SRPM for Imaging 1.0.
I created a patch to fix it, and sent that to F. Lundh (no response yet).

In any case, the following patch fixed it for me:

--- PIL/Image.py.orig Mon Aug 2 15:39:56 1999
+++ PIL/Image.py Sun Aug 15 14:30:28 1999
@@ -961,7 +961,7 @@
if not command:
command = "start"
else:
- format = None
+ format = "PPM"
if not command:
command = "xv"
if title:

In other words, on Unix, the default format string defaults to None. Change it
to a valid extension string (if "PPM" doesn't work for your viewer, try "TIF"
or "BMP" or "JPG" or whatever)

Chad
chad@vision.arc.nasa.gov