1993.08.21 05:06 "Bug in tiffsplit", by Bernard Gardner

1993.08.21 05:06 "Bug in tiffsplit", by Bernard Gardner

I have found a problem in tiffsplit.

I have a set if tiff files which each contain three images: A 24-bit rgb preview of a stereo picture, suitable for viewing through stereo Red/Green glasses, and the full size 8-bit grey scale left and right views of the object

When I use tiffsplit to split these images, the preview image is reduced to grey scale. This seems to be because tiffsplit uses TIFFNumberOfStrips to determine the number of strips to copy for the image, but TIFFNumberOfStrips is only returning the number of strips in the first plane. The greyscale images seem fine.

What do you folk suggest as a fix? Is it the library or the program, or is there something funny about the format of my images?

tiffinfo and tiffdump output for the original and first split image follow. Note that StripByteCounts and StripOffsets are wrong in the split off image.

Bernard.

--------

TIFF Directory at offset 0x58962
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 462 Image Length: 627
  Resolution: 66.6667, 66.6667 pixels/inch
  Bits/Sample: 8
  Compression Scheme: Lempel-Ziv & Welch encoding
  Photometric Interpretation: RGB color
  Image Description: "preview"
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 3
  Planar Configuration: separate image planes

TIFF Directory at offset 0x140dfe
  Subfile Type: (0 = 0x0)
  Image Width: 1386 Image Length: 1881
  Resolution: 200, 200 pixels/inch
  Bits/Sample: 8
  Compression Scheme: Lempel-Ziv & Welch encoding
  Photometric Interpretation: min-is-black
  Image Description: "A+10.tif"
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 1
  Planar Configuration: single image plane

TIFF Directory at offset 0x1f9928
  Subfile Type: (0 = 0x0)
  Image Width: 1386 Image Length: 1881
  Resolution: 200, 200 pixels/inch
  Bits/Sample: 8
  Compression Scheme: Lempel-Ziv & Welch encoding
  Photometric Interpretation: min-is-black
  Image Description: "A-10.tif"
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 1
  Planar Configuration: single image plane

--------

TIFF Directory at offset 0x21574
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 462 Image Length: 627
  Resolution: 66.6667, 66.6667 pixels/inch
  Bits/Sample: 8
  Compression Scheme: Lempel-Ziv & Welch encoding
  Photometric Interpretation: RGB color
  Image Description: "preview"
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 3
  Planar Configuration: separate image planes

--------

/usr/hons/bernard/work/s2/A_10.tif:
Magic: 0x4d4d <big-endian> Version: 0x2a
Directory 0: offset 362850 (0x58962)
SubFileType (254) LONG (4) 1<1>
ImageWidth (256) SHORT (3) 1<0>
ImageLength (257) SHORT (3) 1<0>
BitsPerSample (258) SHORT (3) 3<8 8 8>
Compression (259) SHORT (3) 1<0>
Photometric (262) SHORT (3) 1<0>
ImageDescription (270) ASCII (2) 8<preview>
StripOffsets (273) LONG (4) 3<8 136563 249706>
Orientation (274) SHORT (3) 1<0>
SamplesPerPixel (277) SHORT (3) 1<0>
StripByteCounts (279) LONG (4) 3<136555 113143 113143>
XResolution (282) RATIONAL (5) 1<66.6667>
YResolution (283) RATIONAL (5) 1<66.6667>
PlanarConfig (284) SHORT (3) 1<0>
ResolutionUnit (296) SHORT (3) 1<0>

Directory 1: offset 1314302 (0x140dfe)
SubFileType (254) LONG (4) 1<0>
ImageWidth (256) SHORT (3) 1<0>
ImageLength (257) SHORT (3) 1<0>
BitsPerSample (258) SHORT (3) 1<0>
Compression (259) SHORT (3) 1<0>
Photometric (262) SHORT (3) 1<0>
ImageDescription (270) ASCII (2) 9<A+10.tif>
StripOffsets (273) LONG (4) 1<363090>
Orientation (274) SHORT (3) 1<0>
SamplesPerPixel (277) SHORT (3) 1<0>
StripByteCounts (279) LONG (4) 1<951211>
XResolution (282) RATIONAL (5) 1<200>
YResolution (283) RATIONAL (5) 1<200>
PlanarConfig (284) SHORT (3) 1<0>
ResolutionUnit (296) SHORT (3) 1<0>

Directory 2: offset 2070824 (0x1f9928)
SubFileType (254) LONG (4) 1<0>
ImageWidth (256) SHORT (3) 1<0>
ImageLength (257) SHORT (3) 1<0>
BitsPerSample (258) SHORT (3) 1<0>
Compression (259) SHORT (3) 1<0>
Photometric (262) SHORT (3) 1<0>
ImageDescription (270) ASCII (2) 9<A-10.tif>
StripOffsets (273) LONG (4) 1<1314514>
Orientation (274) SHORT (3) 1<0>
SamplesPerPixel (277) SHORT (3) 1<0>
StripByteCounts (279) LONG (4) 1<756310>
XResolution (282) RATIONAL (5) 1<200>
YResolution (283) RATIONAL (5) 1<200>
PlanarConfig (284) SHORT (3) 1<0>
ResolutionUnit (296) SHORT (3) 1<0>

--------

/usr/hons/bernard/work/s2/xaa.tif:
Magic: 0x4d4d <big-endian> Version: 0x2a
Directory 0: offset 136564 (0x21574)
SubFileType (254) LONG (4) 1<1>
ImageWidth (256) SHORT (3) 1<0>
ImageLength (257) SHORT (3) 1<0>
BitsPerSample (258) SHORT (3) 3<8 8 8>
Compression (259) SHORT (3) 1<0>
Photometric (262) SHORT (3) 1<0>
ImageDescription (270) ASCII (2) 8<preview>
StripOffsets (273) LONG (4) 3<8 0 0>
Orientation (274) SHORT (3) 1<0>
SamplesPerPixel (277) SHORT (3) 1<0>
StripByteCounts (279) LONG (4) 3<136555 0 0>
XResolution (282) RATIONAL (5) 1<66.6667>
YResolution (283) RATIONAL (5) 1<66.6667>
PlanarConfig (284) SHORT (3) 1<0>
ResolutionUnit (296) SHORT (3) 1<0>