From 963e9c6bc0b30048052bf076e0c8b62ea2f9e90f Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Fri, 9 Feb 1996 22:51:07 +0000 Subject: v3.4beta029 release --- Makefile.in | 11 ++- TODO | 5 +- config.site | 53 +++++++++++--- configure | 16 ++-- contrib/mac-cw/Makefile.script | 72 ++++++++++++++++++ contrib/mac-cw/README | 18 +++++ contrib/mac-cw/mac_main.c | 20 +++++ contrib/mac-cw/mac_main.h | 12 +++ contrib/mac-cw/metrowerks.note | 84 +++++++++++++++++++++ contrib/mac-cw/mkg3_main.c | 14 ++++ contrib/mac-cw/version.h | 4 + contrib/vms/libtiff/tiffshraxp.opt | Bin 3221 -> 3221 bytes dist/tiff.alpha | 2 +- html/Makefile.in | 6 +- html/build.html | 63 +++++++++++++--- html/index.html | 4 +- html/v3.4beta028.html | 145 +++++++++++++++++++++++++++++++++++++ html/v3.4beta029.html | 85 ++++++++++++++++++++++ libtiff/Makefile.in | 8 +- libtiff/tif_apple.c | 4 +- libtiff/tif_fax3.c | 101 ++++++++++++++------------ libtiff/tif_fax3.h | 42 ++++++++--- libtiff/tiffcomp.h | 4 +- man/Makefile.in | 4 +- port/Makefile.in | 4 +- tools/Makefile.in | 12 ++- 26 files changed, 691 insertions(+), 102 deletions(-) create mode 100644 contrib/mac-cw/Makefile.script create mode 100644 contrib/mac-cw/README create mode 100644 contrib/mac-cw/mac_main.c create mode 100644 contrib/mac-cw/mac_main.h create mode 100644 contrib/mac-cw/metrowerks.note create mode 100644 contrib/mac-cw/mkg3_main.c create mode 100644 contrib/mac-cw/version.h create mode 100644 html/v3.4beta028.html create mode 100644 html/v3.4beta029.html diff --git a/Makefile.in b/Makefile.in index 14c79064..d9d15abf 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,5 +1,5 @@ #! smake -# $Header: /usr/people/sam/tiff/RCS/Makefile.in,v 1.41 1996/01/10 19:30:44 sam Exp $ +# $Header: /usr/people/sam/tiff/RCS/Makefile.in,v 1.44 1996/02/09 21:29:19 sam Exp $ # # @WARNING@ # @@ -38,7 +38,7 @@ SRCDIR = @SRCDIR@ # CXXCOMPILER: @CXXCOMPILER@ # @SETMAKE@ -SHELL = /bin/sh +SHELL = @SCRIPT_SH@ NULL = ECHO = echo GENDIST = ${TOOLROOT}/usr/sbin/gendist @@ -46,6 +46,8 @@ GENDIST = ${TOOLROOT}/usr/sbin/gendist all default: @if [ "@PORT@" = yes ]; then \ ${ECHO} "= "port; cd port; ${MAKE}; \ + else \ + true; \ fi @${ECHO} "= "libtiff; cd libtiff; ${MAKE} @${ECHO} "= "tools; cd tools; ${MAKE} @@ -59,6 +61,8 @@ install: clean: @if [ "@PORT@" = yes ]; then \ ${ECHO} "= "port; cd port; ${MAKE} clean; \ + else \ + true; \ fi @${ECHO} "= "libtiff; cd libtiff; ${MAKE} clean @${ECHO} "= "tools; cd tools; ${MAKE} clean @@ -256,6 +260,8 @@ TIFFFILES=\ html/misc.html \ html/support.html \ html/tools.html \ + html/v3.4beta029.html \ + html/v3.4beta028.html \ html/v3.4beta024.html \ html/v3.4beta018.html \ html/v3.4beta016.html \ @@ -305,6 +311,7 @@ CONTRIBFILES=\ contrib/win32 \ contrib/win95 \ contrib/winnt \ + contrib/mac-cw \ ${NULL} DISTFILES=\ ${TIFFFILES} \ diff --git a/TODO b/TODO index 1b6beea0..3fd94828 100644 --- a/TODO +++ b/TODO @@ -1,10 +1,7 @@ -# $Header: /usr/people/sam/tiff/RCS/TODO,v 1.2 1995/07/03 18:42:38 sam Exp $ +# $Header: /usr/people/sam/tiff/RCS/TODO,v 1.4 1996/02/09 22:09:00 sam Exp $ -o update manual pages o tiffcmp read data by strip/tile instead of scanline o YCbCr sampling support -o html manual pages o extracate colorspace conversion support o look at isolating all codecs from TIFF library -o tiffcp problem with JPEG-encoded image o JPEG colormode order dependency problem diff --git a/config.site b/config.site index 54a1b746..357294c3 100644 --- a/config.site +++ b/config.site @@ -1,4 +1,4 @@ -# $Header: /usr/people/sam/tiff/RCS/config.site,v 1.8 1996/01/10 19:31:37 sam Exp $ +# $Header: /usr/people/sam/tiff/RCS/config.site,v 1.10 1996/02/09 05:53:45 sam Exp $ # # TIFF Software # @@ -41,8 +41,8 @@ # Package controls. # #DSO="auto" # auto|IRIX configure DSO support for system -#JPEG="no" # yes|no configure JPEG support -#ZIP="no" # yes|no configure Deflate support +#JPEG="no" # yes|no configure JPEG support (see below) +#ZIP="no" # yes|no configure Deflate support (see below) #LIBGL="auto" # yes|no|auto configure IRIS GL-based tools #LIBIMAGE="auto" # yes|no|auto configure SGI RGB image tools @@ -55,16 +55,48 @@ #DIR_MAN="/usr/local/man" # directory for manual pages # -# JPEG-specific parameters; used when JPEG support is enabled. +# Configuring supporting libraries. # -# NB: JPEG support requires release 5 or later of the IJG code, -# which you can find on the Internet at ftp.uu.net:/graphics/jpeg/. +# The TIFF software makes use of two ancillary packages: the IJG +# distribution to support the JPEG codec and the zlib distribution +# to support the Deflate codec. To setup use of these packages you +# need to specify where each package's include files are located and +# where the pre-built library (static archive or DSO) is located. +# These may be different or the same (as when the package is compiled +# and referenced directly from the place where the software was +# loaded and compiled). # -#DIRS_LIBINC="$DIRS_LIBINC ../jpeg" # directory for JPEG include files -#LIBJPEG="-L ../jpeg -ljpeg" # JPEG library to load +# DIRS_LIBINC is a space-separated list of directories to use for +# locating include files in these packages. Note that it should not +# include -I options as might be passed to the C preprocessor; these +# are automatically added by the configure script when the Makefiles +# are generated. +# +# DIR_LIB is the pathname of the directory where 's +# pre-built library may be found; this is used when building a TIFF +# DSO (on systems where support is present) and when building the +# programs in the tools directory. By default the configure script +# will load the associated library using +# +# -L${DIR_LIB} -l +# +# e.g. -L${DIR_JPEGLIB} -ljpeg. If this is wrong for your system +# (e.g. your compiler/loader does not support the -L option), then +# the LIB parameter can be set explicitly to specify the +# library to use. +# + +# +# JPEG-specific parameters; used when JPEG support is enabled (see above). +# +# JPEG support requires release 5 or later of the IJG code, +# which you can find on the Internet at ftp.uu.net:/graphics/jpeg/. +# +#DIRS_LIBINC="$DIRS_LIBINC ../src/jpeg-5a" # directory for jpeg include files +#DIR_JPEGLIB=../src/jpeg-5a # directory for libjpeg # -# Deflate-specific parameters; used when Deflate support is enabled. +# Deflate-specific parameters; used when Deflate support is enabled (see above). # # NB: Deflate support requires version 0.92 or later of the zlib # library written by Jean-loup Gailly and Mark Adler. Starting @@ -76,7 +108,7 @@ # Look for it also at ftp://ftp.uu.net/pub/archiving/zip/zlib. # #DIRS_LIBINC="$DIRS_LIBINC ../zlib" # directory for zlib include files -#LIBGZ="-L ../zlib -lz" # libgz library to load +#DIR_GZLIB="../zlib" # directory for libz # # Miscellaneous parameters. @@ -129,4 +161,5 @@ #LN_S="-s" # option to ${LN} to create symlink #MV_F="-f" # option to ${MV} to force operation #SED="/bin/sed" # pathname of suitable sed program +#SCRIPT_SH="/bin/sh" # pathname of suitable shell #STRIP="/bin/strip" # strip program used by install.sh diff --git a/configure b/configure index b68f57b6..9613382d 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #!/bin/sh -# $Header: /usr/people/sam/tiff/RCS/configure,v 1.32 1996/01/10 19:31:39 sam Exp $ +# $Header: /usr/people/sam/tiff/RCS/configure,v 1.34 1996/02/09 05:53:45 sam Exp $ # # Tag Image File Format (TIFF) Software # @@ -52,7 +52,7 @@ MACHDEPLIBS=-lm : ${MAKE=make} # make to use # screws up the test of `-f -' -unset MAKEFLAGS +: ${MAKEFLAGS=} # unset MAKEFLAGS RM="rm -f" POSIXLY_CORRECT=1; export POSIXLY_CORRECT # disable GNU extensions @@ -140,7 +140,7 @@ do -target|--target) ac_prev=TARGET;; -target=*|--target=*) TARGET="$ac_optarg" ;; -version|--version) - echo "This is TIFF configure $Revision: 1.32 $" + echo "This is TIFF configure $Revision: 1.34 $" exit 0 ;; -help|--help) usage; exit 0;; @@ -1071,6 +1071,7 @@ Note "Selecting programs used during installation." # test -z "${CHMOD:-}" && CHMOD=`findAppDef chmod $PATH chmod` test -z "${LN:-}" && LN=`findAppDef ln $PATH ln` +test -z "${SCRIPT_SH:-}" && SCRIPT_SH=`findAppDef sh $PATH sh` test -z "${SED:-}" && SED=`findAppDef sed $PATH sed` test -z "${STRIP:-}" && STRIP=`findAppDef strip $PATH strip` @@ -1452,14 +1453,14 @@ esac if [ "${JPEG}" = yes ]; then test -z "${CONF_JPEG:-}" && CONF_JPEG="-DJPEG_SUPPORT" - test -z "${LIBJPEG:-}" && LIBJPEG="${DIR_JPEGLIB}/libjpeg.a" + test -z "${LIBJPEG:-}" && LIBJPEG="-L${DIR_JPEGLIB} -ljpeg" else CONF_JPEG= LIBJPEG= fi if [ "${ZIP}" = yes ]; then test -z "${CONF_ZIP:-}" && CONF_ZIP="-DZIP_SUPPORT" - test -z "${LIBGZ:-}" && LIBGZ="${DIR_GZLIB}/libz.a" + test -z "${LIBGZ:-}" && LIBGZ="-L${DIR_GZLIB} -lz" else CONF_ZIP= LIBGZ= @@ -1476,7 +1477,9 @@ relativize() if [ $SRCDIR_IS_LIBTIFF = no ]; then (for i do case "$i" in - /*) echo "$i" ;; + /*|-l*) echo "$i" ;; + -L|-L/*) echo "$i" ;; + -L*) echo "$i" | sed 's;-L;-L../;' ;; *) echo "../$i" ;; esac done) | tr '\012' ' ' @@ -1561,6 +1564,7 @@ cat>>confsed<
  • Building on a UNIX system. -
  • Building on a Macintosh system. +
  • Building on a Macintosh system with MPW. +
  • Building on a Macintosh system with CodeWarrior.
  • Building on an MS-DOS or Windows system.
  • Building on a VMS system.
  • Building on an Acorn RISC OS system. @@ -161,9 +162,7 @@ is located. Configuration files are just shell scripts that define shell variables that control the configuration process. For example, the following file might be used on a BSDI system to -configure the software for installation in the /usr/contrib - area and to make use of the Adobe Font Metric files that are already -distributed as part of the BSDI 1.1 distribution: +configure the software for installation in the /usr/contrib area.
     #
    @@ -175,9 +174,9 @@ DIR_MAN="/usr/contrib/man"		# directory for manual pages
     

    -For a complete list of the possible configuration parameters, look -at the sample config.site file provided in the distribution -or check the section below. +For a complete list of the possible configuration parameters look +at the sample config.site file provided in the distribution; the +section below describes some of the more important parameters.


    Configuring Optional Packages/Support

    @@ -210,6 +209,8 @@ of TIFF images with JPEG-encoded data. Support for JPEG-encoded data requires the Independent JPEG Group (IJG) libjpeg distribution; this software is available at ftp.uu.net:/graphics/jpeg/. +If JPEG support is enabled the DIRS_LIBINC and DIR_JPEGLIB +parameters should also be set (see below). By default JPEG support is not configured.

    @@ -221,6 +222,8 @@ Support for deflate-encoded data requires the freely available this software is available at ftp.uu.net:/pub/archiving/zip/zlib/ (or try quest.jpl.nasa.gov:/beta/zlib/). +If ZIP support is enabled the DIRS_LIBINC and DIR_GZLIB +parameters should also be set (see below). By default this package is not configured. @@ -439,6 +442,18 @@ using ranlib. default this is /usr/local/bin. + +DIR_GZLIB +The options to pass to the C compiler to reference the zlib library +when ZIP support is enabled; e.g. ``-L../src/zlib -lgz''. + + + +DIR_JPEGLIB +The options to pass to the C compiler to reference the JPEG library +when JPEG support is enabled; e.g. ``-L/usr/local/lib -ljpeg''. + + DIR_LIB The directory to install libraries and DSO's; by default @@ -451,6 +466,14 @@ this is /usr/local/lib. pages should be installed. + +DIRS_LIBINC +A space-separated list of directories in which to search for +include files when building the library and tools. +If JPEG or ZIP support is configured this parameter should include +the directories where the associated include files are located. + + DSOOPTS When DSO's are built, the options to specify to CC @@ -565,7 +588,7 @@ Someone needs to fill this in.... -


    Building the Software on a Macintosh

    +


    Building the Software on a Macintosh with MPW

    The directory contrib/mac-mpw contains support for compiling the library and tools under the MPW Shell on a @@ -596,6 +619,28 @@ special characters. +


    Building the Software on a Macintosh with CodeWarrior

    + +The directory contrib/mac-cw contains support for +compiling the library and tools with MetroWerks CodeWarrior 6.1 +on a Macintosh system. +This support was contributed by Niles Ritter +(ndr@tazboy.jpl.nasa.gov). + +

    +[From the file contrib/mac-cw/README.] + +In this directory you will find a Makefile.script Applescript +file, which should be run in order to build the libtiff code +using MetroWerks CodeWarrior. + +Refer to the "metrowerks.note" instructions on building the +library for 68k and PowerPC native code, as well as building +some of the libtiff tools, which are rather unix-like, but +at least give an example of how to link everything together. + + +


    Building the Software on a VMS System

    The VMS port was done by Karsten Spang @@ -992,7 +1037,7 @@ libtiff/mkversion.c program to generate libtiff/version.h.
    Sam Leffler / sam@engr.sgi.com. -Last updated: $Date: 1995/10/16 21:46:06 $ +Last updated: $Date: 1996/02/09 22:08:41 $
    diff --git a/html/index.html b/html/index.html index cc9adf34..86de3779 100644 --- a/html/index.html +++ b/html/index.html @@ -12,7 +12,7 @@ TIFF Software Latest Release: None
    -Latest Software: v3.4beta028
    +Latest Software: v3.4beta029
    Master FTP Site: ftp.sgi.com (192.48.153.1), directory graphics/tiff
    Home Page: http://www-mipl.jpl.nasa.gov/~ndr/tiff/
    @@ -81,7 +81,7 @@ the master FTP site listed above.
    Sam Leffler / sam@engr.sgi.com. -Last updated: $Date: 1996/01/10 20:27:41 $ +Last updated: $Date: 1996/02/09 21:28:38 $
    diff --git a/html/v3.4beta028.html b/html/v3.4beta028.html new file mode 100644 index 00000000..bec8b88c --- /dev/null +++ b/html/v3.4beta028.html @@ -0,0 +1,145 @@ + + + +Changes in TIFF v3.4beta028 + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • a -noninteractive flag was added to configure to + control whether or not it prints and prompts for configuration information +
    • various typos and fixes were made in configure for the the + library-only build support (this and other configure fixes from + Richard Mlynarik <mly@adoc.xerox.com>) +
    • bugs were fixed in the handling of pathnames supplied for external + packages; e.g. DIR_JPEG +
    • the handling of SETMAKE is now done properly +
    • the default prototype function declaration for pow was corrected +
    • a bug was fixed in libtiff/Makefile.in that caused installation + to fail on systems without DSO support +
    + +


    + +CHANGES IN LIBTIFF: + +
      +
    • Acorn RISC O/S support that was accidentally left out of the + left out of the previous distribution is present (from Peter Greenham) +
    • complaints about unknown and/or unsupported codecs have been + delayed until they are invoked; this permits applications to open + images and look at tags even if the image data is compressed with + an unknown/unsupported compression scheme +
    • bugs in handling unknown tags have been corrected; applications + that use multiple codecs, each with codec-specific tags, no longer + generate confusing error messages +
    • a missing pseudo-tag definition in the CCITT G3 codec was fixed + (this problem caused core dumps in the tiffcp program) +
    • pseudo-tags are now treated specially; they are always considered + to be set (i.e. they do not use bits in the FIELD_* bit-vectors). +
    • the use of strip chopping can now be controlled on a per-file basis + through a mode parameter supplied when opening a file (``C'' to + enable strip chopping and ``c'' to disable) +
    • two bugs were fixed in the writing of opposite-endian byte-order + files +
    • support was added for three new fax-related tags registered to + SGI: FaxRecvParams, FaxRecvTime, and FaxSubAddress +
    • the bit order of image data read and written can now be controlled + on a per-file basis through a mode parameter supplied when opening + a file (``B'' to force MSB2LSB bit order, ``L'' for LSB2MSB bit + order, and ``H'' for the bit order of the native CPU) +
    • the byte order of image and tag data written to newly-created files + can now be controlled on a per-file basis through a mode parameter + supplied when openening a file (``b'' to force Big-Endian byte order + and ``l'' to force Little-Endian byte order) +
    • the use memory-mapped files for images opened read-only can now + be controlled on a per-file basis through a mode parameter supplied + when opening a file (``M'' to enable use of memory-mapped files + and ``m'' to disable use) +
    • the use of the WIN32 define in tiffiop.h has + been replaced by __WIN32__ +
    + +


    + +CHANGES IN THE TOOLS: + +
      +
    • fax2ps now does a save and restore + around each page of PostScript; this fixes a problem with VM + overflow when printing a many-page document on some printers +
    • a bug in the handling of 3-channel images by ras2tiff + was fixed +
    • tiffcp has new options to control the byte order of + newly created files: -B for Big-Endian byte order, -L + for Little-Endian byte order; a -M option to disable the + use of memory-mapped files, and a -C option to disable the + use of strip chopping +
    • bugs were fixed in tiffcp's handling of codec-specific tags +
    + +


    + +CHANGES IN THE MANUAL PAGES: + +
      +
    • the TIFFOpen page has been updated to reflect the new + optional open mode parameters +
    + +


    + +CHANGES IN THE CONTRIBUTED SOFTWARE: + +
      +
    • contrib/win95 contains information and code from Philippe Tenenhaus + <100423.3705@compuserve.com> + about using the software under Windows 95 +
    • contrib/winnt contains information and code from Dave Dyer + <ddyer@triple-i.com> + about using the software under Windows NT +
    + + TIFF home page.
    + +
    + +
    +Sam Leffler / sam@engr.sgi.com +Last updated $Date: 1996/02/09 21:28:38 $. +
    + + + diff --git a/html/v3.4beta029.html b/html/v3.4beta029.html new file mode 100644 index 00000000..4b38d0e6 --- /dev/null +++ b/html/v3.4beta029.html @@ -0,0 +1,85 @@ + + + +Changes in TIFF v3.4beta029 + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • configure now relativizes pathname references given in + -L options (as frequently specified when configuring + ancillary packages) +
    • problems related to configuring the software on Ultrix 4.4 have + been corrected +
    • the shell to use in Makefiles and scripts can now be set with the + SCRIPT_SH configuration parameter +
    • comments in config.site now correctly indicate how to setup the + use of ancillary packages +
    + +


    + +CHANGES IN LIBTIFF: + +
      +
    • mods for building the software on a Mac using the + MetroWerks CodeWarrior compilers +
    • a bug in the CCITT T.4/T.6 decoder was fixed where the last codeword in + a strip/tile might not be decoded; this was seen only when decoding + multi-strip images +
    • a bug in the CCITT RLE codecs was fixed whereby the pseudo tags were not + being properly registered +
    + +


    + +CHANGES IN THE CONTRIBUTED SOFTWARE: + +
      +
    • contrib/mac-cw contains information and code from Niles Ritter + <ndr@tazboy.jpl.nasa.gov> + about building the software with the MetroWerks CodeWarrior compilers + on Macintosh systems +
    + + TIFF home page.
    + +
    + +
    +Sam Leffler / sam@engr.sgi.com +Last updated $Date: 1996/02/09 21:28:33 $. +
    + + + diff --git a/libtiff/Makefile.in b/libtiff/Makefile.in index c7b9491f..d29af81b 100644 --- a/libtiff/Makefile.in +++ b/libtiff/Makefile.in @@ -1,4 +1,4 @@ -# $Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.in,v 1.27 1996/01/10 19:35:01 sam Exp $ +# $Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.in,v 1.28 1996/02/09 05:55:00 sam Exp $ # # Tag Image File Format Library # @@ -33,7 +33,7 @@ SRCDIR = @LIBSRCDIR@ # TARGET: @TARGET@ # CCOMPILER: @CCOMPILER@ # -SHELL = /bin/sh +SHELL = @SCRIPT_SH@ NULL = CC = @CCOMPILER@ AR = @AR@ @@ -136,6 +136,8 @@ TARGETS = libtiff.a all: ${TARGETS} if [ @DSO@dso != nodso ]; then \ ${MAKE} @DSO@dso; \ + else \ + true; \ fi libtiff.a: ${OBJS} @@ -261,6 +263,8 @@ install: all installHdrs ${INSTALL} -idb tiff.sw.dev -m 444 -F @DIR_LIB@ -O libtiff.a if [ @DSO@dso != nodso ]; then \ ${MAKE} installDSO; \ + else \ + true; \ fi clean: diff --git a/libtiff/tif_apple.c b/libtiff/tif_apple.c index 519b876f..81f87724 100644 --- a/libtiff/tif_apple.c +++ b/libtiff/tif_apple.c @@ -1,4 +1,4 @@ -/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_apple.c,v 1.21 1996/01/10 19:32:54 sam Exp $ */ +/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_apple.c,v 1.22 1996/02/06 23:50:58 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler @@ -46,7 +46,7 @@ #include #include -#if defined(__PPCC__) || defined(__SC__) || defined(__MRC__) +#if defined(__PPCC__) || defined(__SC__) || defined(__MRC__) || defined(applec) #define CtoPstr c2pstr #endif diff --git a/libtiff/tif_fax3.c b/libtiff/tif_fax3.c index ea32a3bc..2d5df7f0 100644 --- a/libtiff/tif_fax3.c +++ b/libtiff/tif_fax3.c @@ -1,4 +1,4 @@ -/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_fax3.c,v 1.133 1996/01/10 19:33:02 sam Exp $ */ +/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_fax3.c,v 1.135 1996/02/08 20:21:27 sam Exp $ */ /* * Copyright (c) 1990-1996 Sam Leffler @@ -592,6 +592,17 @@ Fax3PutBits(TIFF* tif, u_int bits, u_int length) */ #define putcode(tif, te) Fax3PutBits(tif, (te)->code, (te)->length) +#ifdef FAX3_DEBUG +#define DEBUG_COLOR(w) (tab == TIFFFaxWhiteCodes ? w "W" : w "B") +#define DEBUG_PRINT(what,len) { \ + int t; \ + printf("%08X/%-2d: %s%5d\t", data, bit, DEBUG_COLOR(what), len); \ + for (t = length-1; t >= 0; t--) \ + putchar(code & (1<= 2624) { const tableentry* te = &tab[63 + (2560>>6)]; code = te->code, length = te->length; +#ifdef FAX3_DEBUG + DEBUG_PRINT("MakeUp", te->runlen); +#endif _PutBits(tif, code, length); span -= te->runlen; } @@ -616,10 +630,16 @@ putspan(TIFF* tif, int32 span, const tableentry* tab) const tableentry* te = &tab[63 + (span>>6)]; assert(te->runlen == 64*(span>>6)); code = te->code, length = te->length; +#ifdef FAX3_DEBUG + DEBUG_PRINT("MakeUp", te->runlen); +#endif _PutBits(tif, code, length); span -= te->runlen; } code = tab[span].code, length = tab[span].length; +#ifdef FAX3_DEBUG + DEBUG_PRINT(" Term", tab[span].runlen); +#endif _PutBits(tif, code, length); sp->data = data; @@ -1070,21 +1090,20 @@ Fax3Cleanup(TIFF* tif) } } -#define FIELD_OPTIONS (FIELD_CODEC+0) -#define FIELD_BADFAXLINES (FIELD_CODEC+1) -#define FIELD_CLEANFAXDATA (FIELD_CODEC+2) -#define FIELD_BADFAXRUN (FIELD_CODEC+3) -#define FIELD_RECVPARAMS (FIELD_CODEC+4) -#define FIELD_SUBADDRESS (FIELD_CODEC+5) -#define FIELD_RECVTIME (FIELD_CODEC+6) +#define FIELD_BADFAXLINES (FIELD_CODEC+0) +#define FIELD_CLEANFAXDATA (FIELD_CODEC+1) +#define FIELD_BADFAXRUN (FIELD_CODEC+2) +#define FIELD_RECVPARAMS (FIELD_CODEC+3) +#define FIELD_SUBADDRESS (FIELD_CODEC+4) +#define FIELD_RECVTIME (FIELD_CODEC+5) -static const TIFFFieldInfo fax3FieldInfo[] = { +#define FIELD_OPTIONS (FIELD_CODEC+6) + +static const TIFFFieldInfo faxFieldInfo[] = { { TIFFTAG_FAXMODE, 0, 0, TIFF_ANY, FIELD_PSEUDO, FALSE, FALSE, "FaxMode" }, { TIFFTAG_FAXFILLFUNC, 0, 0, TIFF_ANY, FIELD_PSEUDO, FALSE, FALSE, "FaxFillFunc" }, - { TIFFTAG_GROUP3OPTIONS, 1, 1, TIFF_LONG, FIELD_OPTIONS, - FALSE, FALSE, "Group3Options" }, { TIFFTAG_BADFAXLINES, 1, 1, TIFF_LONG, FIELD_BADFAXLINES, TRUE, FALSE, "BadFaxLines" }, { TIFFTAG_BADFAXLINES, 1, 1, TIFF_SHORT, FIELD_BADFAXLINES, @@ -1102,29 +1121,13 @@ static const TIFFFieldInfo fax3FieldInfo[] = { { TIFFTAG_FAXRECVTIME, 1, 1, TIFF_LONG, FIELD_RECVTIME, TRUE, FALSE, "FaxRecvTime" }, }; +static const TIFFFieldInfo fax3FieldInfo[] = { + { TIFFTAG_GROUP3OPTIONS, 1, 1, TIFF_LONG, FIELD_OPTIONS, + FALSE, FALSE, "Group3Options" }, +}; static const TIFFFieldInfo fax4FieldInfo[] = { - { TIFFTAG_FAXMODE, 0, 0, TIFF_ANY, FIELD_PSEUDO, - FALSE, FALSE, "FaxMode" }, - { TIFFTAG_FAXFILLFUNC, 0, 0, TIFF_ANY, FIELD_PSEUDO, - FALSE, FALSE, "FaxFillFunc" }, { TIFFTAG_GROUP4OPTIONS, 1, 1, TIFF_LONG, FIELD_OPTIONS, FALSE, FALSE, "Group4Options" }, - { TIFFTAG_BADFAXLINES, 1, 1, TIFF_LONG, FIELD_BADFAXLINES, - TRUE, FALSE, "BadFaxLines" }, - { TIFFTAG_BADFAXLINES, 1, 1, TIFF_SHORT, FIELD_BADFAXLINES, - TRUE, FALSE, "BadFaxLines" }, - { TIFFTAG_CLEANFAXDATA, 1, 1, TIFF_SHORT, FIELD_CLEANFAXDATA, - TRUE, FALSE, "CleanFaxData" }, - { TIFFTAG_CONSECUTIVEBADFAXLINES,1,1, TIFF_LONG, FIELD_BADFAXRUN, - TRUE, FALSE, "ConsecutiveBadFaxLines" }, - { TIFFTAG_CONSECUTIVEBADFAXLINES,1,1, TIFF_SHORT, FIELD_BADFAXRUN, - TRUE, FALSE, "ConsecutiveBadFaxLines" }, - { TIFFTAG_FAXRECVPARAMS, 1, 1, TIFF_LONG, FIELD_RECVPARAMS, - TRUE, FALSE, "FaxRecvParams" }, - { TIFFTAG_FAXSUBADDRESS, -1,-1, TIFF_ASCII, FIELD_SUBADDRESS, - TRUE, FALSE, "FaxSubAddress" }, - { TIFFTAG_FAXRECVTIME, 1, 1, TIFF_LONG, FIELD_RECVTIME, - TRUE, FALSE, "FaxRecvTime" }, }; #define N(a) (sizeof (a) / sizeof (a[0])) @@ -1268,8 +1271,8 @@ Fax3PrintDir(TIFF* tif, FILE* fd, long flags) (u_long) sp->recvtime); } -int -TIFFInitCCITTFax3(TIFF* tif, int scheme) +static int +InitCCITTFax3(TIFF* tif) { Fax3BaseState* sp; @@ -1291,14 +1294,7 @@ TIFFInitCCITTFax3(TIFF* tif, int scheme) * Merge codec-specific tag information and * override parent get/set field methods. */ - switch (scheme) { - case COMPRESSION_CCITTFAX3: - _TIFFMergeFieldInfo(tif, fax3FieldInfo, N(fax3FieldInfo)); - break; - case COMPRESSION_CCITTFAX4: - _TIFFMergeFieldInfo(tif, fax4FieldInfo, N(fax4FieldInfo)); - break; - } + _TIFFMergeFieldInfo(tif, faxFieldInfo, N(faxFieldInfo)); sp->vgetparent = tif->tif_vgetfield; tif->tif_vgetfield = Fax3VGetField; /* hook for codec tags */ sp->vsetparent = tif->tif_vsetfield; @@ -1308,7 +1304,6 @@ TIFFInitCCITTFax3(TIFF* tif, int scheme) sp->recvparams = 0; sp->subaddress = NULL; - TIFFSetField(tif, TIFFTAG_FAXMODE, FAXMODE_CLASSF); if (tif->tif_mode == O_RDONLY) { tif->tif_flags |= TIFF_NOBITREV;/* decoder does bit reversal */ DecoderState(tif)->runs = NULL; @@ -1336,6 +1331,20 @@ TIFFInitCCITTFax3(TIFF* tif, int scheme) return (1); } +int +TIFFInitCCITTFax3(TIFF* tif, int scheme) +{ + if (InitCCITTFax3(tif)) { + _TIFFMergeFieldInfo(tif, fax3FieldInfo, N(fax3FieldInfo)); + + /* + * The default format is Class/F-style w/o RTC. + */ + return TIFFSetField(tif, TIFFTAG_FAXMODE, FAXMODE_CLASSF); + } else + return (0); +} + /* * CCITT Group 4 (T.6) Facsimile-compatible * Compression Scheme Support. @@ -1419,7 +1428,9 @@ Fax4PostEncode(TIFF* tif) int TIFFInitCCITTFax4(TIFF* tif, int scheme) { - if (TIFFInitCCITTFax3(tif, scheme)) { /* reuse G3 logic */ + if (InitCCITTFax3(tif)) { /* reuse G3 support */ + _TIFFMergeFieldInfo(tif, fax4FieldInfo, N(fax4FieldInfo)); + tif->tif_decoderow = Fax4Decode; tif->tif_decodestrip = Fax4Decode; tif->tif_decodetile = Fax4Decode; @@ -1492,7 +1503,7 @@ Fax3DecodeRLE(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s) int TIFFInitCCITTRLE(TIFF* tif, int scheme) { - if (TIFFInitCCITTFax3(tif, scheme)) { /* reuse G3 compression */ + if (InitCCITTFax3(tif)) { /* reuse G3 support */ tif->tif_decoderow = Fax3DecodeRLE; tif->tif_decodestrip = Fax3DecodeRLE; tif->tif_decodetile = Fax3DecodeRLE; @@ -1508,7 +1519,7 @@ TIFFInitCCITTRLE(TIFF* tif, int scheme) int TIFFInitCCITTRLEW(TIFF* tif, int scheme) { - if (TIFFInitCCITTFax3(tif, scheme)) { /* reuse G3 compression */ + if (InitCCITTFax3(tif)) { /* reuse G3 support */ tif->tif_decoderow = Fax3DecodeRLE; tif->tif_decodestrip = Fax3DecodeRLE; tif->tif_decodetile = Fax3DecodeRLE; diff --git a/libtiff/tif_fax3.h b/libtiff/tif_fax3.h index d4ed4a21..224d5e2c 100644 --- a/libtiff/tif_fax3.h +++ b/libtiff/tif_fax3.h @@ -1,4 +1,4 @@ -/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_fax3.h,v 1.27 1996/01/10 19:33:22 sam Exp $ */ +/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_fax3.h,v 1.29 1996/02/09 22:51:07 sam Exp $ */ /* * Copyright (c) 1990-1996 Sam Leffler @@ -122,25 +122,49 @@ extern const TIFFFaxTabEnt TIFFFaxBlackTable[]; * data. In any event, we don't prescan and must watch for * running out of data since we can't permit the library to * scan past the end of the input data buffer. + * + * Finally, note that we must handle remaindered data at the end + * of a strip specially. The coder asks for a fixed number of + * bits when scanning for the next code. This may be more bits + * than are actually present in the data stream. If we appear + * to run out of data but still have some number of valid bits + * remaining then we makeup the requested amount with zeros and + * return successfully. If the returned data is incorrect then + * we should be called again and get a premature EOF error; + * otherwise we should get the right answer. */ #ifndef NeedBits8 #define NeedBits8(n,eoflab) do { \ if (BitsAvail < (n)) { \ - if (EndOfData()) goto eoflab; \ - BitAcc |= bitmap[*cp++]< -#elif !defined(__MWERKS__) && !defined(THINK_C) && !defined(__acornriscos) +#elif !defined(__MWERKS__) && !defined(THINK_C) && !defined(__acornriscos) && !defined(applec) #include #endif diff --git a/man/Makefile.in b/man/Makefile.in index 14138d27..150d95dd 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -1,4 +1,4 @@ -# $Header: /usr/people/sam/tiff/man/RCS/Makefile.in,v 1.10 1995/10/16 22:50:32 sam Exp $ +# $Header: /usr/people/sam/tiff/man/RCS/Makefile.in,v 1.11 1996/02/09 05:54:37 sam Exp $ # # @WARNING@ # @@ -35,7 +35,7 @@ SRCDIR = ${DEPTH}/@SRCDIR@/man # TARGET: @TARGET@ # CCOMPILER: @CCOMPILER@ # -SHELL = /bin/sh +SHELL = @SCRIPT_SH@ NULL = ECHO = echo MV = mv diff --git a/port/Makefile.in b/port/Makefile.in index 47882670..f7da0136 100644 --- a/port/Makefile.in +++ b/port/Makefile.in @@ -1,5 +1,5 @@ #! smake -# $Header: /usr/people/sam/tiff/port/RCS/Makefile.in,v 1.4 1996/01/10 19:36:05 sam Exp $ +# $Header: /usr/people/sam/tiff/port/RCS/Makefile.in,v 1.5 1996/02/09 05:54:37 sam Exp $ # # @WARNING@ # @@ -39,7 +39,7 @@ VPATH = ../@SRCDIR@/port # CCOMPILER: @CCOMPILER@ # -SHELL = /bin/sh +SHELL = @SCRIPT_SH@ NULL = CC = @CCOMPILER@ AR = @AR@ diff --git a/tools/Makefile.in b/tools/Makefile.in index 05726871..5d99c54b 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -1,4 +1,4 @@ -# $Header: /usr/people/sam/tiff/tools/RCS/Makefile.in,v 1.16 1996/01/10 19:35:25 sam Exp $ +# $Header: /usr/people/sam/tiff/tools/RCS/Makefile.in,v 1.17 1996/02/09 05:55:00 sam Exp $ # # @WARNING@ # @@ -36,7 +36,7 @@ LIBDIR = ${DEPTH}/@SRCDIR@/libtiff # TARGET: @TARGET@ # CCOMPILER: @CCOMPILER@ # -SHELL = /bin/sh +SHELL = @SCRIPT_SH@ NULL = CC = @CCOMPILER@ INSTALL = @INSTALL@ @@ -93,18 +93,26 @@ TARGETS =\ all: ${TARGETS} @if [ "@LIBIMAGE@" = yes ]; then \ ${MAKE} sgi2tiff; \ + else \ + true; \ fi @if [ "@LIBGL@" = yes ]; then \ ${MAKE} tiffgt tiffsv; \ + else \ + true; \ fi install: all ${INSTALL} -idb tiff.sw.tools -m 755 -dir @DIR_BIN@ ${INSTALL} -idb tiff.sw.tools -m 755 -F @DIR_BIN@ -O ${TARGETS} @if [ "@LIBIMAGE@" = yes ]; then \ ${INSTALL} -idb tiff.sw.tools -m 755 -F @DIR_BIN@ -O sgi2tiff; \ + else \ + true; \ fi @if [ "@LIBGL@" = yes ]; then \ ${INSTALL} -idb tiff.sw.tools -m 755 -F @DIR_BIN@ -O tiffgt tiffsv;\ + else \ + true; \ fi clean: rm -f ${TARGETS} ${OBJS} sgigt.o tiffgt sgisv.o tiffsv \ -- cgit v1.2.1