1993.11.16 09:54 "Decompressing images having 5 samples per pixel", by Olli Raisa

Libtiff may have a bug in decompressing images having more than 4 samples per pixel. Below you will find more detailed information of a file that is written by PhotoShop 2.5 (Macintosh). If the image is written without compression I can read it with libtiff 3.30beta (SunOS 5.2) correctly. With LZW compression I get vertical stripes in a part of the image.

Olli Raisa
Unda Oy

BTW, what is the status of JPEG compression in libtiff?

--

olli@myy % tiffinfo photoshop.tif
photoshop.tif: Warning, unknown field with tag 34377 (0x8649) ignored.

TIFF Directory at offset 0x8
  Subfile Type: (0 = 0x0)
  Image Width: 200 Image Length: 200
  Resolution: 20, 20 pixels/inch
  Bits/Sample: 8
  Compression Scheme: Lempel-Ziv & Welch encoding
  Photometric Interpretation: RGB color
  Extra Samples: 2<unspecified, unspecified>
  Predictor: horizontal differencing
  Samples/Pixel: 5
  Rows/Strip: 8
  Planar Configuration: single image plane

olli@myy % /p/bin/tiffdump photoshop.tif
photoshop.tif:

Magic: 0x4d4d <big-endian> Version: 0x2a
Directory 0: offset 8 (0x8)
SubFileType (254) LONG (4) 1<0>
ImageWidth (256) SHORT (3) 1<200>
ImageLength (257) SHORT (3) 1<200>
BitsPerSample (258) SHORT (3) 5<8 8 8 8 8>
Compression (259) SHORT (3) 1<5>
Photometric (262) SHORT (3) 1<2>
StripOffsets (273) LONG (4) 25<872 1734 2604 3470 4350 5216 6180 7186 8168 9140 10098 11054 11996 12932 13874 14826 15778 16734 17694 18668 19696 20602 21476 22346 23214>
SamplesPerPixel (277) SHORT (3) 1<5>
RowsPerStrip (278) SHORT (3) 1<8>
StripByteCounts (279) LONG (4) 25<861 869 865 880 866 964 1006 981 971 958 956 941 936 941 951 952 956 959 974 1028 906 874 869 867 857>
XResolution (282) RATIONAL (5) 1<20>
YResolution (283) RATIONAL (5) 1<20>
PlanarConfig (284) SHORT (3) 1<1>
ResolutionUnit (296) SHORT (3) 1<2>
Predictor (317) SHORT (3) 1<2>
ExtraSamples (338) BYTE (1) 2<0x00 0x00>
34377 (0x8649) BYTE (1) 428<0x244c8 0x244c9 0x244ca 0x244cb 0x244cc 0x244cd 0x244ce 0x244cf 0x244d0 0x244d1 0x244d2 0x244d3 0x244d4 0x244d5 0x244d6 0x244d7 0x244d8 0x244d9 0x244da 0x244db 0x244dc 0x244dd 0x244de 0x244df 0x244e0 0x244e1 0x244e2 0x244e3 ...