1997.01.14 11:08 "Problem with CCITT G4 and long scanlines", by Mogens Sorensen

1997.01.14 11:08 "Problem with CCITT G4 and long scanlines", by Mogens Sorensen

I am using v3.4beta35 on WinNT and have run into some problems with Group 4 compression when the scanline width exceeds 65536 pixels (16 bits ?).

I am generating the tiff file with the library and then use tiffinfo -D to check it. For most files tiffinfo gives a lot of errors and warnings, for others it tries to access an illegal address and exits.

I do not know the inner working of the G4 compression/decompression code/algorithm and have therefore not tried to debug it yet.

Has anybody seen similar problems or know about limitations?, and possibly made a fix for it?

The following dump shows the errors I get as well as details about the file format.

tiffinfo -D 2380001.tif

TIFF Directory at offset 0xc16a02
    Image Width: 119104 Image Length: 24765
    Resolution: 2540, 2540 pixels/inch
    Bits/Sample: 1
    Compression Scheme: CCITT Group 4
    Photometric Interpretation: min-is-white
    Orientation: row 0 top, col 0 lhs
    Samples/Pixel: 1
    Rows/Strip: 16
    Planar Configuration: single image plane

Fax4Decode: Warning, 2380001.tif: Line length mismatch at scanline 0 (got
119136, expected 119104).
Fax4Decode: 2380001.tif: Bad code word at scanline 13 (x 118748).
Fax4Decode: Warning, 2380001.tif: Premature EOL at scanline 13 (got 118748,
expected 119104).
Fax4Decode: 2380001.tif: Bad code word at scanline 14 (x 1052).
Fax4Decode: Warning, 2380001.tif: Premature EOL at scanline 14 (got 1052,
expected 119104).
Fax4Decode: Warning, 2380001.tif: Premature EOF at scanline 15 (x 53568).
Fax4Decode: Warning, 2380001.tif: Premature EOL at scanline 15 (got 53568,
expected 119104).
Fax4Decode: Warning, 2380001.tif: Line length mismatch at scanline 16 (got
120036, expected 119104).
Fax4Decode: 2380001.tif: Bad code word at scanline 30 (x 59342).
Fax4Decode: Warning, 2380001.tif: Premature EOL at scanline 30 (got 59342,
expected 119104).
Fax4Decode: 2380001.tif: Bad code word at scanline 31 (x 1052).
Fax4Decode: Warning, 2380001.tif: Premature EOL at scanline 31 (got 1052,
expected 119104).
Fax4Decode: Warning, 2380001.tif: Line length mismatch at scanline 32 (got
120036, expected 119104).
Fax4Decode: Warning, 2380001.tif: Line length mismatch at scanline 48 (got
128262, expected 119104).
Fax4Decode: Warning, 2380001.tif: Line length mismatch at scanline 64 (got
128261, expected 119104).
Fax4Decode: Warning, 2380001.tif: Line length mismatch at scanline 80 (got
128261, expected 119104).
Fax4Decode: Warning, 2380001.tif: Line length mismatch at scanline 96 (got
128261, expected 119104).
Fax4Decode: Warning, 2380001.tif: Line length mismatch at scanline 112 (got
128261, expected 119104).
Fax4Decode: Warning, 2380001.tif: Line length mismatch at scanline 128 (got
128261, expected 119104).
Fax4Decode: Warning, 2380001.tif: Line length mismatch at scanline 144 (got
128261, expected 119104).
Fax4Decode: Warning, 2380001.tif: Line length mismatch at scanline 160 (got
128261, expected 119104).
Fax4Decode: Warning, 2380001.tif: Line length mismatch at scanline 176 (got
128261, expected 119104).
Fax4Decode: Warning, 2380001.tif: Line length mismatch at scanline 192 (got
119517, expected 119104).
Fax4Decode: Warning, 2380001.tif: Line length mismatch at scanline 193 (got
119106, expected 119104).
Fax4Decode: 2380001.tif: Uncompressed data (not supported) at scanline 194
(x 4678).
Fax4Decode: Warning, 2380001.tif: Premature EOL at scanline 194 (got 4678,
expected 119104).

.............

Regards
Mogens

 ------------------------------------------------------------------
!  PURUP ESKOFOT A/S             !  Phone........: +45 8743 4343   !
!  Mogens Sorensen, R&D          !  Phone direct.: +45 8743 4372   !
!  Sonderskovvej 5               !  Fax..........: +45 8743 4445   !
!  DK-8520 Lystrup, DENMARK      !  E-mail.......: ms@pe.dk        !
 ------------------------------------------------------------------