summaryrefslogtreecommitdiff
path: root/libtiff
diff options
context:
space:
mode:
Diffstat (limited to 'libtiff')
-rw-r--r--libtiff/Makefile.in6
-rw-r--r--libtiff/t4.h2
-rw-r--r--libtiff/tif_aux.c5
-rw-r--r--libtiff/tif_close.c5
-rw-r--r--libtiff/tif_compress.c16
-rw-r--r--libtiff/tif_dir.c30
-rw-r--r--libtiff/tif_dir.h18
-rw-r--r--libtiff/tif_dirinfo.c10
-rw-r--r--libtiff/tif_dirread.c30
-rw-r--r--libtiff/tif_dirwrite.c33
-rw-r--r--libtiff/tif_fax3.c4
-rw-r--r--libtiff/tif_fax3.h14
-rw-r--r--libtiff/tif_getimage.c10
-rw-r--r--libtiff/tif_jpeg.c8
-rw-r--r--libtiff/tif_lzw.c11
-rw-r--r--libtiff/tif_open.c13
-rw-r--r--libtiff/tif_pixarlog.c12
-rw-r--r--libtiff/tif_print.c11
-rw-r--r--libtiff/tif_read.c48
-rw-r--r--libtiff/tif_zip.c14
-rw-r--r--libtiff/tiff.h7
-rw-r--r--libtiff/tiffconf.h13
-rw-r--r--libtiff/tiffio.h14
-rw-r--r--libtiff/tiffiop.h3
24 files changed, 210 insertions, 127 deletions
diff --git a/libtiff/Makefile.in b/libtiff/Makefile.in
index ede6b0b6..111e6348 100644
--- a/libtiff/Makefile.in
+++ b/libtiff/Makefile.in
@@ -1,4 +1,4 @@
-# $Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.in,v 1.38 1996/06/10 20:48:50 sam Exp $
+# $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,7 +159,7 @@ libtiff.a: ${OBJS}
# default IRIX DSO building rule
IRIXdso: ${OBJS}
- ${CC} -o libtiff.@DSOSUF@ -shared -rdata_shared \
+ ${CC} @ENVOPTS@ -o libtiff.@DSOSUF@ -shared -rdata_shared \
-check_registry ${SRCDIR}/../port/irix/so_locations \
-quickstart_info \
${OBJS} @LIBJPEG@ @LIBGZ@
@@ -319,7 +319,7 @@ installDSO: @DSO@dso
${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@ \
+ ${INSTALL} -idb tiff.sw.tools -m 555 -F @DIR_LIB@ \
-O libtiff.@DSOSUF@; \
fi
install: all installHdrs
diff --git a/libtiff/t4.h b/libtiff/t4.h
index 30dc5aef..4873d35d 100644
--- a/libtiff/t4.h
+++ b/libtiff/t4.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/t4.h,v 1.15 1996/01/10 19:33:20 sam Exp $ */
+/* $Id: t4.h,v 1.16 1996/06/24 03:00:54 sam Exp $ */
/*
* Copyright (c) 1988-1996 Sam Leffler
diff --git a/libtiff/tif_aux.c b/libtiff/tif_aux.c
index debfd382..608115a6 100644
--- a/libtiff/tif_aux.c
+++ b/libtiff/tif_aux.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_aux.c,v 1.32 1996/01/10 19:32:55 sam Exp $ */
+/* $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
@@ -124,6 +124,9 @@ TIFFVGetFieldDefaulted(TIFF* tif, ttag_t tag, va_list ap)
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:
*va_arg(ap, uint16 *) = td->td_extrasamples;
diff --git a/libtiff/tif_close.c b/libtiff/tif_close.c
index 8f416876..d45e5c65 100644
--- a/libtiff/tif_close.c
+++ b/libtiff/tif_close.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_close.c,v 1.30 1996/01/10 19:32:55 sam Exp $ */
+/* $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,8 +37,7 @@ TIFFClose(TIFF* tif)
* Flush buffered data and directory (if dirty).
*/
TIFFFlush(tif);
- if (tif->tif_cleanup)
- (*tif->tif_cleanup)(tif);
+ (*tif->tif_cleanup)(tif);
TIFFFreeDirectory(tif);
if (tif->tif_rawdata && (tif->tif_flags&TIFF_MYBUFFER))
_TIFFfree(tif->tif_rawdata);
diff --git a/libtiff/tif_compress.c b/libtiff/tif_compress.c
index ce99489e..3878d7ab 100644
--- a/libtiff/tif_compress.c
+++ b/libtiff/tif_compress.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_compress.c,v 1.51 1996/01/10 19:32:57 sam Exp $ */
+/* $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,11 +122,9 @@ _TIFFNoPreCode(TIFF* tif, tsample_t s)
static int _TIFFtrue(TIFF* tif) { (void) tif; return (1); }
static void _TIFFvoid(TIFF* tif) { (void) tif; }
-int
-TIFFSetCompressionScheme(TIFF* tif, int scheme)
+void
+_TIFFSetDefaultCompressionState(TIFF* tif)
{
- const TIFFCodec *c = TIFFFindCODEC(scheme);
-
tif->tif_setupdecode = _TIFFtrue;
tif->tif_predecode = _TIFFNoPreCode;
tif->tif_decoderow = _TIFFNoRowDecode;
@@ -144,6 +142,14 @@ TIFFSetCompressionScheme(TIFF* tif, int scheme)
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
diff --git a/libtiff/tif_dir.c b/libtiff/tif_dir.c
index 82187349..d219cbdf 100644
--- a/libtiff/tif_dir.c
+++ b/libtiff/tif_dir.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dir.c,v 1.156 1996/01/10 20:37:08 sam Exp $ */
+/* $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,6 +50,8 @@ _TIFFsetByteArray(void** vpp, void* vp, long n)
}
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,12 +366,23 @@ _TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap)
td->td_dotrange[1] = (uint16) va_arg(ap, int);
break;
case TIFFTAG_INKNAMES:
- _TIFFsetString(&td->td_inknames, va_arg(ap, char*));
+ 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,10 +690,19 @@ _TIFFVGetField(TIFF* tif, ttag_t tag, va_list ap)
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,6 +797,9 @@ TIFFFreeDirectory(TIFF* tif)
CleanupField(td_transferfunction[1]);
CleanupField(td_transferfunction[2]);
#endif
+#ifdef ICC_SUPPORT
+ CleanupField(td_profileData);
+#endif
CleanupField(td_stripoffset);
CleanupField(td_stripbytecount);
}
@@ -822,6 +847,7 @@ TIFFDefaultDirectory(TIFF* tif)
#endif
#ifdef CMYK_SUPPORT
td->td_inkset = INKSET_CMYK;
+ td->td_ninks = 4;
#endif
tif->tif_postdecode = _TIFFNoPostDecode;
tif->tif_vsetfield = _TIFFVSetField;
diff --git a/libtiff/tif_dir.h b/libtiff/tif_dir.h
index c2021dfa..f9eac232 100644
--- a/libtiff/tif_dir.h
+++ b/libtiff/tif_dir.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dir.h,v 1.4 1996/01/10 19:33:21 sam Exp $ */
+/* $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,10 +91,15 @@ typedef struct {
#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,8 +170,10 @@ typedef struct {
#define FIELD_DOTRANGE 47
#define FIELD_TARGETPRINTER 48
#define FIELD_SUBIFD 49
-
-#define FIELD_CODEC 50 /* base of codec-private tags */
+#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,8 +199,8 @@ typedef struct {
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) */
+ 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,6 +211,7 @@ typedef struct {
#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 */
diff --git a/libtiff/tif_dirinfo.c b/libtiff/tif_dirinfo.c
index 436165f5..c4584647 100644
--- a/libtiff/tif_dirinfo.c
+++ b/libtiff/tif_dirinfo.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dirinfo.c,v 1.38 1996/06/04 19:04:41 sam Exp $ */
+/* $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,7 +166,9 @@ static const TIFFFieldInfo tiffFieldInfo[] = {
{ TIFFTAG_INKSET, 1, 1, TIFF_SHORT, FIELD_INKSET,
FALSE, FALSE, "InkSet" },
{ TIFFTAG_INKNAMES, -1,-1, TIFF_ASCII, FIELD_INKNAMES,
- TRUE, FALSE, "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,6 +216,10 @@ static const TIFFFieldInfo tiffFieldInfo[] = {
{ 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]))
diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
index 6fd3a66b..8d9cac55 100644
--- a/libtiff/tif_dirread.c
+++ b/libtiff/tif_dirread.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dirread.c,v 1.71 1996/03/29 16:35:17 sam Exp $ */
+/* $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,9 +59,7 @@ static int TIFFFetchFloatArray(TIFF*, TIFFDirEntry*, float*);
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)
@@ -100,8 +98,7 @@ TIFFReadDirectory(TIFF* tif)
/*
* Cleanup any previous compression state.
*/
- if (tif->tif_curdir != (tdir_t) -1)
- (*tif->tif_cleanup)(tif);
+ (*tif->tif_cleanup)(tif);
tif->tif_curdir++;
nextdiroff = 0;
if (!isMapped(tif)) {
@@ -132,7 +129,7 @@ TIFFReadDirectory(TIFF* tif)
} else {
toff_t off = tif->tif_diroff;
- if (off + sizeof (short) > tif->tif_size) {
+ if (off + sizeof (uint16) > tif->tif_size) {
TIFFError(tif->tif_name,
"Can not read TIFF directory count");
return (0);
@@ -152,7 +149,7 @@ TIFFReadDirectory(TIFF* tif)
_TIFFmemcpy(dir, tif->tif_base + off,
dircount*sizeof (TIFFDirEntry));
off += dircount* sizeof (TIFFDirEntry);
- if (off + sizeof (uint32) < tif->tif_size)
+ if (off + sizeof (uint32) <= tif->tif_size)
_TIFFmemcpy(&nextdiroff, tif->tif_base+off, sizeof (uint32));
}
if (tif->tif_flags & TIFF_SWAB)
@@ -528,7 +525,6 @@ TIFFReadDirectory(TIFF* tif)
*/
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.
@@ -538,11 +534,9 @@ TIFFReadDirectory(TIFF* tif)
* 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)
+ if (td->td_nstrips == 1 && td->td_compression == COMPRESSION_NONE &&
+ (tif->tif_flags & (TIFF_STRIPCHOP|TIFF_ISTILED)) == TIFF_STRIPCHOP)
ChopUpSingleUncompressedStrip(tif);
-#endif
/*
* Reinitialize i/o since we are starting on a new directory.
*/
@@ -585,7 +579,9 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
if (cc > sizeof (uint32))
space += cc;
}
- space = (filesize - space) / td->td_samplesperpixel;
+ 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,7 +597,7 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
filesize - td->td_stripoffset[i];
} else {
uint32 rowbytes = TIFFScanlineSize(tif);
- uint32 rowsperstrip = td->td_imagelength / td->td_nstrips;
+ uint32 rowsperstrip = td->td_imagelength/td->td_stripsperimage;
for (i = 0; i < td->td_nstrips; i++)
td->td_stripbytecount[i] = rowbytes*rowsperstrip;
}
@@ -991,7 +987,7 @@ TIFFFetchAnyArray(TIFF* tif, TIFFDirEntry* dir, double* v)
static int
TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp)
{
- static char mesg[] = "to fetch tag value";
+ static const char mesg[] = "to fetch tag value";
int ok = 0;
const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dp->tdir_tag);
@@ -1271,7 +1267,7 @@ TIFFFetchExtraSamples(TIFF* tif, TIFFDirEntry* dir)
static int
TIFFFetchRefBlackWhite(TIFF* tif, TIFFDirEntry* dir)
{
- static char mesg[] = "for \"ReferenceBlackWhite\" array";
+ static const char mesg[] = "for \"ReferenceBlackWhite\" array";
char* cp;
int ok;
@@ -1298,7 +1294,6 @@ TIFFFetchRefBlackWhite(TIFF* tif, TIFFDirEntry* dir)
}
#endif
-#if STRIPCHOP_SUPPORT
/*
* Replace a single strip (tile) of uncompressed data by
* multiple strips (tiles), each approximately 8Kbytes.
@@ -1371,4 +1366,3 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
td->td_stripbytecount = newcounts;
td->td_stripoffset = newoffsets;
}
-#endif /* STRIPCHOP_SUPPORT */
diff --git a/libtiff/tif_dirwrite.c b/libtiff/tif_dirwrite.c
index 849cc11a..d177d6e0 100644
--- a/libtiff/tif_dirwrite.c
+++ b/libtiff/tif_dirwrite.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dirwrite.c,v 1.56 1996/04/29 21:56:21 sam Exp $ */
+/* $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,6 +369,7 @@ static int
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,10 +380,9 @@ TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip)
case TIFF_SSHORT:
if (wc > 1) {
uint16* wp;
- if (wc == (u_short) TIFF_VARIABLE) {
+ if (wc == (u_short) TIFF_VARIABLE)
TIFFGetField(tif, fip->field_tag, &wc, &wp);
- dir->tdir_count = wc;
- } else
+ else
TIFFGetField(tif, fip->field_tag, &wp);
if (!WRITEF(TIFFWriteShortArray, wp))
return (0);
@@ -397,10 +397,9 @@ TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip)
case TIFF_SLONG:
if (wc > 1) {
uint32* lp;
- if (wc == (u_short) TIFF_VARIABLE) {
+ if (wc == (u_short) TIFF_VARIABLE)
TIFFGetField(tif, fip->field_tag, &wc, &lp);
- dir->tdir_count = wc;
- } else
+ else
TIFFGetField(tif, fip->field_tag, &lp);
if (!WRITEF(TIFFWriteLongArray, lp))
return (0);
@@ -413,10 +412,9 @@ TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip)
case TIFF_SRATIONAL:
if (wc > 1) {
float* fp;
- if (wc == (u_short) TIFF_VARIABLE) {
+ if (wc == (u_short) TIFF_VARIABLE)
TIFFGetField(tif, fip->field_tag, &wc, &fp);
- dir->tdir_count = wc;
- } else
+ else
TIFFGetField(tif, fip->field_tag, &fp);
if (!WRITEF(TIFFWriteRationalArray, fp))
return (0);
@@ -430,10 +428,9 @@ TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip)
case TIFF_FLOAT:
if (wc > 1) {
float* fp;
- if (wc == (u_short) TIFF_VARIABLE) {
+ if (wc == (u_short) TIFF_VARIABLE)
TIFFGetField(tif, fip->field_tag, &wc, &fp);
- dir->tdir_count = wc;
- } else
+ else
TIFFGetField(tif, fip->field_tag, &fp);
if (!WRITEF(TIFFWriteFloatArray, fp))
return (0);
@@ -447,10 +444,9 @@ TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip)
case TIFF_DOUBLE:
if (wc > 1) {
double* dp;
- if (wc == (u_short) TIFF_VARIABLE) {
+ if (wc == (u_short) TIFF_VARIABLE)
TIFFGetField(tif, fip->field_tag, &wc, &dp);
- dir->tdir_count = wc;
- } else
+ else
TIFFGetField(tif, fip->field_tag, &dp);
if (!WRITEF(TIFFWriteDoubleArray, dp))
return (0);
@@ -474,6 +470,9 @@ TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip)
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,7 +687,7 @@ TIFFWriteRationalArray(TIFF* tif,
if (type == TIFF_RATIONAL) {
TIFFWarning(tif->tif_name,
"\"%s\": Information lost writing value (%g) as (unsigned) RATIONAL",
- _TIFFFieldWithTag(tif,tag)->field_name, v);
+ _TIFFFieldWithTag(tif,tag)->field_name, fv);
fv = 0;
} else
fv = -fv, sign = -1;
diff --git a/libtiff/tif_fax3.c b/libtiff/tif_fax3.c
index 2d5df7f0..af5f2ee8 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.135 1996/02/08 20:21:27 sam Exp $ */
+/* $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,7 +718,7 @@ Fax3PreEncode(TIFF* tif, tsample_t s)
* 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 */
+ res *= 2.54f; /* convert to inches */
sp->maxk = (res > 150 ? 4 : 2);
sp->k = sp->maxk-1;
} else
diff --git a/libtiff/tif_fax3.h b/libtiff/tif_fax3.h
index 33d41760..88f2cf2f 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.31 1996/06/04 19:04:41 sam Exp $ */
+/* $Id: tif_fax3.h,v 1.33 1996/08/22 18:17:39 sam Exp $ */
/*
* Copyright (c) 1990-1996 Sam Leffler
@@ -507,11 +507,13 @@ done1d: \
} \
} \
if (RunLength) { \
- /* expect a final V0 */ \
- NeedBits8(1,eof2d); \
- if (!GetBits(1)) \
- goto badMain2d; \
- ClrBits(1); \
+ if (RunLength + a0 < lastx) { \
+ /* expect a final V0 */ \
+ NeedBits8(1,eof2d); \
+ if (!GetBits(1)) \
+ goto badMain2d; \
+ ClrBits(1); \
+ } \
SETVAL(0); \
} \
eol2d: \
diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c
index 92c1d1ba..aae7100d 100644
--- a/libtiff/tif_getimage.c
+++ b/libtiff/tif_getimage.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_getimage.c,v 1.39 1996/01/10 19:33:04 sam Exp $ */
+/* $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,7 +1173,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr44tile)
uint32* cp1 = cp+w+toskew;
uint32* cp2 = cp1+w+toskew;
uint32* cp3 = cp2+w+toskew;
- u_int incr = 3*w+4*toskew;
+ int32 incr = 3*w+4*toskew;
(void) y;
/* XXX adjust fromskew */
@@ -1215,7 +1215,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr42tile)
{
YCbCrSetup;
uint32* cp1 = cp+w+toskew;
- u_int incr = 2*toskew+w;
+ int32 incr = 2*toskew+w;
(void) y;
/* XXX adjust fromskew */
@@ -1277,7 +1277,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr22tile)
{
YCbCrSetup;
uint32* cp1 = cp+w+toskew;
- u_int incr = 2*toskew+w;
+ int32 incr = 2*toskew+w;
(void) y;
/* XXX adjust fromskew */
@@ -1589,7 +1589,7 @@ cvtcmap(TIFFRGBAImage* img)
long i;
for (i = (1L<<img->bitspersample)-1; i >= 0; i--) {
-#define CVT(x) ((uint16)(((x) * 255) / ((1L<<16)-1)))
+#define CVT(x) ((uint16)((x)>>8))
r[i] = CVT(r[i]);
g[i] = CVT(g[i]);
b[i] = CVT(b[i]);
diff --git a/libtiff/tif_jpeg.c b/libtiff/tif_jpeg.c
index c415fa64..081b3c91 100644
--- a/libtiff/tif_jpeg.c
+++ b/libtiff/tif_jpeg.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_jpeg.c,v 1.25 1996/01/10 19:33:04 sam Exp $ */
+/* $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,7 +607,7 @@ JPEGPreDecode(TIFF* tif, tsample_t s)
{
JPEGState *sp = JState(tif);
TIFFDirectory *td = &tif->tif_dir;
- static char module[] = "JPEGPreDecode";
+ static const char module[] = "JPEGPreDecode";
uint32 segment_width, segment_height;
int downsampled_output;
int ci;
@@ -901,7 +901,7 @@ JPEGSetupEncode(TIFF* tif)
{
JPEGState* sp = JState(tif);
TIFFDirectory *td = &tif->tif_dir;
- static char module[] = "JPEGSetupEncode";
+ static const char module[] = "JPEGSetupEncode";
assert(sp != NULL);
assert(!sp->cinfo.comm.is_decompressor);
@@ -1017,7 +1017,7 @@ JPEGPreEncode(TIFF* tif, tsample_t s)
{
JPEGState *sp = JState(tif);
TIFFDirectory *td = &tif->tif_dir;
- static char module[] = "JPEGPreEncode";
+ static const char module[] = "JPEGPreEncode";
uint32 segment_width, segment_height;
int downsampled_input;
diff --git a/libtiff/tif_lzw.c b/libtiff/tif_lzw.c
index d5eada58..be43e54f 100644
--- a/libtiff/tif_lzw.c
+++ b/libtiff/tif_lzw.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_lzw.c,v 1.70 1996/01/10 19:33:05 sam Exp $ */
+/* $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,7 +191,7 @@ static int
LZWSetupDecode(TIFF* tif)
{
LZWDecodeState* sp = DecoderState(tif);
- static char module[] = " LZWSetupDecode";
+ static const char module[] = " LZWSetupDecode";
int code;
assert(sp != NULL);
@@ -644,7 +644,7 @@ static int
LZWSetupEncode(TIFF* tif)
{
LZWEncodeState* sp = EncoderState(tif);
- static char module[] = "LZWSetupEncode";
+ static const char module[] = "LZWSetupEncode";
assert(sp != NULL);
sp->enc_hashtab = (hash_t*) _TIFFmalloc(HSIZE*sizeof (hash_t));
@@ -782,10 +782,6 @@ LZWEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
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.
@@ -793,7 +789,6 @@ LZWEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
if ((h -= disp) < 0)
h += HSIZE;
hp = &sp->enc_hashtab[h];
-#endif
if (hp->hash == fcode) {
ent = hp->code;
goto hit;
diff --git a/libtiff/tif_open.c b/libtiff/tif_open.c
index 6ae2c130..bd995664 100644
--- a/libtiff/tif_open.c
+++ b/libtiff/tif_open.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_open.c,v 1.63 1996/01/10 19:33:07 sam Exp $ */
+/* $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,7 +152,7 @@ TIFFClientOpen(
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_row = (uint32) -1; /* read/write pre-increment */
tif->tif_clientdata = clientdata;
tif->tif_readproc = readproc;
tif->tif_writeproc = writeproc;
@@ -161,6 +161,7 @@ TIFFClientOpen(
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,7 +169,11 @@ TIFFClientOpen(
*/
tif->tif_flags = FILLORDER_MSB2LSB;
if (m == O_RDONLY)
- tif->tif_flags |= TIFF_MAPPED|TIFF_STRIPCHOP;
+#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,7 +255,6 @@ TIFFClientOpen(
if (m == O_RDONLY)
tif->tif_flags &= ~TIFF_MAPPED;
break;
-#ifdef STRIPCHOP_SUPPORT
case 'C':
if (m == O_RDONLY)
tif->tif_flags |= TIFF_STRIPCHOP;
@@ -259,7 +263,6 @@ TIFFClientOpen(
if (m == O_RDONLY)
tif->tif_flags &= ~TIFF_STRIPCHOP;
break;
-#endif
}
/*
* Read in TIFF header.
diff --git a/libtiff/tif_pixarlog.c b/libtiff/tif_pixarlog.c
index c3df5b28..f7a0eea4 100644
--- a/libtiff/tif_pixarlog.c
+++ b/libtiff/tif_pixarlog.c
@@ -637,7 +637,7 @@ PixarLogSetupDecode(TIFF* tif)
{
TIFFDirectory *td = &tif->tif_dir;
PixarLogState* sp = DecoderState(tif);
- static char module[] = "PixarLogSetupDecode";
+ static const char module[] = "PixarLogSetupDecode";
assert(sp != NULL);
@@ -690,7 +690,7 @@ PixarLogDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s)
{
TIFFDirectory *td = &tif->tif_dir;
PixarLogState* sp = DecoderState(tif);
- static char module[] = "PixarLogDecode";
+ static const char module[] = "PixarLogDecode";
int i, nsamples, llen;
uint16 *up;
@@ -801,7 +801,7 @@ PixarLogSetupEncode(TIFF* tif)
{
TIFFDirectory *td = &tif->tif_dir;
PixarLogState* sp = EncoderState(tif);
- static char module[] = "PixarLogSetupEncode";
+ static const char module[] = "PixarLogSetupEncode";
assert(sp != NULL);
@@ -1012,7 +1012,7 @@ PixarLogEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
{
TIFFDirectory *td = &tif->tif_dir;
PixarLogState *sp = EncoderState(tif);
- static char module[] = "PixarLogEncode";
+ static const char module[] = "PixarLogEncode";
int i, n, llen;
unsigned short * up;
@@ -1093,7 +1093,7 @@ static int
PixarLogPostEncode(TIFF* tif)
{
PixarLogState *sp = EncoderState(tif);
- static char module[] = "PixarLogPostEncode";
+ static const char module[] = "PixarLogPostEncode";
int state;
sp->stream.avail_in = 0;
@@ -1162,7 +1162,7 @@ PixarLogVSetField(TIFF* tif, ttag_t tag, va_list ap)
{
PixarLogState *sp = (PixarLogState *)tif->tif_data;
int result;
- static char module[] = "PixarLogVSetField";
+ static const char module[] = "PixarLogVSetField";
switch (tag) {
case TIFFTAG_PIXARLOGQUALITY:
diff --git a/libtiff/tif_print.c b/libtiff/tif_print.c
index 5b919ecf..1e2d3b20 100644
--- a/libtiff/tif_print.c
+++ b/libtiff/tif_print.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_print.c,v 1.67 1996/02/16 05:54:21 sam Exp $ */
+/* $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,12 +213,14 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, " Ink Names: ");
i = td->td_samplesperpixel;
sep = "";
- for (cp = td->td_inknames; i > 0; cp = strchr(cp, '\0')) {
+ 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]);
@@ -397,6 +399,11 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, "(present)\n");
}
#endif
+#ifdef ICC_SUPPORT
+ if (TIFFFieldSet(tif,FIELD_ICCPROFILE))
+ fprintf(fd, " ICC Profile: <present>, %lu bytes\n",
+ (u_long) td->td_profileLength);
+#endif
#if SUBIFD_SUPPORT
if (TIFFFieldSet(tif, FIELD_SUBIFD)) {
fprintf(fd, " SubIFD Offsets:");
diff --git a/libtiff/tif_read.c b/libtiff/tif_read.c
index ce78af1c..5f261618 100644
--- a/libtiff/tif_read.c
+++ b/libtiff/tif_read.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_read.c,v 1.70 1996/01/10 19:33:11 sam Exp $ */
+/* $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,6 +157,8 @@ TIFFReadRawStrip1(TIFF* tif,
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,17 +166,25 @@ TIFFReadRawStrip1(TIFF* tif,
(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);
+ 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: Seek error at scanline %lu, strip %lu",
+ "%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_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,8 +261,12 @@ TIFFFillStrip(TIFF* tif, tstrip_t strip)
* 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);
+ 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,6 +356,8 @@ TIFFReadRawTile1(TIFF* tif,
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,21 +367,27 @@ TIFFReadRawTile1(TIFF* tif,
(long) tile);
return ((tsize_t) -1);
}
- if (!ReadOK(tif, buf, size)) {
- TIFFError(module, "%s: Read error at row %ld, col %ld",
+ 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);
+ (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: Seek error at row %ld, col %ld, tile %ld",
+ "%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);
+ (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);
diff --git a/libtiff/tif_zip.c b/libtiff/tif_zip.c
index 84d2c8e3..902c1c82 100644
--- a/libtiff/tif_zip.c
+++ b/libtiff/tif_zip.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_zip.c,v 1.8 1996/03/07 17:00:23 sam Exp $ */
+/* $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,7 +88,7 @@ static int
ZIPSetupDecode(TIFF* tif)
{
ZIPState* sp = DecoderState(tif);
- static char module[] = "ZIPSetupDecode";
+ static const char module[] = "ZIPSetupDecode";
assert(sp != NULL);
if (inflateInit(&sp->stream) != Z_OK) {
@@ -119,7 +119,7 @@ static int
ZIPDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s)
{
ZIPState* sp = DecoderState(tif);
- static char module[] = "ZIPDecode";
+ static const char module[] = "ZIPDecode";
(void) s;
assert(sp != NULL);
@@ -156,7 +156,7 @@ static int
ZIPSetupEncode(TIFF* tif)
{
ZIPState* sp = EncoderState(tif);
- static char module[] = "ZIPSetupEncode";
+ static const char module[] = "ZIPSetupEncode";
assert(sp != NULL);
if (deflateInit(&sp->stream, sp->zipquality) != Z_OK) {
@@ -190,7 +190,7 @@ static int
ZIPEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
{
ZIPState *sp = EncoderState(tif);
- static char module[] = "ZIPEncode";
+ static const char module[] = "ZIPEncode";
(void) s;
sp->stream.next_in = bp;
@@ -219,7 +219,7 @@ static int
ZIPPostEncode(TIFF* tif)
{
ZIPState *sp = EncoderState(tif);
- static char module[] = "ZIPPostEncode";
+ static const char module[] = "ZIPPostEncode";
int state;
sp->stream.avail_in = 0;
@@ -263,7 +263,7 @@ static int
ZIPVSetField(TIFF* tif, ttag_t tag, va_list ap)
{
ZIPState* sp = ZState(tif);
- static char module[] = "ZIPVSetField";
+ static const char module[] = "ZIPVSetField";
switch (tag) {
case TIFFTAG_ZIPQUALITY:
diff --git a/libtiff/tiff.h b/libtiff/tiff.h
index fefce51b..2ccec968 100644
--- a/libtiff/tiff.h
+++ b/libtiff/tiff.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tiff.h,v 1.72 1996/05/10 14:43:54 sam Exp $ */
+/* $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,6 +257,7 @@ typedef enum {
#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,6 +334,8 @@ typedef enum {
#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,4 +400,6 @@ typedef enum {
/* 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 <dev@oceana.com> */
+#define TIFFTAG_DCSCLIPRECTANGLE 65559 /* area of image to acquire */
#endif /* _TIFF_ */
diff --git a/libtiff/tiffconf.h b/libtiff/tiffconf.h
index 13f1ccde..8d36f5d6 100644
--- a/libtiff/tiffconf.h
+++ b/libtiff/tiffconf.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffconf.h,v 1.13 1996/04/05 17:36:53 sam Exp $ */
+/* $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,10 +69,12 @@
* 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,12 +117,13 @@
/*
* ``Orthogonal Features''
*
- * STRIPCHOP_SUPPORT automatically convert single-strip uncompressed images
- * to mutiple strips of ~8Kb (for reducing memory use)
+ * 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_SUPPORT
-#define STRIPCHOP_SUPPORT 1 /* enable strip chopping */
+#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 */
diff --git a/libtiff/tiffio.h b/libtiff/tiffio.h
index 6bd776e7..dd37437c 100644
--- a/libtiff/tiffio.h
+++ b/libtiff/tiffio.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffio.h,v 1.94 1996/06/04 19:04:41 sam Exp $ */
+/* $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,7 +39,7 @@
* version checking should be done based on the
* string returned by TIFFGetVersion.
*/
-#define TIFFLIB_VERSION 19960307 /* March 7, 1996 */
+#define TIFFLIB_VERSION 19970127 /* January 27, 1997 */
/*
* TIFF is defined as an incomplete type to hide the
@@ -52,7 +52,7 @@ typedef struct tiff TIFF;
* 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
+ * 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,6 +71,12 @@ typedef uint16 tsample_t; /* sample number */
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 <windows.h>
#ifdef __WIN32__
@@ -81,8 +87,6 @@ typedef HFILE thandle_t; /* client data handle */
#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
diff --git a/libtiff/tiffiop.h b/libtiff/tiffiop.h
index 6412898a..dd86dc0d 100644
--- a/libtiff/tiffiop.h
+++ b/libtiff/tiffiop.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffiop.h,v 1.80 1996/04/05 17:36:53 sam Exp $ */
+/* $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,6 +227,7 @@ extern int TIFFFlushData1(TIFF*);
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*);