[Image-SIG] problem reading tiffs
Wed, 20 Feb 2002 15:19:57 +0100
I am trying to use PIL to read tiffs created by metamorph. I get an error:
>Traceback (most recent call last):
> File "./get_data.py", line 12, in ?
> im = Image.open("2.6_7.8DIC21.TIF")
> File "/usr/local/python-2.2/lib/python2.2/site-packages/PIL/Image.py",
line 960, in open
> raise IOError, "cannot identify image file"
>IOError: cannot identify image file
Whenever I run tiffinfo on the file I get:
>2.6_7.8DIC02.TIF: Warning, unknown field with tag 317 (0x13d) ignored.
>2.6_7.8DIC02.TIF: Warning, unknown field with tag 33628 (0x835c) ignored.
>TIFF Directory at offset 0x2b8cc
> Subfile Type: (0 = 0x0)
> Image Width: 300 Image Length: 296
> Resolution: 15.5358, 15.5358 pixels/inch
> Bits/Sample: 16
> Compression Scheme: None
> Photometric Interpretation: min-is-black
> Date & Time: "2002:01:08 14:00:11"
> Software: "MetaMorph"
> Image Description: "Acquired from MV-1500\r\nExposure: 250 ms\r\nRegion:
600 x 600, offset at (340, 212)\r\nBinning: 2 x 2\r\nGain: 1\r\nBit Depth:
> Rows/Strip: 13
> Planar Configuration: single image plane
now it could be that the unknown tags are causing the read to fail, in which
case I will need to modify tiffimageplugin.py to accept these new tags (I
Alternatively, I am concerned that my libImaging directry is still in my
home, and wasn't moved to /usr/local/python like everything else. Perhaps
this is a problem also?
I also saw in the archives (way back in 99!) that there was a re-written
version of TiffImagePlugin.py which mentioned specifically handling these
files (created my metamorph). Is this still available? Is it now the current
module? Is my problem nothing to do with the files I'm trying to read and
instead to do with my installation?
Any help at in pointing me towards decoding these slightly unusual tiffs
would be much appreciated. At the moment I am not really so sure how I can
trace the problem and do the decoding.