2002.07.23 22:50 "CCITT Group 4 assistence needed for HylaFAX", by Lee Howard

2002.07.24 07:46 "Re: CCITT Group 4 assistence needed for HylaFAX", by Frank D. Cringle

I'm needing some help with getting HylaFAX to support MMR-encoded (Group 4) faxes. I've got a nearly complete patch for HylaFAX which does this, but I've run into a couple of snags which are rooted in code incompatibility with the differences between Group 3 and Group 4 TIFF image data. As I'm not TIFF-savvy, I'm seeking for help on this.

However, even if you don't have this kind of time, I wouldn't mind some general outlines on how these two procedures should be altered for Group 4 faxes (i.e., how to count lines and how to image a tagline on top of an existing image).

Disclaimer: I am not familiar with HylaFAX, so I may be making some wrong assumptions in that area. As I understand it, when HylaFAX receives a G3 fax, the modem reports the number of lines in the fax in a status report. In practice, G3 faxes are often damaged in transmission so HylaFAX counts the number of lines actually received and records that value in the tiff header instead of (or as well as?) the expected value.

A damaged G4 fax is useless, or at least it can only be interpreted up to the first error. So we must assume an error free (or error correcting) channel for transmission of G4 faxes. In that case the sender should be able to tell the receiver how many lines are in the fax. That would make counting after reception redundant.

If you really need to count the lines in a G4 image, you need to know the precise width and then run through all the data, interpreting each code bitstring as you go.

As to adding or replacing initial lines, the easiest way would be to expand the image into a bitmap, replace the lines and then re-encode the image. Doing it more efficiently by just replacing the relevant part of the raw data should be possible but rather fiddly. I don't recall off hand whether G4 allows padding bits to be inserted, to avoid repacking all the bytes after the transition from new to old data.

Frank Cringle,      fdc@cliwe.ping.de
voice: (+49 7745) 928759; fax: 928761