HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] Problem Faxing To Brother NSC/IntelliFax



Robert and Pete,

If you can, please test the attached patch in sending to "problematic" receivers where they send MCF but don't print out the full page.

There were conditions that were not uncommon where HylaFAX would transmit an EOFB signal (a data signal terminating a page of MMR image data) somewhat incorrectly as:

000000000001000000000001000000000001

When it should have been:

000000000001000000000001

The extra 12 bits were leftovers from the original MMR source document (which explains why documents converted with ModemSoftRTFCC didn't have a problem), and some receivers are just downright picky about the correctness of the EOFB signal. That said, the erronious EOFB signal was still correct, in a manner of speaking, since, per spec, everything after an encountered EOFB signal is to be ignored.

Anyway, please test the attached patch if you can. I expect that it will resolve some, if not all, of the problems that you've been experiencing.

Thanks,

Lee.
--- hylafax.orig/faxd/MemoryDecoder.c++	2006-01-16 07:13:56.000000000 -0800
+++ hylafax/faxd/MemoryDecoder.c++	2006-01-28 19:46:01.743554888 -0800
@@ -296,8 +296,28 @@
 	    rows++;
         }
     }
-    if (seenRTC() && *(endOfData - 1) == 0x00)
-	endOfData--;	// step back over the first byte of EOFB, lastbyte must be non-zero!
+    /*
+     * The loop above will leave the endOfData pointer somewhere inside of EOFB.
+     * Make sure that endOfData points to the last byte containing real image data.
+     * So trim any whole bytes containing EOFB data.
+     */
+    if (seenRTC()) {
+	bool trimmed;
+	u_int searcharea;
+	u_short i;
+	do {
+	    searcharea =  (*(endOfData) << 16) | (*(endOfData - 1) << 8) | *(endOfData - 2);
+	    trimmed = false;
+	    for (i = 0; i < 13; i++) {
+		if (((searcharea >> i) & 0xFFF) == 0x800) {
+		    endOfData--;
+		    if (*endOfData == 0x00) endOfData--;
+		    trimmed = true;
+		    break;
+		}
+	    }
+	} while (trimmed);
+    }
     return endOfData;
 }
 



Project hosted by iFAX Solutions