#! /bin/sh # # This is a shell script that converts tiff-v3.4beta035 to tiff-v3.4beta036 # TOP=. findBinary() { IFS=: for i in $PATH; do test -x $i/$1 && return done echo "Fatal error: this shell script requires $2." exit 1 } findBinary patch "Larry Wall's patch program" Patch() { echo "Patch $1:" patch -s $TOP/$1 } NewFile() { echo "New file $1" cat >$TOP/$1 } NewDir() { echo "New directory $1" mkdir "$TOP/$1" } RmDir() { echo "Remove directory $1" rm -rf $TOP/$1.orig mv $TOP/$1 $TOP/$1.orig } RmFile() { echo "Remove $1" rm -f $TOP/$1.orig mv $TOP/$1 $TOP/$1.orig } Patch Makefile.in<<'EOF-EOF-EOF' *** tiff-v3.4beta035/Makefile.in Mon Jun 10 15:24:57 1996 --- tiff-v3.4beta036/Makefile.in Thu Feb 20 18:11:19 1997 *************** *** 1,5 **** #! smake ! # $Header: /usr/people/sam/tiff/RCS/Makefile.in,v 1.57 1996/06/10 22:24:41 sam Exp $ # # @WARNING@ # --- 1,5 ---- #! smake ! # $Header: /usr/people/sam/tiff/RCS/Makefile.in,v 1.58 1997/02/21 01:20:19 sam Exp $ # # @WARNING@ # *************** *** 272,277 **** --- 272,279 ---- html/misc.html \ html/support.html \ html/tools.html \ + html/v3.4beta036.html \ + html/v3.4beta035.html \ html/v3.4beta034.html \ html/v3.4beta033.html \ html/v3.4beta032.html \ EOF-EOF-EOF Patch configure<<'EOF-EOF-EOF' *** tiff-v3.4beta035/configure Mon Jun 10 15:24:56 1996 --- tiff-v3.4beta036/configure Thu Feb 20 18:11:18 1997 *************** *** 1,5 **** #!/bin/sh ! # $Header: /usr/people/sam/tiff/RCS/configure,v 1.52 1996/06/10 20:48:14 sam Exp $ # # Tag Image File Format (TIFF) Software # --- 1,5 ---- #!/bin/sh ! # $Header: /usr/people/sam/tiff/RCS/configure,v 1.56 1997/01/28 00:39:52 sam Exp $ # # Tag Image File Format (TIFF) Software # *************** *** 147,153 **** -target|--target) ac_prev=TARGET;; -target=*|--target=*) TARGET="$ac_optarg" ;; -version|--version) ! echo "This is TIFF configure $Revision: 1.52 $" exit 0 ;; -help|--help) usage; exit 0;; --- 147,153 ---- -target|--target) ac_prev=TARGET;; -target=*|--target=*) TARGET="$ac_optarg" ;; -version|--version) ! echo "This is TIFF configure $Revision: 1.56 $" exit 0 ;; -help|--help) usage; exit 0;; *************** *** 1093,1098 **** --- 1093,1099 ---- DSOSUF=so DSOOPTS='-elf -shared -no_unresolved -all' DSO=IRIX52 + TIFFLIBREF='-L${DEPTH}/libtiff -rpath '${DIR_LIB}' -ltiff' fi ;; *-irix*) *************** *** 1101,1106 **** --- 1102,1108 ---- DSOLD="${CCOMPILER} ${ENVOPTS}" DSOOPTS='-shared -rdata_shared -check_registry ${SRCDIR}/port/irix/so_locations -quickstart_info' DSO=IRIX + TIFFLIBREF='-L${DEPTH}/libtiff -rpath '${DIR_LIB}' -ltiff' fi ;; *-aix*) *************** *** 1109,1114 **** --- 1111,1123 ---- LIBCOPTS="-bM\:SRE" DSO=AIX ;; + *-hpux*yes) + DSOSUF=sl + DSOLD=gcc + DSOOPTS='-fpic -shared' + LIBCOPTS=-fpic + DSO=HPUX + ;; *-hpux*) DSOSUF=sl DSOOPTS='-b' *************** *** 1115,1132 **** LIBCOPTS="+Z" # LIBPORT="-Wl,+b${DIR_LIB}" DSO=HPUX ;; - *-solaris*-yes) - DSOSUF=so - DSOOPTS='-G' - LIBCOPTS="-fpic" - DSO=SOLARIS - ;; *-solaris*) DSOSUF=so DSOOPTS='-G' ! LIBCOPTS="-K PIC" DSO=SOLARIS ;; *-netbsd*) DSOSUF=so.${DIST_MAJOR}.0 --- 1124,1141 ---- LIBCOPTS="+Z" # LIBPORT="-Wl,+b${DIR_LIB}" DSO=HPUX + TIFFLIBREF="-Wl,+s,+b${DIR_LIB}"' -L${DEPTH}/libtiff -ltiff' ;; *-solaris*) DSOSUF=so DSOOPTS='-G' ! if [ $ISGCC = yes ]; then ! LIBCOPTS="-fpic" ! else ! LIBCOPTS="-K PIC" ! fi DSO=SOLARIS + TIFFLIBREF='-L${DEPTH}/libtiff -R'${DIR_LIB}' -ltiff' ;; *-netbsd*) DSOSUF=so.${DIST_MAJOR}.0 *************** *** 1141,1147 **** TIFFLIBREF='-L${DEPTH}/libtiff -ltiff' ;; *-linux*) ! if [ -x /lib/libc.so.5 ]; then DSOSUF=so.${DIST_MAJOR} DSOSUF_VERSION=${DSOSUF}.${DIST_MINOR}.${DIST_ALPHA} LIBCOPTS='-fPIC' --- 1150,1156 ---- TIFFLIBREF='-L${DEPTH}/libtiff -ltiff' ;; *-linux*) ! if [ -r /lib/libc.so.5 ]; then DSOSUF=so.${DIST_MAJOR} DSOSUF_VERSION=${DSOSUF}.${DIST_MINOR}.${DIST_ALPHA} LIBCOPTS='-fPIC' EOF-EOF-EOF Patch dist/tiff.alpha<<'EOF-EOF-EOF' *** tiff-v3.4beta035/dist/tiff.alpha Wed Jun 5 14:24:18 1996 --- tiff-v3.4beta036/dist/tiff.alpha Mon Aug 26 16:24:59 1996 *************** *** 1 **** ! define ALPHA 035 --- 1 ---- ! define ALPHA 036 EOF-EOF-EOF Patch html/Makefile.in<<'EOF-EOF-EOF' *** tiff-v3.4beta035/html/Makefile.in Mon Jun 10 15:25:50 1996 --- tiff-v3.4beta036/html/Makefile.in Thu Feb 20 18:11:58 1997 *************** *** 1,4 **** ! # $Header: /usr/people/sam/tiff/html/RCS/Makefile.in,v 1.13 1996/06/05 21:43:27 sam Exp $ # # @WARNING@ # --- 1,4 ---- ! # $Header: /usr/people/sam/tiff/html/RCS/Makefile.in,v 1.14 1997/02/21 01:20:12 sam Exp $ # # @WARNING@ # *************** *** 71,76 **** --- 71,78 ---- v3.4beta032.html \ v3.4beta033.html \ v3.4beta034.html \ + v3.4beta035.html \ + v3.4beta036.html \ ${NULL} IMAGES=\ images/back.gif \ EOF-EOF-EOF Patch html/document.html<<'EOF-EOF-EOF' *** tiff-v3.4beta035/html/document.html Mon Jun 10 15:25:52 1996 --- tiff-v3.4beta036/html/document.html Thu Feb 20 18:11:59 1997 *************** *** 39,45 **** Acrobat format (PDF); this can be found at TIFF Technical Notes can be retrieved from --- 39,45 ---- Acrobat format (PDF); this can be found at TIFF Technical Notes can be retrieved from *************** *** 53,59 ****
Sam Leffler / sam@engr.sgi.com. ! Last updated: $Date: 1996/04/29 19:18:06 $
--- 53,59 ----
Sam Leffler / sam@engr.sgi.com. ! Last updated: $Date: 1996/11/10 16:39:43 $
EOF-EOF-EOF Patch html/index.html<<'EOF-EOF-EOF' *** tiff-v3.4beta035/html/index.html Mon Jun 10 15:25:52 1996 --- tiff-v3.4beta036/html/index.html Thu Feb 20 18:11:59 1997 *************** *** 12,18 **** Latest Release: v3.4
! Latest Software: v3.4beta034
Master FTP Site: ftp.sgi.com (192.48.153.1), directory graphics/tiff
Home Page: http://www-mipl.jpl.nasa.gov/~ndr/tiff/
--- 12,18 ---- Latest Release: v3.4
! Latest Software: v3.4beta036
Master FTP Site: ftp.sgi.com (192.48.153.1), directory graphics/tiff
Home Page: http://www-mipl.jpl.nasa.gov/~ndr/tiff/
*************** *** 81,87 ****
Sam Leffler / sam@engr.sgi.com. ! Last updated: $Date: 1996/05/21 19:01:11 $
--- 81,87 ----
Sam Leffler / sam@engr.sgi.com. ! Last updated: $Date: 1997/02/21 01:20:12 $
EOF-EOF-EOF Patch html/internals.html<<'EOF-EOF-EOF' *** tiff-v3.4beta035/html/internals.html Mon Jun 10 15:25:53 1996 --- tiff-v3.4beta036/html/internals.html Thu Feb 20 18:11:59 1997 *************** *** 199,204 **** --- 199,214 ---- support for the TIFF 6.0 CMYK-related tags + + ICC_SUPPORT + support for the ICC Profile tag; see + The ICC Profile Format Specification, + Annex B.3 "Embedding ICC Profiles in TIFF Files"; + available at + http://www.color.org + + + *************** *** 639,645 ****
Sam Leffler / sam@engr.sgi.com. ! Last updated: $Date: 1996/04/29 19:18:06 $
--- 649,655 ----
Sam Leffler / sam@engr.sgi.com. ! Last updated: $Date: 1996/12/13 05:31:06 $
EOF-EOF-EOF Patch html/libtiff.html<<'EOF-EOF-EOF' *** tiff-v3.4beta035/html/libtiff.html Mon Jun 10 15:25:54 1996 --- tiff-v3.4beta036/html/libtiff.html Thu Feb 20 18:12:00 1997 *************** *** 230,236 **** { TIFF* tif = TIFFOpen(argv[1], "r"); if (tif) { ! int dircount = 1; do { dircount++; } while (TIFFReadDirectory(tif)); --- 230,236 ---- { TIFF* tif = TIFFOpen(argv[1], "r"); if (tif) { ! int dircount = 0; do { dircount++; } while (TIFFReadDirectory(tif)); *************** *** 375,381 **** npixels = w * h; raster = (uint32*) _TIFFmalloc(npixels * sizeof (uint32)); if (raster != NULL) { ! if (TIFFReadRGBAImage(tif, raster, w, h, 0)) { ...process raster data... } _TIFFfree(raster); --- 375,381 ---- npixels = w * h; raster = (uint32*) _TIFFmalloc(npixels * sizeof (uint32)); if (raster != NULL) { ! if (TIFFReadRGBAImage(tif, w, h, raster, 0)) { ...process raster data... } _TIFFfree(raster); *************** *** 738,744 ****
Sam Leffler / sam@engr.sgi.com. ! Last updated: $Date: 1996/04/29 19:18:06 $
--- 738,744 ----
Sam Leffler / sam@engr.sgi.com. ! Last updated: $Date: 1996/08/29 01:08:05 $
EOF-EOF-EOF Patch libtiff/Makefile.in<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/Makefile.in Mon Jun 10 15:25:00 1996 --- tiff-v3.4beta036/libtiff/Makefile.in Thu Feb 20 18:11:21 1997 *************** *** 1,4 **** ! # $Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.in,v 1.38 1996/06/10 20:48:50 sam Exp $ # # Tag Image File Format Library # --- 1,4 ---- ! # $Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.in,v 1.40 1996/11/11 16:15:16 sam Exp $ # # Tag Image File Format Library # *************** *** 159,165 **** # default IRIX DSO building rule IRIXdso: ${OBJS} ! ${CC} -o libtiff.@DSOSUF@ -shared -rdata_shared \ -check_registry ${SRCDIR}/../port/irix/so_locations \ -quickstart_info \ ${OBJS} @LIBJPEG@ @LIBGZ@ --- 159,165 ---- # default IRIX DSO building rule IRIXdso: ${OBJS} ! ${CC} @ENVOPTS@ -o libtiff.@DSOSUF@ -shared -rdata_shared \ -check_registry ${SRCDIR}/../port/irix/so_locations \ -quickstart_info \ ${OBJS} @LIBJPEG@ @LIBGZ@ *************** *** 319,325 **** ${INSTALL} -idb tiff.sw.tools -F @DIR_LIB@ \ -ln libtiff.@DSOSUF_VERSION@ -O libtiff.@DSOSUF@; \ else \ ! ${INSTALL} -idb tiff.sw.tools -m 444 -F @DIR_LIB@ \ -O libtiff.@DSOSUF@; \ fi install: all installHdrs --- 319,325 ---- ${INSTALL} -idb tiff.sw.tools -F @DIR_LIB@ \ -ln libtiff.@DSOSUF_VERSION@ -O libtiff.@DSOSUF@; \ else \ ! ${INSTALL} -idb tiff.sw.tools -m 555 -F @DIR_LIB@ \ -O libtiff.@DSOSUF@; \ fi install: all installHdrs EOF-EOF-EOF Patch libtiff/t4.h<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/t4.h Mon Jun 10 15:25:01 1996 --- tiff-v3.4beta036/libtiff/t4.h Thu Feb 20 18:11:21 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/t4.h,v 1.15 1996/01/10 19:33:20 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Id: t4.h,v 1.16 1996/06/24 03:00:54 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler EOF-EOF-EOF Patch libtiff/tif_aux.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_aux.c Mon Jun 10 15:25:05 1996 --- tiff-v3.4beta036/libtiff/tif_aux.c Thu Feb 20 18:11:24 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_aux.c,v 1.32 1996/01/10 19:32:55 sam Exp $ */ /* * Copyright (c) 1991-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_aux.c,v 1.33 1996/08/01 19:10:34 sam Exp $ */ /* * Copyright (c) 1991-1996 Sam Leffler *************** *** 123,128 **** --- 123,131 ---- return (1); case TIFFTAG_INKSET: *va_arg(ap, uint16 *) = td->td_inkset; + return (1); + case TIFFTAG_NUMBEROFINKS: + *va_arg(ap, uint16 *) = td->td_ninks; return (1); #endif case TIFFTAG_EXTRASAMPLES: EOF-EOF-EOF Patch libtiff/tif_close.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_close.c Mon Jun 10 15:25:05 1996 --- tiff-v3.4beta036/libtiff/tif_close.c Thu Feb 20 18:11:24 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_close.c,v 1.30 1996/01/10 19:32:55 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_close.c,v 1.31 1997/01/27 19:09:09 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 37,44 **** * Flush buffered data and directory (if dirty). */ TIFFFlush(tif); ! if (tif->tif_cleanup) ! (*tif->tif_cleanup)(tif); TIFFFreeDirectory(tif); if (tif->tif_rawdata && (tif->tif_flags&TIFF_MYBUFFER)) _TIFFfree(tif->tif_rawdata); --- 37,43 ---- * Flush buffered data and directory (if dirty). */ TIFFFlush(tif); ! (*tif->tif_cleanup)(tif); TIFFFreeDirectory(tif); if (tif->tif_rawdata && (tif->tif_flags&TIFF_MYBUFFER)) _TIFFfree(tif->tif_rawdata); EOF-EOF-EOF Patch libtiff/tif_compress.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_compress.c Mon Jun 10 15:25:06 1996 --- tiff-v3.4beta036/libtiff/tif_compress.c Thu Feb 20 18:11:25 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_compress.c,v 1.51 1996/01/10 19:32:57 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_compress.c,v 1.52 1997/01/27 19:09:09 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 122,132 **** static int _TIFFtrue(TIFF* tif) { (void) tif; return (1); } static void _TIFFvoid(TIFF* tif) { (void) tif; } ! int ! TIFFSetCompressionScheme(TIFF* tif, int scheme) { - const TIFFCodec *c = TIFFFindCODEC(scheme); - tif->tif_setupdecode = _TIFFtrue; tif->tif_predecode = _TIFFNoPreCode; tif->tif_decoderow = _TIFFNoRowDecode; --- 122,130 ---- static int _TIFFtrue(TIFF* tif) { (void) tif; return (1); } static void _TIFFvoid(TIFF* tif) { (void) tif; } ! void ! _TIFFSetDefaultCompressionState(TIFF* tif) { tif->tif_setupdecode = _TIFFtrue; tif->tif_predecode = _TIFFNoPreCode; tif->tif_decoderow = _TIFFNoRowDecode; *************** *** 144,149 **** --- 142,155 ---- tif->tif_defstripsize = _TIFFDefaultStripSize; tif->tif_deftilesize = _TIFFDefaultTileSize; tif->tif_flags &= ~TIFF_NOBITREV; + } + + int + TIFFSetCompressionScheme(TIFF* tif, int scheme) + { + const TIFFCodec *c = TIFFFindCODEC(scheme); + + _TIFFSetDefaultCompressionState(tif); /* * Don't treat an unknown compression scheme as an error. * This permits applications to open files with data that EOF-EOF-EOF Patch libtiff/tif_dir.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_dir.c Mon Jun 10 15:25:07 1996 --- tiff-v3.4beta036/libtiff/tif_dir.c Thu Feb 20 18:11:26 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dir.c,v 1.156 1996/01/10 20:37:08 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dir.c,v 1.158 1996/12/13 05:25:39 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 50,55 **** --- 50,57 ---- } void _TIFFsetString(char** cpp, char* cp) { _TIFFsetByteArray((void**) cpp, (void*) cp, (long) (strlen(cp)+1)); } + void _TIFFsetNString(char** cpp, char* cp, long n) + { _TIFFsetByteArray((void**) cpp, (void*) cp, n); } void _TIFFsetShortArray(uint16** wpp, uint16* wp, long n) { _TIFFsetByteArray((void**) wpp, (void*) wp, n*sizeof (uint16)); } void _TIFFsetLongArray(uint32** lpp, uint32* lp, long n) *************** *** 364,375 **** td->td_dotrange[1] = (uint16) va_arg(ap, int); break; case TIFFTAG_INKNAMES: ! _TIFFsetString(&td->td_inknames, va_arg(ap, char*)); break; case TIFFTAG_TARGETPRINTER: _TIFFsetString(&td->td_targetprinter, va_arg(ap, char*)); break; #endif default: /* * This can happen if multiple images are open with --- 366,388 ---- td->td_dotrange[1] = (uint16) va_arg(ap, int); break; case TIFFTAG_INKNAMES: ! i = va_arg(ap, int); ! _TIFFsetNString(&td->td_inknames, va_arg(ap, char*), i); break; + case TIFFTAG_NUMBEROFINKS: + td->td_ninks = (uint16) va_arg(ap, int); + break; case TIFFTAG_TARGETPRINTER: _TIFFsetString(&td->td_targetprinter, va_arg(ap, char*)); break; #endif + #ifdef ICC_SUPPORT + case TIFFTAG_ICCPROFILE: + td->td_profileLength = (uint32) va_arg(ap, uint32); + _TIFFsetByteArray(&td->td_profileData, va_arg(ap, void*), + td->td_profileLength); + break; + #endif default: /* * This can happen if multiple images are open with *************** *** 677,686 **** --- 690,708 ---- case TIFFTAG_INKNAMES: *va_arg(ap, char**) = td->td_inknames; break; + case TIFFTAG_NUMBEROFINKS: + *va_arg(ap, uint16*) = td->td_ninks; + break; case TIFFTAG_TARGETPRINTER: *va_arg(ap, char**) = td->td_targetprinter; break; #endif + #ifdef ICC_SUPPORT + case TIFFTAG_ICCPROFILE: + *va_arg(ap, uint32*) = td->td_profileLength; + *va_arg(ap, void**) = td->td_profileData; + break; + #endif default: /* * This can happen if multiple images are open with *************** *** 775,780 **** --- 797,805 ---- CleanupField(td_transferfunction[1]); CleanupField(td_transferfunction[2]); #endif + #ifdef ICC_SUPPORT + CleanupField(td_profileData); + #endif CleanupField(td_stripoffset); CleanupField(td_stripbytecount); } *************** *** 822,827 **** --- 847,853 ---- #endif #ifdef CMYK_SUPPORT td->td_inkset = INKSET_CMYK; + td->td_ninks = 4; #endif tif->tif_postdecode = _TIFFNoPostDecode; tif->tif_vsetfield = _TIFFVSetField; EOF-EOF-EOF Patch libtiff/tif_dir.h<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_dir.h Mon Jun 10 15:25:06 1996 --- tiff-v3.4beta036/libtiff/tif_dir.h Thu Feb 20 18:11:25 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dir.h,v 1.4 1996/01/10 19:33:21 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dir.h,v 1.6 1996/12/13 05:25:17 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 91,100 **** --- 91,105 ---- #endif #ifdef CMYK_SUPPORT uint16 td_inkset; + uint16 td_ninks; uint16 td_dotrange[2]; char* td_inknames; char* td_targetprinter; #endif + #ifdef ICC_SUPPORT + uint32 td_profileLength; + void *td_profileData; + #endif } TIFFDirectory; /* *************** *** 165,172 **** #define FIELD_DOTRANGE 47 #define FIELD_TARGETPRINTER 48 #define FIELD_SUBIFD 49 ! ! #define FIELD_CODEC 50 /* base of codec-private tags */ /* * Pseudo-tags don't normally need field bits since they * are not written to an output file (by definition). --- 170,179 ---- #define FIELD_DOTRANGE 47 #define FIELD_TARGETPRINTER 48 #define FIELD_SUBIFD 49 ! #define FIELD_NUMBEROFINKS 50 ! #define FIELD_ICCPROFILE 51 ! /* end of support for well-known tags; codec-private tags follow */ ! #define FIELD_CODEC 51 /* base of codec-private tags */ /* * Pseudo-tags don't normally need field bits since they * are not written to an output file (by definition). *************** *** 192,199 **** typedef struct { ttag_t field_tag; /* field's tag */ ! short field_readcount; /* read count (-1 for unknown) */ ! short field_writecount; /* write count (-1 for unknown) */ TIFFDataType field_type; /* type of associated data */ u_short field_bit; /* bit in fieldsset bit vector */ u_char field_oktochange; /* if true, can change while writing */ --- 199,206 ---- typedef struct { ttag_t field_tag; /* field's tag */ ! short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */ ! short field_writecount; /* write count/TIFF_VARIABLE */ TIFFDataType field_type; /* type of associated data */ u_short field_bit; /* bit in fieldsset bit vector */ u_char field_oktochange; /* if true, can change while writing */ *************** *** 204,209 **** --- 211,217 ---- #define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */ #define TIFF_VARIABLE -1 /* marker for variable length tags */ #define TIFF_SPP -2 /* marker for SamplesPerPixel tags */ + #define TIFF_VARIABLE2 -3 /* marker for uint32 var-length tags */ extern const int tiffDataWidth[]; /* table of tag datatype widths */ EOF-EOF-EOF Patch libtiff/tif_dirinfo.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_dirinfo.c Mon Jun 10 15:25:07 1996 --- tiff-v3.4beta036/libtiff/tif_dirinfo.c Thu Feb 20 18:11:26 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dirinfo.c,v 1.38 1996/06/04 19:04:41 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dirinfo.c,v 1.40 1996/12/13 05:25:39 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 166,172 **** { TIFFTAG_INKSET, 1, 1, TIFF_SHORT, FIELD_INKSET, FALSE, FALSE, "InkSet" }, { TIFFTAG_INKNAMES, -1,-1, TIFF_ASCII, FIELD_INKNAMES, ! TRUE, FALSE, "InkNames" }, { TIFFTAG_DOTRANGE, 2, 2, TIFF_SHORT, FIELD_DOTRANGE, FALSE, FALSE, "DotRange" }, { TIFFTAG_DOTRANGE, 2, 2, TIFF_BYTE, FIELD_DOTRANGE, --- 166,174 ---- { TIFFTAG_INKSET, 1, 1, TIFF_SHORT, FIELD_INKSET, FALSE, FALSE, "InkSet" }, { TIFFTAG_INKNAMES, -1,-1, TIFF_ASCII, FIELD_INKNAMES, ! TRUE, TRUE, "InkNames" }, ! { TIFFTAG_NUMBEROFINKS, 1, 1, TIFF_SHORT, FIELD_NUMBEROFINKS, ! TRUE, FALSE, "NumberOfInks" }, { TIFFTAG_DOTRANGE, 2, 2, TIFF_SHORT, FIELD_DOTRANGE, FALSE, FALSE, "DotRange" }, { TIFFTAG_DOTRANGE, 2, 2, TIFF_BYTE, FIELD_DOTRANGE, *************** *** 214,219 **** --- 216,225 ---- { TIFFTAG_TILEDEPTH, 1, 1, TIFF_SHORT, FIELD_TILEDEPTH, FALSE, FALSE, "TileDepth" }, /* end SGI tags */ + #ifdef ICC_SUPPORT + { TIFFTAG_ICCPROFILE, -1,-3, TIFF_UNDEFINED, FIELD_ICCPROFILE, + FALSE, TRUE, "ICC Profile" }, + #endif }; #define N(a) (sizeof (a) / sizeof (a[0])) EOF-EOF-EOF Patch libtiff/tif_dirread.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_dirread.c Mon Jun 10 15:25:08 1996 --- tiff-v3.4beta036/libtiff/tif_dirread.c Thu Feb 20 18:11:26 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dirread.c,v 1.71 1996/03/29 16:35:17 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dirread.c,v 1.76 1997/02/10 20:18:43 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 59,67 **** static int TIFFFetchDoubleArray(TIFF*, TIFFDirEntry*, double*); static int TIFFFetchAnyArray(TIFF*, TIFFDirEntry*, double*); static int TIFFFetchShortPair(TIFF*, TIFFDirEntry*); - #if STRIPCHOP_SUPPORT static void ChopUpSingleUncompressedStrip(TIFF*); - #endif static char * CheckMalloc(TIFF* tif, tsize_t n, const char* what) --- 59,65 ---- *************** *** 100,107 **** /* * Cleanup any previous compression state. */ ! if (tif->tif_curdir != (tdir_t) -1) ! (*tif->tif_cleanup)(tif); tif->tif_curdir++; nextdiroff = 0; if (!isMapped(tif)) { --- 98,104 ---- /* * Cleanup any previous compression state. */ ! (*tif->tif_cleanup)(tif); tif->tif_curdir++; nextdiroff = 0; if (!isMapped(tif)) { *************** *** 132,138 **** } else { toff_t off = tif->tif_diroff; ! if (off + sizeof (short) > tif->tif_size) { TIFFError(tif->tif_name, "Can not read TIFF directory count"); return (0); --- 129,135 ---- } else { toff_t off = tif->tif_diroff; ! if (off + sizeof (uint16) > tif->tif_size) { TIFFError(tif->tif_name, "Can not read TIFF directory count"); return (0); *************** *** 152,158 **** _TIFFmemcpy(dir, tif->tif_base + off, dircount*sizeof (TIFFDirEntry)); off += dircount* sizeof (TIFFDirEntry); ! if (off + sizeof (uint32) < tif->tif_size) _TIFFmemcpy(&nextdiroff, tif->tif_base+off, sizeof (uint32)); } if (tif->tif_flags & TIFF_SWAB) --- 149,155 ---- _TIFFmemcpy(dir, tif->tif_base + off, dircount*sizeof (TIFFDirEntry)); off += dircount* sizeof (TIFFDirEntry); ! if (off + sizeof (uint32) <= tif->tif_size) _TIFFmemcpy(&nextdiroff, tif->tif_base+off, sizeof (uint32)); } if (tif->tif_flags & TIFF_SWAB) *************** *** 528,534 **** */ if (!TIFFFieldSet(tif, FIELD_COMPRESSION)) TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE); - #if STRIPCHOP_SUPPORT /* * Some manufacturers make life difficult by writing * large amounts of uncompressed data as a single strip. --- 525,530 ---- *************** *** 538,548 **** * side effect, however, is that the RowsPerStrip tag * value may be changed. */ ! if ((tif->tif_flags & TIFF_STRIPCHOP) && ! td->td_nstrips == 1 && td->td_compression == COMPRESSION_NONE && ! td->td_tilewidth == td->td_imagewidth) ChopUpSingleUncompressedStrip(tif); - #endif /* * Reinitialize i/o since we are starting on a new directory. */ --- 534,542 ---- * side effect, however, is that the RowsPerStrip tag * value may be changed. */ ! if (td->td_nstrips == 1 && td->td_compression == COMPRESSION_NONE && ! (tif->tif_flags & (TIFF_STRIPCHOP|TIFF_ISTILED)) == TIFF_STRIPCHOP) ChopUpSingleUncompressedStrip(tif); /* * Reinitialize i/o since we are starting on a new directory. */ *************** *** 585,591 **** if (cc > sizeof (uint32)) space += cc; } ! space = (filesize - space) / td->td_samplesperpixel; for (i = 0; i < td->td_nstrips; i++) td->td_stripbytecount[i] = space; /* --- 579,587 ---- if (cc > sizeof (uint32)) space += cc; } ! space = filesize - space; ! if (td->td_planarconfig == PLANARCONFIG_SEPARATE) ! space /= td->td_samplesperpixel; for (i = 0; i < td->td_nstrips; i++) td->td_stripbytecount[i] = space; /* *************** *** 601,607 **** filesize - td->td_stripoffset[i]; } else { uint32 rowbytes = TIFFScanlineSize(tif); ! uint32 rowsperstrip = td->td_imagelength / td->td_nstrips; for (i = 0; i < td->td_nstrips; i++) td->td_stripbytecount[i] = rowbytes*rowsperstrip; } --- 597,603 ---- filesize - td->td_stripoffset[i]; } else { uint32 rowbytes = TIFFScanlineSize(tif); ! uint32 rowsperstrip = td->td_imagelength/td->td_stripsperimage; for (i = 0; i < td->td_nstrips; i++) td->td_stripbytecount[i] = rowbytes*rowsperstrip; } *************** *** 991,997 **** static int TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp) { ! static char mesg[] = "to fetch tag value"; int ok = 0; const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dp->tdir_tag); --- 987,993 ---- static int TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp) { ! static const char mesg[] = "to fetch tag value"; int ok = 0; const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dp->tdir_tag); *************** *** 1271,1277 **** static int TIFFFetchRefBlackWhite(TIFF* tif, TIFFDirEntry* dir) { ! static char mesg[] = "for \"ReferenceBlackWhite\" array"; char* cp; int ok; --- 1267,1273 ---- static int TIFFFetchRefBlackWhite(TIFF* tif, TIFFDirEntry* dir) { ! static const char mesg[] = "for \"ReferenceBlackWhite\" array"; char* cp; int ok; *************** *** 1298,1304 **** } #endif - #if STRIPCHOP_SUPPORT /* * Replace a single strip (tile) of uncompressed data by * multiple strips (tiles), each approximately 8Kbytes. --- 1294,1299 ---- *************** *** 1371,1374 **** td->td_stripbytecount = newcounts; td->td_stripoffset = newoffsets; } - #endif /* STRIPCHOP_SUPPORT */ --- 1366,1368 ---- EOF-EOF-EOF Patch libtiff/tif_dirwrite.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_dirwrite.c Mon Jun 10 15:25:08 1996 --- tiff-v3.4beta036/libtiff/tif_dirwrite.c Thu Feb 20 18:11:26 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dirwrite.c,v 1.56 1996/04/29 21:56:21 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dirwrite.c,v 1.58 1997/01/15 19:01:24 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 369,374 **** --- 369,375 ---- TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip) { u_short wc = (u_short) fip->field_writecount; + uint32 wc2; dir->tdir_tag = fip->field_tag; dir->tdir_type = (u_short) fip->field_type; *************** *** 379,388 **** case TIFF_SSHORT: if (wc > 1) { uint16* wp; ! if (wc == (u_short) TIFF_VARIABLE) { TIFFGetField(tif, fip->field_tag, &wc, &wp); ! dir->tdir_count = wc; ! } else TIFFGetField(tif, fip->field_tag, &wp); if (!WRITEF(TIFFWriteShortArray, wp)) return (0); --- 380,388 ---- case TIFF_SSHORT: if (wc > 1) { uint16* wp; ! if (wc == (u_short) TIFF_VARIABLE) TIFFGetField(tif, fip->field_tag, &wc, &wp); ! else TIFFGetField(tif, fip->field_tag, &wp); if (!WRITEF(TIFFWriteShortArray, wp)) return (0); *************** *** 397,406 **** case TIFF_SLONG: if (wc > 1) { uint32* lp; ! if (wc == (u_short) TIFF_VARIABLE) { TIFFGetField(tif, fip->field_tag, &wc, &lp); ! dir->tdir_count = wc; ! } else TIFFGetField(tif, fip->field_tag, &lp); if (!WRITEF(TIFFWriteLongArray, lp)) return (0); --- 397,405 ---- case TIFF_SLONG: if (wc > 1) { uint32* lp; ! if (wc == (u_short) TIFF_VARIABLE) TIFFGetField(tif, fip->field_tag, &wc, &lp); ! else TIFFGetField(tif, fip->field_tag, &lp); if (!WRITEF(TIFFWriteLongArray, lp)) return (0); *************** *** 413,422 **** case TIFF_SRATIONAL: if (wc > 1) { float* fp; ! if (wc == (u_short) TIFF_VARIABLE) { TIFFGetField(tif, fip->field_tag, &wc, &fp); ! dir->tdir_count = wc; ! } else TIFFGetField(tif, fip->field_tag, &fp); if (!WRITEF(TIFFWriteRationalArray, fp)) return (0); --- 412,420 ---- case TIFF_SRATIONAL: if (wc > 1) { float* fp; ! if (wc == (u_short) TIFF_VARIABLE) TIFFGetField(tif, fip->field_tag, &wc, &fp); ! else TIFFGetField(tif, fip->field_tag, &fp); if (!WRITEF(TIFFWriteRationalArray, fp)) return (0); *************** *** 430,439 **** case TIFF_FLOAT: if (wc > 1) { float* fp; ! if (wc == (u_short) TIFF_VARIABLE) { TIFFGetField(tif, fip->field_tag, &wc, &fp); ! dir->tdir_count = wc; ! } else TIFFGetField(tif, fip->field_tag, &fp); if (!WRITEF(TIFFWriteFloatArray, fp)) return (0); --- 428,436 ---- case TIFF_FLOAT: if (wc > 1) { float* fp; ! if (wc == (u_short) TIFF_VARIABLE) TIFFGetField(tif, fip->field_tag, &wc, &fp); ! else TIFFGetField(tif, fip->field_tag, &fp); if (!WRITEF(TIFFWriteFloatArray, fp)) return (0); *************** *** 447,456 **** case TIFF_DOUBLE: if (wc > 1) { double* dp; ! if (wc == (u_short) TIFF_VARIABLE) { TIFFGetField(tif, fip->field_tag, &wc, &dp); ! dir->tdir_count = wc; ! } else TIFFGetField(tif, fip->field_tag, &dp); if (!WRITEF(TIFFWriteDoubleArray, dp)) return (0); --- 444,452 ---- case TIFF_DOUBLE: if (wc > 1) { double* dp; ! if (wc == (u_short) TIFF_VARIABLE) TIFFGetField(tif, fip->field_tag, &wc, &dp); ! else TIFFGetField(tif, fip->field_tag, &dp); if (!WRITEF(TIFFWriteDoubleArray, dp)) return (0); *************** *** 474,479 **** --- 470,478 ---- if (wc == (u_short) TIFF_VARIABLE) { TIFFGetField(tif, fip->field_tag, &wc, &cp); dir->tdir_count = wc; + } else if (wc == (u_short) TIFF_VARIABLE2) { + TIFFGetField(tif, fip->field_tag, &wc2, &cp); + dir->tdir_count = wc2; } else TIFFGetField(tif, fip->field_tag, &cp); if (!TIFFWriteByteArray(tif, dir, cp)) *************** *** 688,694 **** if (type == TIFF_RATIONAL) { TIFFWarning(tif->tif_name, "\"%s\": Information lost writing value (%g) as (unsigned) RATIONAL", ! _TIFFFieldWithTag(tif,tag)->field_name, v); fv = 0; } else fv = -fv, sign = -1; --- 687,693 ---- if (type == TIFF_RATIONAL) { TIFFWarning(tif->tif_name, "\"%s\": Information lost writing value (%g) as (unsigned) RATIONAL", ! _TIFFFieldWithTag(tif,tag)->field_name, fv); fv = 0; } else fv = -fv, sign = -1; EOF-EOF-EOF Patch libtiff/tif_fax3.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_fax3.c Mon Jun 10 15:25:09 1996 --- tiff-v3.4beta036/libtiff/tif_fax3.c Thu Feb 20 18:11:27 1997 *************** *** 1,4 **** ! /* $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 --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_fax3.c,v 1.136 1997/02/20 20:14:39 sam Exp $ */ /* * Copyright (c) 1990-1996 Sam Leffler *************** *** 718,724 **** * and use 150 lpi to avoid problems with units conversion.) */ if (tif->tif_dir.td_resolutionunit == RESUNIT_CENTIMETER) ! res = (res * .3937f) / 2.54f; /* convert to inches */ sp->maxk = (res > 150 ? 4 : 2); sp->k = sp->maxk-1; } else --- 718,724 ---- * and use 150 lpi to avoid problems with units conversion.) */ if (tif->tif_dir.td_resolutionunit == RESUNIT_CENTIMETER) ! res *= 2.54f; /* convert to inches */ sp->maxk = (res > 150 ? 4 : 2); sp->k = sp->maxk-1; } else EOF-EOF-EOF Patch libtiff/tif_fax3.h<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_fax3.h Mon Jun 10 15:25:10 1996 --- tiff-v3.4beta036/libtiff/tif_fax3.h Thu Feb 20 18:11:28 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_fax3.h,v 1.31 1996/06/04 19:04:41 sam Exp $ */ /* * Copyright (c) 1990-1996 Sam Leffler --- 1,4 ---- ! /* $Id: tif_fax3.h,v 1.33 1996/08/22 18:17:39 sam Exp $ */ /* * Copyright (c) 1990-1996 Sam Leffler *************** *** 507,517 **** } \ } \ if (RunLength) { \ ! /* expect a final V0 */ \ ! NeedBits8(1,eof2d); \ ! if (!GetBits(1)) \ ! goto badMain2d; \ ! ClrBits(1); \ SETVAL(0); \ } \ eol2d: \ --- 507,519 ---- } \ } \ if (RunLength) { \ ! if (RunLength + a0 < lastx) { \ ! /* expect a final V0 */ \ ! NeedBits8(1,eof2d); \ ! if (!GetBits(1)) \ ! goto badMain2d; \ ! ClrBits(1); \ ! } \ SETVAL(0); \ } \ eol2d: \ EOF-EOF-EOF Patch libtiff/tif_getimage.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_getimage.c Mon Jun 10 15:25:10 1996 --- tiff-v3.4beta036/libtiff/tif_getimage.c Thu Feb 20 18:11:28 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_getimage.c,v 1.39 1996/01/10 19:33:04 sam Exp $ */ /* * Copyright (c) 1991-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_getimage.c,v 1.41 1997/01/27 23:27:39 sam Exp $ */ /* * Copyright (c) 1991-1996 Sam Leffler *************** *** 1173,1179 **** uint32* cp1 = cp+w+toskew; uint32* cp2 = cp1+w+toskew; uint32* cp3 = cp2+w+toskew; ! u_int incr = 3*w+4*toskew; (void) y; /* XXX adjust fromskew */ --- 1173,1179 ---- uint32* cp1 = cp+w+toskew; uint32* cp2 = cp1+w+toskew; uint32* cp3 = cp2+w+toskew; ! int32 incr = 3*w+4*toskew; (void) y; /* XXX adjust fromskew */ *************** *** 1215,1221 **** { YCbCrSetup; uint32* cp1 = cp+w+toskew; ! u_int incr = 2*toskew+w; (void) y; /* XXX adjust fromskew */ --- 1215,1221 ---- { YCbCrSetup; uint32* cp1 = cp+w+toskew; ! int32 incr = 2*toskew+w; (void) y; /* XXX adjust fromskew */ *************** *** 1277,1283 **** { YCbCrSetup; uint32* cp1 = cp+w+toskew; ! u_int incr = 2*toskew+w; (void) y; /* XXX adjust fromskew */ --- 1277,1283 ---- { YCbCrSetup; uint32* cp1 = cp+w+toskew; ! int32 incr = 2*toskew+w; (void) y; /* XXX adjust fromskew */ *************** *** 1589,1595 **** long i; for (i = (1L<bitspersample)-1; i >= 0; i--) { ! #define CVT(x) ((uint16)(((x) * 255) / ((1L<<16)-1))) r[i] = CVT(r[i]); g[i] = CVT(g[i]); b[i] = CVT(b[i]); --- 1589,1595 ---- long i; for (i = (1L<bitspersample)-1; i >= 0; i--) { ! #define CVT(x) ((uint16)((x)>>8)) r[i] = CVT(r[i]); g[i] = CVT(g[i]); b[i] = CVT(b[i]); EOF-EOF-EOF Patch libtiff/tif_jpeg.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_jpeg.c Mon Jun 10 15:25:11 1996 --- tiff-v3.4beta036/libtiff/tif_jpeg.c Thu Feb 20 18:11:28 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_jpeg.c,v 1.25 1996/01/10 19:33:04 sam Exp $ */ /* * Copyright (c) 1994-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_jpeg.c,v 1.26 1997/01/27 19:36:58 sam Exp $ */ /* * Copyright (c) 1994-1996 Sam Leffler *************** *** 607,613 **** { JPEGState *sp = JState(tif); TIFFDirectory *td = &tif->tif_dir; ! static char module[] = "JPEGPreDecode"; uint32 segment_width, segment_height; int downsampled_output; int ci; --- 607,613 ---- { JPEGState *sp = JState(tif); TIFFDirectory *td = &tif->tif_dir; ! static const char module[] = "JPEGPreDecode"; uint32 segment_width, segment_height; int downsampled_output; int ci; *************** *** 901,907 **** { JPEGState* sp = JState(tif); TIFFDirectory *td = &tif->tif_dir; ! static char module[] = "JPEGSetupEncode"; assert(sp != NULL); assert(!sp->cinfo.comm.is_decompressor); --- 901,907 ---- { JPEGState* sp = JState(tif); TIFFDirectory *td = &tif->tif_dir; ! static const char module[] = "JPEGSetupEncode"; assert(sp != NULL); assert(!sp->cinfo.comm.is_decompressor); *************** *** 1017,1023 **** { JPEGState *sp = JState(tif); TIFFDirectory *td = &tif->tif_dir; ! static char module[] = "JPEGPreEncode"; uint32 segment_width, segment_height; int downsampled_input; --- 1017,1023 ---- { JPEGState *sp = JState(tif); TIFFDirectory *td = &tif->tif_dir; ! static const char module[] = "JPEGPreEncode"; uint32 segment_width, segment_height; int downsampled_input; EOF-EOF-EOF Patch libtiff/tif_lzw.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_lzw.c Mon Jun 10 15:25:11 1996 --- tiff-v3.4beta036/libtiff/tif_lzw.c Thu Feb 20 18:11:29 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_lzw.c,v 1.70 1996/01/10 19:33:05 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_lzw.c,v 1.72 1997/01/27 19:36:58 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 191,197 **** LZWSetupDecode(TIFF* tif) { LZWDecodeState* sp = DecoderState(tif); ! static char module[] = " LZWSetupDecode"; int code; assert(sp != NULL); --- 191,197 ---- LZWSetupDecode(TIFF* tif) { LZWDecodeState* sp = DecoderState(tif); ! static const char module[] = " LZWSetupDecode"; int code; assert(sp != NULL); *************** *** 644,650 **** LZWSetupEncode(TIFF* tif) { LZWEncodeState* sp = EncoderState(tif); ! static char module[] = "LZWSetupEncode"; assert(sp != NULL); sp->enc_hashtab = (hash_t*) _TIFFmalloc(HSIZE*sizeof (hash_t)); --- 644,650 ---- LZWSetupEncode(TIFF* tif) { LZWEncodeState* sp = EncoderState(tif); ! static const char module[] = "LZWSetupEncode"; assert(sp != NULL); sp->enc_hashtab = (hash_t*) _TIFFmalloc(HSIZE*sizeof (hash_t)); *************** *** 782,791 **** if (h == 0) disp = 1; do { - #ifndef _WINDOWS - if ((hp -= disp) < sp->enc_hashtab) - hp += HSIZE; - #else /* * Avoid pointer arithmetic 'cuz of * wraparound problems with segments. --- 782,787 ---- *************** *** 793,799 **** if ((h -= disp) < 0) h += HSIZE; hp = &sp->enc_hashtab[h]; - #endif if (hp->hash == fcode) { ent = hp->code; goto hit; --- 789,794 ---- EOF-EOF-EOF Patch libtiff/tif_open.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_open.c Mon Jun 10 15:25:12 1996 --- tiff-v3.4beta036/libtiff/tif_open.c Thu Feb 20 18:11:29 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_open.c,v 1.63 1996/01/10 19:33:07 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_open.c,v 1.65 1997/01/27 23:05:36 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 152,158 **** tif->tif_curdir = (tdir_t) -1; /* non-existent directory */ tif->tif_curoff = 0; tif->tif_curstrip = (tstrip_t) -1; /* invalid strip */ ! tif->tif_row = (uint32)-1; /* read/write pre-increment */ tif->tif_clientdata = clientdata; tif->tif_readproc = readproc; tif->tif_writeproc = writeproc; --- 152,158 ---- tif->tif_curdir = (tdir_t) -1; /* non-existent directory */ tif->tif_curoff = 0; tif->tif_curstrip = (tstrip_t) -1; /* invalid strip */ ! tif->tif_row = (uint32) -1; /* read/write pre-increment */ tif->tif_clientdata = clientdata; tif->tif_readproc = readproc; tif->tif_writeproc = writeproc; *************** *** 161,166 **** --- 161,167 ---- tif->tif_sizeproc = sizeproc; tif->tif_mapproc = mapproc; tif->tif_unmapproc = unmapproc; + _TIFFSetDefaultCompressionState(tif); /* setup default state */ /* * Default is to return data MSB2LSB and enable the * use of memory-mapped files and strip chopping when *************** *** 168,174 **** */ tif->tif_flags = FILLORDER_MSB2LSB; if (m == O_RDONLY) ! tif->tif_flags |= TIFF_MAPPED|TIFF_STRIPCHOP; { union { int32 i; char c[4]; } u; u.i = 1; bigendian = u.c[0] == 0; } /* --- 169,179 ---- */ tif->tif_flags = FILLORDER_MSB2LSB; if (m == O_RDONLY) ! #ifdef STRIPCHOP_DEFAULT ! tif->tif_flags |= TIFF_MAPPED|STRIPCHOP_DEFAULT; ! #else ! tif->tif_flags |= TIFF_MAPPED; ! #endif { union { int32 i; char c[4]; } u; u.i = 1; bigendian = u.c[0] == 0; } /* *************** *** 250,256 **** if (m == O_RDONLY) tif->tif_flags &= ~TIFF_MAPPED; break; - #ifdef STRIPCHOP_SUPPORT case 'C': if (m == O_RDONLY) tif->tif_flags |= TIFF_STRIPCHOP; --- 255,260 ---- *************** *** 259,265 **** if (m == O_RDONLY) tif->tif_flags &= ~TIFF_STRIPCHOP; break; - #endif } /* * Read in TIFF header. --- 263,268 ---- EOF-EOF-EOF Patch libtiff/tif_pixarlog.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_pixarlog.c Mon Jun 10 15:25:13 1996 --- tiff-v3.4beta036/libtiff/tif_pixarlog.c Thu Feb 20 18:11:30 1997 *************** *** 637,643 **** { TIFFDirectory *td = &tif->tif_dir; PixarLogState* sp = DecoderState(tif); ! static char module[] = "PixarLogSetupDecode"; assert(sp != NULL); --- 637,643 ---- { TIFFDirectory *td = &tif->tif_dir; PixarLogState* sp = DecoderState(tif); ! static const char module[] = "PixarLogSetupDecode"; assert(sp != NULL); *************** *** 690,696 **** { TIFFDirectory *td = &tif->tif_dir; PixarLogState* sp = DecoderState(tif); ! static char module[] = "PixarLogDecode"; int i, nsamples, llen; uint16 *up; --- 690,696 ---- { TIFFDirectory *td = &tif->tif_dir; PixarLogState* sp = DecoderState(tif); ! static const char module[] = "PixarLogDecode"; int i, nsamples, llen; uint16 *up; *************** *** 801,807 **** { TIFFDirectory *td = &tif->tif_dir; PixarLogState* sp = EncoderState(tif); ! static char module[] = "PixarLogSetupEncode"; assert(sp != NULL); --- 801,807 ---- { TIFFDirectory *td = &tif->tif_dir; PixarLogState* sp = EncoderState(tif); ! static const char module[] = "PixarLogSetupEncode"; assert(sp != NULL); *************** *** 1012,1018 **** { TIFFDirectory *td = &tif->tif_dir; PixarLogState *sp = EncoderState(tif); ! static char module[] = "PixarLogEncode"; int i, n, llen; unsigned short * up; --- 1012,1018 ---- { TIFFDirectory *td = &tif->tif_dir; PixarLogState *sp = EncoderState(tif); ! static const char module[] = "PixarLogEncode"; int i, n, llen; unsigned short * up; *************** *** 1093,1099 **** PixarLogPostEncode(TIFF* tif) { PixarLogState *sp = EncoderState(tif); ! static char module[] = "PixarLogPostEncode"; int state; sp->stream.avail_in = 0; --- 1093,1099 ---- PixarLogPostEncode(TIFF* tif) { PixarLogState *sp = EncoderState(tif); ! static const char module[] = "PixarLogPostEncode"; int state; sp->stream.avail_in = 0; *************** *** 1162,1168 **** { PixarLogState *sp = (PixarLogState *)tif->tif_data; int result; ! static char module[] = "PixarLogVSetField"; switch (tag) { case TIFFTAG_PIXARLOGQUALITY: --- 1162,1168 ---- { PixarLogState *sp = (PixarLogState *)tif->tif_data; int result; ! static const char module[] = "PixarLogVSetField"; switch (tag) { case TIFFTAG_PIXARLOGQUALITY: EOF-EOF-EOF Patch libtiff/tif_print.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_print.c Mon Jun 10 15:25:14 1996 --- tiff-v3.4beta036/libtiff/tif_print.c Thu Feb 20 18:11:31 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_print.c,v 1.67 1996/02/16 05:54:21 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_print.c,v 1.69 1996/12/13 05:25:39 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 213,224 **** fprintf(fd, " Ink Names: "); i = td->td_samplesperpixel; sep = ""; ! for (cp = td->td_inknames; i > 0; cp = strchr(cp, '\0')) { fprintf(fd, "%s", sep); _TIFFprintAscii(fd, cp); sep = ", "; } } if (TIFFFieldSet(tif,FIELD_DOTRANGE)) fprintf(fd, " Dot Range: %u-%u\n", td->td_dotrange[0], td->td_dotrange[1]); --- 213,226 ---- fprintf(fd, " Ink Names: "); i = td->td_samplesperpixel; sep = ""; ! for (cp = td->td_inknames; i > 0; cp = strchr(cp,'\0')+1, i--) { fprintf(fd, "%s", sep); _TIFFprintAscii(fd, cp); sep = ", "; } } + if (TIFFFieldSet(tif,FIELD_NUMBEROFINKS)) + fprintf(fd, " Number of Inks: %u\n", td->td_ninks); if (TIFFFieldSet(tif,FIELD_DOTRANGE)) fprintf(fd, " Dot Range: %u-%u\n", td->td_dotrange[0], td->td_dotrange[1]); *************** *** 396,401 **** --- 398,408 ---- } else fprintf(fd, "(present)\n"); } + #endif + #ifdef ICC_SUPPORT + if (TIFFFieldSet(tif,FIELD_ICCPROFILE)) + fprintf(fd, " ICC Profile: , %lu bytes\n", + (u_long) td->td_profileLength); #endif #if SUBIFD_SUPPORT if (TIFFFieldSet(tif, FIELD_SUBIFD)) { EOF-EOF-EOF Patch libtiff/tif_read.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_read.c Mon Jun 10 15:25:15 1996 --- tiff-v3.4beta036/libtiff/tif_read.c Thu Feb 20 18:11:31 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_read.c,v 1.70 1996/01/10 19:33:11 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_read.c,v 1.71 1996/07/18 22:48:25 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 157,162 **** --- 157,164 ---- TIFFDirectory *td = &tif->tif_dir; if (!isMapped(tif)) { + tsize_t cc; + if (!SeekOK(tif, td->td_stripoffset[strip])) { TIFFError(module, "%s: Seek error at scanline %lu, strip %lu", *************** *** 164,180 **** (u_long) tif->tif_row, (u_long) strip); return (-1); } ! if (!ReadOK(tif, buf, size)) { ! TIFFError(module, "%s: Read error at scanline %lu", ! tif->tif_name, (u_long) tif->tif_row); return (-1); } } else { if (td->td_stripoffset[strip] + size > tif->tif_size) { TIFFError(module, ! "%s: Seek error at scanline %lu, strip %lu", tif->tif_name, ! (u_long) tif->tif_row, (u_long) strip); return (-1); } _TIFFmemcpy(buf, tif->tif_base + td->td_stripoffset[strip], size); --- 166,190 ---- (u_long) tif->tif_row, (u_long) strip); return (-1); } ! cc = TIFFReadFile(tif, buf, size); ! if (cc != size) { ! TIFFError(module, ! "%s: Read error at scanline %lu; got %lu bytes, expected %lu", ! tif->tif_name, ! (u_long) tif->tif_row, ! (u_long) cc, ! (u_long) size); return (-1); } } else { if (td->td_stripoffset[strip] + size > tif->tif_size) { TIFFError(module, ! "%s: Read error at scanline %lu, strip %lu; got %lu bytes, expected %lu", tif->tif_name, ! (u_long) tif->tif_row, ! (u_long) strip, ! (u_long) tif->tif_size - td->td_stripoffset[strip], ! (u_long) size); return (-1); } _TIFFmemcpy(buf, tif->tif_base + td->td_stripoffset[strip], size); *************** *** 251,258 **** * This error message might seem strange, but it's * what would happen if a read were done instead. */ ! TIFFError(module, "%s: Read error on strip %lu", ! tif->tif_name, (u_long) strip); tif->tif_curstrip = NOSTRIP; return (0); } --- 261,272 ---- * This error message might seem strange, but it's * what would happen if a read were done instead. */ ! TIFFError(module, ! "%s: Read error on strip %lu; got %lu bytes, expected %lu", ! tif->tif_name, ! (u_long) strip, ! (u_long) tif->tif_size - td->td_stripoffset[strip], ! (u_long) bytecount); tif->tif_curstrip = NOSTRIP; return (0); } *************** *** 342,347 **** --- 356,363 ---- TIFFDirectory *td = &tif->tif_dir; if (!isMapped(tif)) { + tsize_t cc; + if (!SeekOK(tif, td->td_stripoffset[tile])) { TIFFError(module, "%s: Seek error at row %ld, col %ld, tile %ld", *************** *** 351,371 **** (long) tile); return ((tsize_t) -1); } ! if (!ReadOK(tif, buf, size)) { ! TIFFError(module, "%s: Read error at row %ld, col %ld", tif->tif_name, (long) tif->tif_row, ! (long) tif->tif_col); return ((tsize_t) -1); } } else { if (td->td_stripoffset[tile] + size > tif->tif_size) { TIFFError(module, ! "%s: Seek error at row %ld, col %ld, tile %ld", tif->tif_name, (long) tif->tif_row, (long) tif->tif_col, ! (long) tile); return ((tsize_t) -1); } _TIFFmemcpy(buf, tif->tif_base + td->td_stripoffset[tile], size); --- 367,393 ---- (long) tile); return ((tsize_t) -1); } ! cc = TIFFReadFile(tif, buf, size); ! if (cc != size) { ! TIFFError(module, ! "%s: Read error at row %ld, col %ld; got %lu bytes, expected %lu", tif->tif_name, (long) tif->tif_row, ! (long) tif->tif_col, ! (u_long) cc, ! (u_long) size); return ((tsize_t) -1); } } else { if (td->td_stripoffset[tile] + size > tif->tif_size) { TIFFError(module, ! "%s: Read error at row %ld, col %ld, tile %ld; got %lu bytes, expected %lu", tif->tif_name, (long) tif->tif_row, (long) tif->tif_col, ! (long) tile, ! (u_long) tif->tif_size - td->td_stripoffset[tile], ! (u_long) size); return ((tsize_t) -1); } _TIFFmemcpy(buf, tif->tif_base + td->td_stripoffset[tile], size); EOF-EOF-EOF Patch libtiff/tif_zip.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tif_zip.c Mon Jun 10 15:25:19 1996 --- tiff-v3.4beta036/libtiff/tif_zip.c Thu Feb 20 18:11:34 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_zip.c,v 1.8 1996/03/07 17:00:23 sam Exp $ */ /* * Copyright (c) 1995-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_zip.c,v 1.9 1997/01/27 19:36:58 sam Exp $ */ /* * Copyright (c) 1995-1996 Sam Leffler *************** *** 88,94 **** ZIPSetupDecode(TIFF* tif) { ZIPState* sp = DecoderState(tif); ! static char module[] = "ZIPSetupDecode"; assert(sp != NULL); if (inflateInit(&sp->stream) != Z_OK) { --- 88,94 ---- ZIPSetupDecode(TIFF* tif) { ZIPState* sp = DecoderState(tif); ! static const char module[] = "ZIPSetupDecode"; assert(sp != NULL); if (inflateInit(&sp->stream) != Z_OK) { *************** *** 119,125 **** ZIPDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s) { ZIPState* sp = DecoderState(tif); ! static char module[] = "ZIPDecode"; (void) s; assert(sp != NULL); --- 119,125 ---- ZIPDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s) { ZIPState* sp = DecoderState(tif); ! static const char module[] = "ZIPDecode"; (void) s; assert(sp != NULL); *************** *** 156,162 **** ZIPSetupEncode(TIFF* tif) { ZIPState* sp = EncoderState(tif); ! static char module[] = "ZIPSetupEncode"; assert(sp != NULL); if (deflateInit(&sp->stream, sp->zipquality) != Z_OK) { --- 156,162 ---- ZIPSetupEncode(TIFF* tif) { ZIPState* sp = EncoderState(tif); ! static const char module[] = "ZIPSetupEncode"; assert(sp != NULL); if (deflateInit(&sp->stream, sp->zipquality) != Z_OK) { *************** *** 190,196 **** ZIPEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) { ZIPState *sp = EncoderState(tif); ! static char module[] = "ZIPEncode"; (void) s; sp->stream.next_in = bp; --- 190,196 ---- ZIPEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) { ZIPState *sp = EncoderState(tif); ! static const char module[] = "ZIPEncode"; (void) s; sp->stream.next_in = bp; *************** *** 219,225 **** ZIPPostEncode(TIFF* tif) { ZIPState *sp = EncoderState(tif); ! static char module[] = "ZIPPostEncode"; int state; sp->stream.avail_in = 0; --- 219,225 ---- ZIPPostEncode(TIFF* tif) { ZIPState *sp = EncoderState(tif); ! static const char module[] = "ZIPPostEncode"; int state; sp->stream.avail_in = 0; *************** *** 263,269 **** ZIPVSetField(TIFF* tif, ttag_t tag, va_list ap) { ZIPState* sp = ZState(tif); ! static char module[] = "ZIPVSetField"; switch (tag) { case TIFFTAG_ZIPQUALITY: --- 263,269 ---- ZIPVSetField(TIFF* tif, ttag_t tag, va_list ap) { ZIPState* sp = ZState(tif); ! static const char module[] = "ZIPVSetField"; switch (tag) { case TIFFTAG_ZIPQUALITY: EOF-EOF-EOF Patch libtiff/tiff.h<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tiff.h Mon Jun 10 15:25:01 1996 --- tiff-v3.4beta036/libtiff/tiff.h Thu Feb 20 18:11:21 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tiff.h,v 1.72 1996/05/10 14:43:54 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tiff.h,v 1.75 1996/12/13 05:25:39 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 257,262 **** --- 257,263 ---- #define TIFFTAG_INKSET 332 /* !inks in separated image */ #define INKSET_CMYK 1 /* !cyan-magenta-yellow-black */ #define TIFFTAG_INKNAMES 333 /* !ascii names of inks */ + #define TIFFTAG_NUMBEROFINKS 334 /* !number of inks */ #define TIFFTAG_DOTRANGE 336 /* !0% and 100% dot codes */ #define TIFFTAG_TARGETPRINTER 337 /* !separation target */ #define TIFFTAG_EXTRASAMPLES 338 /* !info about extra samples */ *************** *** 333,338 **** --- 334,341 ---- #define TIFFTAG_IT8COLORCHARACTERIZATION 34029 /* color character. table */ /* tags 34232-34236 are private tags registered to Texas Instruments */ #define TIFFTAG_FRAMECOUNT 34232 /* Sequence Frame Count */ + /* tag 34750 is a private tag registered to Adobe? */ + #define TIFFTAG_ICCPROFILE 34675 /* ICC profile data */ /* tag 34750 is a private tag registered to Pixel Magic */ #define TIFFTAG_JBIGOPTIONS 34750 /* JBIG options */ /* tags 34908-34914 are private tags registered to SGI */ *************** *** 397,400 **** --- 400,405 ---- /* Note: quality level is on the ZLIB 1-9 scale. Default value is -1 */ #define TIFFTAG_ZIPQUALITY 65557 /* compression quality level */ #define TIFFTAG_PIXARLOGQUALITY 65558 /* PixarLog uses same scale */ + /* 65559 is allocated to Oceana Matrix */ + #define TIFFTAG_DCSCLIPRECTANGLE 65559 /* area of image to acquire */ #endif /* _TIFF_ */ EOF-EOF-EOF Patch libtiff/tiffconf.h<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tiffconf.h Mon Jun 10 15:25:02 1996 --- tiff-v3.4beta036/libtiff/tiffconf.h Thu Feb 20 18:11:22 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffconf.h,v 1.13 1996/04/05 17:36:53 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffconf.h,v 1.15 1997/01/27 23:05:36 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 69,78 **** --- 69,80 ---- * COLORIMETRY_SUPPORT enable support for 6.0 colorimetry tags * YCBCR_SUPPORT enable support for 6.0 YCbCr tags * CMYK_SUPPORT enable support for 6.0 CMYK tags + * ICC_SUPPORT enable support for ICC profile tag */ #define COLORIMETRY_SUPPORT #define YCBCR_SUPPORT #define CMYK_SUPPORT + #define ICC_SUPPORT #endif /* FEATURE_SUPPORT */ #ifndef COMPRESSION_SUPPORT *************** *** 115,126 **** /* * ``Orthogonal Features'' * ! * STRIPCHOP_SUPPORT automatically convert single-strip uncompressed images ! * to mutiple strips of ~8Kb (for reducing memory use) * SUBIFD_SUPPORT enable support for SubIFD tag (thumbnails and such) */ ! #ifndef STRIPCHOP_SUPPORT ! #define STRIPCHOP_SUPPORT 1 /* enable strip chopping */ #endif #ifndef SUBIFD_SUPPORT #define SUBIFD_SUPPORT 1 /* enable SubIFD tag (330) support */ --- 117,129 ---- /* * ``Orthogonal Features'' * ! * STRIPCHOP_DEFAULT default handling of strip chopping support (whether ! * or not to convert single-strip uncompressed images ! * to mutiple strips of ~8Kb--to reduce memory use) * SUBIFD_SUPPORT enable support for SubIFD tag (thumbnails and such) */ ! #ifndef STRIPCHOP_DEFAULT ! #define STRIPCHOP_DEFAULT TIFF_STRIPCHOP /* default is to enable */ #endif #ifndef SUBIFD_SUPPORT #define SUBIFD_SUPPORT 1 /* enable SubIFD tag (330) support */ EOF-EOF-EOF Patch libtiff/tiffio.h<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tiffio.h Mon Jun 10 15:25:02 1996 --- tiff-v3.4beta036/libtiff/tiffio.h Thu Feb 20 18:11:22 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffio.h,v 1.94 1996/06/04 19:04:41 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffio.h,v 1.95 1997/01/27 23:05:10 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 39,45 **** * version checking should be done based on the * string returned by TIFFGetVersion. */ ! #define TIFFLIB_VERSION 19960307 /* March 7, 1996 */ /* * TIFF is defined as an incomplete type to hide the --- 39,45 ---- * version checking should be done based on the * string returned by TIFFGetVersion. */ ! #define TIFFLIB_VERSION 19970127 /* January 27, 1997 */ /* * TIFF is defined as an incomplete type to hide the *************** *** 52,58 **** * data types used in the *exported* interfaces. These * definitions depend on the proper definition of types * in tiff.h. Note also that the varargs interface used ! * pass tag types and values uses the types defined in * tiff.h directly. * * NB: ttag_t is unsigned int and not unsigned short because --- 52,58 ---- * data types used in the *exported* interfaces. These * definitions depend on the proper definition of types * in tiff.h. Note also that the varargs interface used ! * to pass tag types and values uses the types defined in * tiff.h directly. * * NB: ttag_t is unsigned int and not unsigned short because *************** *** 71,76 **** --- 71,82 ---- typedef uint32 tstrip_t; /* strip number */ typedef uint32 ttile_t; /* tile number */ typedef int32 tsize_t; /* i/o size in bytes */ + typedef void* tdata_t; /* image data ref */ + typedef int32 toff_t; /* file offset */ + + #if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32)) + #define __WIN32__ + #endif #if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows) #include #ifdef __WIN32__ *************** *** 81,88 **** #else typedef void* thandle_t; /* client data handle */ #endif - typedef void* tdata_t; /* image data ref */ - typedef int32 toff_t; /* file offset */ #ifndef NULL #define NULL 0 --- 87,92 ---- EOF-EOF-EOF Patch libtiff/tiffiop.h<<'EOF-EOF-EOF' *** tiff-v3.4beta035/libtiff/tiffiop.h Mon Jun 10 15:25:03 1996 --- tiff-v3.4beta036/libtiff/tiffiop.h Thu Feb 20 18:11:22 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffiop.h,v 1.80 1996/04/05 17:36:53 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffiop.h,v 1.81 1997/01/27 19:09:09 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 227,232 **** --- 227,233 ---- extern void TIFFFreeDirectory(TIFF*); extern int TIFFDefaultDirectory(TIFF*); extern int TIFFSetCompressionScheme(TIFF*, int); + extern int TIFFSetDefaultCompressionState(TIFF*); extern uint32 _TIFFDefaultStripSize(TIFF*, uint32); extern void _TIFFDefaultTileSize(TIFF*, uint32*, uint32*); EOF-EOF-EOF Patch man/TIFFGetField.3t<<'EOF-EOF-EOF' *** tiff-v3.4beta035/man/TIFFGetField.3t Mon Jun 10 15:25:40 1996 --- tiff-v3.4beta036/man/TIFFGetField.3t Thu Feb 20 18:11:50 1997 *************** *** 1,4 **** ! .\" $Header: /usr/people/sam/tiff/man/RCS/TIFFGetField.3t,v 1.16 1995/10/11 19:45:29 sam Exp $ .\" .\" Copyright (c) 1988-1995 Sam Leffler .\" Copyright (c) 1991-1995 Silicon Graphics, Inc. --- 1,4 ---- ! .\" $Header: /usr/people/sam/tiff/man/RCS/TIFFGetField.3t,v 1.17 1996/12/13 05:25:58 sam Exp $ .\" .\" Copyright (c) 1988-1995 Sam Leffler .\" Copyright (c) 1991-1995 Silicon Graphics, Inc. *************** *** 179,189 **** --- 179,195 ---- TIFFTAG_YCBCRSUBSAMPLING 2 uint16* TIFFTAG_YPOSITION 1 float* TIFFTAG_YRESOLUTION 1 float* + TIFFTAG_ICCPROFILE 2 uint32*,void** count, profile data\(dd .fi \(dg If .I SamplesPerPixel is one, then a single array is returned; otherwise three arrays are returned. + .fi + \(dd The contents of this field are quite complex. See + .IR "The ICC Profile Format Specification" , + Annex B.3 "Embedding ICC Profiles in TIFF Files" + (available at http://www.color.org) for an explanation. .SH "RETURN VALUES" 1 is returned if the tag is defined in the current directory; otherwise a 0 is returned. EOF-EOF-EOF Patch man/TIFFOpen.3t<<'EOF-EOF-EOF' *** tiff-v3.4beta035/man/TIFFOpen.3t Mon Jun 10 15:25:40 1996 --- tiff-v3.4beta036/man/TIFFOpen.3t Thu Feb 20 18:11:50 1997 *************** *** 1,4 **** ! .\" $Header: /usr/people/sam/tiff/man/RCS/TIFFOpen.3t,v 1.14 1996/01/09 22:45:06 sam Exp $ .\" .\" Copyright (c) 1988-1995 Sam Leffler .\" Copyright (c) 1991-1995 Silicon Graphics, Inc. --- 1,4 ---- ! .\" $Header: /usr/people/sam/tiff/man/RCS/TIFFOpen.3t,v 1.15 1997/01/27 23:46:06 sam Exp $ .\" .\" Copyright (c) 1988-1995 Sam Leffler .\" Copyright (c) 1991-1995 Silicon Graphics, Inc. *************** *** 186,203 **** Enable the use of ``strip chopping'' when reading images that are comprised of a single strip or tile of uncompressed data. Strip chopping is a mechanism by which the library will automatically ! convert the single-strip [-tile] image to multiple strips [tiles], each of which has about 8 Kilobytes of data. This facility can be useful in reducing the amount of memory used ! to read an image because the library normally reads each strip [tile] in its entirety. Strip chopping does however alter the apparent contents of the image because when an image is divided into multiple strips it looks as though the underlying file contains multiple separate ! strips [tiles]. ! Finally, note that strip chopping is an optional compile-time ! feature of the library; just because its use is enabled by an ! application does not mean that it may be present in the library. .TP .B c Disable the use of strip chopping when reading images. --- 186,204 ---- Enable the use of ``strip chopping'' when reading images that are comprised of a single strip or tile of uncompressed data. Strip chopping is a mechanism by which the library will automatically ! convert the single-strip image to multiple strips, each of which has about 8 Kilobytes of data. This facility can be useful in reducing the amount of memory used ! to read an image because the library normally reads each strip in its entirety. Strip chopping does however alter the apparent contents of the image because when an image is divided into multiple strips it looks as though the underlying file contains multiple separate ! strips. ! Finally, note that default handling of strip chopping is a compile-time ! configuration parameter. ! The default behaviour, for backwards compatibility, is to enable ! strip chopping. .TP .B c Disable the use of strip chopping when reading images. EOF-EOF-EOF Patch man/TIFFSetField.3t<<'EOF-EOF-EOF' *** tiff-v3.4beta035/man/TIFFSetField.3t Mon Jun 10 15:25:45 1996 --- tiff-v3.4beta036/man/TIFFSetField.3t Thu Feb 20 18:11:53 1997 *************** *** 1,4 **** ! .\" $Header: /usr/people/sam/tiff/man/RCS/TIFFSetField.3t,v 1.15 1995/10/11 19:45:29 sam Exp $ .\" .\" Copyright (c) 1988-1995 Sam Leffler .\" Copyright (c) 1991-1995 Silicon Graphics, Inc. --- 1,4 ---- ! .\" $Header: /usr/people/sam/tiff/man/RCS/TIFFSetField.3t,v 1.16 1996/12/13 05:25:58 sam Exp $ .\" .\" Copyright (c) 1988-1995 Sam Leffler .\" Copyright (c) 1991-1995 Silicon Graphics, Inc. *************** *** 89,94 **** --- 89,97 ---- is an unsigned 32-bit value; .I uint16* is an array of unsigned 16-bit values. + .I void* + is an array of data values of unspecified type. + Consult the .SM TIFF specification for information on the meaning of each tag. *************** *** 161,175 **** --- 164,186 ---- TIFFTAG_YCBCRSAMPLING 2 uint16 \(dg TIFFTAG_YPOSITION 1 float TIFFTAG_YRESOLUTION 1 float + TIFFTAG_ICCPROFILE 2 uint32,void* count, profile data* .fi .sp 5p \(dg Tag may not have its values changed once data is written. .br + .fi \(dd If .I SamplesPerPixel is one, then a single array is passed; otherwise three arrays should be passed. + .fi + * The contents of this field are quite complex. See + .IR "The ICC Profile Format Specification" , + Annex B.3 "Embedding ICC Profiles in TIFF Files" + (available at http://www.color.org) for an explanation. + .br .SH "RETURN VALUES" 1 is returned if the tag is defined in the current directory; otherwise a 0 is returned. EOF-EOF-EOF Patch man/libtiff.3t<<'EOF-EOF-EOF' *** tiff-v3.4beta035/man/libtiff.3t Mon Jun 10 15:25:47 1996 --- tiff-v3.4beta036/man/libtiff.3t Thu Feb 20 18:11:55 1997 *************** *** 1,4 **** ! .\" $Header: /usr/people/sam/tiff/man/RCS/libtiff.3t,v 1.22 1996/01/09 22:47:08 sam Exp $ .\" .\" Copyright (c) 1988-1995 Sam Leffler .\" Copyright (c) 1991-1995 Silicon Graphics, Inc. --- 1,4 ---- ! .\" $Header: /usr/people/sam/tiff/man/RCS/libtiff.3t,v 1.23 1996/08/01 19:10:20 sam Exp $ .\" .\" Copyright (c) 1988-1995 Sam Leffler .\" Copyright (c) 1991-1995 Silicon Graphics, Inc. *************** *** 23,29 **** .\" OF THIS SOFTWARE. .\" .if n .po 0 ! .TH INTRO 3T "October 15, 1995" .SH NAME libtiff \- introduction to .IR libtiff , --- 23,29 ---- .\" OF THIS SOFTWARE. .\" .if n .po 0 ! .TH INTRO 3T "August 1, 1996" .SH NAME libtiff \- introduction to .IR libtiff , *************** *** 285,290 **** --- 285,291 ---- MinSampleValue 280 R/W Model 272 R/W NewSubFileType 254 R/W called SubFileType in spec + NumberOfInks 334 R/W Orientation 274 R/W PageName 285 R/W PageNumber 297 R/W EOF-EOF-EOF Patch man/tiff2ps.1<<'EOF-EOF-EOF' *** tiff-v3.4beta035/man/tiff2ps.1 Mon Jun 10 15:25:35 1996 --- tiff-v3.4beta036/man/tiff2ps.1 Thu Feb 20 18:11:46 1997 *************** *** 1,4 **** ! .\" $Header: /usr/people/sam/tiff/man/RCS/tiff2ps.1,v 1.18 1995/10/11 19:42:04 sam Exp $ .\" .\" Copyright (c) 1988-1995 Sam Leffler .\" Copyright (c) 1991-1995 Silicon Graphics, Inc. --- 1,4 ---- ! .\" $Header: /usr/people/sam/tiff/man/RCS/tiff2ps.1,v 1.19 1997/01/27 23:48:56 sam Exp $ .\" .\" Copyright (c) 1988-1995 Sam Leffler .\" Copyright (c) 1991-1995 Silicon Graphics, Inc. *************** *** 23,33 **** .\" OF THIS SOFTWARE. .\" .if n .po 0 ! .TH TIFF2PS 1 "October 15, 1995" .SH NAME tiff2ps \- convert a .SM TIFF ! image to PostScript\(tm .SH SYNOPSIS .B tiff2ps [ --- 23,34 ---- .\" OF THIS SOFTWARE. .\" .if n .po 0 ! .ds Ps P\s-2OST\s+2S\s-2CRIPT\s+2 ! .TH TIFF2PS 1 "January 27, 1997" .SH NAME tiff2ps \- convert a .SM TIFF ! image to \*(Ps\(tm .SH SYNOPSIS .B tiff2ps [ *************** *** 38,54 **** .I tiff2ps reads .SM TIFF ! images and writes PostScript or Encapsulated PostScript (EPS) on the standard output. By default, .I tiff2ps ! writes Encapsulated PostScript for the first image in the specified .SM TIFF image file. .PP By default, .I tiff2ps ! will generate PostScript that fills a printed area specified by the .SM TIFF tags in the input file. --- 39,55 ---- .I tiff2ps reads .SM TIFF ! images and writes \*(Ps or Encapsulated \*(Ps (EPS) on the standard output. By default, .I tiff2ps ! writes Encapsulated \*(Ps for the first image in the specified .SM TIFF image file. .PP By default, .I tiff2ps ! will generate \*(Ps that fills a printed area specified by the .SM TIFF tags in the input file. *************** *** 67,73 **** .SM TIFF tags. .PP ! The PostScript generated for .SM RGB, palette, and .SM CMYK --- 68,74 ---- .SM TIFF tags. .PP ! The \*(Ps generated for .SM RGB, palette, and .SM CMYK *************** *** 74,80 **** images uses the .I colorimage operator. ! The PostScript generated for greyscale and bilevel images uses the .I image --- 75,81 ---- images uses the .I colorimage operator. ! The \*(Ps generated for greyscale and bilevel images uses the .I image *************** *** 81,88 **** operator. When the .I colorimage ! operator is used, PostScript code to emulate this operator ! on older PostScript printers is also generated. Note that this emulation code can be very slow. .PP Color images with associated alpha data are composited over --- 82,89 ---- operator. When the .I colorimage ! operator is used, \*(Ps code to emulate this operator ! on older \*(Ps printers is also generated. Note that this emulation code can be very slow. .PP Color images with associated alpha data are composited over *************** *** 90,99 **** .SH OPTIONS .TP .B \-1 ! Generate PostScript Level I (the default). .TP .B \-2 ! Generate PostScript Level II. .TP .B \-a Generate output for all IFDs (pages) in the input file. --- 91,100 ---- .SH OPTIONS .TP .B \-1 ! Generate \*(Ps Level I (the default). .TP .B \-2 ! Generate \*(Ps Level II. .TP .B \-a Generate output for all IFDs (pages) in the input file. *************** *** 107,113 **** multi-page (e.g. facsimile) file. .TP .B \-e ! Force the generation of Encapsulated PostScript. .TP .B \-h Specify the vertical size of the printed area (in inches). --- 108,114 ---- multi-page (e.g. facsimile) file. .TP .B \-e ! Force the generation of Encapsulated \*(Ps. .TP .B \-h Specify the vertical size of the printed area (in inches). *************** *** 122,128 **** like which are hidden using the SubIFD tag. .TP .B \-p ! Force the generation of (non-Encapsulated) PostScript. .TP .B \-s Generate output for a single IFD (page) in the input file. --- 123,129 ---- like which are hidden using the SubIFD tag. .TP .B \-p ! Force the generation of (non-Encapsulated) \*(Ps. .TP .B \-s Generate output for a single IFD (page) in the input file. *************** *** 129,136 **** .TP .B \-w Specify the horizontal size of the printed area (in inches). .SH EXAMPLES ! The following generates PostScript Level II for all pages of a facsimile: .RS .nf tiff2ps -a2 fax.tif | lpr --- 130,146 ---- .TP .B \-w Specify the horizontal size of the printed area (in inches). + .TP + .B \-z + When generating \*(Ps Level II, data is scaled so that it does not + image into the + .I deadzone + on a page (the outer margin that the printing device is unable to mark). + This option suppresses this behaviour. + When \*(Ps Level I is generated, data is imaged to the entire printed + page and this option has no affect. .SH EXAMPLES ! The following generates \*(Ps Level II for all pages of a facsimile: .RS .nf tiff2ps -a2 fax.tif | lpr *************** *** 139,145 **** Note also that if you have version 2.6.1 or newer of Ghostscript then you can efficiently preview facsimile generated with the above command. .PP ! To generate Encapsulated PostScript for a the image at directory 2 of an image use: .RS .nf --- 149,155 ---- Note also that if you have version 2.6.1 or newer of Ghostscript then you can efficiently preview facsimile generated with the above command. .PP ! To generate Encapsulated \*(Ps for a the image at directory 2 of an image use: .RS .nf *************** *** 148,155 **** .RE (notice that directories are numbered starting at zero.) .SH BUGS ! Because PostScript does not support the notion of a colormap, ! 8-bit palette images produce 24-bit PostScript images. This conversion results in output that is six times bigger than the original image and which takes a long time to send to a printer over a serial line. --- 158,165 ---- .RE (notice that directories are numbered starting at zero.) .SH BUGS ! Because \*(Ps does not support the notion of a colormap, ! 8-bit palette images produce 24-bit \*(Ps images. This conversion results in output that is six times bigger than the original image and which takes a long time to send to a printer over a serial line. EOF-EOF-EOF Patch man/tiffcp.1<<'EOF-EOF-EOF' *** tiff-v3.4beta035/man/tiffcp.1 Mon Jun 10 15:25:36 1996 --- tiff-v3.4beta036/man/tiffcp.1 Thu Feb 20 18:11:47 1997 *************** *** 1,4 **** ! .\" $Header: /usr/people/sam/tiff/man/RCS/tiffcp.1,v 1.23 1996/01/10 00:01:03 sam Exp $ .\" .\" Copyright (c) 1988-1995 Sam Leffler .\" Copyright (c) 1991-1995 Silicon Graphics, Inc. --- 1,4 ---- ! .\" $Header: /usr/people/sam/tiff/man/RCS/tiffcp.1,v 1.24 1996/08/07 00:01:40 sam Exp $ .\" .\" Copyright (c) 1988-1995 Sam Leffler .\" Copyright (c) 1991-1995 Silicon Graphics, Inc. *************** *** 64,69 **** --- 64,70 ---- Force output to be written with Big-Endian byte order. This option only has an effect when the output file is created or overwritten and not when it is appended to. + .TP .B \-C Suppress the use of ``strip chopping'' when reading images that have a single strip/tile of uncompressed data. *************** *** 134,144 **** Specifying .B "\-f lsb2msb" will force data to be written with the FillOrder tag set to ! .SM LSB2MSB , while .B "\-f msb2lsb" will force data to be written with the FillOrder tag set to ! .SM MSB2LSB . .TP .B \-l Specify the length of a tile (in pixels). --- 135,145 ---- Specifying .B "\-f lsb2msb" will force data to be written with the FillOrder tag set to ! .SM LSB2MSB, while .B "\-f msb2lsb" will force data to be written with the FillOrder tag set to ! .SM MSB2LSB. .TP .B \-l Specify the length of a tile (in pixels). *************** *** 145,154 **** --- 146,157 ---- .I tiffcp attempts to set the tile dimensions so that no more than 8 kilobytes of data appear in a tile. + .TP .B \-L Force output to be written with Little-Endian byte order. This option only has an effect when the output file is created or overwritten and not when it is appended to. + .TP .B \-M Suppress the use of memory-mapped files when reading images. .TP EOF-EOF-EOF Patch man/tiffinfo.1<<'EOF-EOF-EOF' *** tiff-v3.4beta035/man/tiffinfo.1 Mon Jun 10 15:25:37 1996 --- tiff-v3.4beta036/man/tiffinfo.1 Thu Feb 20 18:11:48 1997 *************** *** 1,4 **** ! .\" $Header: /usr/people/sam/tiff/man/RCS/tiffinfo.1,v 1.17 1995/10/11 19:42:08 sam Exp $ .\" .\" Copyright (c) 1988-1995 Sam Leffler .\" Copyright (c) 1991-1995 Silicon Graphics, Inc. --- 1,4 ---- ! .\" $Header: /usr/people/sam/tiff/man/RCS/tiffinfo.1,v 1.18 1997/01/27 23:49:18 sam Exp $ .\" .\" Copyright (c) 1988-1995 Sam Leffler .\" Copyright (c) 1991-1995 Silicon Graphics, Inc. *************** *** 23,29 **** .\" OF THIS SOFTWARE. .\" .if n .po 0 ! .TH TIFFINFO 1 "May 2, 1990" .SH NAME tiffinfo \- print information about .SM TIFF --- 23,29 ---- .\" OF THIS SOFTWARE. .\" .if n .po 0 ! .TH TIFFINFO 1 "January 27, 1997" .SH NAME tiffinfo \- print information about .SM TIFF *************** *** 68,73 **** --- 68,76 ---- .TP .B \-s Display the offsets and byte counts for each data strip in a directory. + .TP + .B \-z + Enable strip chopping when reading image data. .TP .B \-# Set the initial EOF-EOF-EOF Patch tools/Makefile.in<<'EOF-EOF-EOF' *** tiff-v3.4beta035/tools/Makefile.in Mon Jun 10 15:25:22 1996 --- tiff-v3.4beta036/tools/Makefile.in Thu Feb 20 18:11:36 1997 *************** *** 1,4 **** ! # $Header: /usr/people/sam/tiff/tools/RCS/Makefile.in,v 1.19 1996/05/21 18:31:15 sam Exp $ # # @WARNING@ # --- 1,4 ---- ! # $Header: /usr/people/sam/tiff/tools/RCS/Makefile.in,v 1.21 1996/08/26 23:39:12 sam Exp $ # # @WARNING@ # *************** *** 241,251 **** # SGI versions of tiffgt & tiffsv that require -lgl tiffgt: sgigt.o ${TIFFLIB} ! ${CC} -o tiffgt ${CFLAGS} sgigt.o ${LIBS} -lgutil -lgl_s sgigt.o: ${SRCDIR}/sgigt.c ${CC} -c ${CFLAGS} ${SRCDIR}/sgigt.c tiffsv: sgisv.o ${TIFFLIB} ! ${CC} -o tiffsv ${CFLAGS} sgisv.o ${LIBS} -lgutil -lgl_s sgisv.o: ${SRCDIR}/sgisv.c ${CC} -c ${CFLAGS} ${SRCDIR}/sgisv.c --- 241,251 ---- # SGI versions of tiffgt & tiffsv that require -lgl tiffgt: sgigt.o ${TIFFLIB} ! ${CC} -o tiffgt ${CFLAGS} sgigt.o -lgutil -lgl ${LIBS} sgigt.o: ${SRCDIR}/sgigt.c ${CC} -c ${CFLAGS} ${SRCDIR}/sgigt.c tiffsv: sgisv.o ${TIFFLIB} ! ${CC} -o tiffsv ${CFLAGS} sgisv.o -lgutil -lgl ${LIBS} sgisv.o: ${SRCDIR}/sgisv.c ${CC} -c ${CFLAGS} ${SRCDIR}/sgisv.c EOF-EOF-EOF Patch tools/pal2rgb.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/tools/pal2rgb.c Mon Jun 10 15:25:24 1996 --- tiff-v3.4beta036/tools/pal2rgb.c Thu Feb 20 18:11:38 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/tools/RCS/pal2rgb.c,v 1.29 1996/01/10 19:35:29 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/tools/RCS/pal2rgb.c,v 1.30 1996/06/20 18:55:15 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 161,167 **** */ int i; ! for (i = (1< 0; i--) { #define CVT(x) (((x) * 255) / ((1L<<16)-1)) rmap[i] = CVT(rmap[i]); gmap[i] = CVT(gmap[i]); --- 161,167 ---- */ int i; ! for (i = (1<= 0; i--) { #define CVT(x) (((x) * 255) / ((1L<<16)-1)) rmap[i] = CVT(rmap[i]); gmap[i] = CVT(gmap[i]); EOF-EOF-EOF Patch tools/sgigt.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/tools/sgigt.c Mon Jun 10 15:25:26 1996 --- tiff-v3.4beta036/tools/sgigt.c Thu Feb 20 18:11:39 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/tools/RCS/sgigt.c,v 1.66 1996/01/10 19:35:32 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/tools/RCS/sgigt.c,v 1.67 1996/11/11 16:18:16 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 228,234 **** if (raster != NULL) _TIFFfree(raster), raster = NULL; raster = (uint32*) _TIFFmalloc(w * h * sizeof (uint32)); ! if (raster == 0) { width = height = 0; TIFFError(filename, "No space for raster buffer"); goto bad3; --- 228,234 ---- if (raster != NULL) _TIFFfree(raster), raster = NULL; raster = (uint32*) _TIFFmalloc(w * h * sizeof (uint32)); ! if (raster == NULL) { width = height = 0; TIFFError(filename, "No space for raster buffer"); goto bad3; *************** *** 868,874 **** { YCbCrSetup; uint32* cp1 = cp+w+toskew; ! unsigned int incr = 2*toskew+w; (void) y; /* XXX adjust fromskew */ --- 868,874 ---- { YCbCrSetup; uint32* cp1 = cp+w+toskew; ! int32 incr = 2*toskew+w; (void) y; /* XXX adjust fromskew */ EOF-EOF-EOF Patch tools/tiff2ps.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/tools/tiff2ps.c Mon Jun 10 15:25:28 1996 --- tiff-v3.4beta036/tools/tiff2ps.c Thu Feb 20 18:11:41 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/tools/RCS/tiff2ps.c,v 1.48 1996/01/10 19:35:35 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/tools/RCS/tiff2ps.c,v 1.51 1997/02/20 20:15:03 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 46,51 **** --- 46,52 ---- int generateEPSF = TRUE; /* generate Encapsulated PostScript */ int PSduplex = FALSE; /* enable duplex printing */ int PStumble = FALSE; /* enable top edge binding */ + int PSavoiddeadzone = TRUE; /* enable avoiding printer deadzone */ char *filename; /* input filename */ /* *************** *** 83,89 **** extern int optind; FILE* output = stdout; ! while ((c = getopt(argc, argv, "h:w:d:o:O:aeps128DT")) != -1) switch (c) { case 'd': dirnum = atoi(optarg); --- 84,90 ---- extern int optind; FILE* output = stdout; ! while ((c = getopt(argc, argv, "h:w:d:o:O:aezps128DT")) != -1) switch (c) { case 'd': dirnum = atoi(optarg); *************** *** 124,129 **** --- 125,133 ---- case 'w': pageWidth = atof(optarg); break; + case 'z': + PSavoiddeadzone = FALSE; + break; case '1': level2 = FALSE; ascii85 = FALSE; *************** *** 280,286 **** yres = PS_UNIT_SIZE; switch (res_unit) { case RESUNIT_CENTIMETER: ! xres /= 2.54, yres /= 2.54; break; case RESUNIT_NONE: xres *= PS_UNIT_SIZE, yres *= PS_UNIT_SIZE; --- 284,290 ---- yres = PS_UNIT_SIZE; switch (res_unit) { case RESUNIT_CENTIMETER: ! xres *= 2.54, yres *= 2.54; break; case RESUNIT_NONE: xres *= PS_UNIT_SIZE, yres *= PS_UNIT_SIZE; *************** *** 314,319 **** --- 318,324 ---- { uint32 w, h; float ox, oy, prw, prh; + float scale; uint32 subfiletype; uint16* sampleinfo; static int npages = 0; *************** *** 361,370 **** fprintf(fd, "%%%%Page: %d %d\n", npages, npages); fprintf(fd, "gsave\n"); fprintf(fd, "100 dict begin\n"); ! if (pw != 0 && ph != 0) ! fprintf(fd, "%f %f scale\n", ! pw*PS_UNIT_SIZE, ph*PS_UNIT_SIZE); ! else fprintf(fd, "%f %f scale\n", prw, prh); PSpage(fd, tif, w, h); fprintf(fd, "end\n"); --- 366,381 ---- fprintf(fd, "%%%%Page: %d %d\n", npages, npages); fprintf(fd, "gsave\n"); fprintf(fd, "100 dict begin\n"); ! if (pw != 0 && ph != 0) { ! /* NB: maintain image aspect ratio */ ! scale = (pw*PS_UNIT_SIZE/prw) < (ph*PS_UNIT_SIZE/prh) ? ! (pw*PS_UNIT_SIZE/prw) : ! (ph*PS_UNIT_SIZE/prh); ! if (scale > 1.0) ! scale = 1.0; ! fprintf(fd, "0 %f translate\n", ph*PS_UNIT_SIZE-prh*scale); ! fprintf(fd, "%f %f scale\n", prw*scale, prh*scale); ! } else fprintf(fd, "%f %f scale\n", prw, prh); PSpage(fd, tif, w, h); fprintf(fd, "end\n"); *************** *** 403,408 **** --- 414,429 ---- %%EndFeature\n\ "; + static char AvoidDeadZonePreamble[] = "\ + gsave newpath clippath pathbbox grestore\n\ + 4 2 roll 2 copy translate\n\ + exch 3 1 roll sub 3 1 roll sub exch\n\ + currentpagedevice /PageSize get aload pop\n\ + exch 3 1 roll div 3 1 roll div abs exch abs\n\ + 2 copy gt { exch } if pop\n\ + dup 1 lt { dup scale } { pop } ifelse\n\ + "; + void PSHead(FILE *fd, TIFF *tif, uint32 w, uint32 h, float pw, float ph, float ox, float oy) *************** *** 428,433 **** --- 449,456 ---- fprintf(fd, "%s", DuplexPreamble); if (PStumble) fprintf(fd, "%s", TumblePreamble); + if (PSavoiddeadzone && level2) + fprintf(fd, "%s", AvoidDeadZonePreamble); fprintf(fd, "%%%%EndSetup\n"); } *************** *** 583,589 **** fputs(" /ImageType 1\n", fd); fprintf(fd, " /Width %lu\n", (unsigned long) tile_width); fprintf(fd, " /Height %lu\n", (unsigned long) tile_height); ! if (planarconfiguration == PLANARCONFIG_SEPARATE) fputs(" /MultipleDataSources true\n", fd); fprintf(fd, " /ImageMatrix [ %lu 0 0 %ld %s %s ]\n", (unsigned long) w, - (long)h, im_x, im_y); --- 606,612 ---- fputs(" /ImageType 1\n", fd); fprintf(fd, " /Width %lu\n", (unsigned long) tile_width); fprintf(fd, " /Height %lu\n", (unsigned long) tile_height); ! if (planarconfiguration == PLANARCONFIG_SEPARATE && samplesperpixel > 1) fputs(" /MultipleDataSources true\n", fd); fprintf(fd, " /ImageMatrix [ %lu 0 0 %ld %s %s ]\n", (unsigned long) w, - (long)h, im_x, im_y); *************** *** 1312,1318 **** ascii85breaklen = 2*MAXLINE; } } - p += 4; } _TIFFmemcpy(ascii85buf, p, n); ascii85count = n; --- 1335,1340 ---- *************** *** 1348,1353 **** --- 1370,1376 ---- " -s generate PostScript for a single image", " -T print pages for top edge binding", " -w # assume printed page width is # inches (default 8.5)", + " -z enable printing in the deadzone (only for PostScript Level II)", NULL }; EOF-EOF-EOF Patch tools/tiffcp.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/tools/tiffcp.c Mon Jun 10 15:25:29 1996 --- tiff-v3.4beta036/tools/tiffcp.c Thu Feb 20 18:11:41 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/tools/RCS/tiffcp.c,v 1.48 1996/01/10 19:35:36 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/tools/RCS/tiffcp.c,v 1.51 1996/12/13 05:22:37 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 399,404 **** --- 399,405 ---- { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT }, { TIFFTAG_INKSET, 1, TIFF_SHORT }, { TIFFTAG_INKNAMES, 1, TIFF_ASCII }, + { TIFFTAG_NUMBEROFINKS, 1, TIFF_SHORT }, { TIFFTAG_DOTRANGE, 2, TIFF_SHORT }, { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII }, { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT }, *************** *** 511,516 **** --- 512,522 ---- CopyTag(TIFFTAG_FAXRECVTIME, 1, TIFF_LONG); CopyTag(TIFFTAG_FAXSUBADDRESS, 1, TIFF_ASCII); break; + } + { uint32 len32; + void** data; + if (TIFFGetField(in, TIFFTAG_ICCPROFILE, &len32, &data)) + TIFFSetField(out, TIFFTAG_ICCPROFILE, len32, data); } for (p = tags; p < &tags[NTAGS]; p++) CopyTag(p->tag, p->count, p->type); EOF-EOF-EOF Patch tools/tiffdump.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/tools/tiffdump.c Mon Jun 10 15:25:29 1996 --- tiff-v3.4beta036/tools/tiffdump.c Thu Feb 20 18:11:42 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/tools/RCS/tiffdump.c,v 1.49 1996/03/29 16:38:33 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/tools/RCS/tiffdump.c,v 1.51 1996/12/13 04:47:56 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 64,71 **** char* curfile; int swabflag; int bigendian; ! int typeshift[13]; /* data type shift counts */ ! long typemask[13]; /* data type masks */ char* bytefmt = "%s%#02x"; /* BYTE */ char* sbytefmt = "%s%d"; /* SBYTE */ --- 64,72 ---- char* curfile; int swabflag; int bigendian; ! int typeshift[13]; /* data type shift counts */ ! long typemask[13]; /* data type masks */ ! int maxitems = 24; /* maximum indirect data items to print */ char* bytefmt = "%s%#02x"; /* BYTE */ char* sbytefmt = "%s%d"; /* SBYTE */ *************** *** 99,105 **** bigendian = (*(char *)&one == 0); appname = argv[0]; ! while ((c = getopt(argc, argv, "o:h")) != -1) { switch (c) { case 'h': /* print values in hex */ shortfmt = "%s%#x"; --- 100,106 ---- bigendian = (*(char *)&one == 0); appname = argv[0]; ! while ((c = getopt(argc, argv, "m:o:h")) != -1) { switch (c) { case 'h': /* print values in hex */ shortfmt = "%s%#x"; *************** *** 110,115 **** --- 111,119 ---- case 'o': diroff = (uint32) strtoul(optarg, NULL, 0); break; + case 'm': + maxitems = strtoul(optarg, NULL, 0); + break; default: usage(); } *************** *** 347,354 **** unsigned char *data = (unsigned char *)_TIFFmalloc(space); if (data) { if (TIFFFetchData(fd, dp, data)) ! PrintData(stdout, dp->tdir_type, ! dp->tdir_count, data); _TIFFfree(data); } else Error("No space for data for tag %u", --- 351,363 ---- unsigned char *data = (unsigned char *)_TIFFmalloc(space); if (data) { if (TIFFFetchData(fd, dp, data)) ! if (dp->tdir_count > maxitems) { ! PrintData(stdout, dp->tdir_type, ! maxitems, data); ! printf(" ..."); ! } else ! PrintData(stdout, dp->tdir_type, ! dp->tdir_count, data); _TIFFfree(data); } else Error("No space for data for tag %u", *************** *** 423,428 **** --- 432,438 ---- { TIFFTAG_SUBIFD, "SubIFD" }, { TIFFTAG_INKSET, "InkSet" }, { TIFFTAG_INKNAMES, "InkNames" }, + { TIFFTAG_NUMBEROFINKS, "NumberOfInks" }, { TIFFTAG_DOTRANGE, "DotRange" }, { TIFFTAG_TARGETPRINTER, "TargetPrinter" }, { TIFFTAG_EXTRASAMPLES, "ExtraSamples" }, *************** *** 452,457 **** --- 462,468 ---- { TIFFTAG_TILEDEPTH, "TileDepth (Silicon Graphics)" }, { 32768, "OLD BOGUS Matteing tag" }, { TIFFTAG_COPYRIGHT, "Copyright" }, + { TIFFTAG_ICCPROFILE, "ICC Profile" }, { TIFFTAG_JBIGOPTIONS, "JBIG Options" }, }; #define NTAGS (sizeof (tagnames) / sizeof (tagnames[0])) *************** *** 567,574 **** break; if (*tp) fprintf(fd, "\\%c", *tp); ! else fprintf(fd, "\\%03o", *cp); } } --- 578,587 ---- break; if (*tp) fprintf(fd, "\\%c", *tp); ! else if (*cp) fprintf(fd, "\\%03o", *cp); + else + fprintf(fd, "\\0"); } } EOF-EOF-EOF Patch tools/tiffinfo.c<<'EOF-EOF-EOF' *** tiff-v3.4beta035/tools/tiffinfo.c Mon Jun 10 15:25:30 1996 --- tiff-v3.4beta036/tools/tiffinfo.c Thu Feb 20 18:11:42 1997 *************** *** 1,4 **** ! /* $Header: /usr/people/sam/tiff/tools/RCS/tiffinfo.c,v 1.26 1996/01/10 19:35:39 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler --- 1,4 ---- ! /* $Header: /usr/people/sam/tiff/tools/RCS/tiffinfo.c,v 1.27 1997/01/27 22:54:52 sam Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler *************** *** 51,58 **** extern char* optarg; long flags = 0; uint32 diroff = 0; ! while ((c = getopt(argc, argv, "f:o:cdDSjlmrsvw0123456789")) != -1) switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': --- 51,59 ---- extern char* optarg; long flags = 0; uint32 diroff = 0; + int chopstrips = 0; /* disable strip chopping */ ! while ((c = getopt(argc, argv, "f:o:cdDSjlmrsvwz0123456789")) != -1) switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': *************** *** 96,101 **** --- 97,105 ---- case 'w': showwords = 1; break; + case 'z': + chopstrips = 1; + break; case '?': usage(); /*NOTREACHED*/ *************** *** 106,112 **** for (; optind < argc; optind++) { if (multiplefiles) printf("%s:\n", argv[optind]); ! tif = TIFFOpen(argv[optind], "r"); if (tif != NULL) { if (dirnum != -1) { if (TIFFSetDirectory(tif, dirnum)) --- 110,116 ---- for (; optind < argc; optind++) { if (multiplefiles) printf("%s:\n", argv[optind]); ! tif = TIFFOpen(argv[optind], chopstrips ? "rC" : "rc"); if (tif != NULL) { if (dirnum != -1) { if (TIFFSetDirectory(tif, dirnum)) *************** *** 139,144 **** --- 143,149 ---- " -r read/display raw image data instead of decoded data", " -s display strip offsets and byte counts", " -w display raw data in words rather than bytes", + " -z enable strip chopping", " -# set initial directory (first directory is # 0)", NULL }; EOF-EOF-EOF NewFile html/v3.4beta035.html<<'EOF-EOF-EOF' Changes in TIFF v3.4beta035 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:
  • support was added installing the HTML documentation
  • support was added for building the library as a DSO under FreeBSD


CHANGES IN LIBTIFF:
  • the interface to the mkversion program was restored to the form used prior to v3.4beta034
  • several portability problems for 16-bit systems were fixed
TIFF home page.

Sam Leffler / sam@engr.sgi.com Last updated $Date: 1997/02/21 01:20:07 $.
EOF-EOF-EOF NewFile html/v3.4beta036.html<<'EOF-EOF-EOF' Changes in TIFF v3.4beta036 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:
  • support was added for building the library as a DSO under HP-UX with the native C compiler
  • tools are now built with explicit pathnames for the DSO under IRIX, Solaris, and Linux
  • DSO configuration support for Linux was changed to require that libc.so only be readable (not executable)


CHANGES IN LIBTIFF:
  • support was add for ICC: NumberOfInks, and ICCProfile
  • a memory leak caused by doing TIFFSetDirectory(0) was fixed
  • a bug was fixed whereby certain multi-directory files were not properly handled when accessed by mapping the data into memory
  • the strip chopping support is now always compiled into the library with the default usage controlled by a STRIPCHOP_DEFAULT configuration parameter
  • the strip chopping support no longer chops tiled images
  • all static strings are now const--for shared libraries
  • the logic for estimating the strip size of images without a StripByteCounts tag was improved by handling PlanarContig images differently from PlanarSeparate
  • a bug was fixed in the G3 codec when converting the Y resolution of data specified in metric units
  • a bug was fixed in the G3/G4 decoder for data where lines terminate with a v0 code
  • the TIFFRGBAImage support was changed to scale 16-bit colormap entries more conservatively to avoid problems with applications that do not generate fully saturated pixel values
  • the LZW decoder was changed to use a more conservative scheme when bounds checking the hash table array; this avoids pitfalls with systems that load objects into memory in unusual locations
  • a bug was fixed in TIFFPrintDirectory's handling of the InkNames tag
  • TIFFPrintDirectory now understands NumberOfInks and ICC-related tags
  • the routines for reading image data now provide more useful information when a read error is encountered
  • support was added for compiling with Microsoft Visual C++ 4.0


CHANGES IN THE TOOLS:
  • a bug was fixed in pal2rgb's colormap handling
  • tiff2ps now includes John Wehle's changes for maintaining the aspect ratio of images when scaling and for honoring the deadzone on a page when generating PostScript Level II
  • tiff2ps does a better job guarding against the mishandling of greyscale images
  • tiff2ps now correctly converts X- and Y-resolution values specified in metric units
  • tiffdump has a new -m option to control the maximum number of indirect data values printed for a tag (by default 24)
  • tiffdump understands several new tags
  • tiffdump now shows any terminating null in ASCII strings
  • tiffinfo now suppresses strip chopping when interpreting an image; a new -z option has been added to enable strip chopping
TIFF home page.

Sam Leffler / sam@engr.sgi.com Last updated $Date: 1997/02/21 01:20:07 $.
EOF-EOF-EOF