|AWARE [SYSTEMS]||Imaging expertise for the Delphi developer|
|TIFF and LibTiff Mailing List Archive|
LibTiff Mailing List
2005.01.26 19:08 "TIFF CLASS F Revision 4 and EOLs at beginning of strip", by Eric J Witherspoon
I have enjoyed using the tiff lib and I am quite impressed with it's flexibility and ease of use. I have recently run into some Class F files that return EOF and EOL errors. I have attached one to this message. The returned error strings are: C:\img\b_a.tif: Premature EOF at scanline 100 (x 0). C:\img\b_a.tif: Premature EOL at scanline 100 (got 0, expected 600). C:\img\b_a.tif: Premature EOL at scanline 200 (got 0, expected 600). C:\img\b_a.tif: Premature EOL at scanline 300 (got 0, expected 600). C:\img\b_a.tif: Premature EOL at scanline 400 (got 0, expected 600). C:\img\b_a.tif: Premature EOL at scanline 500 (got 0, expected 600). This results in an image that has one missing line after the first strip (rows per strip = 100) and white stripes through it every strip thereafter. This file has T3Options: EOL padding (4 = 0x4) set. But this parameter seems to be ignored. I use the simple TIFFRGBAImageGet to access the image data. My initial thought was that this image was corrupt or written incorrectly... But it turns out that starting a strip with an EOL is part of Revision 4 of the Tiff Class F recommendation. This does not show up in the Tiff Spec 6.0. But I have noticed that several other readers view this file correctly. Unfortunately the version of libtiff that I am using (3.7.1) does not handle these EOL characters correctly when at the beginning of a strip. Below I have included the second technical note of revision 4 about EOL placement in strips. Any suggestions of how to add this support would be appreciated. I find the nested macros used in tif_fax3.c Fax3Decode1D from tif_fax3.h quite daunting. I thought that maybe the SYNC_EOL(EOF1D); macro would be a good place to start... -Eric Witherspoon -------------------------------------- TIFF CLASS F March 1, 1992 Revision 4 under TECHNICAL POINTS 2. EOL Placement in Strips As illustrated in FIGURE 1/T.4 in Recommendation T.4 (the "Blue Book"), facsimile documents begin with an EOL (End- of-Line) code. The last line of the image is not terminated by an EOL. Expressed differently, EOL's are actually BOL's (Beginning-of-Line). When a page is stored as a multi-strip image, one must consider where to divide scanline data. With the RTC not included, treating EOL codes like BOL codes permits all strips to have a consistent format: RowsPerStrip EOL- prefixed lines of data. Consequently, multi-strip Class F images must break data such that each strip begins with an EOL code. This is easily done if these codes are treated like BOL codes.