[Image-SIG] show() and save() glitches (PIL 1.1, Py 2.0b2)

Randall Hopper aa8vb@yahoo.com
Wed, 11 Oct 2000 18:56:58 -0400


     Trying out PIL 1.1 on Python 2.0b2 here.  I'm really impressed it can
read and thumbnail this image, and fast, without requiring massive VM.

     Hit a few stumbles though in doing something simple with the thumbnail
though.  show() trips on an internal error, and so does save().  Note that
this is a "huge" 8-bit palettized image (mode P).  It thumbnails fine.  The
problem is then doing a show() or doing a save() to TIFF on the resulting
thumbnail.

Randall

------------------------------------------------------------------------------
show() glitch:
------------------------------------------------------------------------------

   > python2
   Python 2.0b2 (#2, Oct 11 2000, 17:40:00) [C] on irix646-n32                     Type "copyright", "credits" or "license" for more information.
   >>> import Image
   >>> im = Image.open( "penn_mrlc.tif" )
   >>> im.size
   (24758, 13716)
   >>> im.mode
   'P'
   >>> im.thumbnail( (128,128) )
   >>> im.size
   (128, 70)
   >>> im.mode
   'P'
   >>> im.show()
   Traceback (most recent call last):
     File "<stdin>", line 1, in ?
     File "/home/rhh/software/python2/lib/python2.0/site-packages/PIL/Image.py", line 695, in show
       _showxv(self, title, command)
     File "/home/rhh/software/python2/lib/python2.0/site-packages/PIL/Image.py", line 973, in _showxv
       file = self.convert(base)._dump(format=format)
     File "/home/rhh/software/python2/lib/python2.0/site-packages/PIL/Image.py", line 312, in _dump
       file = file + "." + format
   TypeError: cannot add type "None" to string

------------------------------------------------------------------------------
save() glitch:
------------------------------------------------------------------------------

   > python2
   Python 2.0b2 (#2, Oct 11 2000, 17:40:00) [C] on irix646-n32
Type "copyright", "credits" or "license" for more information.
   >>> import Image
   >>> im = Image.open( "penn_mrlc.tif" )

   ... etc. - same as above ...

   >>> im.save( "t.tif" )
   Traceback (most recent call last):
     File "<stdin>", line 1, in ?
     File "/home/rhh/software/python2/lib/python2.0/site-packages/PIL/Image.py", line 667, in save
       SAVE[string.upper(format)](self, fp, filename)
     File "/home/rhh/software/python2/lib/python2.0/site-packages/PIL/TiffImagePlugin.py", line 592, in _save
       offset = ifd.save(fp)
     File "/home/rhh/software/python2/lib/python2.0/site-packages/PIL/TiffImagePlugin.py", line 329, in save
       append(tag, typ, len(value), data + (4-len(data))*"\0", "")
   TypeError: append requires exactly 1 argument; 5 given

   >>> im.save( "t.gif" )
   >>>

------------------------------------------------------------------------------


A few small glitches in building it, but I'll report later.

Randall

-- 
Randall Hopper
aa8vb@yahoo.com