[Image-SIG] silent corruption of FillOrder: lsb-to-msb TIFF reads?

Jeff Breidenbach jbreiden@parc.com
Thu, 15 May 2003 11:01:13 PDT

I'm getting unusual results when reading a set of TIFF files. 
PIL reads the file without complaint, but appears to be silently 
corrupting the image. The following commands save out a bunch of 
colorful noise.

>>> import Image
>>> a = Image.open("foo.tif")
>>> a.save("bar.bmp")

Looking at the output, I suspect that PIL's TIFF reader
is ignoring the FillOrder tag. Even more suspicious, when I 
convert the TIFF to  FillOrder: msb-to-lsb, no such corruption 

Any comments? Ideally, I'd love for PIL to be able to read
this type of TIFF file, or at least have a better grasp
of its own limitations. I've attached the TIFF characteristics 


TIFF Directory at offset 0x5c4e9ee
  Image Width: 4913 Image Length: 6567
  Resolution: 600, 600 pixels/inch
  Bits/Sample: 8
  Compression Scheme: None
  Photometric Interpretation: RGB color
  FillOrder: lsb-to-msb
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 3
  Rows/Strip: 1
  Planar Configuration: single image plane
Image: foo.tif
  Format: TIFF (Tagged Image File Format)
  Geometry: 4913x6567
  Class: DirectClass
  Type: true color
  Depth: 8 bits-per-pixel component
  Colors: 165833
  Resolution: 600x600 pixels/inch
  Filesize: 92.4m
  Interlace: None
  Background Color: grey100
  Border Color: #DFDFDF
  Matte Color: grey74
  Dispose: Undefined
  Iterations: 0
  Compression: None

Jeff Breidenbach <jbreiden "at" parc.com>
Member of Research Staff, PARC