HylaFAX The world's most advanced open source fax server

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

[hylafax-users] JPEG/JBIG in TIFF Support



Hi All,

I'm trying to build JPEG recieve and JBIG send/recieve support into
HylaFAX+ v5.1.8. I am trying to follow the steps highlighted at the
HylaFAX wiki here:

http://www.hylafax.org/content/Handbook:Advanced_Server_Configuration:JPEG_and_JBIG_Faxing

I am building this on Solaris 10 x86.

I seem to be halfway there, but I have an issue when I come to apply
JBIG support to libtiff. Here is what I have done thus far:

------------------------------------------------------------------------------------------------
 Building JPEG (successfull)
------------------------------------------------------------------------------------------------
[1] Downloaded the JPEG 6b sources
       /usr/sfw/bin/wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz
[2] Downloaded the itulab/jbig patch
       /usr/sfw/bin/wget http://bugs.hylafax.org//attachment.cgi?id=1009
-O jpeg-itulab-jbig.patch
[3] Extracted the source
       /usr/sfw/bin/gtar zxf ./jpegsrc.v6b.tar.gz
[4] Apply the patch to the jpeg-6b sources
       cd jpeg-6b
       /usr/bin/gpatch -p1 < ../jpeg-itulab-jbig.patch
[5] Build the libraries
       ./configure --enable-shared --prefix=/var/tmp/jpeg
       /usr/sfw/bin/gmake
       /usr/sfw/bin/gmake test
       /usr/sfw/bin/gmake install

------------------------------------------------------------------------------------------------
Building libTIFF (fails)
------------------------------------------------------------------------------------------------
[1] Download the TIFF v3.7.2 sources
       /usr/sfw/bin/wget
ftp://ftp.remotesensing.org/pub/libtiff/old/tiff-3.7.2.tar.gz
[2] Download the JPEG patch
       /usr/sfw/bin/wget
http://bugzilla.remotesensing.org/attachment.cgi?id=330 -O
tiff-jpeg-support.patch
[3] Download the JBIG patch
       /usr/sfw/bin/wget
http://bugzilla.remotesensing.org/attachment.cgi?id=259 -O
tiff-jbig-support.patch
[3] Extract the source
       /usr/sfw/bin/gtar zxf ./tiff-3.7.2.tar.gz
[4] Apply the JPEG support patch to tiff 3.7.2
       cd tiff-3.7.2
       /usr/bin/gpatch -p1 < ../tiff-jpeg-support.patch
[5] Apply the JBIG support patch to tiff 3.7.2
       /usr/bin/gpatch -p1 < ../tiff-jbig-support.patch

This is where I have the problem, the patching of the JBIG support fails
when it tries to patch tools/tiffcp.c.

Here is the output of the above libTIFF steps (the patching part)

------------------------------------------------------------------------------------------------
user@host:~/try/tiff-3.7.2 $ /usr/bin/gpatch -p1 <
../tiff-jpeg-support.patch
patching file libtiff/tiff.h
patching file libtiff/tif_getimage.c
patching file libtiff/tif_jpeg.c
patching file libtiff/tif_print.c
patching file libtiff/tif_strip.c
patching file libtiff/tif_tile.c
patching file tools/tiff2ps.c
patching file tools/tiffcp.c
patching file tools/tiffgt.c
user@host:~/try/tiff-3.7.2 $ /usr/bin/gpatch -p1 <
../tiff-jbig-support.patch
patching file configure
patching file configure.ac
patching file libtiff/Makefile.in
patching file libtiff/Makefile.vc
patching file libtiff/tif_config.h.in
patching file libtiff/tif_jbig.c
patching file libtiff/tiffconf.h.in
patching file libtiff/tiffconf.h.vc
patching file tools/tiffcp.c
Hunk #1 succeeded at 420 (offset 71 lines).
Hunk #2 FAILED at 720.
1 out of 2 hunks FAILED -- saving rejects to file tools/tiffcp.c.rej
------------------------------------------------------------------------------------------------

The contents of tools/tiffcp.c.rej looks like this

------------------------------------------------------------------------------------------------
***************
*** 718,723 ****
        case COMPRESSION_JPEG:
                TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality);
                TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode);
                break;
        case COMPRESSION_LZW:
        case COMPRESSION_DEFLATE:
--- 720,731 ----
        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:
------------------------------------------------------------------------------------------------

I have tried patching the JBIG support alone to the tiff sources, and
that works. We would like both support for JPEG & JBIG, so, I assume I
would need to apply both patches to the tiff sources, when I try this,
then this is when it fails. I can successfully apply either 1 of the
above patches. Does this mean we can only support one of JPEG recieve or
JBIG send/recieve within libTIFF, or have I missed something, or,
patched incorrectly?

If anyone has any suggestions as to how to build JPEG & JBIG support for
HylaFAX+ please could you let me know, or rather, point me in the
correct direction.

Any comments/suggestions are greatly appreciated.

Thanks
Bruce
begin:vcard
fn:Bruce McAlister
n:McAlister;Bruce
org:Blueface Ltd
adr:;;8 Clanwilliam Terrace;Dublin;Dublin;Dublin 2;Ireland
email;internet:bruce.mcalister@xxxxxxxxxxx
tel;work:+353 1 524 2009
x-mozilla-html:FALSE
url:http://www.blueface.ie
version:2.1
end:vcard




Project hosted by iFAX Solutions