diff --git a/ChangeLog b/ChangeLog index 43170a0c..448375e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-07-04 Bob Friesenhahn + + * {configure.ac, libtiff/tif_config.h.vc, libtiff/tif_jbig.c} + (JBIGDecode): jbg_newlen is not available in older JBIG-KIT and + its use does not appear to be required, so use it only when it is + available. + 2006-06-24 Andrey Kiselev * libtiff/tif_dirinfo.c: Added missed EXIF tag ColorSpace (40961). diff --git a/configure.ac b/configure.ac index 7b03fbde..a8562af7 100644 --- a/configure.ac +++ b/configure.ac @@ -451,6 +451,9 @@ if test "$HAVE_JBIG" = "yes" ; then LIBDIR="-R $with_jbig_lib_dir $LIBDIR" fi + # Older versions of jbigkit lack jbg_newlen + AC_CHECK_FUNCS([jbg_newlen]) + fi dnl --------------------------------------------------------------------------- diff --git a/libtiff/tif_config.h.in b/libtiff/tif_config.h.in index 4b2fa8c8..c2f70461 100644 --- a/libtiff/tif_config.h.in +++ b/libtiff/tif_config.h.in @@ -55,6 +55,9 @@ /* Define to 1 if you have the `isascii' function. */ #undef HAVE_ISASCII +/* Define to 1 if you have the `jbg_newlen' function. */ +#undef HAVE_JBG_NEWLEN + /* Define to 1 if you have the `lfind' function. */ #undef HAVE_LFIND diff --git a/libtiff/tif_config.h.vc b/libtiff/tif_config.h.vc index 367e92f5..fa16a198 100644 --- a/libtiff/tif_config.h.vc +++ b/libtiff/tif_config.h.vc @@ -8,6 +8,9 @@ machine */ #define HAVE_IEEEFP 1 +/* Define to 1 if you have the `jbg_newlen' function. */ +#define HAVE_JBG_NEWLEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 diff --git a/libtiff/tif_jbig.c b/libtiff/tif_jbig.c index 4af7db17..4fff939c 100644 --- a/libtiff/tif_jbig.c +++ b/libtiff/tif_jbig.c @@ -1,4 +1,4 @@ -/* $Id: tif_jbig.c,v 1.1 2006-06-07 15:39:03 dron Exp $ */ +/* $Id: tif_jbig.c,v 1.2 2006-07-04 19:01:47 bfriesen Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -88,6 +88,8 @@ static int JBIGDecode(TIFF* tif, tidata_t buffer, tsize_t size, tsample_t s) } jbg_dec_init(&decoder); + +#if defined(HAVE_JBG_NEWLEN) jbg_newlen(tif->tif_rawdata, tif->tif_rawdatasize); /* * I do not check the return status of jbg_newlen because even if this @@ -99,6 +101,7 @@ static int JBIGDecode(TIFF* tif, tidata_t buffer, tsize_t size, tsample_t s) * PostScript. As long as the actual image length is contained in the * BIE header jbg_dec_in should succeed. */ +#endif /* HAVE_JBG_NEWLEN */ decodeStatus = jbg_dec_in(&decoder, tif->tif_rawdata, tif->tif_rawdatasize, NULL);