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] Repairing partially received faxes
Charles Duffy wrote:
I'm using tiff2pdf to convert incoming TIFF files to PDF. This works
great -- except when the incoming fax job is interrupted. When this
happens, tiff2pdf aborts with output which doesn't constitute a valid
PDF, and I'm still trying to work out a way to recover as much of the
job as possible.
My initial thoughts were to use tiffsplit to split out valid pages and
tiffcp to rebind them into a single document before running through
tiff2pdf; however, tiffcp does not appear to accept JBIG-encoded
input, even with libtiff 3.8.2 with JBIG support (as patched in by the
current Gentoo ebuild):
$ tiffcp -c none /tmp/fax673.split* /tmp/fax673.recombine.tif
/tmp/fax673.splitaaa.tif: ISO JBIG scanline decoding is not implemented.
/tmp/fax673.splitaaa.tif: Error, can't read scanline 0.
I do the tiffsplit + tiffcp approach to filter and clean-up all received
faxes on many of my production systems. It should work fine for you
with JBIG, too. Make sure that you patched tiffcp with the following as
part of your patching...
diff -Nru tiff-3.7.2.orig/tools/tiffcp.c tiff-3.7.2/tools/tiffcp.c
--- tiff-3.7.2.orig/tools/tiffcp.c Fri Jul 22 08:54:47 2005
+++ tiff-3.7.2/tools/tiffcp.c Fri Jul 22 08:54:57 2005
@@ -349,6 +349,8 @@
if (cp)
defpredictor = atoi(cp+1);
defcompression = COMPRESSION_DEFLATE;
+ } else if (strneq(opt, "jbig", 4)) {
+ defcompression = COMPRESSION_JBIG;
} else
return (0);
return (1);
@@ -647,6 +649,12 @@
case COMPRESSION_JPEG:
TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality);
TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode);
+ break;
+ case COMPRESSION_JBIG:
+ CopyTag(TIFFTAG_FAXRECVPARAMS, 1, TIFF_LONG);
+ CopyTag(TIFFTAG_FAXRECVTIME, 1, TIFF_LONG);
+ CopyTag(TIFFTAG_FAXSUBADDRESS, 1, TIFF_ASCII);
+ CopyTag(TIFFTAG_FAXDCS, 1, TIFF_ASCII);
break;
case COMPRESSION_LZW:
case COMPRESSION_DEFLATE:
You may also need this patch to tiffsplit:
--- tools/tiffsplit.c.orig 2005-10-28 14:46:55.512161808 -0700
+++ tools/tiffsplit.c 2005-10-28 14:48:23.411799032 -0700
@@ -191,6 +191,13 @@
CopyField(TIFFTAG_HOSTCOMPUTER, stringv);
CopyField(TIFFTAG_PAGENAME, stringv);
CopyField(TIFFTAG_DOCUMENTNAME, stringv);
+ CopyField(TIFFTAG_BADFAXLINES, longv);
+ CopyField(TIFFTAG_CLEANFAXDATA, longv);
+ CopyField(TIFFTAG_CONSECUTIVEBADFAXLINES, longv);
+ CopyField(TIFFTAG_FAXRECVPARAMS, longv);
+ CopyField(TIFFTAG_FAXRECVTIME, longv);
+ CopyField(TIFFTAG_FAXSUBADDRESS, stringv);
+ CopyField(TIFFTAG_FAXDCS, stringv);
if (TIFFIsTiled(in))
return (cpTiles(in, out));
else
I've not yet tried libtiff-3.9.0, but these changes are *supposed* to be
in there. I'm currently still using 3.7.2 everywhere I need JBIG or
JPEG support.
Thanks,
Lee.
____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
*To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*