1993.06.21 22:04 "Re: fax2tiff", by Sam Leffler
I have a question about reading FAX files with the TIFF library.
I'm trying to read a Group 4 FAX file, and fax2tiff keeps dumping core.
Not surprising, it only reads Group 3 encoded data.
I'm sure the FAX file is valid, as when I append TIFF header information, a TIFFOpen works with the file flawlessly. If the FAX file were bad, the program should report bad rows, not dump core, correct?
The program shouldn't dump core, but in general raw G4-encoded data has no information that permits one to recognize it's garbage.
fax2tiff seems to function by "hot wiring" the TIFF library, but the code leaves some questions:
- At what point do (*tifin->tif_predecode) and (*tifin->tif_decoderow) recieve the addresses of functions? Is it when "TIFFSetField(&faxTIFF, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX3);" is executed?
Huh? What does "recieve the addresses of functions" mean?
- If I want to read Group 4 rather than Group 3, do I merely change the above TIFFSetField?
Possibly; did you try it?
The FAX information is originating in a CALS image that I cut apart. I am trying to write a generalized CALS reader for John Bradley's XV, and it seems silly to implement additional Group 4 machinery when libtiff is already in use. I will most probably attempt to replace the FAX G3 code Bradley is distributing in xv-3.00 (that came from PBM) with a simpler/smaller call to libtiff (if I can figure out fax2tiff).
That is a worthwhile thing to do and should be possible; though perhaps a bit painful.