summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Leffler <sam@engr.sgi.com>1997-02-21 01:20:19 +0000
committerRoger Leigh <rleigh@codelibre.net>2022-06-22 19:39:48 +0100
commit7b7dc6a9696b7d7fb1c2fcdd355ee0e3a9d22c2d (patch)
tree2a8da34f4359d1a3a969b4f900e3e8c3724ebe86
parent773e971189d30b0603751845b31c66b62fc913a7 (diff)
downloadlibtiff-git-7b7dc6a9696b7d7fb1c2fcdd355ee0e3a9d22c2d.tar.gz
v3.4beta036 releasev3.4beta036
-rw-r--r--Makefile.in4
-rwxr-xr-xconfigure29
-rw-r--r--dist/tiff.alpha2
-rw-r--r--html/Makefile.in4
-rw-r--r--html/document.html4
-rw-r--r--html/index.html4
-rw-r--r--html/internals.html12
-rw-r--r--html/libtiff.html6
-rw-r--r--html/v3.4beta035.html62
-rw-r--r--html/v3.4beta036.html116
-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
-rw-r--r--man/TIFFGetField.3t8
-rw-r--r--man/TIFFOpen.3t15
-rw-r--r--man/TIFFSetField.3t13
-rw-r--r--man/libtiff.3t5
-rw-r--r--man/tiff2ps.146
-rw-r--r--man/tiffcp.19
-rw-r--r--man/tiffinfo.17
-rw-r--r--tools/Makefile.in6
-rw-r--r--tools/pal2rgb.c4
-rw-r--r--tools/sgigt.c6
-rw-r--r--tools/tiff2ps.c41
-rw-r--r--tools/tiffcp.c8
-rw-r--r--tools/tiffdump.c27
-rw-r--r--tools/tiffinfo.c11
48 files changed, 576 insertions, 210 deletions
diff --git a/Makefile.in b/Makefile.in
index 055c7f81..6389aef0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,5 +1,5 @@
#! smake
-# $Header: /usr/people/sam/tiff/RCS/Makefile.in,v 1.57 1996/06/10 22:24:41 sam Exp $
+# $Header: /usr/people/sam/tiff/RCS/Makefile.in,v 1.58 1997/02/21 01:20:19 sam Exp $
#
# @WARNING@
#
@@ -272,6 +272,8 @@ TIFFFILES=\
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 \
diff --git a/configure b/configure
index 92b2b5c4..5149317f 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Header: /usr/people/sam/tiff/RCS/configure,v 1.52 1996/06/10 20:48:14 sam Exp $
+# $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,7 +147,7 @@ do
-target|--target) ac_prev=TARGET;;
-target=*|--target=*) TARGET="$ac_optarg" ;;
-version|--version)
- echo "This is TIFF configure $Revision: 1.52 $"
+ echo "This is TIFF configure $Revision: 1.56 $"
exit 0
;;
-help|--help) usage; exit 0;;
@@ -1093,6 +1093,7 @@ if [ "$DSO" = auto ]; then
DSOSUF=so
DSOOPTS='-elf -shared -no_unresolved -all'
DSO=IRIX52
+ TIFFLIBREF='-L${DEPTH}/libtiff -rpath '${DIR_LIB}' -ltiff'
fi
;;
*-irix*)
@@ -1101,6 +1102,7 @@ if [ "$DSO" = auto ]; then
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,24 +1111,31 @@ if [ "$DSO" = auto ]; then
LIBCOPTS="-bM\:SRE"
DSO=AIX
;;
+ *-hpux*yes)
+ DSOSUF=sl
+ DSOLD=gcc
+ DSOOPTS='-fpic -shared'
+ LIBCOPTS=-fpic
+ DSO=HPUX
+ ;;
*-hpux*)
DSOSUF=sl
DSOOPTS='-b'
LIBCOPTS="+Z"
# LIBPORT="-Wl,+b${DIR_LIB}"
DSO=HPUX
- ;;
- *-solaris*-yes)
- DSOSUF=so
- DSOOPTS='-G'
- LIBCOPTS="-fpic"
- DSO=SOLARIS
+ TIFFLIBREF="-Wl,+s,+b${DIR_LIB}"' -L${DEPTH}/libtiff -ltiff'
;;
*-solaris*)
DSOSUF=so
DSOOPTS='-G'
- LIBCOPTS="-K PIC"
+ 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,7 +1150,7 @@ if [ "$DSO" = auto ]; then
TIFFLIBREF='-L${DEPTH}/libtiff -ltiff'
;;
*-linux*)
- if [ -x /lib/libc.so.5 ]; then
+ if [ -r /lib/libc.so.5 ]; then
DSOSUF=so.${DIST_MAJOR}
DSOSUF_VERSION=${DSOSUF}.${DIST_MINOR}.${DIST_ALPHA}
LIBCOPTS='-fPIC'
diff --git a/dist/tiff.alpha b/dist/tiff.alpha
index c6261fe1..21bf733e 100644
--- a/dist/tiff.alpha
+++ b/dist/tiff.alpha
@@ -1 +1 @@
-define ALPHA 035
+define ALPHA 036
diff --git a/html/Makefile.in b/html/Makefile.in
index c443ee71..8e6b677c 100644
--- a/html/Makefile.in
+++ b/html/Makefile.in
@@ -1,4 +1,4 @@
-# $Header: /usr/people/sam/tiff/html/RCS/Makefile.in,v 1.13 1996/06/05 21:43:27 sam Exp $
+# $Header: /usr/people/sam/tiff/html/RCS/Makefile.in,v 1.14 1997/02/21 01:20:12 sam Exp $
#
# @WARNING@
#
@@ -71,6 +71,8 @@ HTMLFILES=\
v3.4beta032.html \
v3.4beta033.html \
v3.4beta034.html \
+ v3.4beta035.html \
+ v3.4beta036.html \
${NULL}
IMAGES=\
images/back.gif \
diff --git a/html/document.html b/html/document.html
index 38434774..2e200e24 100644
--- a/html/document.html
+++ b/html/document.html
@@ -39,7 +39,7 @@ Adobe (nee Aldus) also provides the 6.0 spec online in
Acrobat format (PDF); this can be found at
<UL>
-<A HREF="ftp://ftp.adobe.com/pub/adobe/DeveloperSupport/TechNotes/PDFfiles/TIFF6.pdf">ftp://ftp.adobe.com/pub/adobe/DeveloperSupport/TechNotes/PDFfiles/TIFF6.pdf</A>
+<A HREF="ftp://ftp.adobe.com/pub/adobe/devrelations/devtechnotes/pdffiles/tiff6.pdf">ftp://ftp.adobe.com/pub/adobe/devrelations/devtechnotes/pdffiles/tiff6.pdf</A>
</UL>
TIFF Technical Notes can be retrieved from
@@ -53,7 +53,7 @@ TIFF Technical Notes can be retrieved from
<ADDRESS>
<A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>.
-Last updated: $Date: 1996/04/29 19:18:06 $
+Last updated: $Date: 1996/11/10 16:39:43 $
</ADDRESS>
</BODY>
diff --git a/html/index.html b/html/index.html
index e6c7a26e..6934f31d 100644
--- a/html/index.html
+++ b/html/index.html
@@ -12,7 +12,7 @@ TIFF Software
</H1>
<B>Latest Release</B>: <A HREF="v3.4beta033.html">v3.4</A><BR>
-<B>Latest Software</B>: <A HREF="v3.4beta034.html">v3.4beta034</A><BR>
+<B>Latest Software</B>: <A HREF="v3.4beta036.html">v3.4beta036</A><BR>
<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<B>Home Page</B>: <A HREF="http://www-mipl.jpl.nasa.gov/~ndr/tiff/">
http://www-mipl.jpl.nasa.gov/~ndr/tiff/</A> <BR>
@@ -81,7 +81,7 @@ the master FTP site listed above.
<ADDRESS>
<A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>.
-Last updated: $Date: 1996/05/21 19:01:11 $
+Last updated: $Date: 1997/02/21 01:20:12 $
</ADDRESS>
</BODY>
diff --git a/html/internals.html b/html/internals.html
index 94f8c29d..756b5ab0 100644
--- a/html/internals.html
+++ b/html/internals.html
@@ -199,6 +199,16 @@ run-length encoding scheme from ThunderScan (compression 32809)</TD>
<TD>support for the TIFF 6.0 CMYK-related tags</TD>
</TR>
+<TR>
+<TD VALIGN=top><TT>ICC_SUPPORT</TT></TD>
+<TD>support for the ICC Profile tag; see
+<I>The ICC Profile Format Specification</I>,
+Annex B.3 "Embedding ICC Profiles in TIFF Files";
+available at
+<A HREF=http://www.color.org>http://www.color.org</A>
+</TD>
+</TR>
+
</TABLE>
@@ -639,7 +649,7 @@ the portability of your TIFF files.
<ADDRESS>
<A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>.
-Last updated: $Date: 1996/04/29 19:18:06 $
+Last updated: $Date: 1996/12/13 05:31:06 $
</ADDRESS>
</BODY>
diff --git a/html/libtiff.html b/html/libtiff.html
index 7fffe63e..75607d77 100644
--- a/html/libtiff.html
+++ b/html/libtiff.html
@@ -230,7 +230,7 @@ main(int argc, char* argv[])
{
TIFF* tif = TIFFOpen(argv[1], "r");
if (tif) {
- int dircount = 1;
+ int dircount = 0;
do {
dircount++;
} while (TIFFReadDirectory(tif));
@@ -375,7 +375,7 @@ main(int argc, char* argv[])
npixels = w * h;
raster = (uint32*) _TIFFmalloc(npixels * sizeof (uint32));
if (raster != NULL) {
- if (TIFFReadRGBAImage(tif, raster, w, h, 0)) {
+ if (TIFFReadRGBAImage(tif, w, h, raster, 0)) {
...process raster data...
}
_TIFFfree(raster);
@@ -738,7 +738,7 @@ main()
<ADDRESS>
<A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>.
-Last updated: $Date: 1996/04/29 19:18:06 $
+Last updated: $Date: 1996/08/29 01:08:05 $
</ADDRESS>
</BODY>
diff --git a/html/v3.4beta035.html b/html/v3.4beta035.html
new file mode 100644
index 00000000..56433968
--- /dev/null
+++ b/html/v3.4beta035.html
@@ -0,0 +1,62 @@
+<HTML>
+<HEAD>
+<TITLE>
+Changes in TIFF v3.4beta035
+</TITLE>
+</HEAD>
+
+<BODY>
+
+<BASEFONT SIZE=4>
+<B><FONT SIZE=+3>T</FONT>IFF <FONT SIZE=+2>C</FONT>HANGE <FONT SIZE=+2>I</FONT>NFORMATION</B>
+<BASEFONT SIZE=3>
+
+<UL>
+<HR SIZE=4 WIDTH=65% ALIGN=left>
+<B>Current Version</B>: v3.4beta035<BR>
+<B>Previous Version</B>: <A HREF=v3.4beta034.html>v3.4beta034</A><BR>
+<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<HR SIZE=4 WIDTH=65% ALIGN=left>
+</UL>
+
+<P>
+This document describes the changes made to the software between the
+<I>previous</I> and <I>current</I> 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:
+<UL>
+<LI><A HREF="#configure">Changes in the software configuration</A>
+<LI><A HREF="#libtiff">Changes in libtiff</A>
+</UL>
+
+<P><HR WIDTH=65% ALIGN=right>
+
+<A NAME="configure"><B><FONT SIZE=+3>C</FONT>HANGES IN THE SOFTWARE CONFIGURATION:</B></A>
+
+<UL>
+<LI>support was added installing the HTML documentation
+<LI>support was added for building the library as a DSO under FreeBSD
+</UL>
+
+<P><HR WIDTH=65% ALIGN=right>
+
+<A NAME="libtiff"><B><FONT SIZE=+3>C</FONT>HANGES IN LIBTIFF:</B></A>
+
+<UL>
+<LI>the interface to the <B>mkversion</B> program was restored to
+ the form used prior to v3.4beta034
+<LI>several portability problems for 16-bit systems were fixed
+</UL>
+
+<A HREF="index.html"><IMG SRC="images/back.gif"></A> TIFF home page.<BR>
+
+<HR>
+
+<ADDRESS>
+<A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
+Last updated $Date: 1997/02/21 01:20:07 $.
+</ADDRESS>
+
+</BODY>
+</HTML>
diff --git a/html/v3.4beta036.html b/html/v3.4beta036.html
new file mode 100644
index 00000000..22a62270
--- /dev/null
+++ b/html/v3.4beta036.html
@@ -0,0 +1,116 @@
+<HTML>
+<HEAD>
+<TITLE>
+Changes in TIFF v3.4beta036
+</TITLE>
+</HEAD>
+
+<BODY>
+
+<BASEFONT SIZE=4>
+<B><FONT SIZE=+3>T</FONT>IFF <FONT SIZE=+2>C</FONT>HANGE <FONT SIZE=+2>I</FONT>NFORMATION</B>
+<BASEFONT SIZE=3>
+
+<UL>
+<HR SIZE=4 WIDTH=65% ALIGN=left>
+<B>Current Version</B>: v3.4beta036<BR>
+<B>Previous Version</B>: <A HREF=v3.4beta035.html>v3.4beta035</A><BR>
+<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<HR SIZE=4 WIDTH=65% ALIGN=left>
+</UL>
+
+<P>
+This document describes the changes made to the software between the
+<I>previous</I> and <I>current</I> 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:
+<UL>
+<LI><A HREF="#configure">Changes in the software configuration</A>
+<LI><A HREF="#libtiff">Changes in libtiff</A>
+<LI><A HREF="#tools">Changes in the tools</A>
+</UL>
+
+<P><HR WIDTH=65% ALIGN=right>
+
+<A NAME="configure"><B><FONT SIZE=+3>C</FONT>HANGES IN THE SOFTWARE CONFIGURATION:</B></A>
+
+<UL>
+<LI>support was added for building the library as a DSO under HP-UX with
+ the native C compiler
+<LI>tools are now built with explicit pathnames for the DSO under IRIX,
+ Solaris, and Linux
+<LI>DSO configuration support for Linux was changed to require that
+ <B>libc.so</B> only be readable (not executable)
+</UL>
+
+<P><HR WIDTH=65% ALIGN=right>
+
+<A NAME="libtiff"><B><FONT SIZE=+3>C</FONT>HANGES IN LIBTIFF:</B></A>
+
+<UL>
+<LI>support was add for ICC: <TT>NumberOfInks</TT>, and <TT>ICCProfile</TT>
+<LI>a memory leak caused by doing <TT>TIFFSetDirectory(0)</TT> was fixed
+<LI>a bug was fixed whereby certain multi-directory files were not
+ properly handled when accessed by mapping the data into memory
+<LI>the strip chopping support is now always compiled
+ into the library with the default usage controlled by a
+ <TT>STRIPCHOP_DEFAULT</TT> configuration parameter
+<LI>the strip chopping support no longer chops tiled images
+<LI>all static strings are now const--for shared libraries
+<LI>the logic for estimating the strip size of images without
+ a <TT>StripByteCounts</TT> tag was improved by handling
+ <TT>PlanarContig</TT> images differently from <TT>PlanarSeparate</TT>
+<LI>a bug was fixed in the G3 codec when converting the Y resolution
+ of data specified in metric units
+<LI>a bug was fixed in the G3/G4 decoder for data where lines terminate
+ with a v0 code
+<LI>the <TT>TIFFRGBAImage</TT> support was changed to scale 16-bit colormap
+ entries more conservatively to avoid problems with applications
+ that do not generate fully saturated pixel values
+<LI>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
+<LI>a bug was fixed in <TT>TIFFPrintDirectory</TT>'s handling of the
+ <TT>InkNames</TT> tag
+<LI><TT>TIFFPrintDirectory</TT> now understands <TT>NumberOfInks</TT>
+ and ICC-related tags
+<LI>the routines for reading image data now provide more useful information
+ when a read error is encountered
+<LI>support was added for compiling with Microsoft Visual C++ 4.0
+</UL>
+
+<P><HR WIDTH=65% ALIGN=right>
+
+<A NAME="tools"><B><FONT SIZE=+3>C</FONT>HANGES IN THE TOOLS:</B></A>
+
+<UL>
+<LI>a bug was fixed in <B>pal2rgb</B>'s colormap handling
+<LI><B>tiff2ps</B> 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
+<LI><B>tiff2ps</B> does a better job guarding against the mishandling
+ of greyscale images
+<LI><B>tiff2ps</B> now correctly converts X- and Y-resolution values
+ specified in metric units
+<LI><B>tiffdump</B> has a new <TT>-m</TT> option to control the maximum
+ number of indirect
+ data values printed for a tag (by default 24)
+<LI><B>tiffdump</B> understands several new tags
+<LI><B>tiffdump</B> now shows any terminating null in ASCII strings
+<LI><B>tiffinfo</B> now suppresses strip chopping when interpreting an image;
+ a new <TT>-z</TT> option has been added to enable strip chopping
+</UL>
+
+<A HREF="index.html"><IMG SRC="images/back.gif"></A> TIFF home page.<BR>
+
+<HR>
+
+<ADDRESS>
+<A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
+Last updated $Date: 1997/02/21 01:20:07 $.
+</ADDRESS>
+
+</BODY>
+</HTML>
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*);
diff --git a/man/TIFFGetField.3t b/man/TIFFGetField.3t
index fa8f8ec5..9768658e 100644
--- a/man/TIFFGetField.3t
+++ b/man/TIFFGetField.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFGetField.3t,v 1.16 1995/10/11 19:45:29 sam Exp $
+.\" $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,11 +179,17 @@ TIFFTAG_YCBCRPOSITIONING 1 uint16*
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.
diff --git a/man/TIFFOpen.3t b/man/TIFFOpen.3t
index d33394a8..5e98c301 100644
--- a/man/TIFFOpen.3t
+++ b/man/TIFFOpen.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFOpen.3t,v 1.14 1996/01/09 22:45:06 sam Exp $
+.\" $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,18 +186,19 @@ Disable the use of memory-mapped files.
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],
+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 [tile]
+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 [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.
+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.
diff --git a/man/TIFFSetField.3t b/man/TIFFSetField.3t
index f292733a..0c7a29d3 100644
--- a/man/TIFFSetField.3t
+++ b/man/TIFFSetField.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/TIFFSetField.3t,v 1.15 1995/10/11 19:45:29 sam Exp $
+.\" $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,6 +89,9 @@ is an unsigned 16-bit value;
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,15 +164,23 @@ TIFFTAG_YCBCRPOSITIONING 1 uint16 \(dg
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.
diff --git a/man/libtiff.3t b/man/libtiff.3t
index 085729eb..411a4659 100644
--- a/man/libtiff.3t
+++ b/man/libtiff.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/libtiff.3t,v 1.22 1996/01/09 22:47:08 sam Exp $
+.\" $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,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH INTRO 3T "October 15, 1995"
+.TH INTRO 3T "August 1, 1996"
.SH NAME
libtiff \- introduction to
.IR libtiff ,
@@ -285,6 +285,7 @@ MaxSampleValue 281 R/W
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
diff --git a/man/tiff2ps.1 b/man/tiff2ps.1
index 5085ec5d..d636524b 100644
--- a/man/tiff2ps.1
+++ b/man/tiff2ps.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tiff2ps.1,v 1.18 1995/10/11 19:42:04 sam Exp $
+.\" $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,11 +23,12 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFF2PS 1 "October 15, 1995"
+.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 PostScript\(tm
+image to \*(Ps\(tm
.SH SYNOPSIS
.B tiff2ps
[
@@ -38,17 +39,17 @@ image to PostScript\(tm
.I tiff2ps
reads
.SM TIFF
-images and writes PostScript or Encapsulated PostScript (EPS)
+images and writes \*(Ps or Encapsulated \*(Ps (EPS)
on the standard output.
By default,
.I tiff2ps
-writes Encapsulated PostScript for the first image in the specified
+writes Encapsulated \*(Ps 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
+will generate \*(Ps that fills a printed area specified
by the
.SM TIFF
tags in the input file.
@@ -67,22 +68,22 @@ overriding any relevant
.SM TIFF
tags.
.PP
-The PostScript generated for
+The \*(Ps generated for
.SM RGB,
palette, and
.SM CMYK
images uses the
.I colorimage
operator.
-The PostScript generated for
+The \*(Ps generated for
greyscale and bilevel images
uses the
.I image
operator.
When the
.I colorimage
-operator is used, PostScript code to emulate this operator
-on older PostScript printers is also generated.
+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,10 +91,10 @@ a white background.
.SH OPTIONS
.TP
.B \-1
-Generate PostScript Level I (the default).
+Generate \*(Ps Level I (the default).
.TP
.B \-2
-Generate PostScript Level II.
+Generate \*(Ps Level II.
.TP
.B \-a
Generate output for all IFDs (pages) in the input file.
@@ -107,7 +108,7 @@ This option is useful for selecting individual pages in a
multi-page (e.g. facsimile) file.
.TP
.B \-e
-Force the generation of Encapsulated PostScript.
+Force the generation of Encapsulated \*(Ps.
.TP
.B \-h
Specify the vertical size of the printed area (in inches).
@@ -122,15 +123,24 @@ This option is useful for selecting thumbnail images and the
like which are hidden using the SubIFD tag.
.TP
.B \-p
-Force the generation of (non-Encapsulated) PostScript.
+Force the generation of (non-Encapsulated) \*(Ps.
.TP
.B \-s
Generate output for a single IFD (page) in the input file.
.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 PostScript Level II for all pages of a facsimile:
+The following generates \*(Ps Level II for all pages of a facsimile:
.RS
.nf
tiff2ps -a2 fax.tif | lpr
@@ -139,7 +149,7 @@ tiff2ps -a2 fax.tif | lpr
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
+To generate Encapsulated \*(Ps for a the image at directory 2
of an image use:
.RS
.nf
@@ -148,8 +158,8 @@ tiff2ps -d 1 foo.tif
.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.
+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.
diff --git a/man/tiffcp.1 b/man/tiffcp.1
index e928c866..e0cc4ef4 100644
--- a/man/tiffcp.1
+++ b/man/tiffcp.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tiffcp.1,v 1.23 1996/01/10 00:01:03 sam Exp $
+.\" $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,6 +64,7 @@ the image data content in any way.
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,21 +135,23 @@ will create a new file with the same fill order as the original.
Specifying
.B "\-f lsb2msb"
will force data to be written with the FillOrder tag set to
-.SM LSB2MSB ,
+.SM LSB2MSB,
while
.B "\-f msb2lsb"
will force data to be written with the FillOrder tag set to
-.SM MSB2LSB .
+.SM MSB2LSB.
.TP
.B \-l
Specify the length of a tile (in pixels).
.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
diff --git a/man/tiffinfo.1 b/man/tiffinfo.1
index b46ab504..550efcbd 100644
--- a/man/tiffinfo.1
+++ b/man/tiffinfo.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/people/sam/tiff/man/RCS/tiffinfo.1,v 1.17 1995/10/11 19:42:08 sam Exp $
+.\" $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,7 +23,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
-.TH TIFFINFO 1 "May 2, 1990"
+.TH TIFFINFO 1 "January 27, 1997"
.SH NAME
tiffinfo \- print information about
.SM TIFF
@@ -69,6 +69,9 @@ i.e. a leading ``0x'' for hexadecimal and a leading ``0'' for octal.
.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
.SM TIFF
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 193160cb..dc522592 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -1,4 +1,4 @@
-# $Header: /usr/people/sam/tiff/tools/RCS/Makefile.in,v 1.19 1996/05/21 18:31:15 sam Exp $
+# $Header: /usr/people/sam/tiff/tools/RCS/Makefile.in,v 1.21 1996/08/26 23:39:12 sam Exp $
#
# @WARNING@
#
@@ -241,11 +241,11 @@ sgi2tiff.o: ${SRCDIR}/sgi2tiff.c
# SGI versions of tiffgt & tiffsv that require -lgl
tiffgt: sgigt.o ${TIFFLIB}
- ${CC} -o tiffgt ${CFLAGS} sgigt.o ${LIBS} -lgutil -lgl_s
+ ${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 ${LIBS} -lgutil -lgl_s
+ ${CC} -o tiffsv ${CFLAGS} sgisv.o -lgutil -lgl ${LIBS}
sgisv.o: ${SRCDIR}/sgisv.c
${CC} -c ${CFLAGS} ${SRCDIR}/sgisv.c
diff --git a/tools/pal2rgb.c b/tools/pal2rgb.c
index e26d7318..fced076c 100644
--- a/tools/pal2rgb.c
+++ b/tools/pal2rgb.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/pal2rgb.c,v 1.29 1996/01/10 19:35:29 sam Exp $ */
+/* $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,7 +161,7 @@ main(int argc, char* argv[])
*/
int i;
- for (i = (1<<bitspersample)-1; i > 0; i--) {
+ for (i = (1<<bitspersample)-1; i >= 0; i--) {
#define CVT(x) (((x) * 255) / ((1L<<16)-1))
rmap[i] = CVT(rmap[i]);
gmap[i] = CVT(gmap[i]);
diff --git a/tools/sgigt.c b/tools/sgigt.c
index 4e5ed0e7..98f04cd4 100644
--- a/tools/sgigt.c
+++ b/tools/sgigt.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/sgigt.c,v 1.66 1996/01/10 19:35:32 sam Exp $ */
+/* $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,7 +228,7 @@ main(int argc, char* argv[])
if (raster != NULL)
_TIFFfree(raster), raster = NULL;
raster = (uint32*) _TIFFmalloc(w * h * sizeof (uint32));
- if (raster == 0) {
+ if (raster == NULL) {
width = height = 0;
TIFFError(filename, "No space for raster buffer");
goto bad3;
@@ -868,7 +868,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr22tile)
{
YCbCrSetup;
uint32* cp1 = cp+w+toskew;
- unsigned int incr = 2*toskew+w;
+ int32 incr = 2*toskew+w;
(void) y;
/* XXX adjust fromskew */
diff --git a/tools/tiff2ps.c b/tools/tiff2ps.c
index d3e27558..2ceab788 100644
--- a/tools/tiff2ps.c
+++ b/tools/tiff2ps.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/tiff2ps.c,v 1.48 1996/01/10 19:35:35 sam Exp $ */
+/* $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,6 +46,7 @@ int printAll = FALSE; /* print all images in file */
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,7 +84,7 @@ main(int argc, char* argv[])
extern int optind;
FILE* output = stdout;
- while ((c = getopt(argc, argv, "h:w:d:o:O:aeps128DT")) != -1)
+ while ((c = getopt(argc, argv, "h:w:d:o:O:aezps128DT")) != -1)
switch (c) {
case 'd':
dirnum = atoi(optarg);
@@ -124,6 +125,9 @@ main(int argc, char* argv[])
case 'w':
pageWidth = atof(optarg);
break;
+ case 'z':
+ PSavoiddeadzone = FALSE;
+ break;
case '1':
level2 = FALSE;
ascii85 = FALSE;
@@ -280,7 +284,7 @@ setupPageState(TIFF* tif, uint32* pw, uint32* ph, float* pprw, float* pprh)
yres = PS_UNIT_SIZE;
switch (res_unit) {
case RESUNIT_CENTIMETER:
- xres /= 2.54, yres /= 2.54;
+ xres *= 2.54, yres *= 2.54;
break;
case RESUNIT_NONE:
xres *= PS_UNIT_SIZE, yres *= PS_UNIT_SIZE;
@@ -314,6 +318,7 @@ TIFF2PS(FILE* fd, TIFF* tif, float pw, float ph)
{
uint32 w, h;
float ox, oy, prw, prh;
+ float scale;
uint32 subfiletype;
uint16* sampleinfo;
static int npages = 0;
@@ -361,10 +366,16 @@ TIFF2PS(FILE* fd, TIFF* tif, float pw, float ph)
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
+ 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,6 +414,16 @@ end\n\
%%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,6 +449,8 @@ PSHead(FILE *fd, TIFF *tif, uint32 w, uint32 h, float pw, float ph,
fprintf(fd, "%s", DuplexPreamble);
if (PStumble)
fprintf(fd, "%s", TumblePreamble);
+ if (PSavoiddeadzone && level2)
+ fprintf(fd, "%s", AvoidDeadZonePreamble);
fprintf(fd, "%%%%EndSetup\n");
}
@@ -583,7 +606,7 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
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)
+ 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,7 +1335,6 @@ Ascii85Put(unsigned char code, FILE* fd)
ascii85breaklen = 2*MAXLINE;
}
}
- p += 4;
}
_TIFFmemcpy(ascii85buf, p, n);
ascii85count = n;
@@ -1348,6 +1370,7 @@ char* stuff[] = {
" -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
};
diff --git a/tools/tiffcp.c b/tools/tiffcp.c
index c87cc46c..ef155698 100644
--- a/tools/tiffcp.c
+++ b/tools/tiffcp.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/tiffcp.c,v 1.48 1996/01/10 19:35:36 sam Exp $ */
+/* $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,6 +399,7 @@ static struct cpTag {
{ 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 },
@@ -512,6 +513,11 @@ tiffcp(TIFF* in, TIFF* out)
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);
diff --git a/tools/tiffdump.c b/tools/tiffdump.c
index 16a9f3a3..883d87d9 100644
--- a/tools/tiffdump.c
+++ b/tools/tiffdump.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/tiffdump.c,v 1.49 1996/03/29 16:38:33 sam Exp $ */
+/* $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,8 +64,9 @@ char* appname;
char* curfile;
int swabflag;
int bigendian;
-int typeshift[13]; /* data type shift counts */
-long typemask[13]; /* data type masks */
+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,7 +100,7 @@ main(int argc, char* argv[])
bigendian = (*(char *)&one == 0);
appname = argv[0];
- while ((c = getopt(argc, argv, "o:h")) != -1) {
+ while ((c = getopt(argc, argv, "m:o:h")) != -1) {
switch (c) {
case 'h': /* print values in hex */
shortfmt = "%s%#x";
@@ -110,6 +111,9 @@ main(int argc, char* argv[])
case 'o':
diroff = (uint32) strtoul(optarg, NULL, 0);
break;
+ case 'm':
+ maxitems = strtoul(optarg, NULL, 0);
+ break;
default:
usage();
}
@@ -347,8 +351,13 @@ ReadDirectory(int fd, unsigned ix, uint32 off)
unsigned char *data = (unsigned char *)_TIFFmalloc(space);
if (data) {
if (TIFFFetchData(fd, dp, data))
- PrintData(stdout, dp->tdir_type,
- dp->tdir_count, 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,6 +432,7 @@ static struct tagname {
{ TIFFTAG_SUBIFD, "SubIFD" },
{ TIFFTAG_INKSET, "InkSet" },
{ TIFFTAG_INKNAMES, "InkNames" },
+ { TIFFTAG_NUMBEROFINKS, "NumberOfInks" },
{ TIFFTAG_DOTRANGE, "DotRange" },
{ TIFFTAG_TARGETPRINTER, "TargetPrinter" },
{ TIFFTAG_EXTRASAMPLES, "ExtraSamples" },
@@ -452,6 +462,7 @@ static struct tagname {
{ 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,8 +578,10 @@ PrintASCII(FILE* fd, uint32 cc, const unsigned char* cp)
break;
if (*tp)
fprintf(fd, "\\%c", *tp);
- else
+ else if (*cp)
fprintf(fd, "\\%03o", *cp);
+ else
+ fprintf(fd, "\\0");
}
}
diff --git a/tools/tiffinfo.c b/tools/tiffinfo.c
index fc53887f..3a30909e 100644
--- a/tools/tiffinfo.c
+++ b/tools/tiffinfo.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/tools/RCS/tiffinfo.c,v 1.26 1996/01/10 19:35:39 sam Exp $ */
+/* $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,8 +51,9 @@ main(int argc, char* argv[])
extern char* optarg;
long flags = 0;
uint32 diroff = 0;
+ int chopstrips = 0; /* disable strip chopping */
- while ((c = getopt(argc, argv, "f:o:cdDSjlmrsvw0123456789")) != -1)
+ 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,6 +97,9 @@ main(int argc, char* argv[])
case 'w':
showwords = 1;
break;
+ case 'z':
+ chopstrips = 1;
+ break;
case '?':
usage();
/*NOTREACHED*/
@@ -106,7 +110,7 @@ main(int argc, char* argv[])
for (; optind < argc; optind++) {
if (multiplefiles)
printf("%s:\n", argv[optind]);
- tif = TIFFOpen(argv[optind], "r");
+ tif = TIFFOpen(argv[optind], chopstrips ? "rC" : "rc");
if (tif != NULL) {
if (dirnum != -1) {
if (TIFFSetDirectory(tif, dirnum))
@@ -139,6 +143,7 @@ char* stuff[] = {
" -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
};