TIFF and LibTiff Mail List Archive

2004.02.17 20:17 "[Tiff] strange encoding in T.4 G3-2D faxed TIFF", by Lee Howard

Occassionally I receive faxes from a particular sender that seems to prefix the real TIFF data with a bunch of these:


I'm guessing that's what it looks like in binary, anyway, because this is what the TIFF decoder (HylaFAX's TIFF decoder is very similar to libtiff's tif_fax3.c, tif_fax3.h) tells me:

RECV: begin page
RECV/CQ: Invalid WhiteTable code word, row 0, x 9
RECV/CQ: Bad 1D pixel count, row 0, got 9, expected 1728
RECV/CQ: Invalid WhiteTable code word, row 1, x 9
RECV/CQ: Bad 1D pixel count, row 1, got 9, expected 1728
RECV/CQ: Invalid WhiteTable code word, row 2, x 9
RECV/CQ: Bad 1D pixel count, row 2, got 9, expected 1728
RECV/CQ: Invalid WhiteTable code word, row 3, x 9
RECV/CQ: Bad 1D pixel count, row 3, got 9, expected 1728
RECV/CQ: Invalid WhiteTable code word, row 4, x 9
RECV/CQ: Bad 1D pixel count, row 4, got 9, expected 1728
RECV/CQ: Invalid WhiteTable code word, row 5, x 9
RECV/CQ: Bad 1D pixel count, row 5, got 9, expected 1728
RECV/CQ: Invalid WhiteTable code word, row 6, x 9
RECV/CQ: Bad 1D pixel count, row 6, got 9, expected 1728
RECV/CQ: Invalid WhiteTable code word, row 7, x 9
RECV/CQ: Bad 1D pixel count, row 7, got 9, expected 1728
RECV/CQ: Invalid WhiteTable code word, row 8, x 9
RECV/CQ: Bad 1D pixel count, row 8, got 9, expected 1728
RECV/CQ: Invalid WhiteTable code word, row 9, x 9
RECV/CQ: Bad 1D pixel count, row 9, got 9, expected 1728
RECV/CQ: Bad 1D pixel count, row 1104, got 0, expected 1728
RECV/CQ: Bad 1D pixel count, row 1105, got 0, expected 1728
RECV/CQ: Bad 1D pixel count, row 1106, got 0, expected 1728
RECV/CQ: Bad 1D pixel count, row 1107, got 0, expected 1728
RECV/CQ: Adjusting for RTC found at row 1104
RECV: 1104 total lines, 10 bad lines, 10 consecutive bad lines
RECV: REJECT page quality, 10-line run (max 5)
RECV: end page

Sometimes the EOL comes first, so I guess it looks like this:


and the decoder tells me this:

RECV: begin page
RECV/CQ: Bad 1D pixel count, row 0, got 9, expected 1728
RECV/CQ: Bad 1D pixel count, row 1, got 9, expected 1728
RECV/CQ: Bad 1D pixel count, row 2, got 9, expected 1728
RECV/CQ: Bad 1D pixel count, row 3, got 9, expected 1728
RECV/CQ: Bad 1D pixel count, row 1094, got 0, expected 1728
RECV/CQ: Bad 1D pixel count, row 1095, got 0, expected 1728
RECV/CQ: Bad 1D pixel count, row 1096, got 0, expected 1728
RECV/CQ: Bad 1D pixel count, row 1097, got 0, expected 1728
RECV/CQ: Adjusting for RTC found at row 1094
RECV: 1094 total lines, 4 bad lines, 4 consecutive bad lines
RECV: end page

Fax machines, fax softwares, and Class 2 faxmodem firmwares notoriously do dumb things to TIFF data - for example, some stick misplaced EOLs at the beginning of MMR (G4) data. So it's not surprising for me to see another fax machine doing yet another silly thing here.

Ultimately the TIFF is viewable anyway, so it seems that the initial "bad lines" are merely superfluous. So my inclination is to simply ignore these "bad lines" (so as to not let them cause the page rejection that you see above). However, I'd like to make sure that's the "right thing" to do. Does anyone know what these "bad lines" really are?