summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Welles <mike@onshore.com>1999-09-28 17:22:20 +0100
committerRoger Leigh <rleigh@codelibre.net>2022-06-22 23:29:50 +0100
commit4e500fc403b41416d3febb9aec42af4c01f5ea47 (patch)
treec6f6010186a0648de50210deeb38d5f886f6a363
parent00c28dda69f1be886da146b085f795478d661ddf (diff)
downloadlibtiff-git-tiff-3.5-oldcvs.tar.gz
v3.5.2 releasev3.5.2tiff-3.5-oldcvs
-rw-r--r--CVS/Entries22
-rw-r--r--CVS/Repository1
-rw-r--r--CVS/Root1
-rw-r--r--Makefile.in81
-rw-r--r--README3
-rw-r--r--README-IPTC41
-rw-r--r--README-v3.5.18
-rw-r--r--TODO2
-rw-r--r--VERSION2
-rwxr-xr-xconfig.guess3
-rw-r--r--config.site6
-rwxr-xr-xconfigure14
-rw-r--r--contrib/CVS/Entries13
-rw-r--r--contrib/CVS/Repository1
-rw-r--r--contrib/CVS/Root1
-rw-r--r--contrib/acorn/CVS/Entries7
-rw-r--r--contrib/acorn/CVS/Repository1
-rw-r--r--contrib/acorn/CVS/Root1
-rw-r--r--contrib/addtiffo/Makefile27
-rwxr-xr-xcontrib/addtiffo/Makefile.vc27
-rw-r--r--contrib/addtiffo/README145
-rw-r--r--contrib/addtiffo/addtiffo.c115
-rw-r--r--contrib/addtiffo/rawblockedimage.cpp403
-rw-r--r--contrib/addtiffo/rawblockedimage.h108
-rw-r--r--contrib/addtiffo/tif_overview.cpp559
-rw-r--r--contrib/dbs/CVS/Entries7
-rw-r--r--contrib/dbs/CVS/Repository1
-rw-r--r--contrib/dbs/CVS/Root1
-rw-r--r--contrib/dbs/xtiff/CVS/Entries6
-rw-r--r--contrib/dbs/xtiff/CVS/Repository1
-rw-r--r--contrib/dbs/xtiff/CVS/Root1
-rw-r--r--contrib/dosdjgpp/CVS/Entries7
-rw-r--r--contrib/dosdjgpp/CVS/Repository1
-rw-r--r--contrib/dosdjgpp/CVS/Root1
-rw-r--r--contrib/dosdjgpp/Makefile.lib2
-rw-r--r--contrib/dosdjgpp/Makefile.tools2
-rw-r--r--contrib/dosdjgpp/Makefile.top2
-rw-r--r--contrib/iptcutil/CVS/Entries5
-rw-r--r--contrib/iptcutil/CVS/Repository1
-rw-r--r--contrib/iptcutil/CVS/Root1
-rw-r--r--contrib/iptcutil/Makefile12
-rw-r--r--contrib/iptcutil/iptcutil.c920
-rw-r--r--contrib/iptcutil/test.iptcbin1107 -> 0 bytes
-rw-r--r--contrib/iptcutil/test.txt32
-rw-r--r--contrib/mac-cw/CVS/Entries8
-rw-r--r--contrib/mac-cw/CVS/Repository1
-rw-r--r--contrib/mac-cw/CVS/Root1
-rw-r--r--contrib/mac-mpw/CVS/Entries8
-rw-r--r--contrib/mac-mpw/CVS/Repository1
-rw-r--r--contrib/mac-mpw/CVS/Root1
-rw-r--r--contrib/mfs/CVS/Entries3
-rw-r--r--contrib/mfs/CVS/Repository1
-rw-r--r--contrib/mfs/CVS/Root1
-rw-r--r--contrib/pds/CVS/Entries6
-rw-r--r--contrib/pds/CVS/Repository1
-rw-r--r--contrib/pds/CVS/Root1
-rw-r--r--contrib/pds/tif_imageiter.c2
-rw-r--r--contrib/pds/tif_pdsdirread.c2
-rw-r--r--contrib/pds/tif_pdsdirwrite.c2
-rw-r--r--contrib/ras/CVS/Entries4
-rw-r--r--contrib/ras/CVS/Repository1
-rw-r--r--contrib/ras/CVS/Root1
-rw-r--r--contrib/tags/Makefile.gcc56
-rw-r--r--contrib/tags/Makefile.mpw67
-rw-r--r--contrib/tags/README116
-rw-r--r--contrib/tags/listtif.c32
-rw-r--r--contrib/tags/maketif.c70
-rw-r--r--contrib/tags/xtif_dir.c343
-rw-r--r--contrib/tags/xtiffio.h52
-rw-r--r--contrib/tags/xtiffiop.h65
-rw-r--r--contrib/vms/CVS/Entries2
-rw-r--r--contrib/vms/CVS/Repository1
-rw-r--r--contrib/vms/CVS/Root1
-rw-r--r--contrib/vms/libtiff/CVS/Entries6
-rw-r--r--contrib/vms/libtiff/CVS/Repository1
-rw-r--r--contrib/vms/libtiff/CVS/Root1
-rw-r--r--contrib/vms/tools/CVS/Entries2
-rw-r--r--contrib/vms/tools/CVS/Repository1
-rw-r--r--contrib/vms/tools/CVS/Root1
-rw-r--r--contrib/win32/CVS/Entries4
-rw-r--r--contrib/win32/CVS/Repository1
-rw-r--r--contrib/win32/CVS/Root1
-rw-r--r--contrib/win95/CVS/Entries4
-rw-r--r--contrib/win95/CVS/Repository1
-rw-r--r--contrib/win95/CVS/Root1
-rw-r--r--contrib/winnt/CVS/Entries8
-rw-r--r--contrib/winnt/CVS/Repository1
-rw-r--r--contrib/winnt/CVS/Root1
-rw-r--r--dist/CVS/Entries6
-rw-r--r--dist/CVS/Repository1
-rw-r--r--dist/CVS/Root1
-rwxr-xr-xdist/newalpha2
-rw-r--r--dist/newversion2
-rw-r--r--dist/tiff.alpha2
-rw-r--r--dist/tiff.spec2
-rw-r--r--dist/tiff.version2
-rw-r--r--html/CVS/Entries27
-rw-r--r--html/CVS/Repository1
-rw-r--r--html/CVS/Root1
-rw-r--r--html/Makefile.in2
-rw-r--r--html/build.html4
-rw-r--r--html/document.html4
-rw-r--r--html/images/CVS/Entries17
-rw-r--r--html/images/CVS/Repository1
-rw-r--r--html/images/CVS/Root1
-rw-r--r--html/index.html33
-rw-r--r--html/v3.5.1.html75
-rw-r--r--libtiff/CVS/Entries57
-rw-r--r--libtiff/CVS/Repository1
-rw-r--r--libtiff/CVS/Root1
-rw-r--r--libtiff/Makefile.in16
-rw-r--r--libtiff/Makefile.lcc2
-rw-r--r--libtiff/makefile.vc79
-rw-r--r--libtiff/mkg3states.c2
-rw-r--r--libtiff/mkspans.c2
-rw-r--r--libtiff/mkversion.c4
-rw-r--r--libtiff/tif_acorn.c2
-rw-r--r--libtiff/tif_apple.c2
-rw-r--r--libtiff/tif_atari.c2
-rw-r--r--libtiff/tif_aux.c2
-rw-r--r--libtiff/tif_close.c2
-rw-r--r--libtiff/tif_codec.c2
-rw-r--r--libtiff/tif_compress.c2
-rw-r--r--libtiff/tif_dir.c58
-rw-r--r--libtiff/tif_dir.h2
-rw-r--r--libtiff/tif_dirinfo.c2
-rw-r--r--libtiff/tif_dirread.c26
-rw-r--r--libtiff/tif_dirwrite.c27
-rw-r--r--libtiff/tif_dumpmode.c2
-rw-r--r--libtiff/tif_error.c2
-rw-r--r--libtiff/tif_fax3.c26
-rw-r--r--libtiff/tif_fax3.h10
-rw-r--r--libtiff/tif_flush.c2
-rw-r--r--libtiff/tif_getimage.c226
-rw-r--r--libtiff/tif_jpeg.c2
-rw-r--r--libtiff/tif_luv.c7
-rw-r--r--libtiff/tif_lzw.c4
-rw-r--r--libtiff/tif_msdos.c2
-rw-r--r--libtiff/tif_next.c2
-rw-r--r--libtiff/tif_open.c4
-rw-r--r--libtiff/tif_packbits.c2
-rw-r--r--libtiff/tif_predict.c2
-rw-r--r--libtiff/tif_predict.h2
-rw-r--r--libtiff/tif_print.c2
-rw-r--r--libtiff/tif_read.c4
-rw-r--r--libtiff/tif_strip.c2
-rw-r--r--libtiff/tif_swab.c2
-rw-r--r--libtiff/tif_thunder.c2
-rw-r--r--libtiff/tif_tile.c2
-rw-r--r--libtiff/tif_unix.c8
-rw-r--r--libtiff/tif_version.c2
-rw-r--r--libtiff/tif_vms.c2
-rw-r--r--libtiff/tif_warning.c2
-rw-r--r--libtiff/tif_win3.c2
-rw-r--r--libtiff/tif_win32.c21
-rw-r--r--libtiff/tif_write.c2
-rw-r--r--libtiff/tif_zip.c2
-rw-r--r--libtiff/tiff.h10
-rw-r--r--libtiff/tiffcomp.h2
-rw-r--r--libtiff/tiffconf.h2
-rw-r--r--libtiff/tiffio.h10
-rw-r--r--libtiff/tiffiop.h2
-rw-r--r--man/CVS/Entries56
-rw-r--r--man/CVS/Repository1
-rw-r--r--man/CVS/Root1
-rw-r--r--man/Makefile.in8
-rw-r--r--man/TIFFClose.3t2
-rw-r--r--man/TIFFError.3t2
-rw-r--r--man/TIFFFlush.3t2
-rw-r--r--man/TIFFGetField.3t2
-rw-r--r--man/TIFFOpen.3t2
-rw-r--r--man/TIFFPrintDirectory.3t2
-rw-r--r--man/TIFFRGBAImage.3t6
-rw-r--r--man/TIFFReadDirectory.3t2
-rw-r--r--man/TIFFReadEncodedStrip.3t2
-rw-r--r--man/TIFFReadEncodedTile.3t2
-rw-r--r--man/TIFFReadRGBAImage.3t6
-rw-r--r--man/TIFFReadRGBAStrip.3t176
-rw-r--r--man/TIFFReadRGBATile.3t178
-rw-r--r--man/TIFFReadRawStrip.3t2
-rw-r--r--man/TIFFReadRawTile.3t2
-rw-r--r--man/TIFFReadScanline.3t2
-rw-r--r--man/TIFFReadTile.3t2
-rw-r--r--man/TIFFSetDirectory.3t2
-rw-r--r--man/TIFFSetField.3t2
-rw-r--r--man/TIFFWarning.3t2
-rw-r--r--man/TIFFWriteDirectory.3t2
-rw-r--r--man/TIFFWriteEncodedStrip.3t2
-rw-r--r--man/TIFFWriteEncodedTile.3t2
-rw-r--r--man/TIFFWriteRawStrip.3t2
-rw-r--r--man/TIFFWriteRawTile.3t2
-rw-r--r--man/TIFFWriteScanline.3t2
-rw-r--r--man/TIFFbuffer.3t2
-rw-r--r--man/TIFFcodec.3t2
-rw-r--r--man/TIFFmemory.3t2
-rw-r--r--man/TIFFquery.3t2
-rw-r--r--man/TIFFsize.3t2
-rw-r--r--man/TIFFstrip.3t2
-rw-r--r--man/TIFFswab.3t2
-rw-r--r--man/TIFFtile.3t2
-rw-r--r--man/fax2ps.12
-rw-r--r--man/fax2tiff.12
-rw-r--r--man/gif2tiff.12
-rw-r--r--man/libtiff.3t10
-rw-r--r--man/pal2rgb.12
-rw-r--r--man/ppm2tiff.12
-rw-r--r--man/ras2tiff.12
-rw-r--r--man/rgb2ycbcr.12
-rw-r--r--man/sgi2tiff.12
-rw-r--r--man/thumbnail.12
-rw-r--r--man/tiff2bw.12
-rw-r--r--man/tiff2ps.12
-rw-r--r--man/tiffcmp.12
-rw-r--r--man/tiffcp.12
-rw-r--r--man/tiffdither.12
-rw-r--r--man/tiffdump.12
-rw-r--r--man/tiffgt.12
-rw-r--r--man/tiffinfo.12
-rw-r--r--man/tiffmedian.12
-rw-r--r--man/tiffsplit.12
-rw-r--r--man/tiffsv.12
-rw-r--r--port/CVS/Entries7
-rw-r--r--port/CVS/Repository1
-rw-r--r--port/CVS/Root1
-rw-r--r--port/Makefile.in2
-rw-r--r--port/install.sh.in2
-rw-r--r--port/irix/CVS/Entries2
-rw-r--r--port/irix/CVS/Repository1
-rw-r--r--port/irix/CVS/Root1
-rwxr-xr-xtest_pics.sh29
-rw-r--r--tiff.h421
-rw-r--r--tools/CVS/Entries26
-rw-r--r--tools/CVS/Repository1
-rw-r--r--tools/CVS/Root1
-rw-r--r--tools/Makefile.in10
-rw-r--r--tools/Makefile.lcc7
-rw-r--r--tools/Makefile.vc28
-rw-r--r--tools/fax2ps.c12
-rw-r--r--tools/fax2tiff.c2
-rw-r--r--tools/gif2tiff.c2
-rw-r--r--tools/pal2rgb.c2
-rw-r--r--tools/ppm2tiff.c2
-rw-r--r--tools/ras2tiff.c2
-rw-r--r--tools/rasterfile.h2
-rw-r--r--tools/rgb2ycbcr.c2
-rw-r--r--tools/sgi2tiff.c2
-rw-r--r--tools/sgigt.c2
-rw-r--r--tools/sgisv.c2
-rw-r--r--tools/thumbnail.c2
-rw-r--r--tools/tiff2bw.c2
-rw-r--r--tools/tiff2ps.c2
-rw-r--r--tools/tiff2rgba.c452
-rw-r--r--tools/tiffcmp.c2
-rw-r--r--tools/tiffcp.c109
-rw-r--r--tools/tiffdither.c2
-rw-r--r--tools/tiffdump.c2
-rw-r--r--tools/tiffinfo.c2
-rw-r--r--tools/tiffmedian.c2
-rw-r--r--tools/tiffsplit.c2
259 files changed, 3831 insertions, 2194 deletions
diff --git a/CVS/Entries b/CVS/Entries
deleted file mode 100644
index 3d24eeeb..00000000
--- a/CVS/Entries
+++ /dev/null
@@ -1,22 +0,0 @@
-/COPYRIGHT/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/Makefile/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/Makefile.in/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/README/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/README-IPTC/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/TODO/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/VERSION/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/config.guess/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/config.site/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/config.sub/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/configure/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/tiff.h/1.1.1.1/Tue Jul 27 21:50:26 1999//
-D/contrib////
-D/dist////
-D/html////
-D/libtiff////
-D/man////
-D/port////
-D/tools////
-/README-v3.5/-1.1.1.1/Tue Jul 27 21:50:26 1999//
-/README-v3.5.1/1.1/Mon Aug 9 18:45:44 1999//
-/1/-1.1.1.1/Tue Jul 27 21:50:26 1999//
diff --git a/CVS/Repository b/CVS/Repository
deleted file mode 100644
index 355fc430..00000000
--- a/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff
diff --git a/CVS/Root b/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/Makefile.in b/Makefile.in
index c5e4941e..1d47b65d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,5 +1,5 @@
#! smake
-# $Header: /usr/local/cvs/internal/libtiff/Makefile.in,v 1.1.1.1 1999/07/27 21:50:26 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/Makefile.in,v 1.5 1999/09/28 17:22:20 mwelles Exp $
#
# @WARNING@
#
@@ -120,11 +120,13 @@ TIFFFILES=\
VERSION \
COPYRIGHT \
TODO \
+ test_pics.sh \
dist/tiff.spec \
dist/newalpha \
dist/newversion \
libtiff/Makefile.in \
libtiff/Makefile.lcc \
+ libtiff/makefile.vc \
libtiff/t4.h \
libtiff/tiff.h \
libtiff/tiffcomp.h \
@@ -184,6 +186,7 @@ TIFFFILES=\
port/strcasecmp.c \
port/strtoul.c \
tools/Makefile.in \
+ tools/Makefile.vc \
tools/Makefile.lcc \
tools/fax2tiff.c \
tools/fax2ps.c \
@@ -198,6 +201,7 @@ TIFFFILES=\
tools/sgisv.c \
tools/thumbnail.c \
tools/tiff2bw.c \
+ tools/tiff2rgba.c \
tools/tiff2ps.c \
tools/tiffcmp.c \
tools/tiffcp.c \
@@ -238,6 +242,8 @@ TIFFFILES=\
man/TIFFReadEncodedStrip.3t \
man/TIFFReadEncodedTile.3t \
man/TIFFReadRGBAImage.3t \
+ man/TIFFReadRGBAStrip.3t \
+ man/TIFFReadRGBATile.3t \
man/TIFFReadRawStrip.3t \
man/TIFFReadRawTile.3t \
man/TIFFReadScanline.3t \
@@ -380,6 +386,13 @@ CONTRIBFILES=\
contrib/pds/tif_imageiter.h \
contrib/pds/tif_pdsdirread.c \
contrib/pds/tif_pdsdirwrite.c \
+ contrib/addtiffo/README \
+ contrib/addtiffo/Makefile \
+ contrib/addtiffo/Makefile.vc \
+ contrib/addtiffo/addtiffo.c \
+ contrib/addtiffo/tif_overview.cpp \
+ contrib/addtiffo/rawblockedimage.cpp \
+ contrib/addtiffo/rawblockedimage.h \
${NULL}
DISTFILES=\
${TIFFFILES} \
@@ -401,64 +414,23 @@ CONFIG=\
rcsclean:
rcsclean ${TIFFFILES} && co ${TIFFFILES}
-alpha:
- (cd ${SRCDIR}/dist; sh newversion)
- -${MAKE} clean
- ${MAKE} alpha.stamp
- ${SRCDIR}/configure ${CONFIG}
- ${MAKE} product
- ${MAKE} alpha.tar
-
-# stamp relevant files according to current alpha
-alpha.stamp:
- VERSION="Alpha@DIST_ALPHA@"; \
- NOW=`date`; \
- for i in ${TIFFFILES}; do \
- REV=`rlog -h -d"$$NOW" ${SRCDIR}/$$i|fgrep 'head:'|awk '{print $$2}'`;\
- rcs "-N$$VERSION:$$REV" "-sExp:$$REV" ${SRCDIR}/$$i && co -sExp ${SRCDIR}/$$i; \
- done
-
-purge-old-alphas:
- VERSIONS=`awk 'BEGIN { \
- for (i=1; i<=@DIST_ALPHA@; i++) printf " -nAlpha%03d",i;\
- exit \
- }'`; \
- for i in ${TIFFFILES}; do \
- echo rcs $$VERSIONS ${SRCDIR}/$$i; \
- rcs $$VERSIONS ${SRCDIR}/$$i && co ${SRCDIR}/$$i; \
- done
-
-alphadiff:
- -@for i in ${TIFFFILES}; do \
- rcsdiff -r${ALPHA} ${SRCDIR}/$$i; \
- done
-
-# create alpha distribution archive
-alpha.tar:
- VERSION="@VERSION@"; \
- rm -f tiff-$$VERSION $$VERSION $$VERSION-tar; \
- ln -s ${SRCDIR} tiff-$$VERSION; \
- (for i in ${DISTFILES}; do \
- echo $$i; \
- done) | sed "s;.*;tiff-$$VERSION/&;" >$$VERSION; \
- tar cvf $$VERSION-tar `cat $$VERSION`; \
- rm -f tiff-$$VERSION-tar.${ZIPSUF}; \
- cat $$VERSION-tar | ${COMPRESS} >tiff-$$VERSION-tar.${ZIPSUF}; \
- rm -f tiff-$$VERSION $$VERSION $$VERSION-tar;
-
release:
(cd ${SRCDIR}/dist; sh newversion)
-${MAKE} clean
${MAKE} release.stamp
${SRCDIR}/configure ${CONFIG}
- ${MAKE} product
+# ${MAKE} product
${MAKE} release.tar
+# stamp relevant files according to current alpha
release.stamp:
- NOW=`date`; \
- for i in ${TIFFFILES}; do \
- REV=`rlog -h -d"$$NOW" ${SRCDIR}/$$i|fgrep 'head:'|awk '{print $$2}'`;\
- rcs "-NRelease@DIST_MAJOR@_@DIST_MINOR@_@DIST_TYPE@:$$REV" "-sRel:$$REV" ${SRCDIR}/$$i && co -sRel ${SRCDIR}/$$i; \
+ cvs tag -R "Release"
+ date "+%m/%d/%Y" > RELEASE-DATE
+
+#diffs since last release
+releasediff:
+ -@for i in ${TIFFFILES}; do \
+ cvs diff -D`cat RELEASE-DATE` ${SRCDIR}/$$i; \
done
# create release distribution archive
@@ -475,6 +447,13 @@ release.tar:
rm -f tiff-$$VERSION $$VERSION $$VERSION-tar;
#
+# Simple rule to run test suite assuming that pics directory is
+# just below this one, and that .rpt files are available.
+#
+test:
+ test_pics.sh pics/*.tif
+
+#
# Create a package of the test images.
#
diff --git a/README b/README
index 339494ec..b35f81a9 100644
--- a/README
+++ b/README
@@ -1,4 +1,5 @@
-$Header: /usr/local/cvs/internal/libtiff/README,v 1.1.1.1 1999/07/27 21:50:26 mike Exp $
+$Header: /cvsroot/osrs/libtiff/README,v 1.2 1999/08/16 17:09:27 warmerda Exp $
+
TIFF Software Distribution
--------------------------
diff --git a/README-IPTC b/README-IPTC
deleted file mode 100644
index c70f5ff5..00000000
--- a/README-IPTC
+++ /dev/null
@@ -1,41 +0,0 @@
-To: sam@engr.sgi.com
-cc: adam@onshore.com
-cc: billr@corbis.com
-cc: magick@wizards.dupont.com
-Subject: libtiff fork
-X-Mailer: VM 6.63 under Emacs 20.3.2
---text follows this line--
-
-I've finished merging a forked libtiff that was being shipped with
-ImageMagick (that added IPTC newsphoto support) with the last libtiff
-release (tiff-v3.4beta037). I'm going to make this available at
-ftp://ftp.onshore.com/pub/libtiff (as tiff-v3.4beta037-IPTC).
-
-I'm very reluctant to fork code, and I woud refrain, but for the following:
-
- 1. Repeated mail to you about the patches has gone unanswered.
-
- 2. I keep getting mail from people strugging to get IPTC newphoto support
- to work properly with ImageMagick.
-
- 3. The NT source distibution was already shipping with a forked version.
-
-In order for the situation to be less confusing, I'm going to make an
-archive of the forked version available.
-
-I very much would like for there not to be a fork. Are you still
-maintaining libtiff? If not, is there a current maintainer?
-
-I'm willing to adopt it if there isn't. I'd hate to see such an
-important library fragment. It's extremely likely that onShore
-(http://onshore.com/), will donate web space, bandwidth, and listserv
-services if so.
-
-
-
-------------------------------------------------------
-M. L. Welles mike@onShore.com
- http://fifth.net/
--------------------------------------------------------
-
-
diff --git a/README-v3.5.1 b/README-v3.5.1
deleted file mode 100644
index b51914d2..00000000
--- a/README-v3.5.1
+++ /dev/null
@@ -1,8 +0,0 @@
-Release 3.5.1 is merely a renaming of v3.4-beta037-IPTC to bump the
-version number so that the maintainer switch is clear and folks will
-know which problems I caused. See README-IPTC forchages between v3.5
-and the last version that Sam released.
-
-
---Mike Welles (mike@onshore.com)
-
diff --git a/TODO b/TODO
index 6ce2c815..5ddb4ff1 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,4 @@
-# $Header: /usr/local/cvs/internal/libtiff/TODO,v 1.1.1.1 1999/07/27 21:50:26 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/TODO,v 1.1.1.1 1999/07/27 21:50:26 mike Exp $
o tiffcmp read data by strip/tile instead of scanline
o YCbCr sampling support
diff --git a/VERSION b/VERSION
index d5c0c991..87ce4929 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.5.1
+3.5.2
diff --git a/config.guess b/config.guess
index 75907e0d..1c1fbc71 100755
--- a/config.guess
+++ b/config.guess
@@ -264,6 +264,9 @@ EOF
hp3[0-9][05]:NetBSD:*:*)
echo m68k-hp-netbsd${UNAME_RELEASE}
exit 0 ;;
+ i[345]86:CYGWIN*:*:*)
+ echo ${UNAME_MACHINE}-unknown-Cygwin${UNAME_RELEASE}
+ exit 0 ;;
i[34]86:BSD/386:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
diff --git a/config.site b/config.site
index e60d56b6..2180044b 100644
--- a/config.site
+++ b/config.site
@@ -1,4 +1,4 @@
-# $Header: /usr/local/cvs/internal/libtiff/config.site,v 1.1.1.1 1999/07/27 21:50:26 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/config.site,v 1.2 1999/09/26 22:03:46 mwelles Exp $
#
# TIFF Software
#
@@ -94,8 +94,8 @@
# JPEG support requires release 5 or later of the IJG code,
# which you can find on the Internet at ftp.uu.net:/graphics/jpeg/.
#
-#DIRS_LIBINC="$DIRS_LIBINC ../src/jpeg-5a" # directory for jpeg include files
-#DIR_JPEGLIB=../src/jpeg-5a # directory for libjpeg
+#DIRS_LIBINC="$DIRS_LIBINC ../src/jpeg-6b" # directory for jpeg include files
+#DIR_JPEGLIB=../src/jpeg-6b # directory for libjpeg
#
# Deflate-specific parameters; used when Deflate support is enabled (see above).
diff --git a/configure b/configure
index b9fa7eda..3880d1f5 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Header: /usr/local/cvs/internal/libtiff/configure,v 1.1.1.1 1999/07/27 21:50:26 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/configure,v 1.2 1999/09/08 12:32:18 warmerda 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.1.1.1 $"
+ echo "This is TIFF configure $Revision: 1.2 $"
exit 0
;;
-help|--help) usage; exit 0;;
@@ -1100,7 +1100,13 @@ if [ "$DSO" = auto ]; then
if (findApp rld /lib:/usr/lib:$PATH) >/dev/null 2>&1; then
DSOSUF=so
DSOLD="${CCOMPILER} ${ENVOPTS}"
- DSOOPTS='-shared -rdata_shared -check_registry ${SRCDIR}/port/irix/so_locations -quickstart_info'
+ if [ $ISGCC = yes ]; then
+ LIBCOPTS="-fpic"
+ DSOOPTS='-shared -rdata_shared'
+ else
+ LIBCOPTS="-KPIC"
+ DSOOPTS='-shared -rdata_shared -check_registry ${SRCDIR}/port/irix/so_locations -quickstart_info'
+ fi
DSO=IRIX
TIFFLIBREF='-L${DEPTH}/libtiff -rpath '${DIR_LIB}' -ltiff'
fi
@@ -1158,7 +1164,7 @@ if [ "$DSO" = auto ]; then
DSO=LINUX
fi
;;
- *-osf3*)
+ *-osf3*|*-osf4*)
DSOSUF=so
DSOOPTS='-shared'
DSO=OSF
diff --git a/contrib/CVS/Entries b/contrib/CVS/Entries
deleted file mode 100644
index ab0ad631..00000000
--- a/contrib/CVS/Entries
+++ /dev/null
@@ -1,13 +0,0 @@
-D/acorn////
-D/dbs////
-D/dosdjgpp////
-D/iptcutil////
-D/mac-cw////
-D/mac-mpw////
-D/mfs////
-D/pds////
-D/ras////
-D/vms////
-D/win32////
-D/win95////
-D/winnt////
diff --git a/contrib/CVS/Repository b/contrib/CVS/Repository
deleted file mode 100644
index ae63d111..00000000
--- a/contrib/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib
diff --git a/contrib/CVS/Root b/contrib/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/acorn/CVS/Entries b/contrib/acorn/CVS/Entries
deleted file mode 100644
index 442bb996..00000000
--- a/contrib/acorn/CVS/Entries
+++ /dev/null
@@ -1,7 +0,0 @@
-/Makefile/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/ReadMe/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/SetVars/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/cleanlib/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/convert/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/install/1.1.1.1/Tue Jul 27 21:50:26 1999//
-D
diff --git a/contrib/acorn/CVS/Repository b/contrib/acorn/CVS/Repository
deleted file mode 100644
index f1a274a6..00000000
--- a/contrib/acorn/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/acorn
diff --git a/contrib/acorn/CVS/Root b/contrib/acorn/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/acorn/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/addtiffo/Makefile b/contrib/addtiffo/Makefile
new file mode 100644
index 00000000..81759b42
--- /dev/null
+++ b/contrib/addtiffo/Makefile
@@ -0,0 +1,27 @@
+#
+# If libtiff.a is installed in /usr/lib or /usr/local/lib just point
+# LIBTIFF_DIR there. It doesn't need a full libtiff tree.
+#
+LIBTIFF_DIR = ../../libtiff
+#
+CC = gcc
+CXX = gcc
+CFLAGS = -O -I$(LIBTIFF_DIR)
+LIBS = $(LIBTIFF_DIR)/libtiff.a -lm
+
+addtiffo: addtiffo.o tif_overview.o rawblockedimage.o
+ $(CXX) $(CFLAGS) addtiffo.o tif_overview.o rawblockedimage.o \
+ $(LIBS) -o addtiffo
+
+
+addtiffo.o: addtiffo.c
+ $(CC) -c $(CFLAGS) addtiffo.c
+
+tif_overview.o: tif_overview.cpp
+ $(CXX) -c $(CFLAGS) tif_overview.cpp
+
+rawblockedimage.o: rawblockedimage.cpp
+ $(CXX) -c $(CFLAGS) rawblockedimage.cpp
+
+clean:
+ rm *.o addtiffo
diff --git a/contrib/addtiffo/Makefile.vc b/contrib/addtiffo/Makefile.vc
new file mode 100755
index 00000000..32b489b3
--- /dev/null
+++ b/contrib/addtiffo/Makefile.vc
@@ -0,0 +1,27 @@
+#
+# If libtiff.a is installed in /usr/lib or /usr/local/lib just point
+# LIBTIFF_DIR there. It doesn't need a full libtiff tree.
+#
+LIBTIFF_DIR = ..\..\libtiff
+#
+CC = cl.exe
+CPPC = cl.exe
+CFLAGS = -O -I$(LIBTIFF_DIR)
+LIBS = $(LIBTIFF_DIR)\tiff.lib
+
+addtiffo: addtiffo.obj tif_overview.obj rawblockedimage.obj
+ $(CC) $(CFLAGS) addtiffo.obj tif_overview.obj rawblockedimage.obj \
+ $(LIBS) /Feaddtiffo.exe
+
+
+addtiffo.obj: addtiffo.c
+ $(CC) -c $(CFLAGS) addtiffo.c
+
+tif_overview.obj: tif_overview.cpp
+ $(CPPC) -c $(CFLAGS) tif_overview.cpp
+
+rawblockedimage.obj: rawblockedimage.cpp
+ $(CPPC) -c $(CFLAGS) rawblockedimage.cpp
+
+clean:
+ del *.obj addtiffo.exe
diff --git a/contrib/addtiffo/README b/contrib/addtiffo/README
new file mode 100644
index 00000000..01346573
--- /dev/null
+++ b/contrib/addtiffo/README
@@ -0,0 +1,145 @@
+ addtiffo 1.0
+ ============
+
+The addtiffo utility is used to add overview pyramids to an existing
+TIFF or GeoTIFF file. Some applications can take advantage of these
+overviews to accelerate overview display performance of large rasters.
+
+This release of addtiffo is primarily intended for compatibility testing
+with applications, and to see if there is interest in a cleaner release
+of the capability ... perhaps incorporation into the libtiff tools
+distribution.
+
+Please feel free to contact me with questions, or problems.
+
+warmerda@home.com
+http://members.home.com/warmerda
+
+
+Usage
+-----
+
+Usage: addtiffo [-subifd] tiff_filename [resolution_reductions]
+
+Example:
+ % addtiffo abc.tif 2 4 8 16
+
+The numeric arguments are the list of reduction factors to
+generate. In this example a 1/2, 1/4 1/8 and 1/16
+
+
+
+Limitations
+-----------
+
+See tif_overview.cpp for up to date details.
+
+ o RawBlockedImage will create temporary files in the current directory
+ to cache the overviews so it doesn't have to hold them all in memory.
+ If the application crashes these will not be deleted (*.rbi).
+
+ o Currently only images with bits_per_sample of a multiple of eight
+ will work.
+
+ o The downsampler currently just takes the top left pixel from the
+ source rectangle. Eventually sampling options of averaging, mode, and
+ ``center pixel'' should be offered.
+
+ o The code will attempt to use the same kind of compression,
+ photometric interpretation, and organization as the source image, but
+ it doesn't copy geotiff tags to the reduced resolution images.
+
+ o Reduced resolution overviews for multi-sample files will currently
+ always be generated as PLANARCONFIG_SEPARATE. This could be fixed
+ reasonable easily if needed to improve compatibility with other
+ packages. Many don't properly support PLANARCONFIG_SEPARATE.
+
+ o Overviews are always written as appended IFDs, rather than using the
+ ``tree of tree's'' approach using the SUBIFD tag. I wanted to implement
+ both, but it isn't currently easy to add a SUBIFD tag to an existing
+ main tiff IFD with libtiff. I hope to try this again later.
+
+
+TIFF File Tags
+--------------
+
+The results of running addtiffo on a 1024x1024 tiled greyscale file
+with the arguments ``2 4 8 16'' is to add four additional TIFF directories
+appended on the file with the SUBFILETYPE flag to 0x1 indicating the extra
+items are reduced resolution images.
+
+The tiffinfo output of such a file might look like this:
+
+TIFF Directory at offset 0x118008
+ Image Width: 1024 Image Length: 1024
+ Tile Width: 256 Tile Length: 112
+ Bits/Sample: 8
+ Compression Scheme: none
+ Photometric Interpretation: min-is-black
+ Samples/Pixel: 1
+ Planar Configuration: single image plane
+TIFF Directory at offset 0x15e1d2
+ Subfile Type: reduced-resolution image (1 = 0x1)
+ Image Width: 512 Image Length: 512
+ Tile Width: 256 Tile Length: 112
+ Bits/Sample: 8
+ Compression Scheme: none
+ Photometric Interpretation: min-is-black
+ Samples/Pixel: 1
+ Planar Configuration: separate image planes
+TIFF Directory at offset 0x1732b8
+ Subfile Type: reduced-resolution image (1 = 0x1)
+ Image Width: 256 Image Length: 256
+ Tile Width: 256 Tile Length: 112
+ Bits/Sample: 8
+ Compression Scheme: none
+ Photometric Interpretation: min-is-black
+ Samples/Pixel: 1
+ Planar Configuration: separate image planes
+TIFF Directory at offset 0x17a366
+ Subfile Type: reduced-resolution image (1 = 0x1)
+ Image Width: 128 Image Length: 128
+ Tile Width: 128 Tile Length: 112
+ Bits/Sample: 8
+ Compression Scheme: none
+ Photometric Interpretation: min-is-black
+ Samples/Pixel: 1
+ Planar Configuration: separate image planes
+TIFF Directory at offset 0x17b40c
+ Subfile Type: reduced-resolution image (1 = 0x1)
+ Image Width: 64 Image Length: 64
+ Tile Width: 64 Tile Length: 64
+ Bits/Sample: 8
+ Compression Scheme: none
+ Photometric Interpretation: min-is-black
+ Samples/Pixel: 1
+ Planar Configuration: separate image planes
+
+
+Building
+--------
+
+You will need a C, and C++ compiler. You will need to have libtiff already
+built and installed. The provided Makefile should work on most Unix systems.
+A similar file will be needed for Windows, but is not provided.
+
+The CFLAGS and LIBS macros in the Makefile will have to be updated to
+point to the correct location of the libtiff include files, and library.
+
+
+Credits
+-------
+
+ o Intergraph Corporation for partially funding the work.
+
+ o Global Geomatics for partially funding reorganization of the overview
+ building ability as a separate utility.
+
+ o Orrin Long, and Ed Grissom of Intergraph for explaining what needed to
+ be done.
+
+ o Max Martinez of Erdas for his discussion of external overviews.
+
+ o Frank Warmerdam for writing the bulk of the code.
+
+ o Sam Leffler since this only exists because of his libtiff.
diff --git a/contrib/addtiffo/addtiffo.c b/contrib/addtiffo/addtiffo.c
new file mode 100644
index 00000000..67d70d5c
--- /dev/null
+++ b/contrib/addtiffo/addtiffo.c
@@ -0,0 +1,115 @@
+/******************************************************************************
+ * $Id: addtiffo.c,v 1.1 1999/08/17 01:47:59 warmerda Exp $
+ *
+ * Project: GeoTIFF Overview Builder
+ * Purpose: Mainline for building overviews in a TIFF file.
+ * Author: Frank Warmerdam, warmerda@home.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log: addtiffo.c,v $
+ * Revision 1.1 1999/08/17 01:47:59 warmerda
+ * New
+ *
+ * Revision 1.1 1999/03/12 17:46:32 warmerda
+ * New
+ *
+ * Revision 1.2 1999/02/11 22:27:12 warmerda
+ * Added multi-sample support
+ *
+ * Revision 1.1 1999/02/11 18:12:30 warmerda
+ * New
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "tiffio.h"
+
+void TIFFBuildOverviews( const char *, int, int *, int );
+
+/************************************************************************/
+/* main() */
+/************************************************************************/
+
+int main( int argc, char ** argv )
+
+{
+ int anOverviews[100];
+ int nOverviewCount = 0;
+ int bUseSubIFD = 0;
+
+/* -------------------------------------------------------------------- */
+/* Usage: */
+/* -------------------------------------------------------------------- */
+ if( argc < 2 )
+ {
+ printf( "Usage: addtiffo tiff_filename [resolution_reductions]\n" );
+ printf( "\n" );
+ printf( "Example:\n" );
+ printf( " %% addtifo abc.tif 2 4 8 16\n" );
+ exit( 1 );
+ }
+
+ if( strcmp(argv[1],"-subifd") == 0 )
+ {
+ bUseSubIFD = 1;
+ argv++;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Collect the user requested reduction factors. */
+/* -------------------------------------------------------------------- */
+ while( nOverviewCount < argc - 2 && nOverviewCount < 100 )
+ {
+ anOverviews[nOverviewCount] = atoi(argv[nOverviewCount+2]);
+ nOverviewCount++;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Default to four overview levels. It would be nicer if it */
+/* defaulted based on the size of the source image. */
+/* -------------------------------------------------------------------- */
+ if( nOverviewCount == 0 )
+ {
+ nOverviewCount = 4;
+
+ anOverviews[0] = 2;
+ anOverviews[1] = 4;
+ anOverviews[2] = 8;
+ anOverviews[3] = 16;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Build the overview. */
+/* -------------------------------------------------------------------- */
+ TIFFBuildOverviews( argv[1], nOverviewCount, anOverviews, bUseSubIFD );
+
+/* -------------------------------------------------------------------- */
+/* Optionally test for memory leaks. */
+/* -------------------------------------------------------------------- */
+#ifdef DBMALLOC
+ malloc_dump(1);
+#endif
+
+ exit( 0 );
+}
diff --git a/contrib/addtiffo/rawblockedimage.cpp b/contrib/addtiffo/rawblockedimage.cpp
new file mode 100644
index 00000000..8a37afd5
--- /dev/null
+++ b/contrib/addtiffo/rawblockedimage.cpp
@@ -0,0 +1,403 @@
+/******************************************************************************
+ * $Id: rawblockedimage.cpp,v 1.1 1999/08/17 01:47:59 warmerda Exp $
+ *
+ * Project: GeoTIFF Overview Builder
+ * Purpose: Implement the RawBlockedImage class, for holding ``under
+ * construction'' overviews in a temporary file.
+ * Author: Frank Warmerdam, warmerda@home.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log: rawblockedimage.cpp,v $
+ * Revision 1.1 1999/08/17 01:47:59 warmerda
+ * New
+ *
+ * Revision 1.2 1999/03/12 17:29:34 warmerda
+ * Use _WIN32 rather than WIN32.
+ *
+ */
+
+#include <assert.h>
+#include <string.h>
+
+#include <stdlib.h>
+
+#ifndef _WIN32
+# include <unistd.h>
+#endif
+
+#include "rawblockedimage.h"
+
+#ifndef FALSE
+# define FALSE 0
+# define TRUE 1
+#endif
+
+#ifndef MAX
+# define MIN(a,b) ((a<b) ? a : b)
+# define MAX(a,b) ((a>b) ? a : b)
+#endif
+
+/************************************************************************/
+/* RawBlockedImage() */
+/************************************************************************/
+
+RawBlockedImage::RawBlockedImage( int nXSizeIn, int nYSizeIn,
+ int nBlockXSizeIn, int nBlockYSizeIn,
+ int nBitsPerPixelIn )
+
+{
+ static int nTempCounter = 0;
+ char szFilename[128];
+
+/* -------------------------------------------------------------------- */
+/* Initialize stuff. */
+/* -------------------------------------------------------------------- */
+ nXSize = nXSizeIn;
+ nYSize = nYSizeIn;
+ nBlockXSize = nBlockXSizeIn;
+ nBlockYSize = nBlockYSizeIn;
+ nBitsPerPixel = nBitsPerPixelIn;
+
+/* -------------------------------------------------------------------- */
+/* Create the raw temporary file, trying to verify first that */
+/* it doesn't already exist. */
+/* -------------------------------------------------------------------- */
+ fp = NULL;
+ while( fp == NULL )
+ {
+ sprintf( szFilename, "temp_%d.rbi", nTempCounter++ );
+ fp = fopen( szFilename, "r" );
+ if( fp != NULL )
+ fclose( fp );
+ else
+ fp = fopen( szFilename, "w+b" );
+ }
+
+ pszFilename = strdup( szFilename );
+ nCurFileSize = 0;
+
+/* -------------------------------------------------------------------- */
+/* Initialize other stuff. */
+/* -------------------------------------------------------------------- */
+ nBlocksPerRow = (nXSize + nBlockXSize - 1) / nBlockXSize;
+ nBlocksPerColumn = (nYSize + nBlockYSize - 1) / nBlockYSize;
+ nBytesPerBlock = (nBlockXSize*nBlockYSize*nBitsPerPixel + 7) / 8;
+
+ nBlocks = nBlocksPerRow * nBlocksPerColumn;
+ nBlocksInCache = 0;
+ nMaxBlocksInCache = MIN(nBlocks, 2*nBlocksPerRow);
+
+ papoBlocks = (RawBlock **) calloc(sizeof(RawBlock*),nBlocks);
+
+ poLRUHead = NULL;
+ poLRUTail = NULL;
+}
+
+/************************************************************************/
+/* ~RawBlockedImage() */
+/************************************************************************/
+
+RawBlockedImage::~RawBlockedImage()
+
+{
+ int i;
+
+ for( i = 0; i < nBlocks; i++ )
+ {
+ if( papoBlocks[i] != NULL )
+ {
+ if( papoBlocks[i]->pabyData != NULL )
+ free( papoBlocks[i]->pabyData );
+
+ delete papoBlocks[i];
+ }
+ }
+
+ if( papoBlocks != NULL)
+ free( papoBlocks );
+
+ fclose( fp );
+
+ unlink( pszFilename ); /* wrap this? */
+
+ free( pszFilename );
+}
+
+/************************************************************************/
+/* InsertInLRUList() */
+/* */
+/* Insert this link at the beginning of the LRU list. First */
+/* removed from it's current position if it is in the list. */
+/************************************************************************/
+
+void RawBlockedImage::InsertInLRUList( RawBlock * poBlock )
+
+{
+/* -------------------------------------------------------------------- */
+/* Remove from list, if it is currently in it. */
+/* -------------------------------------------------------------------- */
+ if( poBlock->poPrevLRU != NULL || poLRUHead == poBlock )
+ RemoveFromLRUList( poBlock );
+
+/* -------------------------------------------------------------------- */
+/* Add at the head. */
+/* -------------------------------------------------------------------- */
+ if( poLRUHead != NULL )
+ {
+ poLRUHead->poPrevLRU = poBlock;
+ }
+
+ poBlock->poNextLRU = poLRUHead;
+ poLRUHead = poBlock;
+
+ if( poLRUTail == NULL )
+ poLRUTail = poBlock;
+}
+
+/************************************************************************/
+/* RemoveFromLRUList() */
+/* */
+/* Remove this block from the LRU list, if present. */
+/************************************************************************/
+
+void RawBlockedImage::RemoveFromLRUList( RawBlock * poBlock )
+
+{
+/* -------------------------------------------------------------------- */
+/* Is it even in the list? */
+/* -------------------------------------------------------------------- */
+ if( poBlock->poPrevLRU == NULL && poLRUHead != poBlock )
+ return;
+
+/* -------------------------------------------------------------------- */
+/* Fix the link before this in the list (or head pointer). */
+/* -------------------------------------------------------------------- */
+ if( poBlock->poPrevLRU == NULL )
+ {
+ poLRUHead = poBlock->poNextLRU;
+ }
+ else
+ {
+ poBlock->poPrevLRU->poNextLRU = poBlock->poNextLRU;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Fix the link after this one, or the tail pointer. */
+/* -------------------------------------------------------------------- */
+ if( poBlock->poNextLRU == NULL )
+ {
+ poLRUTail = poBlock->poPrevLRU;
+ }
+ else
+ {
+ poBlock->poNextLRU->poPrevLRU = poBlock->poPrevLRU;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Update this link to indicate it isn't in the list now. */
+/* -------------------------------------------------------------------- */
+ poBlock->poPrevLRU = poBlock->poNextLRU = NULL;
+}
+
+
+/************************************************************************/
+/* FlushBlock() */
+/************************************************************************/
+
+void RawBlockedImage::FlushBlock( RawBlock * poBlock )
+
+{
+/* -------------------------------------------------------------------- */
+/* If we aren't given a particular block to flush, then select */
+/* the lest recently used one from the LRU list. */
+/* -------------------------------------------------------------------- */
+ if( poBlock == NULL )
+ {
+ if( poLRUTail == NULL )
+ return;
+
+ poBlock = poLRUTail;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Remove from the LRU list. */
+/* -------------------------------------------------------------------- */
+ RemoveFromLRUList( poBlock );
+
+/* -------------------------------------------------------------------- */
+/* If the block has no data, then it doesn't really need to be */
+/* flushed. */
+/* -------------------------------------------------------------------- */
+ if( poBlock->pabyData == NULL )
+ return;
+
+/* -------------------------------------------------------------------- */
+/* Is this block dirty? If so we will have to try and save it. */
+/* -------------------------------------------------------------------- */
+ if( poBlock->nDirty )
+ {
+ if( poBlock->nPositionInFile == -1 )
+ poBlock->nPositionInFile = nCurFileSize;
+
+ nCurFileSize += nBytesPerBlock;
+ if( fseek( fp, poBlock->nPositionInFile, SEEK_SET ) != 0 )
+ {
+ fprintf( stderr,
+ "Seek to %d in overview spill file %s failed.\n",
+ poBlock->nPositionInFile, pszFilename );
+ exit( 1 );
+ }
+
+ if( fwrite( poBlock->pabyData, 1, nBytesPerBlock, fp )
+ != (size_t) nBytesPerBlock )
+ {
+ fprintf( stderr,
+ "Write of %d bytes at %d in overview spill file %s.\n"
+ "Is the disk full?\n",
+ nBytesPerBlock, poBlock->nPositionInFile, pszFilename );
+ exit( 1 );
+ }
+
+ poBlock->nDirty = FALSE;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Free the data block, and decrement used count. */
+/* -------------------------------------------------------------------- */
+ nBlocksInCache--;
+ if( poBlock->pabyData != NULL )
+ free( poBlock->pabyData );
+ poBlock->pabyData = NULL;
+}
+
+
+/************************************************************************/
+/* GetRawBlock() */
+/************************************************************************/
+
+RawBlock *RawBlockedImage::GetRawBlock( int nXOff, int nYOff )
+
+{
+ int nBlock = nXOff + nYOff * nBlocksPerRow;
+ RawBlock *poBlock;
+
+ assert( nBlock >= 0 && nBlock < nBlocks );
+
+/* -------------------------------------------------------------------- */
+/* Is this the first request? If so, create the block object, */
+/* initialize the data memory, and return it. */
+/* -------------------------------------------------------------------- */
+ poBlock = papoBlocks[nBlock];
+ if( poBlock == NULL )
+ {
+ poBlock = papoBlocks[nBlock] = new RawBlock;
+ poBlock->nDirty = FALSE;
+ poBlock->poPrevLRU = poBlock->poNextLRU = NULL;
+ poBlock->nPositionInFile = -1;
+ poBlock->pabyData = (unsigned char *) calloc(1,nBytesPerBlock);
+ nBlocksInCache++;
+
+ if( poBlock->pabyData == NULL )
+ {
+ fprintf( stderr,
+ "RawBlockedImage::GetRawBlock() - out of memory\n" );
+ exit( 1 );
+ }
+ }
+
+/* -------------------------------------------------------------------- */
+/* Does this block need to be read off disk? */
+/* -------------------------------------------------------------------- */
+ else if( poBlock->nPositionInFile >= 0 && poBlock->pabyData == NULL )
+ {
+ nBlocksInCache++;
+ poBlock->pabyData = (unsigned char *) calloc(1,nBytesPerBlock);
+ fseek( fp, poBlock->nPositionInFile, SEEK_SET );
+ fread( poBlock->pabyData, nBytesPerBlock, 1, fp );
+ }
+
+/* -------------------------------------------------------------------- */
+/* Does the data need to be allocated? */
+/* -------------------------------------------------------------------- */
+ else if( poBlock->pabyData == NULL )
+ {
+ poBlock->pabyData = (unsigned char *) calloc(1,nBytesPerBlock);
+ if( poBlock->pabyData == NULL )
+ {
+ fprintf( stderr,
+ "RawBlockedImage::GetRawBlock() - out of memory\n" );
+ exit( 1 );
+ }
+ }
+
+/* -------------------------------------------------------------------- */
+/* Push on the LRU stack, or pop it back to the top. */
+/* -------------------------------------------------------------------- */
+ InsertInLRUList( poBlock );
+
+/* -------------------------------------------------------------------- */
+/* If we have exceeded our self imposed caching limit, flush */
+/* one block. */
+/* -------------------------------------------------------------------- */
+ if( nBlocksInCache > nMaxBlocksInCache )
+ FlushBlock( NULL );
+
+ return( poBlock );
+}
+
+/************************************************************************/
+/* GetTile() */
+/************************************************************************/
+
+unsigned char *RawBlockedImage::GetTile( int nXOff, int nYOff )
+
+{
+ RawBlock *poBlock;
+
+ poBlock = GetRawBlock(nXOff,nYOff);
+ if( poBlock != NULL )
+ return poBlock->pabyData;
+ else
+ return NULL;
+}
+
+/************************************************************************/
+/* GetTileForUpdate() */
+/************************************************************************/
+
+unsigned char *RawBlockedImage::GetTileForUpdate( int nXOff, int nYOff )
+
+{
+ RawBlock *poBlock;
+
+ poBlock = GetRawBlock(nXOff,nYOff);
+ if( poBlock != NULL )
+ {
+ poBlock->nDirty = TRUE;
+
+ return poBlock->pabyData;
+ }
+ else
+ return NULL;
+}
diff --git a/contrib/addtiffo/rawblockedimage.h b/contrib/addtiffo/rawblockedimage.h
new file mode 100644
index 00000000..35aa56a6
--- /dev/null
+++ b/contrib/addtiffo/rawblockedimage.h
@@ -0,0 +1,108 @@
+/******************************************************************************
+ * $Id: rawblockedimage.h,v 1.1 1999/08/17 01:47:59 warmerda Exp $
+ *
+ * Project: GeoTIFF Overview Builder
+ * Purpose: Implement the RawBlockedImage class, for holding ``under
+ * construction'' overviews in a temporary file.
+ * Author: Frank Warmerdam, warmerda@home.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log:
+ */
+
+#ifndef RAWBLOCKEDIMAGE_H_INCLUDED
+#define RAWBLOCKEDIMAGE_H_INCLUDED
+
+#include <stdio.h>
+
+/************************************************************************/
+/* ==================================================================== */
+/* RawBlockedImage */
+/* */
+/* The RawBlockedImage class is used to maintain a single band */
+/* raster tiled image on disk. */
+/* ==================================================================== */
+/************************************************************************/
+
+class RawBlock
+{
+public:
+ RawBlock *poNextLRU;
+ RawBlock *poPrevLRU;
+
+ int nDirty;
+ int nPositionInFile;
+
+ unsigned char *pabyData;
+};
+
+class RawBlockedImage
+{
+ int nXSize;
+ int nYSize;
+
+ int nBlockXSize;
+ int nBlockYSize;
+ int nBitsPerPixel;
+ int nBytesPerBlock;
+
+ int nBlocksPerRow;
+ int nBlocksPerColumn;
+
+ int nBlocks;
+ RawBlock **papoBlocks;
+
+ int nBlocksInCache;
+ int nMaxBlocksInCache;
+
+ FILE *fp;
+ int nCurFileSize;
+ char *pszFilename;
+
+ RawBlock *GetRawBlock( int, int );
+ void FlushBlock( RawBlock * );
+ void InsertInLRUList( RawBlock * );
+ void RemoveFromLRUList( RawBlock * );
+
+ RawBlock *poLRUHead;
+ RawBlock *poLRUTail;
+
+public:
+ RawBlockedImage( int nXSize, int nYSize,
+ int nBlockXSize, int nBlockYSize,
+ int nBitsPerPixel );
+
+ ~RawBlockedImage();
+
+ unsigned char*GetTile( int, int );
+ unsigned char*GetTileForUpdate( int, int );
+
+ int GetBlockXSize() { return nBlockXSize; }
+ int GetBlockYSize() { return nBlockYSize; }
+ int GetXSize() { return nXSize; }
+ int GetYSize() { return nYSize; }
+ int GetBitsPerPixel() { return nBitsPerPixel; }
+};
+
+#endif /* ndef RAWBLOCKEDIMAGE_H_INCLUDED */
diff --git a/contrib/addtiffo/tif_overview.cpp b/contrib/addtiffo/tif_overview.cpp
new file mode 100644
index 00000000..45322c93
--- /dev/null
+++ b/contrib/addtiffo/tif_overview.cpp
@@ -0,0 +1,559 @@
+/******************************************************************************
+ * $Id: tif_overview.cpp,v 1.1 1999/08/17 01:47:59 warmerda Exp $
+ *
+ * Project: TIFF Overview Builder
+ * Purpose: Library function for building overviews in a TIFF file.
+ * Author: Frank Warmerdam, warmerda@home.com
+ *
+ * Notes:
+ * o This module uses the RawBlockedImage class to hold the overviews as
+ * they are being built since we can't easily be reading from one directory
+ * in a TIFF file, and writing to a bunch of others.
+ *
+ * o RawBlockedImage will create temporary files in the current directory
+ * to cache the overviews so it doesn't have to hold them all in memory.
+ * If the application crashes these will not be deleted (*.rbi).
+ *
+ * o Currently only images with bits_per_sample of a multiple of eight
+ * will work.
+ *
+ * o The downsampler currently just takes the top left pixel from the
+ * source rectangle. Eventually sampling options of averaging, mode, and
+ * ``center pixel'' should be offered.
+ *
+ * o The code will attempt to use the same kind of compression,
+ * photometric interpretation, and organization as the source image, but
+ * it doesn't copy geotiff tags to the reduced resolution images.
+ *
+ * o Reduced resolution overviews for multi-sample files will currently
+ * always be generated as PLANARCONFIG_SEPARATE. This could be fixed
+ * reasonable easily if needed to improve compatibility with other
+ * packages. Many don't properly support PLANARCONFIG_SEPARATE.
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log: tif_overview.cpp,v $
+ * Revision 1.1 1999/08/17 01:47:59 warmerda
+ * New
+ *
+ * Revision 1.7 1999/03/12 17:47:26 warmerda
+ * made independent of CPL
+ *
+ * Revision 1.6 1999/02/24 16:24:00 warmerda
+ * Don't include cpl_string.h
+ *
+ * Revision 1.5 1999/02/11 22:27:12 warmerda
+ * Added multi-sample support
+ *
+ * Revision 1.4 1999/02/11 19:23:39 warmerda
+ * Only fix on multiples of 16 in block size if it is a tiled file.
+ *
+ * Revision 1.3 1999/02/11 19:21:14 warmerda
+ * Limit tile sizes to multiples of 16
+ *
+ * Revision 1.2 1999/02/11 18:37:43 warmerda
+ * Removed debugging malloc stuff.
+ *
+ * Revision 1.1 1999/02/11 18:12:30 warmerda
+ * New
+ *
+ */
+
+#include <stdio.h>
+#include <assert.h>
+#include <stdlib.h>
+
+#include "tiffio.h"
+#include "rawblockedimage.h"
+
+#ifndef FALSE
+# define FALSE 0
+# define TRUE 1
+#endif
+
+#ifndef MAX
+# define MIN(a,b) ((a<b) ? a : b)
+# define MAX(a,b) ((a>b) ? a : b)
+#endif
+
+extern "C" {
+ void TIFFBuildOverviews( const char *, int, int *, int );
+}
+
+/************************************************************************/
+/* TIFF_WriteOverview() */
+/************************************************************************/
+
+static
+void TIFF_WriteOverview( TIFF *hTIFF, int nSamples, RawBlockedImage **papoRBI,
+ int bTiled, int nCompressFlag, int nPhotometric,
+ unsigned short *panRed,
+ unsigned short *panGreen,
+ unsigned short *panBlue,
+ int bUseSubIFDs )
+
+{
+ int iSample;
+ RawBlockedImage *poRBI = papoRBI[0];
+
+/* -------------------------------------------------------------------- */
+/* Setup TIFF fields. */
+/* -------------------------------------------------------------------- */
+ TIFFSetField( hTIFF, TIFFTAG_IMAGEWIDTH, poRBI->GetXSize() );
+ TIFFSetField( hTIFF, TIFFTAG_IMAGELENGTH, poRBI->GetYSize() );
+ TIFFSetField( hTIFF, TIFFTAG_PLANARCONFIG,
+ PLANARCONFIG_SEPARATE );
+
+ TIFFSetField( hTIFF, TIFFTAG_BITSPERSAMPLE, poRBI->GetBitsPerPixel() );
+ TIFFSetField( hTIFF, TIFFTAG_SAMPLESPERPIXEL, nSamples );
+ TIFFSetField( hTIFF, TIFFTAG_COMPRESSION, nCompressFlag );
+ TIFFSetField( hTIFF, TIFFTAG_PHOTOMETRIC, nPhotometric );
+
+ if( bTiled )
+ {
+ TIFFSetField( hTIFF, TIFFTAG_TILEWIDTH, poRBI->GetBlockXSize() );
+ TIFFSetField( hTIFF, TIFFTAG_TILELENGTH, poRBI->GetBlockYSize() );
+ }
+ else
+ TIFFSetField( hTIFF, TIFFTAG_ROWSPERSTRIP, poRBI->GetBlockYSize() );
+
+ TIFFSetField( hTIFF, TIFFTAG_SUBFILETYPE, FILETYPE_REDUCEDIMAGE );
+
+/* -------------------------------------------------------------------- */
+/* Write color table if one is present. */
+/* -------------------------------------------------------------------- */
+ if( panRed != NULL )
+ {
+ TIFFSetField( hTIFF, TIFFTAG_COLORMAP, panRed, panGreen, panBlue );
+ }
+
+/* -------------------------------------------------------------------- */
+/* Write blocks to TIFF file. */
+/* -------------------------------------------------------------------- */
+ for( iSample = 0; iSample < nSamples; iSample++ )
+ {
+ int iTileX, iTileY;
+
+ poRBI = papoRBI[iSample];
+
+ for( iTileY = 0;
+ iTileY*poRBI->GetBlockYSize() < poRBI->GetYSize();
+ iTileY++ )
+ {
+ for( iTileX = 0;
+ iTileX*poRBI->GetBlockXSize() < poRBI->GetXSize();
+ iTileX++ )
+ {
+ unsigned char *pabyData = poRBI->GetTile( iTileX, iTileY );
+ int nTileID;
+
+ if( bTiled )
+ {
+ nTileID =
+ TIFFComputeTile(hTIFF,
+ iTileX * poRBI->GetBlockXSize(),
+ iTileY * poRBI->GetBlockYSize(),
+ 0, iSample );
+ TIFFWriteEncodedTile( hTIFF, nTileID,
+ pabyData, TIFFTileSize(hTIFF) );
+ }
+ else
+ {
+ nTileID =
+ TIFFComputeStrip(hTIFF, iTileY*poRBI->GetBlockYSize(),
+ iSample);
+
+ TIFFWriteEncodedStrip( hTIFF, nTileID,
+ pabyData, TIFFStripSize( hTIFF ) );
+ }
+ }
+ }
+ }
+
+ TIFFWriteDirectory( hTIFF );
+}
+
+/************************************************************************/
+/* TIFF_DownSample() */
+/* */
+/* Down sample a tile of full res data into a window of a tile */
+/* of downsampled data. */
+/************************************************************************/
+
+static
+void TIFF_DownSample( unsigned char *pabySrcTile,
+ int nBlockXSize, int nBlockYSize,
+ int nPixelSkewBits, int nBitsPerPixel,
+ unsigned char * pabyOTile,
+ int nOBlockXSize, int nOBlockYSize,
+ int nTXOff, int nTYOff, int nOMult )
+
+{
+ int i, j, k, nPixelBytes = (nBitsPerPixel) / 8;
+ int nPixelGroupBytes = (nBitsPerPixel+nPixelSkewBits)/8;
+ unsigned char *pabySrc, *pabyDst;
+
+ assert( nBitsPerPixel >= 8 );
+
+/* -------------------------------------------------------------------- */
+/* Handle case of one or more whole bytes per sample. */
+/* -------------------------------------------------------------------- */
+ for( j = 0; j*nOMult < nBlockYSize; j++ )
+ {
+ if( j + nTYOff >= nOBlockYSize )
+ break;
+
+ pabySrc = pabySrcTile + j*nOMult*nBlockXSize * nPixelGroupBytes;
+ pabyDst = pabyOTile
+ + ((j+nTYOff)*nOBlockXSize + nTXOff) * nPixelBytes;
+
+ for( i = 0; i*nOMult < nBlockXSize; i++ )
+ {
+ if( i + nTXOff >= nOBlockXSize )
+ break;
+
+ /*
+ * For now use simple subsampling, from the top left corner
+ * of the source block of pixels.
+ */
+
+ for( k = 0; k < nPixelBytes; k++ )
+ {
+ *(pabyDst++) = pabySrc[k];
+ }
+
+ pabySrc += nOMult * nPixelGroupBytes;
+ }
+ }
+}
+
+/************************************************************************/
+/* TIFF_ProcessFullResBlock() */
+/* */
+/* Process one block of full res data, downsampling into each */
+/* of the overviews. */
+/************************************************************************/
+
+void TIFF_ProcessFullResBlock( TIFF *hTIFF, int nPlanarConfig,
+ int nOverviews, int * panOvList,
+ int nBitsPerPixel,
+ int nSamples, RawBlockedImage ** papoRawBIs,
+ int nSXOff, int nSYOff,
+ unsigned char *pabySrcTile,
+ int nBlockXSize, int nBlockYSize )
+
+{
+ int iOverview, iSample;
+
+ for( iSample = 0; iSample < nSamples; iSample++ )
+ {
+ /*
+ * We have to read a tile/strip for each sample for
+ * PLANARCONFIG_SEPARATE. Otherwise, we just read all the samples
+ * at once when handling the first sample.
+ */
+ if( nPlanarConfig == PLANARCONFIG_SEPARATE || iSample == 0 )
+ {
+ if( TIFFIsTiled(hTIFF) )
+ {
+ TIFFReadEncodedTile( hTIFF,
+ TIFFComputeTile(hTIFF, nSXOff, nSYOff,
+ 0, iSample ),
+ pabySrcTile,
+ TIFFTileSize(hTIFF));
+ }
+ else
+ {
+ TIFFReadEncodedStrip( hTIFF,
+ TIFFComputeStrip(hTIFF, nSYOff, iSample),
+ pabySrcTile,
+ TIFFStripSize(hTIFF) );
+ }
+ }
+
+ /*
+ * Loop over destination overview layers
+ */
+ for( iOverview = 0; iOverview < nOverviews; iOverview++ )
+ {
+ RawBlockedImage *poRBI = papoRawBIs[iOverview*nSamples + iSample];
+ unsigned char *pabyOTile;
+ int nTXOff, nTYOff, nOXOff, nOYOff, nOMult;
+ int nOBlockXSize = poRBI->GetBlockXSize();
+ int nOBlockYSize = poRBI->GetBlockYSize();
+ int nSkewBits, nSampleByteOffset;
+
+ /*
+ * Fetch the destination overview tile
+ */
+ nOMult = panOvList[iOverview];
+ nOXOff = (nSXOff/nOMult) / nOBlockXSize;
+ nOYOff = (nSYOff/nOMult) / nOBlockYSize;
+ pabyOTile = poRBI->GetTileForUpdate( nOXOff, nOYOff );
+
+ /*
+ * Establish the offset into this tile at which we should
+ * start placing data.
+ */
+ nTXOff = (nSXOff - nOXOff*nOMult*nOBlockXSize) / nOMult;
+ nTYOff = (nSYOff - nOYOff*nOMult*nOBlockYSize) / nOMult;
+
+ /*
+ * Figure out the skew (extra space between ``our samples'') and
+ * the byte offset to the first sample.
+ */
+ assert( (nBitsPerPixel % 8) == 0 );
+ if( nPlanarConfig == PLANARCONFIG_SEPARATE )
+ {
+ nSkewBits = 0;
+ nSampleByteOffset = 0;
+ }
+ else
+ {
+ nSkewBits = nBitsPerPixel * (nSamples-1);
+ nSampleByteOffset = (nBitsPerPixel/8) * iSample;
+ }
+
+ /*
+ * Perform the downsampling.
+ */
+#ifdef DBMALLOC
+ malloc_chain_check( 1 );
+#endif
+ TIFF_DownSample( pabySrcTile + nSampleByteOffset,
+ nBlockXSize, nBlockYSize,
+ nSkewBits, nBitsPerPixel, pabyOTile,
+ poRBI->GetBlockXSize(),
+ poRBI->GetBlockYSize(),
+ nTXOff, nTYOff,
+ nOMult );
+#ifdef DBMALLOC
+ malloc_chain_check( 1 );
+#endif
+ }
+ }
+}
+
+/************************************************************************/
+/* TIFF_BuildOverviews() */
+/* */
+/* Build the requested list of overviews. Overviews are */
+/* maintained in a bunch of temporary files and then these are */
+/* written back to the TIFF file. Only one pass through the */
+/* source TIFF file is made for any number of output */
+/* overviews. */
+/************************************************************************/
+
+void TIFFBuildOverviews( const char * pszTIFFFilename,
+ int nOverviews, int * panOvList,
+ int bUseSubIFDs )
+
+{
+ RawBlockedImage **papoRawBIs;
+ uint32 nXSize, nYSize, nBlockXSize, nBlockYSize;
+ uint16 nBitsPerPixel, nPhotometric, nCompressFlag, nSamples,
+ nPlanarConfig;
+ int bTiled, nSXOff, nSYOff, i, iSample;
+ unsigned char *pabySrcTile;
+ TIFF *hTIFF;
+ uint16 *panRedMap, *panGreenMap, *panBlueMap;
+
+/* -------------------------------------------------------------------- */
+/* Get the base raster size. */
+/* -------------------------------------------------------------------- */
+ hTIFF = TIFFOpen( pszTIFFFilename, "r" );
+ if( hTIFF == NULL )
+ {
+ fprintf( stderr, "TIFFOpen(%s) failed.\n", pszTIFFFilename );
+ exit( 1 );
+ }
+
+ TIFFGetField( hTIFF, TIFFTAG_IMAGEWIDTH, &nXSize );
+ TIFFGetField( hTIFF, TIFFTAG_IMAGELENGTH, &nYSize );
+
+ TIFFGetField( hTIFF, TIFFTAG_BITSPERSAMPLE, &nBitsPerPixel );
+ TIFFGetField( hTIFF, TIFFTAG_SAMPLESPERPIXEL, &nSamples );
+ TIFFGetField( hTIFF, TIFFTAG_PLANARCONFIG, &nPlanarConfig );
+
+ TIFFGetField( hTIFF, TIFFTAG_PHOTOMETRIC, &nPhotometric );
+ TIFFGetField( hTIFF, TIFFTAG_COMPRESSION, &nCompressFlag );
+
+ if( nBitsPerPixel < 8 )
+ {
+ TIFFError( "TIFFBuildOverviews",
+ "File `%s' has samples of %d bits per sample. Sample\n"
+ "sizes of less than 8 bits per sample are not supported.\n",
+ pszTIFFFilename, nBitsPerPixel );
+ return;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Get the base raster block size. */
+/* -------------------------------------------------------------------- */
+ if( TIFFGetField( hTIFF, TIFFTAG_ROWSPERSTRIP, &(nBlockYSize) ) )
+ {
+ nBlockXSize = nXSize;
+ bTiled = FALSE;
+ }
+ else
+ {
+ TIFFGetField( hTIFF, TIFFTAG_TILEWIDTH, &nBlockXSize );
+ TIFFGetField( hTIFF, TIFFTAG_TILELENGTH, &nBlockYSize );
+ bTiled = TRUE;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Capture the pallette if there is one. */
+/* -------------------------------------------------------------------- */
+ if( TIFFGetField( hTIFF, TIFFTAG_COLORMAP,
+ &panRedMap, &panGreenMap, &panBlueMap ) )
+ {
+ uint16 *panRed2, *panGreen2, *panBlue2;
+
+ panRed2 = (uint16 *) calloc(2,256);
+ panGreen2 = (uint16 *) calloc(2,256);
+ panBlue2 = (uint16 *) calloc(2,256);
+
+ memcpy( panRed2, panRedMap, 512 );
+ memcpy( panGreen2, panGreenMap, 512 );
+ memcpy( panBlue2, panBlueMap, 512 );
+
+ panRedMap = panRed2;
+ panGreenMap = panGreen2;
+ panBlueMap = panBlue2;
+ }
+ else
+ {
+ panRedMap = panGreenMap = panBlueMap = NULL;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Initialize the overview raw layers */
+/* -------------------------------------------------------------------- */
+ papoRawBIs = (RawBlockedImage **)
+ calloc(nOverviews*nSamples,sizeof(void*));
+
+ for( i = 0; i < nOverviews; i++ )
+ {
+ int nOXSize, nOYSize, nOBlockXSize, nOBlockYSize;
+
+ nOXSize = (nXSize + panOvList[i] - 1) / panOvList[i];
+ nOYSize = (nYSize + panOvList[i] - 1) / panOvList[i];
+
+ nOBlockXSize = MIN((int)nBlockXSize,nOXSize);
+ nOBlockYSize = MIN((int)nBlockYSize,nOYSize);
+
+ if( bTiled )
+ {
+ if( (nOBlockXSize % 16) != 0 )
+ nOBlockXSize = nOBlockXSize + 16 - (nOBlockXSize % 16);
+
+ if( (nOBlockYSize % 16) != 0 )
+ nOBlockYSize = nOBlockYSize + 16 - (nOBlockYSize % 16);
+ }
+
+ for( iSample = 0; iSample < nSamples; iSample++ )
+ {
+ papoRawBIs[i*nSamples + iSample] =
+ new RawBlockedImage( nOXSize, nOYSize,
+ nOBlockXSize, nOBlockYSize,
+ nBitsPerPixel );
+ }
+ }
+
+/* -------------------------------------------------------------------- */
+/* Allocate a buffer to hold a source block. */
+/* -------------------------------------------------------------------- */
+ if( bTiled )
+ pabySrcTile = (unsigned char *) malloc(TIFFTileSize(hTIFF));
+ else
+ pabySrcTile = (unsigned char *) malloc(TIFFStripSize(hTIFF));
+
+/* -------------------------------------------------------------------- */
+/* Loop over the source raster, applying data to the */
+/* destination raster. */
+/* -------------------------------------------------------------------- */
+ for( nSYOff = 0; nSYOff < (int) nYSize; nSYOff += nBlockYSize )
+ {
+ for( nSXOff = 0; nSXOff < (int) nXSize; nSXOff += nBlockXSize )
+ {
+ /*
+ * Read and resample into the various overview images.
+ */
+
+ TIFF_ProcessFullResBlock( hTIFF, nPlanarConfig,
+ nOverviews, panOvList,
+ nBitsPerPixel, nSamples, papoRawBIs,
+ nSXOff, nSYOff, pabySrcTile,
+ nBlockXSize, nBlockYSize );
+ }
+ }
+
+ free( pabySrcTile );
+
+ TIFFClose( hTIFF );
+
+/* ==================================================================== */
+/* We now have the overview rasters built, and held as */
+/* RawBlockedImage's. Now we need to write them to new TIFF */
+/* layers. */
+/* ==================================================================== */
+ hTIFF = TIFFOpen( pszTIFFFilename, "a" );
+ if( hTIFF == NULL )
+ {
+ fprintf( stderr,
+ "TIFFOpen(%s,\"a\") failed. No overviews written.\n"
+ "Do you have write permissions on that file?\n",
+ pszTIFFFilename );
+ }
+ else
+ {
+ for( i = 0; i < nOverviews; i++ )
+ {
+ TIFF_WriteOverview( hTIFF, nSamples, papoRawBIs + i*nSamples,
+ bTiled, nCompressFlag, nPhotometric,
+ panRedMap, panGreenMap, panBlueMap,
+ bUseSubIFDs );
+ }
+
+ TIFFClose( hTIFF );
+ }
+
+/* -------------------------------------------------------------------- */
+/* Cleanup the rawblockedimage files. */
+/* -------------------------------------------------------------------- */
+ for( i = 0; i < nOverviews*nSamples; i++ )
+ {
+ delete papoRawBIs[i];
+ }
+
+ if( papoRawBIs != NULL )
+ free( papoRawBIs );
+
+ if( panRedMap != NULL )
+ {
+ free( panRedMap );
+ free( panGreenMap );
+ free( panBlueMap );
+ }
+}
diff --git a/contrib/dbs/CVS/Entries b/contrib/dbs/CVS/Entries
deleted file mode 100644
index ec683a83..00000000
--- a/contrib/dbs/CVS/Entries
+++ /dev/null
@@ -1,7 +0,0 @@
-/Imakefile/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/README/1.1.1.1/Tue Jul 27 21:50:26 1999//
-/tiff-bi.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiff-grayscale.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiff-palette.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiff-rgb.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D/xtiff////
diff --git a/contrib/dbs/CVS/Repository b/contrib/dbs/CVS/Repository
deleted file mode 100644
index fe1d686a..00000000
--- a/contrib/dbs/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/dbs
diff --git a/contrib/dbs/CVS/Root b/contrib/dbs/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/dbs/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/dbs/xtiff/CVS/Entries b/contrib/dbs/xtiff/CVS/Entries
deleted file mode 100644
index fbcdce6e..00000000
--- a/contrib/dbs/xtiff/CVS/Entries
+++ /dev/null
@@ -1,6 +0,0 @@
-/Imakefile/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/README/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/patchlevel.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/xtiff.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/xtifficon.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/contrib/dbs/xtiff/CVS/Repository b/contrib/dbs/xtiff/CVS/Repository
deleted file mode 100644
index 59671bff..00000000
--- a/contrib/dbs/xtiff/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/dbs/xtiff
diff --git a/contrib/dbs/xtiff/CVS/Root b/contrib/dbs/xtiff/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/dbs/xtiff/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/dosdjgpp/CVS/Entries b/contrib/dosdjgpp/CVS/Entries
deleted file mode 100644
index 87919706..00000000
--- a/contrib/dosdjgpp/CVS/Entries
+++ /dev/null
@@ -1,7 +0,0 @@
-/Makefile.lib/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/Makefile.tools/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/Makefile.top/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/README/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/conf.bat/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/port.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/contrib/dosdjgpp/CVS/Repository b/contrib/dosdjgpp/CVS/Repository
deleted file mode 100644
index cdc8c42c..00000000
--- a/contrib/dosdjgpp/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/dosdjgpp
diff --git a/contrib/dosdjgpp/CVS/Root b/contrib/dosdjgpp/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/dosdjgpp/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/dosdjgpp/Makefile.lib b/contrib/dosdjgpp/Makefile.lib
index 78ddce85..0cc25e6f 100644
--- a/contrib/dosdjgpp/Makefile.lib
+++ b/contrib/dosdjgpp/Makefile.lib
@@ -1,4 +1,4 @@
-# $Header: /usr/local/cvs/internal/libtiff/contrib/dosdjgpp/Makefile.lib,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/contrib/dosdjgpp/Makefile.lib,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
#
# manually derived from Makefile.in for DJGPP v2.x (GNU C for DOS/386).
#
diff --git a/contrib/dosdjgpp/Makefile.tools b/contrib/dosdjgpp/Makefile.tools
index cb229383..c36227f6 100644
--- a/contrib/dosdjgpp/Makefile.tools
+++ b/contrib/dosdjgpp/Makefile.tools
@@ -1,4 +1,4 @@
-# $Header: /usr/local/cvs/internal/libtiff/contrib/dosdjgpp/Makefile.tools,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/contrib/dosdjgpp/Makefile.tools,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
#
# manually derived from Makefile.in for DJGPP v2.x (GNU C for DOS/386).
#
diff --git a/contrib/dosdjgpp/Makefile.top b/contrib/dosdjgpp/Makefile.top
index 6d4313ca..56c85710 100644
--- a/contrib/dosdjgpp/Makefile.top
+++ b/contrib/dosdjgpp/Makefile.top
@@ -1,5 +1,5 @@
#! smake
-# $Header: /usr/local/cvs/internal/libtiff/contrib/dosdjgpp/Makefile.top,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/contrib/dosdjgpp/Makefile.top,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
#
# manually derived from Makefile.in (though basically nothing remains)
# for DJGPP v2.x (GNU C for DOS/386).
diff --git a/contrib/iptcutil/CVS/Entries b/contrib/iptcutil/CVS/Entries
deleted file mode 100644
index d2a5bf40..00000000
--- a/contrib/iptcutil/CVS/Entries
+++ /dev/null
@@ -1,5 +0,0 @@
-/Makefile/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/iptcutil.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/test.iptc/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/test.txt/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/contrib/iptcutil/CVS/Repository b/contrib/iptcutil/CVS/Repository
deleted file mode 100644
index e00d29ba..00000000
--- a/contrib/iptcutil/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/iptcutil
diff --git a/contrib/iptcutil/CVS/Root b/contrib/iptcutil/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/iptcutil/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/iptcutil/Makefile b/contrib/iptcutil/Makefile
deleted file mode 100644
index e8aacda1..00000000
--- a/contrib/iptcutil/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-CC=gcc
-CFLAGS=
-iptcutil: iptcutil.c
- $(CC) $(CFLAGS) -o iptcutil iptcutil.c
-
-clean:
- rm iptcutil *~
-
-all: iptcutil
-
-
-
diff --git a/contrib/iptcutil/iptcutil.c b/contrib/iptcutil/iptcutil.c
deleted file mode 100644
index 1ee68bb1..00000000
--- a/contrib/iptcutil/iptcutil.c
+++ /dev/null
@@ -1,920 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#ifdef WIN32
-#include <io.h>
-#endif
-#include <string.h>
-#include <memory.h>
-#include <ctype.h>
-
-#ifdef WIN32
-#define STRNICMP strnicmp
-#else
-#define STRNICMP strncasecmp
-#endif
-
-typedef struct _tag_spec
-{
- short
- id;
-
- char
- *name;
-} tag_spec;
-
-static tag_spec tags[] = {
- 5,"Image Name",
- 7,"Edit Status",
- 10,"Priority",
- 15,"Category",
- 20,"Supplemental Category",
- 22,"Fixture Identifier",
- 25,"Keyword",
- 30,"Release Date",
- 35,"Release Time",
- 40,"Special Instructions",
- 45,"Reference Service",
- 47,"Reference Date",
- 50,"Reference Number",
- 55,"Created Date",
- 60,"Created Time",
- 65,"Originating Program",
- 70,"Program Version",
- 75,"Object Cycle",
- 80,"Byline",
- 85,"Byline Title",
- 90,"City",
- 95,"Province State",
- 100,"Country Code",
- 101,"Country",
- 103,"Original Transmission Reference",
- 105,"Headline",
- 110,"Credit",
- 115,"Source",
- 116,"Copyright String",
- 120,"Caption",
- 121,"Local Caption",
- 122,"Caption Writer",
- 200,"Custom Field 1",
- 201,"Custom Field 2",
- 202,"Custom Field 3",
- 203,"Custom Field 4",
- 204,"Custom Field 5",
- 205,"Custom Field 6",
- 206,"Custom Field 7",
- 207,"Custom Field 8",
- 208,"Custom Field 9",
- 209,"Custom Field 10",
- 210,"Custom Field 11",
- 211,"Custom Field 12",
- 212,"Custom Field 13",
- 213,"Custom Field 14",
- 214,"Custom Field 15",
- 215,"Custom Field 16",
- 216,"Custom Field 17",
- 217,"Custom Field 18",
- 218,"Custom Field 19",
- 219,"Custom Field 20"
-};
-
-/*
- * We format the output using HTML conventions
- * to preserve control characters and such.
- */
-void formatString(FILE *ofile, const char *s, int len)
-{
- putc('"', ofile);
- for (; len > 0; --len, ++s) {
- char c = *s;
- switch (c) {
- case '&':
- fputs("&amp;", ofile);
- break;
-#ifdef HANDLE_GT_LT
- case '<':
- fputs("&lt;", ofile);
- break;
- case '>':
- fputs("&gt;", ofile);
- break;
-#endif
- case '"':
- fputs("&quot;", ofile);
- break;
- default:
- if (iscntrl(c))
- fprintf(ofile, "&#%d;", c);
- else
- putc(*s, ofile);
- break;
- }
- }
- fputs("\"\n", ofile);
-}
-
-typedef struct _html_code
-{
- short
- len;
- const char
- *code,
- val;
-} html_code;
-
-static html_code html_codes[] = {
-#ifdef HANDLE_GT_LT
- 4,"&lt;",'<',
- 4,"&gt;",'>',
-#endif
- 5,"&amp;",'&',
- 6,"&quot;",'"'
-};
-
-/*
- * This routine converts HTML escape sequence
- * back to the original ASCII representation.
- * - returns the number of characters dropped.
- */
-int convertHTMLcodes(char *s, int len)
-{
- if (len <=0 || s==(char*)NULL || *s=='\0')
- return 0;
-
- if (s[1] == '#')
- {
- int val, o;
-
- if (sscanf(s,"&#%d;",&val) == 1)
- {
- o = 3;
- while (s[o] != ';')
- {
- o++;
- if (o > 5)
- break;
- }
- if (o < 5)
- strcpy(s+1, s+1+o);
- *s = val;
- return o;
- }
- }
- else
- {
- int
- i,
- codes = sizeof(html_codes) / sizeof(html_code);
-
- for (i=0; i < codes; i++)
- {
- if (html_codes[i].len <= len)
- if (STRNICMP(s, html_codes[i].code, html_codes[i].len) == 0)
- {
- strcpy(s+1, s+html_codes[i].len);
- *s = html_codes[i].val;
- return html_codes[i].len-1;
- }
- }
- }
-}
-
-int formatIPTC(FILE *ifile, FILE *ofile)
-{
- unsigned int
- foundiptc,
- tagsfound;
-
- unsigned char
- recnum,
- dataset;
-
- unsigned char
- *readable,
- *str;
-
- long
- tagindx,
- taglen;
-
- int
- i,
- tagcount = sizeof(tags) / sizeof(tag_spec);
-
- char
- c;
-
- foundiptc = 0; /* found the IPTC-Header */
- tagsfound = 0; /* number of tags found */
-
- c = getc(ifile);
- while (c != EOF)
- {
- if (c == 0x1c)
- foundiptc = 1;
- else
- {
- if (foundiptc)
- return -1;
- else
- continue;
- }
-
- /* we found the 0x1c tag and now grab the dataset and record number tags */
- dataset = getc(ifile);
- if ((char) dataset == EOF)
- return -1;
- recnum = getc(ifile);
- if ((char) recnum == EOF)
- return -1;
- /* try to match this record to one of the ones in our named table */
- for (i=0; i< tagcount; i++)
- {
- if (tags[i].id == recnum)
- break;
- }
- if (i < tagcount)
- readable = tags[i].name;
- else
- readable = "";
-
- /* then we decode the length of the block that follows - long or short fmt */
- c = getc(ifile);
- if (c == EOF)
- return 0;
- if (c & (unsigned char) 0x80)
- {
- unsigned char
- buffer[4];
-
- for (i=0; i<4; i++)
- {
- c = buffer[i] = getc(ifile);
- if (c == EOF)
- return -1;
- }
- taglen = (((long) buffer[ 0 ]) << 24) |
- (((long) buffer[ 1 ]) << 16) |
- (((long) buffer[ 2 ]) << 8) |
- (((long) buffer[ 3 ]));
- }
- else
- {
- unsigned char
- x = c;
-
- taglen = ((long) x) << 8;
- x = getc(ifile);
- if ((char)x == EOF)
- return -1;
- taglen |= (long) x;
- }
- /* make a buffer to hold the tag data and snag it from the input stream */
- str=(unsigned char *) malloc((unsigned int) (taglen+1));
- if (str == (unsigned char *) NULL)
- {
- printf("Memory allocation failed");
- return 0;
- }
- for (tagindx=0; tagindx<taglen; tagindx++)
- {
- c = str[tagindx] = getc(ifile);
- if (c == EOF)
- return -1;
- }
- str[ taglen ] = 0;
-
- /* now finish up by formatting this binary data into ASCII equivalent */
- if (strlen(readable) > 0)
- fprintf(ofile, "%d#%d#%s=",(unsigned int)dataset, (unsigned int) recnum, readable);
- else
- fprintf(ofile, "%d#%d=",(unsigned int)dataset, (unsigned int) recnum);
- formatString( ofile, str, taglen );
- free(str);
-
- tagsfound++;
-
- c = getc(ifile);
- }
- return tagsfound;
-}
-
-int tokenizer(unsigned inflag,char *token,int tokmax,char *line,
-char *white,char *brkchar,char *quote,char eschar,char *brkused,
-int *next,char *quoted);
-
-char *super_fgets(char *b, int *blen, FILE *file)
-{
- int
- c,
- len;
-
- unsigned char
- *q;
-
- len=*blen;
- for (q=b; ; q++)
- {
- c=fgetc(file);
- if (c == EOF || c == '\n')
- break;
- if (((int)q - (int)b + 1 ) >= (int) len)
- {
- int
- tlen;
-
- tlen=(int)q-(int)b;
- len<<=1;
- b=(unsigned char *) realloc((char *) b,(len+2));
- if ((unsigned char *) b == (unsigned char *) NULL)
- break;
- q=b+tlen;
- }
- *q=(unsigned char) c;
- }
- *blen=0;
- if ((unsigned char *)b != (unsigned char *) NULL)
- {
- int
- tlen;
-
- tlen=(int)q - (int)b;
- if (tlen == 0)
- return (char *) NULL;
- b[tlen] = '\0';
- *blen=++tlen;
- }
- return b;
-}
-
-#define BUFFER_SZ 4096
-
-int main(int argc, char *argv[])
-{
- unsigned int
- length;
-
- unsigned char
- *buffer;
-
- int
- i,
- mode; /* iptc binary, or iptc text */
-
- FILE
- *ifile = stdin,
- *ofile = stdout;
-
- char
- c,
- *usage = "usage: iptcutil -t | -b [-i file] [-o file] <input >output";
-
- if( argc < 2 )
- {
- printf(usage);
- return 1;
- }
-
- mode = 0;
- length = -1;
- buffer = (unsigned char *)NULL;
-
- for (i=1; i<argc; i++)
- {
- c = argv[i][0];
- if (c == '-' || c == '/')
- {
- c = argv[i][1];
- switch( c )
- {
- case 't':
- mode = 1;
-#ifdef WIN32
- /* Set "stdout" to binary mode: */
- _setmode( _fileno( ofile ), _O_BINARY );
-#endif
- break;
- case 'b':
- mode = 0;
-#ifdef WIN32
- /* Set "stdin" to binary mode: */
- _setmode( _fileno( ifile ), _O_BINARY );
-#endif
- break;
- case 'i':
- if (mode == 0)
- ifile = fopen(argv[++i], "rb");
- else
- ifile = fopen(argv[++i], "rt");
- if (ifile == (FILE *)NULL)
- {
- printf("Unable to open: %s\n", argv[i]);
- return 1;
- }
- break;
- case 'o':
- if (mode == 0)
- ofile = fopen(argv[++i], "wt");
- else
- ofile = fopen(argv[++i], "wb");
- if (ofile == (FILE *)NULL)
- {
- printf("Unable to open: %s\n", argv[i]);
- return 1;
- }
- break;
- default:
- printf("Unknown option: %s\n", argv[i]);
- return 1;
- }
- }
- else
- {
- printf(usage);
- return 1;
- }
- }
-
- if (mode == 0) /* handle binary iptc info */
- formatIPTC(ifile, ofile);
-
- if (mode == 1) /* handle text form of iptc info */
- {
- char
- brkused,
- quoted,
- *line,
- *token,
- *newstr;
-
- int
- state,
- next;
-
- unsigned char
- recnum,
- dataset;
-
- int
- inputlen = BUFFER_SZ;
-
- line = (char *) malloc(inputlen);
- token = (char *)NULL;
- while((line = super_fgets(line,&inputlen,ifile))!=NULL)
- {
- state=0;
- next=0;
-
- token = (char *) malloc(inputlen);
- newstr = (char *) malloc(inputlen);
- while(tokenizer(0, token, inputlen, line, "", "=", "\"", 0,
- &brkused,&next,&quoted)==0)
- {
- if (state == 0)
- {
- int
- state,
- next;
-
- char
- brkused,
- quoted;
-
- state=0;
- next=0;
- while(tokenizer(0, newstr, inputlen, token, "", "#", "", 0,
- &brkused, &next, &quoted)==0)
- {
- if (state == 0)
- dataset = (unsigned char) atoi(newstr);
- else
- if (state == 1)
- recnum = (unsigned char) atoi(newstr);
- state++;
- }
- }
- else
- if (state == 1)
- {
- int
- next;
-
- unsigned long
- len;
-
- char
- brkused,
- quoted;
-
- next=0;
- len = strlen(token);
- while(tokenizer(0, newstr, inputlen, token, "", "&", "", 0,
- &brkused, &next, &quoted)==0)
- {
- if (brkused && next > 0)
- {
- char
- *s = &token[next-1];
-
- len -= convertHTMLcodes(s, strlen(s));
- }
- }
-
- fputc(0x1c, ofile);
- fputc(dataset, ofile);
- fputc(recnum, ofile);
- if (len < 0x10000)
- {
- fputc((len >> 8) & 255, ofile);
- fputc(len & 255, ofile);
- }
- else
- {
- fputc(((len >> 24) & 255) | 0x80, ofile);
- fputc((len >> 16) & 255, ofile);
- fputc((len >> 8) & 255, ofile);
- fputc(len & 255, ofile);
- }
- next=0;
- while (len--)
- fputc(token[next++], ofile);
- }
- state++;
- }
- free(token);
- token = (char *)NULL;
- free(newstr);
- newstr = (char *)NULL;
- }
- free(line);
-
- fclose( ifile );
- fclose( ofile );
- }
-
- return 0;
-}
-
-/*
- This routine is a generalized, finite state token parser. It allows
- you extract tokens one at a time from a string of characters. The
- characters used for white space, for break characters, and for quotes
- can be specified. Also, characters in the string can be preceded by
- a specifiable escape character which removes any special meaning the
- character may have.
-
- There are a lot of formal parameters in this subroutine call, but
- once you get familiar with them, this routine is fairly easy to use.
- "#define" macros can be used to generate simpler looking calls for
- commonly used applications of this routine.
-
- First, some terminology:
-
- token: used here, a single unit of information in
- the form of a group of characters.
-
- white space: space that gets ignored (except within quotes
- or when escaped), like blanks and tabs. in
- addition, white space terminates a non-quoted
- token.
-
- break character: a character that separates non-quoted tokens.
- commas are a common break character. the
- usage of break characters to signal the end
- of a token is the same as that of white space,
- except multiple break characters with nothing
- or only white space between generate a null
- token for each two break characters together.
-
- for example, if blank is set to be the white
- space and comma is set to be the break
- character, the line ...
-
- A, B, C , , DEF
-
- ... consists of 5 tokens:
-
- 1) "A"
- 2) "B"
- 3) "C"
- 4) "" (the null string)
- 5) "DEF"
-
- quote character: a character that, when surrounding a group
- of other characters, causes the group of
- characters to be treated as a single token,
- no matter how many white spaces or break
- characters exist in the group. also, a
- token always terminates after the closing
- quote. for example, if ' is the quote
- character, blank is white space, and comma
- is the break character, the following
- string ...
-
- A, ' B, CD'EF GHI
-
- ... consists of 4 tokens:
-
- 1) "A"
- 2) " B, CD" (note the blanks & comma)
- 3) "EF"
- 4) "GHI"
-
- the quote characters themselves do
- not appear in the resultant tokens. the
- double quotes are delimiters i use here for
- documentation purposes only.
-
- escape character: a character which itself is ignored but
- which causes the next character to be
- used as is. ^ and \ are often used as
- escape characters. an escape in the last
- position of the string gets treated as a
- "normal" (i.e., non-quote, non-white,
- non-break, and non-escape) character.
- for example, assume white space, break
- character, and quote are the same as in the
- above examples, and further, assume that
- ^ is the escape character. then, in the
- string ...
-
- ABC, ' DEF ^' GH' I ^ J K^ L ^
-
- ... there are 7 tokens:
-
- 1) "ABC"
- 2) " DEF ' GH"
- 3) "I"
- 4) " " (a lone blank)
- 5) "J"
- 6) "K L"
- 7) "^" (passed as is at end of line)
-
-
- OK, now that you have this background, here's how to call "tokenizer":
-
- result=tokenizer(flag,token,maxtok,string,white,break,quote,escape,
- brkused,next,quoted)
-
- result: 0 if we haven't reached EOS (end of string), and
- 1 if we have (this is an "int").
-
- flag: right now, only the low order 3 bits are used.
- 1 => convert non-quoted tokens to upper case
- 2 => convert non-quoted tokens to lower case
- 0 => do not convert non-quoted tokens
- (this is a "char").
-
- token: a character string containing the returned next token
- (this is a "char[]").
-
- maxtok: the maximum size of "token". characters beyond
- "maxtok" are truncated (this is an "int").
-
- string: the string to be parsed (this is a "char[]").
-
- white: a string of the valid white spaces. example:
-
- char whitesp[]={" \t"};
-
- blank and tab will be valid white space (this is
- a "char[]").
-
- break: a string of the valid break characters. example:
-
- char breakch[]={";,"};
-
- semicolon and comma will be valid break characters
- (this is a "char[]").
-
- IMPORTANT: do not use the name "break" as a C
- variable, as this is a reserved word in C.
-
- quote: a string of the valid quote characters. an example
- would be
-
- char whitesp[]={"'\"");
-
- (this causes single and double quotes to be valid)
- note that a token starting with one of these characters
- needs the same quote character to terminate it.
-
- for example,
-
- "ABC '
-
- is unterminated, but
-
- "DEF" and 'GHI'
-
- are properly terminated. note that different quote
- characters can appear on the same line; only for
- a given token do the quote characters have to be
- the same (this is a "char[]").
-
- escape: the escape character (NOT a string ... only one
- allowed). use zero if none is desired (this is
- a "char").
-
- brkused: the break character used to terminate the current
- token. if the token was quoted, this will be the
- quote used. if the token is the last one on the
- line, this will be zero (this is a pointer to a
- "char").
-
- next: this variable points to the first character of the
- next token. it gets reset by "tokenizer" as it steps
- through the string. set it to 0 upon initialization,
- and leave it alone after that. you can change it
- if you want to jump around in the string or re-parse
- from the beginning, but be careful (this is a
- pointer to an "int").
-
- quoted: set to 1 (true) if the token was quoted and 0 (false)
- if not. you may need this information (for example:
- in C, a string with quotes around it is a character
- string, while one without is an identifier).
-
- (this is a pointer to a "char").
-*/
-
-/* states */
-
-#define IN_WHITE 0
-#define IN_TOKEN 1
-#define IN_QUOTE 2
-#define IN_OZONE 3
-
-int _p_state; /* current state */
-unsigned _p_flag; /* option flag */
-char _p_curquote; /* current quote char */
-int _p_tokpos; /* current token pos */
-
-/* routine to find character in string ... used only by "tokenizer" */
-
-int sindex(char ch,char *string)
-{
- char *cp;
- for(cp=string;*cp;++cp)
- if(ch==*cp)
- return (int)(cp-string); /* return postion of character */
- return -1; /* eol ... no match found */
-}
-
-/* routine to store a character in a string ... used only by "tokenizer" */
-
-void chstore(char *string,int max,char ch)
-{
- char c;
- if(_p_tokpos>=0&&_p_tokpos<max-1)
- {
- if(_p_state==IN_QUOTE)
- c=ch;
- else
- switch(_p_flag&3)
- {
- case 1: /* convert to upper */
- c=toupper(ch);
- break;
-
- case 2: /* convert to lower */
- c=tolower(ch);
- break;
-
- default: /* use as is */
- c=ch;
- break;
- }
- string[_p_tokpos++]=c;
- }
- return;
-}
-
-int tokenizer(unsigned inflag,char *token,int tokmax,char *line,
- char *white,char *brkchar,char *quote,char eschar,char *brkused,
- int *next,char *quoted)
-{
- int qp;
- char c,nc;
-
- *brkused=0; /* initialize to null */
- *quoted=0; /* assume not quoted */
-
- if(!line[*next]) /* if we're at end of line, indicate such */
- return 1;
-
- _p_state=IN_WHITE; /* initialize state */
- _p_curquote=0; /* initialize previous quote char */
- _p_flag=inflag; /* set option flag */
-
- for(_p_tokpos=0;c=line[*next];++(*next)) /* main loop */
- {
- if((qp=sindex(c,brkchar))>=0) /* break */
- {
- switch(_p_state)
- {
- case IN_WHITE: /* these are the same here ... */
- case IN_TOKEN: /* ... just get out */
- case IN_OZONE: /* ditto */
- ++(*next);
- *brkused=brkchar[qp];
- goto byebye;
-
- case IN_QUOTE: /* just keep going */
- chstore(token,tokmax,c);
- break;
- }
- }
- else if((qp=sindex(c,quote))>=0) /* quote */
- {
- switch(_p_state)
- {
- case IN_WHITE: /* these are identical, */
- _p_state=IN_QUOTE; /* change states */
- _p_curquote=quote[qp]; /* save quote char */
- *quoted=1; /* set to true as long as something is in quotes */
- break;
-
- case IN_QUOTE:
- if(quote[qp]==_p_curquote) /* same as the beginning quote? */
- {
- _p_state=IN_OZONE;
- _p_curquote=0;
- }
- else
- chstore(token,tokmax,c); /* treat as regular char */
- break;
-
- case IN_TOKEN:
- case IN_OZONE:
- *brkused=c; /* uses quote as break char */
- goto byebye;
- }
- }
- else if((qp=sindex(c,white))>=0) /* white */
- {
- switch(_p_state)
- {
- case IN_WHITE:
- case IN_OZONE:
- break; /* keep going */
-
- case IN_TOKEN:
- _p_state=IN_OZONE;
- break;
-
- case IN_QUOTE:
- chstore(token,tokmax,c); /* it's valid here */
- break;
- }
- }
- else if(c==eschar) /* escape */
- {
- nc=line[(*next)+1];
- if(nc==0) /* end of line */
- {
- *brkused=0;
- chstore(token,tokmax,c);
- ++(*next);
- goto byebye;
- }
- switch(_p_state)
- {
- case IN_WHITE:
- --(*next);
- _p_state=IN_TOKEN;
- break;
-
- case IN_TOKEN:
- case IN_QUOTE:
- ++(*next);
- chstore(token,tokmax,nc);
- break;
-
- case IN_OZONE:
- goto byebye;
- }
- }
- else /* anything else is just a real character */
- {
- switch(_p_state)
- {
- case IN_WHITE:
- _p_state=IN_TOKEN; /* switch states */
-
- case IN_TOKEN: /* these 2 are */
- case IN_QUOTE: /* identical here */
- chstore(token,tokmax,c);
- break;
-
- case IN_OZONE:
- goto byebye;
- }
- }
- } /* end of main loop */
-
-byebye:
- token[_p_tokpos]=0; /* make sure token ends with EOS */
-
- return 0;
-}
diff --git a/contrib/iptcutil/test.iptc b/contrib/iptcutil/test.iptc
deleted file mode 100644
index a2605622..00000000
--- a/contrib/iptcutil/test.iptc
+++ /dev/null
Binary files differ
diff --git a/contrib/iptcutil/test.txt b/contrib/iptcutil/test.txt
deleted file mode 100644
index d5181004..00000000
--- a/contrib/iptcutil/test.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-2#0="&#0;&#2;"
-2#120#Caption="Chairman of the US House Judiciary Committee, Henry Hyde,R-IL, makes his opening statement during impeachment hearings 11 December on Capitol Hill in Washington, DC. The committee is debating the articles of impechment and my take a vote on the impeachment of US President BIll Clinton on charges that he obstucted justice, lied and abused the power of his office as early as today. AFP PHOTO Paul J. RICHARDS&#13;"
-2#122#Caption Writer="kb/lt"
-2#100#Country Code="USA"
-2#105#Headline="Old fart squeezing two fingers."
-2#30#Release Date="19981211"
-2#35#Release Time="000000+0000"
-2#40#Special Instructions="This is a test. This is only a test. ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890"
-2#80#Byline="PAUL J. RICHARDS"
-2#85#Byline Title="STF"
-2#110#Credit="AFP"
-2#65#Originating Program="MacDesk Reporter"
-2#115#Source="AFP"
-2#5#Image Name="US-HYDE"
-2#55#Created Date="19981211"
-2#90#City="WASHINGTON"
-2#95#Province State="DC"
-2#101#Country="UNITED STATES"
-2#103#Original Transmission Reference="DCA03"
-2#15#Category="POL"
-2#20#Supplemental Category="GOVERNMENT"
-2#10#Priority="5"
-2#25#Keyword="fart"
-2#25#Keyword="squeezing"
-2#25#Keyword="old"
-2#25#Keyword="fingers"
-2#75#Object Cycle="a"
-2#60#Created Time="000000+0000"
-2#70#Program Version="2.0.3"
-2#130="3S"
-2#135="GB"
-2#231="Kaya A. Hoffmann 12/14/98 12:00:44 PM Copy To : Selects - \\KINYANI\Selects&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;"
diff --git a/contrib/mac-cw/CVS/Entries b/contrib/mac-cw/CVS/Entries
deleted file mode 100644
index 35998199..00000000
--- a/contrib/mac-cw/CVS/Entries
+++ /dev/null
@@ -1,8 +0,0 @@
-/Makefile.script/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/README/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/mac_main.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/mac_main.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/metrowerks.note/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/mkg3_main.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/version.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/contrib/mac-cw/CVS/Repository b/contrib/mac-cw/CVS/Repository
deleted file mode 100644
index d620cc0a..00000000
--- a/contrib/mac-cw/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/mac-cw
diff --git a/contrib/mac-cw/CVS/Root b/contrib/mac-cw/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/mac-cw/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/mac-mpw/CVS/Entries b/contrib/mac-mpw/CVS/Entries
deleted file mode 100644
index 5d8ce16e..00000000
--- a/contrib/mac-mpw/CVS/Entries
+++ /dev/null
@@ -1,8 +0,0 @@
-/BUILD.mpw/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/README/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/libtiff.make/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/mactrans.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/port.make/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tools.make/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/top.make/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/contrib/mac-mpw/CVS/Repository b/contrib/mac-mpw/CVS/Repository
deleted file mode 100644
index 738d5fb9..00000000
--- a/contrib/mac-mpw/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/mac-mpw
diff --git a/contrib/mac-mpw/CVS/Root b/contrib/mac-mpw/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/mac-mpw/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/mfs/CVS/Entries b/contrib/mfs/CVS/Entries
deleted file mode 100644
index a9343d70..00000000
--- a/contrib/mfs/CVS/Entries
+++ /dev/null
@@ -1,3 +0,0 @@
-/README/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/mfs_file.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/contrib/mfs/CVS/Repository b/contrib/mfs/CVS/Repository
deleted file mode 100644
index c747801e..00000000
--- a/contrib/mfs/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/mfs
diff --git a/contrib/mfs/CVS/Root b/contrib/mfs/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/mfs/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/pds/CVS/Entries b/contrib/pds/CVS/Entries
deleted file mode 100644
index 02b71f54..00000000
--- a/contrib/pds/CVS/Entries
+++ /dev/null
@@ -1,6 +0,0 @@
-/README/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_imageiter.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_imageiter.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_pdsdirread.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_pdsdirwrite.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/contrib/pds/CVS/Repository b/contrib/pds/CVS/Repository
deleted file mode 100644
index 4f26a798..00000000
--- a/contrib/pds/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/pds
diff --git a/contrib/pds/CVS/Root b/contrib/pds/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/pds/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/pds/tif_imageiter.c b/contrib/pds/tif_imageiter.c
index 60dfa09b..9b4b6e4a 100644
--- a/contrib/pds/tif_imageiter.c
+++ b/contrib/pds/tif_imageiter.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/contrib/pds/tif_imageiter.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/contrib/pds/tif_imageiter.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1991-1996 Sam Leffler
diff --git a/contrib/pds/tif_pdsdirread.c b/contrib/pds/tif_pdsdirread.c
index 37b5d0f5..dfcd009d 100644
--- a/contrib/pds/tif_pdsdirread.c
+++ b/contrib/pds/tif_pdsdirread.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/contrib/pds/tif_pdsdirread.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/contrib/pds/tif_pdsdirread.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1996 Sam Leffler
diff --git a/contrib/pds/tif_pdsdirwrite.c b/contrib/pds/tif_pdsdirwrite.c
index 6b537515..f982c426 100644
--- a/contrib/pds/tif_pdsdirwrite.c
+++ b/contrib/pds/tif_pdsdirwrite.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/contrib/pds/tif_pdsdirwrite.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/contrib/pds/tif_pdsdirwrite.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/* When writing data to TIFF files, it is often useful to store application-
specific data in a private TIFF directory so that the tags don't need to
diff --git a/contrib/ras/CVS/Entries b/contrib/ras/CVS/Entries
deleted file mode 100644
index 731047ff..00000000
--- a/contrib/ras/CVS/Entries
+++ /dev/null
@@ -1,4 +0,0 @@
-/README/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/ras2tif.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif2ras.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/contrib/ras/CVS/Repository b/contrib/ras/CVS/Repository
deleted file mode 100644
index b4f81c23..00000000
--- a/contrib/ras/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/ras
diff --git a/contrib/ras/CVS/Root b/contrib/ras/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/ras/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/tags/Makefile.gcc b/contrib/tags/Makefile.gcc
new file mode 100644
index 00000000..eeceb750
--- /dev/null
+++ b/contrib/tags/Makefile.gcc
@@ -0,0 +1,56 @@
+# Makefile for XLIBTIFF
+#
+# Written by: Niles Ritter
+#
+# This Makefile is for use with gcc (2.2.2 or later)
+#
+DESTDIR=.
+#
+AR = /usr/bin/ar
+AROPTS = rc
+RANLIB = /usr/bin/ranlib
+NULL=
+
+TIFFLIB=../../libtiff
+PORT=../..
+
+IPATH= -I. -I${TIFFLIB} -I${PORT}
+CONF_LIBRARY=\
+ ${NULL}
+CC= gcc
+COPTS= -g
+CFLAGS= ${COPTS} ${IPATH} ${CONF_LIBRARY}
+#
+LIBS= ./libxtiff.a ${TIFFLIB}/libtiff.a -lm
+
+OBJS= \
+ xtif_dir.o \
+ maketif.o \
+ listtif.o \
+ ${NULL}
+
+PROGS= maketif listtif
+LIBXTIFF= libxtiff.a
+ALL= ${LIBXTIFF} ${PROGS}
+
+all: ${ALL}
+
+library: ${LIBXTIFF}
+
+test: ${PROGS}
+ ./maketif
+ ./listtif
+
+maketif: maketif.o libxtiff.a
+ ${CC} ${COPTS} maketif.o ${LIBS} -o maketif
+
+listtif: listtif.o libxtiff.a
+ ${CC} ${COPTS} listtif.o ${LIBS} -o listtif
+
+libxtiff.a: xtif_dir.o
+ ${AR} ${AROPTS} libxtiff.a xtif_dir.o
+ ${RANLIB} libxtiff.a
+
+clean:
+ rm -f ${ALL} ${OBJS} core a.out newtif.tif
+
diff --git a/contrib/tags/Makefile.mpw b/contrib/tags/Makefile.mpw
new file mode 100644
index 00000000..92f506f3
--- /dev/null
+++ b/contrib/tags/Makefile.mpw
@@ -0,0 +1,67 @@
+#***********************************************************************
+#
+# MPW build file for example LIBXTIFF utilities
+#
+# written by Niles D. Ritter.
+#
+CC = c
+AR = lib -o
+RM = delete -y
+LN = duplicate -y
+
+#debug option
+#DEBUG= -sym full
+DEBUG=
+
+# data/code model options
+#MODEL=
+MODEL= -model far
+
+TIFFLIB = :::libtiff:
+
+LINK.c = Link {LDFLAGS}
+.o Ä .c
+ {CC} {DEBUG} {CFLAGS} {CPPFLAGS} {Default}.c -o {Default}.o
+LDFLAGS = {DEBUG} {MODEL} -c 'MPS ' -t MPST -w
+CFLAGS = {MODEL}
+CPPFLAGS = -I {TIFFLIB}
+OBJS = maketif.o listtif.o xtif_dir.o
+CLEANOBJS = maketif.o listtif.o xtif_dir.o
+CLEANOTHER = newtif.tif
+CLEANINC =
+LIBS = {TIFFLIB}libtiff.o ¶
+ libxtiff.o ¶
+ "{CLibraries}"StdClib.o ¶
+ "{Libraries}"Stubs.o ¶
+ "{Libraries}"Runtime.o ¶
+ "{Libraries}"Interface.o
+
+PROGS= maketif listtif
+LIBXTIFF= libxtiff.o
+ALL= {LIBXTIFF} {PROGS}
+
+all Ä {ALL}
+
+library Ä {LIBXTIFF}
+
+test Ä {PROGS}
+ maketif
+ listtif
+
+compile Ä {OBJS}
+
+maketif Ä maketif.o libxtiff.o
+ {LINK.c} -o maketif maketif.o {LIBS}
+
+listtif Ä listtif.o libxtiff.o
+ {LINK.c} -o listtif listtif.o {LIBS}
+
+libxtiff.o Ä xtif_dir.o
+ lib -o libxtiff.o xtif_dir.o
+
+clean Ä
+ {RM} {CLEANOBJS} || set status 0
+ {RM} {LIBXTIFF} || set status 0
+ {RM} {PROGS} || set status 0
+ {RM} Å.tif || set status 0
+
diff --git a/contrib/tags/README b/contrib/tags/README
new file mode 100644
index 00000000..2d096100
--- /dev/null
+++ b/contrib/tags/README
@@ -0,0 +1,116 @@
+
+Client module for adding to LIBTIFF tagset
+-------------------------------------------
+ Author: Niles Ritter
+
+
+In the past, users of the "libtiff" package had to modify the
+source code of the library if they required additional private tags
+or codes not recognized by libtiff. Thus, whenever
+a new revision of libtiff came out the client would have to
+perform modifications to six or seven different files to re-install
+their tags.
+
+The latest versions of libtiff now provide client software new routines,
+giving them the opportunity to install private extensions at runtime,
+rather than compile-time. This means that the client may encapsulate
+all of their private tags into a separate module, which need only
+be recompiled when new versions of libtiff are released; no manual
+editing of files is required.
+
+How it works
+------------
+
+The mechanism for overriding the tag access has been enabled with
+a single new routine, which has the following calling sequence:
+
+ TIFFExtendProc old_extender;
+
+ old_extender = TIFFSetTagExtender(tag_extender);
+
+which must be called prior to opening or creating TIFF files.
+
+This routine sets a static pointer to the user-specified function
+<tag_extender>, which in turn is called by TIFFDefaultDirectory(),
+just after the usual TIFFSetField() and TIFFGetField() methods
+are defined, and just before the compression tag is set. It also
+returns a pointer to the previously-defined value of the tag-extender,
+so that multiple clients may be installed.
+
+The TIFFExtendProc method that you define should be used to override
+the TIFF file's "vsetfield" and "vgetfield" methods, so that you
+can trap your new, private tags, and install their values into
+a private directory structure. For your convienience, a new pointer
+has also been added to the "TIFF" file structure:
+
+ tidata_t tif_clientdir; /* client TIFF directory */
+
+into which you may install whatever private directory structures you like.
+You should also override the tag-printing method from within your
+"vsetfield" method, to permit the symbolic printing of your new tags.
+
+
+Example Client Code:
+--------------------
+
+An example module has been provided as a template for installing
+your own tags into a client tag extender. The module is called
+"xtif_dir.c", and defines all of the interface routines, tag field
+access, tag printing, etc. for most purpose.
+
+To see how the client module operates, there are three "fake"
+tags currently installed. If you use the existing makefile you can
+build them with:
+
+ make all -f Makefile.gcc !or Makefile.mpw
+ maketif
+ listtif
+
+This will build two example programs called "maketif" and "listtif"
+and then run them. These programs do nothing more than create a small
+file called "newtif.tif", install the fake tags, and then list them out
+using TIFFPrintDirectory().
+
+Installing Private Tags
+-----------------------
+
+To use this module for installing your own tags, edit each of the files
+
+ xtif_dir.c
+ xtiffio.h
+ xtiffiop.h
+
+and search for the string "XXX". At these locations the comments
+will direct you how to install your own tag values, define their
+types, etc. Three examples tags are currently installed, demonstrating
+how to implement multi-valued tags, single-valued tags, and ASCII tags.
+The examples are not valid, registered tags, so you must replace them with
+your own.
+
+To test the routines, also edit the test programs "maketif.c" and
+"listtif.c" and replace the portions of the code that set the
+private tag values and list them.
+
+Once you have edited these files, you may build the client module
+with the Makefile provided, and run the test programs.
+
+To use these files in your own code, the "xtif_dir.c" module defines
+replacement routines for the standard "TIFFOpen()" "TIFFFdOpen",
+and "TIFFClose()" routines, called XTIFFOpen, XTIFFFdOpen and XTIFFClose.
+You must use these routines in order to have the extended tag handlers
+installed. Once installed, the standard TIFFGetField() and TIFFSetField
+routines may be used as before.
+
+Adding Extended Tags to "tools"
+-------------------------------
+To create an extended-tag savvy "tiffinfo" program or other utility, you may
+simply recompile and link the tools to your "libxtiff" library, adding
+
+ -DTIFFOpen=XTIFFOpen -DTIFFClose=XTIFFClose -DTIFFFdOpen=XTIFFFdOpen
+
+to the compile statement.
+
+Bugs, Comments Etc:
+------------------
+ Send all reports and suggestions to ndr@tazboy.jpl.nasa.gov
+ (Niles Ritter).
diff --git a/contrib/tags/listtif.c b/contrib/tags/listtif.c
new file mode 100644
index 00000000..2ea12cea
--- /dev/null
+++ b/contrib/tags/listtif.c
@@ -0,0 +1,32 @@
+/*
+ * listtif.c -- lists a tiff file.
+ */
+
+#include "xtiffio.h"
+#include <stdlib.h>
+
+void main(int argc,char *argv[])
+{
+ char *fname="newtif.tif";
+ int flags;
+
+ TIFF *tif=(TIFF*)0; /* TIFF-level descriptor */
+
+ if (argc>1) fname=argv[1];
+
+ tif=XTIFFOpen(fname,"r");
+ if (!tif) goto failure;
+
+ /* We want the double array listed */
+ flags = TIFFPRINT_MYMULTIDOUBLES;
+
+ TIFFPrintDirectory(tif,stdout,flags);
+ XTIFFClose(tif);
+ exit (0);
+
+failure:
+ printf("failure in listtif\n");
+ if (tif) XTIFFClose(tif);
+ exit (-1);
+}
+
diff --git a/contrib/tags/maketif.c b/contrib/tags/maketif.c
new file mode 100644
index 00000000..aad6f153
--- /dev/null
+++ b/contrib/tags/maketif.c
@@ -0,0 +1,70 @@
+/*
+ * maketif.c -- creates a little TIFF file, with
+ * the XTIFF extended tiff example tags.
+ */
+
+#include <stdlib.h>
+#include "xtiffio.h"
+
+
+void SetUpTIFFDirectory(TIFF *tif);
+void WriteImage(TIFF *tif);
+
+#define WIDTH 20
+#define HEIGHT 20
+
+void main()
+{
+ TIFF *tif=(TIFF*)0; /* TIFF-level descriptor */
+
+ tif=XTIFFOpen("newtif.tif","w");
+ if (!tif) goto failure;
+
+ SetUpTIFFDirectory(tif);
+ WriteImage(tif);
+
+ XTIFFClose(tif);
+ exit (0);
+
+failure:
+ printf("failure in maketif\n");
+ if (tif) XTIFFClose(tif);
+ exit (-1);
+}
+
+
+void SetUpTIFFDirectory(TIFF *tif)
+{
+ double mymulti[6]={0.0,1.0,2.0, 3.1415926, 5.0,1.0};
+ uint32 mysingle=3456;
+ char *ascii="This file was produced by Steven Spielberg. NOT";
+
+ TIFFSetField(tif,TIFFTAG_IMAGEWIDTH,WIDTH);
+ TIFFSetField(tif,TIFFTAG_IMAGELENGTH,HEIGHT);
+ TIFFSetField(tif,TIFFTAG_COMPRESSION,COMPRESSION_NONE);
+ TIFFSetField(tif,TIFFTAG_PHOTOMETRIC,PHOTOMETRIC_MINISBLACK);
+ TIFFSetField(tif,TIFFTAG_PLANARCONFIG,PLANARCONFIG_CONTIG);
+ TIFFSetField(tif,TIFFTAG_BITSPERSAMPLE,8);
+ TIFFSetField(tif,TIFFTAG_ROWSPERSTRIP,20);
+
+ /* Install the extended TIFF tag examples */
+ TIFFSetField(tif,TIFFTAG_EXAMPLE_MULTI,6,mymulti);
+ TIFFSetField(tif,TIFFTAG_EXAMPLE_SINGLE,mysingle);
+ TIFFSetField(tif,TIFFTAG_EXAMPLE_ASCII,ascii);
+}
+
+
+void WriteImage(TIFF *tif)
+{
+ int i;
+ char buffer[WIDTH];
+
+ memset(buffer,0,sizeof(buffer));
+ for (i=0;i<HEIGHT;i++)
+ if (!TIFFWriteScanline(tif, buffer, i, 0))
+ TIFFError("WriteImage","failure in WriteScanline\n");
+}
+
+
+
+
diff --git a/contrib/tags/xtif_dir.c b/contrib/tags/xtif_dir.c
new file mode 100644
index 00000000..c9137aac
--- /dev/null
+++ b/contrib/tags/xtif_dir.c
@@ -0,0 +1,343 @@
+/*
+ * xtif_dir.c
+ *
+ * Extended TIFF Directory Tag Support.
+ *
+ * You may use this file as a template to add your own
+ * extended tags to the library. Only the parts of the code
+ * marked with "XXX" require modification. Three example tags
+ * are shown; you should replace them with your own.
+ *
+ * Author: Niles D. Ritter
+ */
+
+#include "xtiffiop.h"
+#include <stdio.h>
+
+/* Tiff info structure.
+ *
+ * Entry format:
+ * { TAGNUMBER, ReadCount, WriteCount, DataType, FIELDNUM,
+ * OkToChange, PassDirCountOnSet, AsciiName }
+ *
+ * For ReadCount, WriteCount, -1 = unknown; used for mult-valued
+ * tags and ASCII.
+ */
+
+static const TIFFFieldInfo xtiffFieldInfo[] = {
+
+ /* XXX Replace these example tags with your own extended tags */
+ { TIFFTAG_EXAMPLE_MULTI, -1,-1, TIFF_DOUBLE, FIELD_EXAMPLE_MULTI,
+ TRUE, TRUE, "MyMultivaluedTag" },
+ { TIFFTAG_EXAMPLE_SINGLE, 1, 1, TIFF_LONG, FIELD_EXAMPLE_SINGLE,
+ TRUE, FALSE, "MySingleLongTag" },
+ { TIFFTAG_EXAMPLE_ASCII, -1,-1, TIFF_ASCII, FIELD_EXAMPLE_ASCII,
+ TRUE, FALSE, "MyAsciiTag" },
+};
+#define N(a) (sizeof (a) / sizeof (a[0]))
+
+
+static void
+_XTIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
+{
+ xtiff *xt = XTIFFDIR(tif);
+ XTIFFDirectory *xd = &xt->xtif_dir;
+ int i,num;
+
+ /* call the inherited method */
+ if (PARENT(xt,printdir))
+ (PARENT(xt,printdir))(tif,fd,flags);
+
+ /* XXX Add field printing here. Replace the three example
+ * tags implemented below with your own.
+ */
+
+ fprintf(fd,"--My Example Tags--\n");
+
+ /* Our first example tag may have a lot of values, so we
+ * will only print them out if the TIFFPRINT_MYMULTIDOUBLES
+ * flag is passed into the print method.
+ */
+ if (TIFFFieldSet(tif,FIELD_EXAMPLE_MULTI))
+ {
+ fprintf(fd, " My Multi-Valued Doubles:");
+ if (flags & TIFFPRINT_MYMULTIDOUBLES)
+ {
+ double *value = xd->xd_example_multi;
+
+ num = xd->xd_num_multi;
+ fprintf(fd,"(");
+ for (i=0;i<num;i++) fprintf(fd, " %lg", *value++);
+ fprintf(fd,")\n");
+ } else
+ fprintf(fd, "(present)\n");
+ }
+
+ if (TIFFFieldSet(tif,FIELD_EXAMPLE_SINGLE))
+ {
+ fprintf(fd, " My Single Long Tag: %lu\n", xd->xd_example_single);
+ }
+
+ if (TIFFFieldSet(tif,FIELD_EXAMPLE_ASCII))
+ {
+ _TIFFprintAsciiTag(fd,"My ASCII Tag",
+ xd->xd_example_ascii);
+ }
+}
+
+static int
+_XTIFFVSetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+ xtiff *xt = XTIFFDIR(tif);
+ XTIFFDirectory* xd = &xt->xtif_dir;
+ int status = 1;
+ uint32 v32=0;
+ int i=0, v=0;
+ va_list ap1 = ap;
+
+ /* va_start is called by the calling routine */
+
+ switch (tag) {
+ /*
+ * XXX put your extended tags here; replace the implemented
+ * example tags with your own.
+ */
+ case TIFFTAG_EXAMPLE_MULTI:
+ /* multi-valued tags need to store the count as well */
+ xd->xd_num_multi = (uint16) va_arg(ap, int);
+ _TIFFsetDoubleArray(&xd->xd_example_multi, va_arg(ap, double*),
+ (long) xd->xd_num_multi);
+ break;
+ case TIFFTAG_EXAMPLE_SINGLE:
+ xd->xd_example_single = va_arg(ap, uint32);
+ break;
+ case TIFFTAG_EXAMPLE_ASCII:
+ _TIFFsetString(&xd->xd_example_ascii, va_arg(ap, char*));
+ break;
+ default:
+ /* call the inherited method */
+ return (PARENT(xt,vsetfield))(tif,tag,ap);
+ break;
+ }
+ if (status) {
+ /* we have to override the print method here,
+ * after the compression tags have gotten to it.
+ * This makes sense because the only time we would
+ * need the extended print method is if an extended
+ * tag is set by the reader.
+ */
+ if (!(xt->xtif_flags & XTIFFP_PRINT))
+ {
+ PARENT(xt,printdir) = TIFFMEMBER(tif,printdir);
+ TIFFMEMBER(tif,printdir) = _XTIFFPrintDirectory;
+ xt->xtif_flags |= XTIFFP_PRINT;
+ }
+ TIFFSetFieldBit(tif, _TIFFFieldWithTag(tif, tag)->field_bit);
+ tif->tif_flags |= TIFF_DIRTYDIRECT;
+ }
+ va_end(ap);
+ return (status);
+badvalue:
+ TIFFError(tif->tif_name, "%d: Bad value for \"%s\"", v,
+ _TIFFFieldWithTag(tif, tag)->field_name);
+ va_end(ap);
+ return (0);
+badvalue32:
+ TIFFError(tif->tif_name, "%ld: Bad value for \"%s\"", v32,
+ _TIFFFieldWithTag(tif, tag)->field_name);
+ va_end(ap);
+ return (0);
+}
+
+
+static int
+_XTIFFVGetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+ xtiff *xt = XTIFFDIR(tif);
+ XTIFFDirectory* xd = &xt->xtif_dir;
+
+ switch (tag) {
+ /*
+ * XXX put your extended tags here; replace the implemented
+ * example tags with your own.
+ */
+ case TIFFTAG_EXAMPLE_MULTI:
+ *va_arg(ap, uint16*) = xd->xd_num_multi;
+ *va_arg(ap, double**) = xd->xd_example_multi;
+ break;
+ case TIFFTAG_EXAMPLE_ASCII:
+ *va_arg(ap, char**) = xd->xd_example_ascii;
+ break;
+ case TIFFTAG_EXAMPLE_SINGLE:
+ *va_arg(ap, uint32*) = xd->xd_example_single;
+ break;
+ default:
+ /* return inherited method */
+ return (PARENT(xt,vgetfield))(tif,tag,ap);
+ break;
+ }
+ return (1);
+}
+
+#define CleanupField(member) { \
+ if (xd->member) { \
+ _TIFFfree(xd->member); \
+ xd->member = 0; \
+ } \
+}
+/*
+ * Release storage associated with a directory.
+ */
+static void
+_XTIFFFreeDirectory(xtiff* xt)
+{
+ XTIFFDirectory* xd = &xt->xtif_dir;
+
+ /*
+ * XXX - Purge all Your allocated memory except
+ * for the xtiff directory itself. This includes
+ * all fields that require a _TIFFsetXXX call in
+ * _XTIFFVSetField().
+ */
+
+ CleanupField(xd_example_multi);
+ CleanupField(xd_example_ascii);
+
+}
+#undef CleanupField
+
+static void _XTIFFLocalDefaultDirectory(TIFF *tif)
+{
+ xtiff *xt = XTIFFDIR(tif);
+ XTIFFDirectory* xd = &xt->xtif_dir;
+
+ /* Install the extended Tag field info */
+ _TIFFMergeFieldInfo(tif, xtiffFieldInfo, N(xtiffFieldInfo));
+
+ /*
+ * free up any dynamically allocated arrays
+ * before the new directory is read in.
+ */
+
+ _XTIFFFreeDirectory(xt);
+ _TIFFmemset(xt,0,sizeof(xtiff));
+
+ /* Override the tag access methods */
+
+ PARENT(xt,vsetfield) = TIFFMEMBER(tif,vsetfield);
+ TIFFMEMBER(tif,vsetfield) = _XTIFFVSetField;
+ PARENT(xt,vgetfield) = TIFFMEMBER(tif,vgetfield);
+ TIFFMEMBER(tif,vgetfield) = _XTIFFVGetField;
+
+ /*
+ * XXX Set up any default values here.
+ */
+
+ xd->xd_example_single = 234;
+}
+
+
+
+/**********************************************************************
+ * Nothing below this line should need to be changed.
+ **********************************************************************/
+
+static TIFFExtendProc _ParentExtender;
+
+/*
+ * This is the callback procedure, and is
+ * called by the DefaultDirectory method
+ * every time a new TIFF directory is opened.
+ */
+
+static void
+_XTIFFDefaultDirectory(TIFF *tif)
+{
+ xtiff *xt;
+
+ /* Allocate Directory Structure if first time, and install it */
+ if (!(tif->tif_flags & XTIFF_INITIALIZED))
+ {
+ xt = _TIFFmalloc(sizeof(xtiff));
+ if (!xt)
+ {
+ /* handle memory allocation failure here ! */
+ return;
+ }
+ _TIFFmemset(xt,0,sizeof(xtiff));
+ /*
+ * Install into TIFF structure.
+ */
+ TIFFMEMBER(tif,clientdir) = (tidata_t)xt;
+ tif->tif_flags |= XTIFF_INITIALIZED; /* dont do this again! */
+ }
+
+ /* set up our own defaults */
+ _XTIFFLocalDefaultDirectory(tif);
+
+ /* Since an XTIFF client module may have overridden
+ * the default directory method, we call it now to
+ * allow it to set up the rest of its own methods.
+ */
+
+ if (_ParentExtender)
+ (*_ParentExtender)(tif);
+
+}
+
+/*
+ * XTIFF Initializer -- sets up the callback
+ * procedure for the TIFF module.
+ */
+
+static
+void _XTIFFInitialize(void)
+{
+ static first_time=1;
+
+ if (! first_time) return; /* Been there. Done that. */
+ first_time = 0;
+
+ /* Grab the inherited method and install */
+ _ParentExtender = TIFFSetTagExtender(_XTIFFDefaultDirectory);
+}
+
+
+/*
+ * Public File I/O Routines.
+ */
+TIFF*
+XTIFFOpen(const char* name, const char* mode)
+{
+ /* Set up the callback */
+ _XTIFFInitialize();
+
+ /* Open the file; the callback will set everything up
+ */
+ return TIFFOpen(name, mode);
+}
+
+TIFF*
+XTIFFFdOpen(int fd, const char* name, const char* mode)
+{
+ /* Set up the callback */
+ _XTIFFInitialize();
+
+ /* Open the file; the callback will set everything up
+ */
+ return TIFFFdOpen(fd, name, mode);
+}
+
+
+void
+XTIFFClose(TIFF *tif)
+{
+ xtiff *xt = XTIFFDIR(tif);
+
+ /* call inherited function first */
+ TIFFClose(tif);
+
+ /* Free up extended allocated memory */
+ _XTIFFFreeDirectory(xt);
+ _TIFFfree(xt);
+}
diff --git a/contrib/tags/xtiffio.h b/contrib/tags/xtiffio.h
new file mode 100644
index 00000000..2aea724d
--- /dev/null
+++ b/contrib/tags/xtiffio.h
@@ -0,0 +1,52 @@
+/*
+ * xtiffio.h -- Public interface to Extended TIFF tags
+ *
+ * This is a template for defining a client module
+ * which supports tag extensions to the standard libtiff
+ * set. Only portions of the code marked "XXX" need to
+ * be changed to support your tag set.
+ *
+ * written by: Niles D. Ritter
+ */
+
+#ifndef __xtiffio_h
+#define __xtiffio_h
+
+#include "tiffio.h"
+
+/*
+ * XXX Define your private Tag names and values here
+ */
+
+/* These tags are not valid, but are provided for example */
+#define TIFFTAG_EXAMPLE_MULTI 61234
+#define TIFFTAG_EXAMPLE_SINGLE 61235
+#define TIFFTAG_EXAMPLE_ASCII 61236
+
+/*
+ * XXX Define Printing method flags. These
+ * flags may be passed in to TIFFPrintDirectory() to
+ * indicate that those particular field values should
+ * be printed out in full, rather than just an indicator
+ * of whether they are present or not.
+ */
+#define TIFFPRINT_MYMULTIDOUBLES 0x80000000
+
+/**********************************************************************
+ * Nothing below this line should need to be changed by the user.
+ **********************************************************************/
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+extern TIFF* XTIFFOpen(const char* name, const char* mode);
+extern TIFF* XTIFFFdOpen(int fd, const char* name, const char* mode);
+extern void XTIFFClose(TIFF *tif);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* __xtiffio_h */
+
diff --git a/contrib/tags/xtiffiop.h b/contrib/tags/xtiffiop.h
new file mode 100644
index 00000000..0d3f1f2c
--- /dev/null
+++ b/contrib/tags/xtiffiop.h
@@ -0,0 +1,65 @@
+/*
+ * Private Extended TIFF library interface.
+ *
+ * uses private LIBTIFF interface.
+ *
+ * The portions of this module marked "XXX" should be
+ * modified to support your tags instead.
+ *
+ * written by: Niles D. Ritter
+ *
+ */
+
+#ifndef __xtiffiop_h
+#define __xtiffiop_h
+
+#include "tiffiop.h"
+#include "xtiffio.h"
+
+/**********************************************************************
+ * User Configuration
+ **********************************************************************/
+
+/* XXX - Define number of your extended tags here */
+#define NUM_XFIELD 3
+#define XFIELD_BASE (FIELD_LAST-NUM_XFIELD)
+
+/* XXX - Define your Tag Fields here */
+#define FIELD_EXAMPLE_MULTI (XFIELD_BASE+0)
+#define FIELD_EXAMPLE_SINGLE (XFIELD_BASE+1)
+#define FIELD_EXAMPLE_ASCII (XFIELD_BASE+2)
+
+
+/* XXX - Define Private directory tag structure here */
+struct XTIFFDirectory {
+ uint16 xd_num_multi; /* dir-count for the multi tag */
+ double* xd_example_multi;
+ uint32 xd_example_single;
+ char* xd_example_ascii;
+};
+typedef struct XTIFFDirectory XTIFFDirectory;
+
+/**********************************************************************
+ * Nothing below this line should need to be changed by the user.
+ **********************************************************************/
+
+struct xtiff {
+ TIFF *xtif_tif; /* parent TIFF pointer */
+ uint32 xtif_flags;
+#define XTIFFP_PRINT 0x00000001
+ XTIFFDirectory xtif_dir; /* internal rep of current directory */
+ TIFFVSetMethod xtif_vsetfield; /* inherited tag set routine */
+ TIFFVGetMethod xtif_vgetfield; /* inherited tag get routine */
+ TIFFPrintMethod xtif_printdir; /* inherited dir print method */
+};
+typedef struct xtiff xtiff;
+
+
+#define PARENT(xt,pmember) ((xt)->xtif_ ## pmember)
+#define TIFFMEMBER(tf,pmember) ((tf)->tif_ ## pmember)
+#define XTIFFDIR(tif) ((xtiff *)TIFFMEMBER(tif,clientdir))
+
+/* Extended TIFF flags */
+#define XTIFF_INITIALIZED 0x80000000
+
+#endif /* __xtiffiop_h */
diff --git a/contrib/vms/CVS/Entries b/contrib/vms/CVS/Entries
deleted file mode 100644
index 540f0771..00000000
--- a/contrib/vms/CVS/Entries
+++ /dev/null
@@ -1,2 +0,0 @@
-D/libtiff////
-D/tools////
diff --git a/contrib/vms/CVS/Repository b/contrib/vms/CVS/Repository
deleted file mode 100644
index ccd0675e..00000000
--- a/contrib/vms/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/vms
diff --git a/contrib/vms/CVS/Root b/contrib/vms/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/vms/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/vms/libtiff/CVS/Entries b/contrib/vms/libtiff/CVS/Entries
deleted file mode 100644
index 4a16a0fa..00000000
--- a/contrib/vms/libtiff/CVS/Entries
+++ /dev/null
@@ -1,6 +0,0 @@
-/makevms.com/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiff.opt/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiffshraxp.opt/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiffshrvax.opt/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiffvec.mar/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/contrib/vms/libtiff/CVS/Repository b/contrib/vms/libtiff/CVS/Repository
deleted file mode 100644
index 021401ed..00000000
--- a/contrib/vms/libtiff/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/vms/libtiff
diff --git a/contrib/vms/libtiff/CVS/Root b/contrib/vms/libtiff/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/vms/libtiff/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/vms/tools/CVS/Entries b/contrib/vms/tools/CVS/Entries
deleted file mode 100644
index f84e7ebd..00000000
--- a/contrib/vms/tools/CVS/Entries
+++ /dev/null
@@ -1,2 +0,0 @@
-/makevms.com/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/contrib/vms/tools/CVS/Repository b/contrib/vms/tools/CVS/Repository
deleted file mode 100644
index 2f2c65ec..00000000
--- a/contrib/vms/tools/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/vms/tools
diff --git a/contrib/vms/tools/CVS/Root b/contrib/vms/tools/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/vms/tools/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/win32/CVS/Entries b/contrib/win32/CVS/Entries
deleted file mode 100644
index e209d194..00000000
--- a/contrib/win32/CVS/Entries
+++ /dev/null
@@ -1,4 +0,0 @@
-/README/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/dllshell.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/libtiff.def/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/contrib/win32/CVS/Repository b/contrib/win32/CVS/Repository
deleted file mode 100644
index c07e506e..00000000
--- a/contrib/win32/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/win32
diff --git a/contrib/win32/CVS/Root b/contrib/win32/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/win32/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/win95/CVS/Entries b/contrib/win95/CVS/Entries
deleted file mode 100644
index cffcfd66..00000000
--- a/contrib/win95/CVS/Entries
+++ /dev/null
@@ -1,4 +0,0 @@
-/Makefile.w95/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/README/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiff2dib.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/contrib/win95/CVS/Repository b/contrib/win95/CVS/Repository
deleted file mode 100644
index 5f4497be..00000000
--- a/contrib/win95/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/win95
diff --git a/contrib/win95/CVS/Root b/contrib/win95/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/win95/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/contrib/winnt/CVS/Entries b/contrib/winnt/CVS/Entries
deleted file mode 100644
index 49cb459b..00000000
--- a/contrib/winnt/CVS/Entries
+++ /dev/null
@@ -1,8 +0,0 @@
-/README/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/README.console/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/fax3sm.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/libtiff.def/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/libtiff.mak/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/libtiff.vcp/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/version.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/contrib/winnt/CVS/Repository b/contrib/winnt/CVS/Repository
deleted file mode 100644
index fcc202e5..00000000
--- a/contrib/winnt/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/contrib/winnt
diff --git a/contrib/winnt/CVS/Root b/contrib/winnt/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/contrib/winnt/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/dist/CVS/Entries b/dist/CVS/Entries
deleted file mode 100644
index 4b367dff..00000000
--- a/dist/CVS/Entries
+++ /dev/null
@@ -1,6 +0,0 @@
-/newalpha/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/newversion/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiff.alpha/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiff.spec/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiff.version/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/dist/CVS/Repository b/dist/CVS/Repository
deleted file mode 100644
index 994dea91..00000000
--- a/dist/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/dist
diff --git a/dist/CVS/Root b/dist/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/dist/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/dist/newalpha b/dist/newalpha
index 20da2a7d..e206a302 100755
--- a/dist/newalpha
+++ b/dist/newalpha
@@ -1,5 +1,5 @@
#! /bin/sh
-# $Header: /usr/local/cvs/internal/libtiff/dist/newalpha,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/dist/newalpha,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
if test -r tiff.alpha; then
ALPHA=`cat tiff.alpha`; rm -f tiff.alpha
echo "$ALPHA" | awk '{ printf "define ALPHA %03d\n", $3+1}' > tiff.alpha
diff --git a/dist/newversion b/dist/newversion
index 6575abf1..10dbf5a6 100644
--- a/dist/newversion
+++ b/dist/newversion
@@ -1,5 +1,5 @@
#! /bin/sh
-# $Header: /usr/local/cvs/internal/libtiff/dist/newversion,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/dist/newversion,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
#
# TIFF Software
#
diff --git a/dist/tiff.alpha b/dist/tiff.alpha
index 316b4d7b..5b20d89d 100644
--- a/dist/tiff.alpha
+++ b/dist/tiff.alpha
@@ -1 +1 @@
-define ALPHA 037
+define ALPHA 01
diff --git a/dist/tiff.spec b/dist/tiff.spec
index 152b9fa9..61a48683 100644
--- a/dist/tiff.spec
+++ b/dist/tiff.spec
@@ -1,4 +1,4 @@
-# $Header: /usr/local/cvs/internal/libtiff/dist/tiff.spec,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/dist/tiff.spec,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
#
# TIFF Software
#
diff --git a/dist/tiff.version b/dist/tiff.version
index c89a3244..7d607d13 100644
--- a/dist/tiff.version
+++ b/dist/tiff.version
@@ -1 +1 @@
-define TIFF_VNUM 3.4beta
+define TIFF_VNUM "3.5.2 (release)"
diff --git a/html/CVS/Entries b/html/CVS/Entries
deleted file mode 100644
index c6e6dfed..00000000
--- a/html/CVS/Entries
+++ /dev/null
@@ -1,27 +0,0 @@
-/Makefile.in/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D/images////
-/contrib.html/1.4/Mon Aug 9 20:21:21 1999//
-/document.html/1.4/Mon Aug 9 20:21:21 1999//
-/intro.html/1.4/Mon Aug 9 20:21:21 1999//
-/v3.4beta007.html/1.3/Mon Aug 9 20:21:21 1999//
-/v3.4beta016.html/1.3/Mon Aug 9 20:21:21 1999//
-/v3.4beta018.html/1.3/Mon Aug 9 20:21:21 1999//
-/v3.4beta024.html/1.3/Mon Aug 9 20:21:21 1999//
-/v3.4beta028.html/1.3/Mon Aug 9 20:21:21 1999//
-/v3.4beta029.html/1.3/Mon Aug 9 20:21:21 1999//
-/v3.4beta031.html/1.3/Mon Aug 9 20:21:21 1999//
-/v3.4beta032.html/1.3/Mon Aug 9 20:21:21 1999//
-/v3.4beta033.html/1.3/Mon Aug 9 20:21:21 1999//
-/v3.4beta034.html/1.3/Mon Aug 9 20:21:21 1999//
-/v3.4beta035.html/1.3/Mon Aug 9 20:21:21 1999//
-/v3.4beta036.html/1.3/Mon Aug 9 20:21:21 1999//
-/v3.5.1.html/1.3/Mon Aug 9 20:21:21 1999//
-/bugs.html/1.5/Fri Aug 13 19:30:57 1999//
-/build.html/1.5/Fri Aug 13 19:30:57 1999//
-/images.html/1.5/Fri Aug 13 19:30:57 1999//
-/index.html/1.9/Fri Aug 13 19:30:57 1999//
-/internals.html/1.4/Fri Aug 13 19:30:57 1999//
-/libtiff.html/1.4/Fri Aug 13 19:30:57 1999//
-/misc.html/1.4/Fri Aug 13 19:30:57 1999//
-/support.html/1.5/Fri Aug 13 19:30:57 1999//
-/tools.html/1.4/Fri Aug 13 19:30:57 1999//
diff --git a/html/CVS/Repository b/html/CVS/Repository
deleted file mode 100644
index 6de9c49c..00000000
--- a/html/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/html
diff --git a/html/CVS/Root b/html/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/html/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/html/Makefile.in b/html/Makefile.in
index 49ab2a16..a3198336 100644
--- a/html/Makefile.in
+++ b/html/Makefile.in
@@ -1,4 +1,4 @@
-# $Header: /usr/local/cvs/internal/libtiff/html/Makefile.in,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/html/Makefile.in,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
#
# @WARNING@
#
diff --git a/html/build.html b/html/build.html
index f4730bcd..f3d257dd 100644
--- a/html/build.html
+++ b/html/build.html
@@ -1133,7 +1133,7 @@ libtiff/tif_version.c library version support
libtiff/tif_vms.c VMS-related OS support
libtiff/tif_warning.c library warning handler
libtiff/tif_win3.c Windows-3.1-related OS support
-libtiff/tif_win32.c Windows-3.2-related OS support
+libtiff/tif_win32.c Win32 (95/98/NT) related OS support
libtiff/tif_write.c image data writing support
libtiff/tif_zip.c Deflate codec
@@ -1145,7 +1145,7 @@ libtiff/mkversion.c program to generate libtiff/version.h.
<P>
<HR>
-Last updated: $Date: 1999/08/13 19:30:57 $
+Last updated: $Date: 1999/08/16 16:47:11 $
</BODY>
</HTML>
diff --git a/html/document.html b/html/document.html
index d5753f66..f4c00f07 100644
--- a/html/document.html
+++ b/html/document.html
@@ -30,7 +30,7 @@ Adobe provides the 6.0 spec online in
Acrobat format (PDF); this can be found at
<UL>
-<A HREF="http://www.adobe.com/supportservice/devrelations/PDFS/TN/TIFF6.pdf">http://www.adobe.com/supportservice/devrelations/PDFS/TN/TIFF6.pdf</A>
+<A HREF="http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf">http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf</A>
</UL>
TIFF Technical Notes can be retrieved from
@@ -43,7 +43,7 @@ TIFF Technical Notes can be retrieved from
<HR>
<ADDRESS>
-Last updated: $Date: 1999/08/09 20:21:21 $
+Last updated: $Date: 1999/08/19 16:01:08 $
</ADDRESS>
</BODY>
diff --git a/html/images/CVS/Entries b/html/images/CVS/Entries
deleted file mode 100644
index b65efc1b..00000000
--- a/html/images/CVS/Entries
+++ /dev/null
@@ -1,17 +0,0 @@
-/back.gif/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/bali.jpg/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/cat.gif/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/cover.jpg/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/cramps.gif/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/dave.gif/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/info.gif/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/jello.jpg/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/jim.gif/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/note.gif/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/oxford.gif/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/quad.jpg/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/ring.gif/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/smallliz.jpg/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/strike.gif/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/warning.gif/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/html/images/CVS/Repository b/html/images/CVS/Repository
deleted file mode 100644
index fd7136a0..00000000
--- a/html/images/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/html/images
diff --git a/html/images/CVS/Root b/html/images/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/html/images/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/html/index.html b/html/index.html
index 43ecf2df..95fafd78 100644
--- a/html/index.html
+++ b/html/index.html
@@ -7,25 +7,26 @@ TIFF Software
<BODY BGCOLOR=white>
<FONT FACE="Arial, Helvetica, Sans">
<H1>
-<IMG SRC=images/jello.jpg WIDTH=256 HEIGHT=192 ALIGN=left BORDER=1 HSPACE=6>
+<!-- IMG SRC=images/jello.jpg WIDTH=256 HEIGHT=192 ALIGN=left BORDER=1 HSPACE=6-->
TIFF Software
<HR SIZE=4 WIDTH=55% ALIGN=left>
</H1>
-
-<B>Latest Release</B>: <A HREF="v3.5.1.html">v3.5.1</A><BR>
-<B>Latest Software</B>: <A HREF="v3.5.1.html">v3.5.1</A><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.onshore.com/pub/libtiff">ftp.onshore.com</A> , directory pub/libtiff (Active mode FTP only!)<BR>
-<B>HTTP Download</B>: <A HREF=http://www.libtiff.org/tiff-v3.5.1.tar.gz>http://www.libtiff.org/tiff-v3.5.1.tar.gz</a><BR>
-<B>Anon CVS</B>: <em>forthcoming</em> <BR>
<B>Home Page</B>: <A HREF="http://www.libtiff.org/">
http://www.libtiff.org</A> <BR>
<B>FAQ Page</B>: <I>forthcoming</I><BR>
-
-
-<BR CLEAR=left>
-<PRE>
-
-</PRE>
+<B>Latest Release</B>: <A HREF="v3.5.2.html">v3.5.2</A><BR>
+<B>Latest Software</B>: <A HREF="v3.5.2.html">v3.5.2</A><BR>
+<B>Master FTP Site</B>: <A HREF="ftp://ftp.onshore.com/pub/libtiff">ftp.onshore.com</A> , directory pub/libtiff (Active mode FTP only!)<BR>
+<B>HTTP Download</B>: <A HREF=http://www.libtiff.org/tiff-v3.5.2.tar.gz>http://www.libtiff.org/tiff-v3.5.2.tar.gz</a><BR>
+<B>Mailing List</B>: <a href=mailto:tiff@olypiakos.com>tiff@olympiakos.com</a> <BR>
+<B>Mailing List Subscription</b>: <a href=mailto:tiff-request@olypiakos.com>tiff-request@olympiakos.com</a> ("subscribe tiff" in body of message). <BR>
+<B>Mailing List Archive</b>: <A HREF= http://www.remotesensing.org/lists/libtiff_archive/maillist.html>http://www.remotesensing.org/lists/libtiff_archive/maillist.html</A> <BR>
+<B>Anon CVS</B>:<pre>
+ export CVSROOT=:pserver:anonymous@remotesensing.org:/cvsroot
+ cvs login # use password "anonymous"
+ cvs checkout libtiff
+</pre>
+<br>
<P>
This software provides support for the <I>Tag Image File Format</I> (TIFF),
@@ -57,8 +58,8 @@ responsible for day to day maintenance.
the TIFF mailing list: <A
HREF=mailto:tiff@olympiakos.com>tiff@olympiakos.com</A>.
-<p> The person responsible for putting up this site and putting together version 3.5.1 is <A
-HREF=http://fifth.net/>Mike Welles</a>.
+<p> The persons responsible for putting up this site and putting together versions >= 3.5.1 are
+<A HREF=http://members.home.com/warmerda>Frank Warmerdam</A> and <A HREF=http://fifth.net/>Mike Welles</a>.
<p>
@@ -80,7 +81,7 @@ The following sections are included in this documentation:
<P>
<HR>
<em>
-$Id: index.html,v 1.9 1999/08/13 19:30:57 mike Exp $
+$Id: index.html,v 1.15 1999/09/26 23:16:03 mwelles Exp $
</em>
</BODY>
diff --git a/html/v3.5.1.html b/html/v3.5.1.html
deleted file mode 100644
index df613126..00000000
--- a/html/v3.5.1.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>
-Changes in TIFF v3.5.1
-</TITLE>
-</HEAD>
-
-<BODY BGCOLOR=white>
-<FONT FACE="Arial, Helvetica, Sans">
-<FONT FACE="Arial, Helvetica, Sans">
-
-<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.5.1<BR>
-<B>Previous Version</B>: v3.4beta037<BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.onshore.com/pub/libtiff">ftp.onshore.com, directory graphics/tiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.libtiff.org/>http://www.libtiff.org</a>
-<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> <em> None of consequence </em>
-</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 added for IPTC Newsphoto metadata (TIFFTAGE_IPTCNEWSPHOTO)
-<LI> Support was added for photoshop caption handling (TIFFTAG_PHOTOSHOP)
-</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 HREF=mailto:billr@corbis.com>Bill Radcliffe's</a> iptcutil was
-added to the "contrib" subdirectory . It can convert an IPTC binary
-blob to ASCII text and vice-versa. The blob itself can be extracted
-from or added to an image with the <A
-href=http://www.wizards.dupont.com/magick>ImageMagick</a> convert(1)
-utility.
-</UL>
-
-<A HREF="index.html"><IMG SRC="images/back.gif"></A> TIFF home page.<BR>
-
-<HR>
-
-Last updated $Date: 1999/08/09 20:21:21 $.
-
-</BODY>
-</HTML>
diff --git a/libtiff/CVS/Entries b/libtiff/CVS/Entries
deleted file mode 100644
index 5d7b86ab..00000000
--- a/libtiff/CVS/Entries
+++ /dev/null
@@ -1,57 +0,0 @@
-/Makefile/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/Makefile.in/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/Makefile.lcc/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/mkg3states.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/mkspans.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/mkversion.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/port.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/t4.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_acorn.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_apple.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_atari.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_aux.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_close.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_codec.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_compress.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_dir.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_dir.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_dirinfo.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_dirread.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_dirwrite.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_dumpmode.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_error.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_fax3.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_fax3.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_flush.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_getimage.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_jpeg.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_luv.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_lzw.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_msdos.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_next.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_open.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_packbits.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_pixarlog.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_predict.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_predict.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_print.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_read.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_strip.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_swab.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_thunder.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_tile.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_unix.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_version.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_vms.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_warning.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_win3.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_win32.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_write.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tif_zip.c/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiff.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiffcomp.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiffconf.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiffio.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/tiffiop.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/uvcode.h/1.1.1.1/Tue Jul 27 21:50:27 1999//
-D
diff --git a/libtiff/CVS/Repository b/libtiff/CVS/Repository
deleted file mode 100644
index 361cf62e..00000000
--- a/libtiff/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/libtiff
diff --git a/libtiff/CVS/Root b/libtiff/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/libtiff/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/libtiff/Makefile.in b/libtiff/Makefile.in
index f54c6079..a329aa7f 100644
--- a/libtiff/Makefile.in
+++ b/libtiff/Makefile.in
@@ -1,4 +1,4 @@
-# $Header: /usr/local/cvs/internal/libtiff/libtiff/Makefile.in,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/libtiff/Makefile.in,v 1.3 1999/09/08 12:40:31 warmerda Exp $
#
# Tag Image File Format Library
#
@@ -161,10 +161,15 @@ libtiff.a: ${OBJS}
# default IRIX DSO building rule
IRIXdso: ${OBJS}
- ${CC} @ENVOPTS@ -o libtiff.@DSOSUF@ -shared -rdata_shared \
- -check_registry ${SRCDIR}/../port/irix/so_locations \
- -quickstart_info \
- ${OBJS} @LIBJPEG@ @LIBGZ@
+ @if [ "`basename ${CC}`" = "gcc" ]; then \
+ ${LD} -n32 @ENVOPTS@ -o libtiff.@DSOSUF@ -shared -rdata_shared \
+ ${OBJS}; \
+ else \
+ ${CC} @ENVOPTS@ -o libtiff.@DSOSUF@ -shared -rdata_shared \
+ -check_registry ${SRCDIR}/../port/irix/so_locations \
+ -quickstart_info \
+ ${OBJS} @LIBJPEG@ @LIBGZ@; \
+ fi
touch $@
# special rule for IRIX 5.2
IRIX52dso: ${OBJS}
@@ -204,6 +209,7 @@ NETBSDdso FREEBSDdso: ${OBJS}
LINUXdso: ${OBJS}
${CC} -shared -Wl,-soname,libtiff.@DSOSUF@ \
-o libtiff.@DSOSUF_VERSION@ ${OBJS} @LIBJPEG@ @LIBGZ@
+ rm -f libtiff.@DSOSUF@
@LN@ @LN_S@ libtiff.@DSOSUF_VERSION@ libtiff.@DSOSUF@
touch $@
# OSF/1 3.2 shared lib rule
diff --git a/libtiff/Makefile.lcc b/libtiff/Makefile.lcc
index 2e6d2764..dbc09b54 100644
--- a/libtiff/Makefile.lcc
+++ b/libtiff/Makefile.lcc
@@ -1,4 +1,4 @@
-# $Header: /usr/local/cvs/internal/libtiff/libtiff/Makefile.lcc,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/libtiff/Makefile.lcc,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
#
# Tag Image File Format Library
#
diff --git a/libtiff/makefile.vc b/libtiff/makefile.vc
new file mode 100644
index 00000000..fc3da9f7
--- /dev/null
+++ b/libtiff/makefile.vc
@@ -0,0 +1,79 @@
+#
+# Simple MS VC++ Makefile
+#
+# To build:
+# C:\libtiff\libtiff> nmake /f makefile.vc all
+#
+
+#
+# Select _CONSOLE to build a library which reports errors to stderr, or
+# _WINDOWED to build such that errors are reported via MessageBox().
+#
+WINMODE = -DTIF_PLATFORM_CONSOLE
+#WINMODE = -DTIF_PLATFORM_WINDOWED
+
+CC = cl
+INCL = -I.
+LIBS =
+CFLAGS = /nologo $(INCL) $(WINMODE)
+
+OBJ = \
+ tif_aux.obj \
+ tif_close.obj \
+ tif_codec.obj \
+ tif_compress.obj \
+ tif_dir.obj \
+ tif_dirinfo.obj \
+ tif_dirread.obj \
+ tif_dirwrite.obj \
+ tif_dumpmode.obj \
+ tif_error.obj \
+ tif_fax3.obj \
+ fax3sm_winnt.obj \
+ tif_getimage.obj \
+ tif_jpeg.obj \
+ tif_flush.obj \
+ tif_luv.obj \
+ tif_lzw.obj \
+ tif_next.obj \
+ tif_open.obj \
+ tif_packbits.obj \
+ tif_pixarlog.obj \
+ tif_predict.obj \
+ tif_print.obj \
+ tif_read.obj \
+ tif_swab.obj \
+ tif_strip.obj \
+ tif_thunder.obj \
+ tif_tile.obj \
+ tif_win32.obj \
+ tif_version.obj \
+ tif_warning.obj \
+ tif_write.obj \
+ tif_zip.obj
+
+VERSION = ..\VERSION
+ALPHA = ..\dist\tiff.alpha
+
+default: libtiff.lib
+
+all: libtiff.lib libtiff.dll
+
+libtiff.lib: $(OBJ)
+ lib /out:libtiff.lib $(OBJ)
+
+libtiff.dll: $(OBJ)
+ link /dll /def:libtiff.def /out:libtiff.dll /implib:libtiff_i.lib \
+ $(OBJ) $(LIBS)
+
+version.h: $(VERSION) $(ALPHA) mkversion.c
+ $(CC) mkversion.c
+ del version.h
+ .\mkversion.exe -v $(VERSION) -a $(ALPHA) version.h
+
+clean:
+ del *.obj *.lib libtiff.dll
+
+tif_version.obj: version.h
+
+
diff --git a/libtiff/mkg3states.c b/libtiff/mkg3states.c
index d8304248..a577ba05 100644
--- a/libtiff/mkg3states.c
+++ b/libtiff/mkg3states.c
@@ -1,4 +1,4 @@
-/* "$Header: /usr/local/cvs/internal/libtiff/libtiff/mkg3states.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* "$Header: /cvsroot/osrs/libtiff/libtiff/mkg3states.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
diff --git a/libtiff/mkspans.c b/libtiff/mkspans.c
index 16984f5b..3ec0e29f 100644
--- a/libtiff/mkspans.c
+++ b/libtiff/mkspans.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/mkspans.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/mkspans.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
diff --git a/libtiff/mkversion.c b/libtiff/mkversion.c
index b3248f31..744d602b 100644
--- a/libtiff/mkversion.c
+++ b/libtiff/mkversion.c
@@ -1,4 +1,4 @@
-/* "$Header: /usr/local/cvs/internal/libtiff/libtiff/mkversion.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* "$Header: /cvsroot/osrs/libtiff/libtiff/mkversion.c,v 1.2 1999/09/08 19:09:35 warmerda Exp $ */
/*
* Copyright (c) 1995-1997 Sam Leffler
@@ -104,7 +104,7 @@ main(int argc, char* argv[])
cp = strchr(cp+1, ' ');
if (cp) { /* append alpha to version */
char* tp;
- for (tp = strchr(version, '\0'), cp++; *tp = *cp; tp++, cp++)
+ for (tp = strchr(version, '\0'), cp++; (*tp = *cp) != 0; tp++, cp++)
;
if (tp[-1] == '\n')
tp[-1] = '\0';
diff --git a/libtiff/tif_acorn.c b/libtiff/tif_acorn.c
index 8b491f11..833c269c 100644
--- a/libtiff/tif_acorn.c
+++ b/libtiff/tif_acorn.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_acorn.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_acorn.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_apple.c b/libtiff/tif_apple.c
index d03d6406..e293e915 100644
--- a/libtiff/tif_apple.c
+++ b/libtiff/tif_apple.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_apple.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_apple.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_atari.c b/libtiff/tif_atari.c
index 2800695c..2e99b951 100644
--- a/libtiff/tif_atari.c
+++ b/libtiff/tif_atari.c
@@ -1,4 +1,4 @@
-/* "$Header: /usr/local/cvs/internal/libtiff/libtiff/tif_atari.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $" */
+/* "$Header: /cvsroot/osrs/libtiff/libtiff/tif_atari.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $" */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_aux.c b/libtiff/tif_aux.c
index b4051b91..16f9922b 100644
--- a/libtiff/tif_aux.c
+++ b/libtiff/tif_aux.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_aux.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_aux.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
diff --git a/libtiff/tif_close.c b/libtiff/tif_close.c
index 6d9a9b5c..3196f245 100644
--- a/libtiff/tif_close.c
+++ b/libtiff/tif_close.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_close.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_close.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_codec.c b/libtiff/tif_codec.c
index 9abbd43e..63e0d7d7 100644
--- a/libtiff/tif_codec.c
+++ b/libtiff/tif_codec.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_codec.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_codec.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_compress.c b/libtiff/tif_compress.c
index 28c09b3e..1bbea50d 100644
--- a/libtiff/tif_compress.c
+++ b/libtiff/tif_compress.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_compress.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_compress.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_dir.c b/libtiff/tif_dir.c
index 677d6099..448b3571 100644
--- a/libtiff/tif_dir.c
+++ b/libtiff/tif_dir.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_dir.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_dir.c,v 1.3 1999/09/08 19:07:02 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -167,7 +167,7 @@ _TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap)
/*
* Setup new compression routine state.
*/
- if (status = TIFFSetCompressionScheme(tif, v))
+ if( (status = TIFFSetCompressionScheme(tif, v)) != 0 )
td->td_compression = v;
break;
case TIFFTAG_PHOTOMETRIC:
@@ -405,7 +405,8 @@ _TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap)
i = va_arg(ap, int);
s = va_arg(ap, char*);
i = checkInkNamesString(tif, i, s);
- if (status = (i > 0)) {
+ status = i > 0;
+ if( i > 0 ) {
_TIFFsetNString(&td->td_inknames, s, i);
td->td_inknameslen = i;
}
@@ -1129,3 +1130,54 @@ TIFFUnlinkDirectory(TIFF* tif, tdir_t dirn)
tif->tif_curstrip = (tstrip_t) -1;
return (1);
}
+
+/* [BFC]
+ *
+ * Author: Bruce Cameron <cameron@petris.com>
+ *
+ * Set a table of tags that are to be replaced during directory process by the
+ * 'IGNORE' state - or return TRUE/FALSE for the requested tag such that
+ * 'ReadDirectory' can use the stored information.
+ */
+int
+TIFFReassignTagToIgnore (enum TIFFIgnoreSense task, int TIFFtagID)
+{
+ static int TIFFignoretags [FIELD_LAST];
+ static int tagcount = 0 ;
+ int i; /* Loop index */
+ int j; /* Loop index */
+
+ switch (task)
+ {
+ case TIS_STORE:
+ if ( tagcount < (FIELD_LAST - 1) )
+ {
+ for ( j = 0 ; j < tagcount ; ++j )
+ { /* Do not add duplicate tag */
+ if ( TIFFignoretags [j] == TIFFtagID )
+ return (TRUE) ;
+ }
+ TIFFignoretags [tagcount++] = TIFFtagID ;
+ return (TRUE) ;
+ }
+ break ;
+
+ case TIS_EXTRACT:
+ for ( i = 0 ; i < tagcount ; ++i )
+ {
+ if ( TIFFignoretags [i] == TIFFtagID )
+ return (TRUE) ;
+ }
+ break;
+
+ case TIS_EMPTY:
+ tagcount = 0 ; /* Clear the list */
+ return (TRUE) ;
+ break;
+
+ default:
+ break;
+ }
+
+ return (FALSE);
+}
diff --git a/libtiff/tif_dir.h b/libtiff/tif_dir.h
index 38cf98ec..e1811474 100644
--- a/libtiff/tif_dir.h
+++ b/libtiff/tif_dir.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_dir.h,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_dir.h,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_dirinfo.c b/libtiff/tif_dirinfo.c
index 9576d56c..5bd5d67d 100644
--- a/libtiff/tif_dirinfo.c
+++ b/libtiff/tif_dirinfo.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_dirinfo.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_dirinfo.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
index 431a7372..567db8c2 100644
--- a/libtiff/tif_dirread.c
+++ b/libtiff/tif_dirread.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_dirread.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_dirread.c,v 1.3 1999/09/08 19:07:02 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -210,11 +210,17 @@ TIFFReadDirectory(TIFF* tif)
*/
fix = 0;
for (dp = dir, n = dircount; n > 0; n--, dp++) {
- /*
- * Find the field information entry for this tag.
- */
+
+ /*
+ * Find the field information entry for this tag.
+ * Added check for tags to ignore ... [BFC]
+ */
+ if( TIFFReassignTagToIgnore(TIS_EXTRACT, dp->tdir_tag) )
+ dp->tdir_tag = IGNORE;
+
if (dp->tdir_tag == IGNORE)
- continue;
+ continue;
+
/*
* Silicon Beach (at least) writes unordered
* directory tags (violating the spec). Handle
@@ -1037,7 +1043,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp)
* NULL byte, so always append one just in case.
*/
cp = CheckMalloc(tif, dp->tdir_count+1, mesg);
- if (ok = (cp && TIFFFetchString(tif, dp, cp)))
+ if( (ok = (cp && TIFFFetchString(tif, dp, cp))) != 0 )
cp[dp->tdir_count] = '\0'; /* XXX */
break;
}
@@ -1110,7 +1116,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp)
case TIFF_ASCII:
case TIFF_UNDEFINED: /* bit of a cheat... */
{ char c[2];
- if (ok = (TIFFFetchString(tif, dp, c) != 0)) {
+ if( (ok = (TIFFFetchString(tif, dp, c) != 0)) != 0 ){
c[1] = '\0'; /* XXX paranoid */
ok = TIFFSetField(tif, dp->tdir_tag, c);
}
@@ -1224,7 +1230,7 @@ TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, long nstrips, uint32** lpp)
dir->tdir_count* sizeof (uint16), "to fetch strip tag");
if (dp == NULL)
return (0);
- if (status = TIFFFetchShortArray(tif, dir, dp)) {
+ if( (status = TIFFFetchShortArray(tif, dir, dp)) != 0 ) {
register uint16* wp = dp;
while (nstrips-- > 0)
*lp++ = *wp++;
@@ -1277,10 +1283,10 @@ TIFFFetchRefBlackWhite(TIFF* tif, TIFFDirEntry* dir)
* Handle LONG's for backward compatibility.
*/
cp = CheckMalloc(tif, dir->tdir_count * sizeof (uint32), mesg);
- if (ok = (cp && TIFFFetchLongArray(tif, dir, (uint32*) cp))) {
+ if( (ok = (cp && TIFFFetchLongArray(tif, dir, (uint32*) cp))) != 0) {
float* fp = (float*)
CheckMalloc(tif, dir->tdir_count * sizeof (float), mesg);
- if (ok = (fp != NULL)) {
+ if( (ok = (fp != NULL)) != 0 ) {
uint32 i;
for (i = 0; i < dir->tdir_count; i++)
fp[i] = (float)((uint32*) cp)[i];
diff --git a/libtiff/tif_dirwrite.c b/libtiff/tif_dirwrite.c
index 3131d406..7363d869 100644
--- a/libtiff/tif_dirwrite.c
+++ b/libtiff/tif_dirwrite.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_dirwrite.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_dirwrite.c,v 1.3 1999/09/08 19:07:02 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -474,6 +474,28 @@ TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip)
return (0);
}
break;
+
+ /* added based on patch request from MARTIN.MCBRIDE.MM@agfa.co.uk,
+ correctness not verified (FW, 99/08) */
+ case TIFF_BYTE:
+ case TIFF_SBYTE:
+ if (wc > 1) {
+ char* cp;
+ if (wc == (u_short) TIFF_VARIABLE) {
+ TIFFGetField(tif, fip->field_tag, &wc, &cp);
+ dir->tdir_count = wc;
+ } else
+ TIFFGetField(tif, fip->field_tag, &cp);
+ if (!TIFFWriteByteArray(tif, dir, cp))
+ return (0);
+ } else {
+ char cv;
+ TIFFGetField(tif, fip->field_tag, &cv);
+ if (!TIFFWriteByteArray(tif, dir, &cv))
+ return (0);
+ }
+ break;
+
case TIFF_UNDEFINED:
{ char* cp;
if (wc == (u_short) TIFF_VARIABLE) {
@@ -488,6 +510,9 @@ TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip)
return (0);
}
break;
+
+ case TIFF_NOTYPE:
+ break;
}
return (1);
}
diff --git a/libtiff/tif_dumpmode.c b/libtiff/tif_dumpmode.c
index e1a7ac2a..270fd7b6 100644
--- a/libtiff/tif_dumpmode.c
+++ b/libtiff/tif_dumpmode.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_dumpmode.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_dumpmode.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_error.c b/libtiff/tif_error.c
index 1b5fdc30..4c4b23d4 100644
--- a/libtiff/tif_error.c
+++ b/libtiff/tif_error.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_fax3.c b/libtiff/tif_fax3.c
index 8b40e338..70eb1b52 100644
--- a/libtiff/tif_fax3.c
+++ b/libtiff/tif_fax3.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_fax3.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_fax3.c,v 1.3 1999/09/17 04:08:59 mwelles Exp $ */
/*
* Copyright (c) 1990-1997 Sam Leffler
@@ -78,9 +78,9 @@ typedef struct {
int bit; /* current i/o bit in byte */
int EOLcnt; /* count of EOL codes recognized */
TIFFFaxFillFunc fill; /* fill routine */
- uint16* runs; /* b&w runs for current/previous row */
- uint16* refruns; /* runs for reference line */
- uint16* curruns; /* runs for current line */
+ uint32* runs; /* b&w runs for current/previous row */
+ uint32* refruns; /* runs for reference line */
+ uint32* curruns; /* runs for current line */
} Fax3DecodeState;
#define DecoderState(tif) ((Fax3DecodeState*) Fax3State(tif))
@@ -117,15 +117,15 @@ typedef struct {
int RunLength; /* length of current run */ \
u_char* cp; /* next byte of input data */ \
u_char* ep; /* end of input data */ \
- uint16* pa; /* place to stuff next run */ \
- uint16* thisrun; /* current row's run array */ \
+ uint32* pa; /* place to stuff next run */ \
+ uint32* thisrun; /* current row's run array */ \
int EOLcnt; /* # EOL codes recognized */ \
const u_char* bitmap = sp->bitmap; /* input data bit reverser */ \
const TIFFFaxTabEnt* TabEnt
#define DECLARE_STATE_2D(tif, sp, mod) \
DECLARE_STATE(tif, sp, mod); \
int b1; /* next change on prev line */ \
- uint16* pb /* next run in reference line */\
+ uint32* pb /* next run in reference line */\
/*
* Load any state that may be changed during decoding.
*/
@@ -295,7 +295,7 @@ Fax3Decode2D(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
EXPAND2D(EOF2Da);
(*sp->fill)(buf, thisrun, pa, lastx);
SETVAL(0); /* imaginary change for reference */
- SWAP(uint16*, sp->curruns, sp->refruns);
+ SWAP(uint32*, sp->curruns, sp->refruns);
buf += sp->b.rowbytes;
occ -= sp->b.rowbytes;
if (occ != 0)
@@ -358,7 +358,7 @@ Fax3Decode2D(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
* runs generated during G3/G4 decoding.
*/
void
-_TIFFFax3fillruns(u_char* buf, uint16* runs, uint16* erun, uint32 lastx)
+_TIFFFax3fillruns(u_char* buf, uint32* runs, uint32* erun, uint32 lastx)
{
static const unsigned char _fillmasks[] =
{ 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff };
@@ -382,7 +382,7 @@ _TIFFFax3fillruns(u_char* buf, uint16* runs, uint16* erun, uint32 lastx)
*cp++ &= 0xff << (8-bx);
run -= 8-bx;
}
- if (n = run >> 3) { /* multiple bytes to fill */
+ if( (n = run >> 3) != 0 ) { /* multiple bytes to fill */
if ((n/sizeof (long)) > 1) {
/*
* Align to longword boundary and fill.
@@ -421,7 +421,7 @@ _TIFFFax3fillruns(u_char* buf, uint16* runs, uint16* erun, uint32 lastx)
*cp++ |= 0xff >> bx;
run -= 8-bx;
}
- if (n = run>>3) { /* multiple bytes to fill */
+ if( (n = run>>3) != 0 ) { /* multiple bytes to fill */
if ((n/sizeof (long)) > 1) {
/*
* Align to longword boundary and fill.
@@ -499,7 +499,7 @@ Fax3SetupState(TIFF* tif)
uint32 nruns = needsRefLine ?
2*TIFFroundup(rowpixels,32) : rowpixels;
- dsp->runs = (uint16*) _TIFFmalloc(nruns*sizeof (uint16));
+ dsp->runs = (uint32*) _TIFFmalloc(nruns*sizeof (uint16));
if (dsp->runs == NULL) {
TIFFError("Fax3SetupState",
"%s: No space for Group 3/4 run arrays",
@@ -1375,7 +1375,7 @@ Fax4Decode(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
EXPAND2D(EOFG4);
(*sp->fill)(buf, thisrun, pa, lastx);
SETVAL(0); /* imaginary change for reference */
- SWAP(uint16*, sp->curruns, sp->refruns);
+ SWAP(uint32*, sp->curruns, sp->refruns);
buf += sp->b.rowbytes;
occ -= sp->b.rowbytes;
if (occ != 0)
diff --git a/libtiff/tif_fax3.h b/libtiff/tif_fax3.h
index 9b8103b7..6049d752 100644
--- a/libtiff/tif_fax3.h
+++ b/libtiff/tif_fax3.h
@@ -1,4 +1,4 @@
-/* $Id: tif_fax3.h,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Id: tif_fax3.h,v 1.2 1999/09/17 04:08:59 mwelles Exp $ */
/*
* Copyright (c) 1990-1997 Sam Leffler
@@ -43,7 +43,7 @@
* The routine must have the type signature given below;
* for example:
*
- * fillruns(unsigned char* buf, uint16* runs, uint16* erun, uint32 lastx)
+ * fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
*
* where buf is place to set the bits, runs is the array of b&w run
* lengths (white then black), erun is the last run in the array, and
@@ -52,7 +52,7 @@
* data in the run array as needed (e.g. to append zero runs to bring
* the count up to a nice multiple).
*/
-typedef void (*TIFFFaxFillFunc)(unsigned char*, uint16*, uint16*, uint32);
+typedef void (*TIFFFaxFillFunc)(unsigned char*, uint32*, uint32*, uint32);
/*
* The default run filler; made external for other decoders.
@@ -60,7 +60,7 @@ typedef void (*TIFFFaxFillFunc)(unsigned char*, uint16*, uint16*, uint32);
#if defined(__cplusplus)
extern "C" {
#endif
-extern void _TIFFFax3fillruns(unsigned char*, uint16*, uint16*, uint32);
+extern void _TIFFFax3fillruns(unsigned char*, uint32*, uint32*, uint32);
#if defined(__cplusplus)
}
#endif
@@ -84,7 +84,7 @@ extern void _TIFFFax3fillruns(unsigned char*, uint16*, uint16*, uint32);
typedef struct { /* state table entry */
unsigned char State; /* see above */
unsigned char Width; /* width of code in bits */
- uint16 Param; /* unsigned 16-bit run length in bits */
+ uint32 Param; /* unsigned 32-bit run length in bits */
} TIFFFaxTabEnt;
extern const TIFFFaxTabEnt TIFFFaxMainTable[];
diff --git a/libtiff/tif_flush.c b/libtiff/tif_flush.c
index 232f6f3f..b10bbcf4 100644
--- a/libtiff/tif_flush.c
+++ b/libtiff/tif_flush.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_flush.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_flush.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c
index fb000b28..c654ce77 100644
--- a/libtiff/tif_getimage.c
+++ b/libtiff/tif_getimage.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_getimage.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_getimage.c,v 1.3 1999/09/08 19:07:02 warmerda Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@@ -157,6 +157,12 @@ TIFFRGBAImageEnd(TIFFRGBAImage* img)
_TIFFfree(img->PALmap), img->PALmap = NULL;
if (img->ycbcr)
_TIFFfree(img->ycbcr), img->ycbcr = NULL;
+
+ if( img->redcmap ) {
+ _TIFFfree( img->redcmap );
+ _TIFFfree( img->greencmap );
+ _TIFFfree( img->bluecmap );
+ }
}
static int
@@ -178,7 +184,16 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
uint16 planarconfig;
uint16 compress;
int colorchannels;
-
+ uint16 *red_orig, *green_orig, *blue_orig;
+ int n_color;
+
+ /* Initialize to normal values */
+ img->row_offset = 0;
+ img->col_offset = 0;
+ img->redcmap = NULL;
+ img->greencmap = NULL;
+ img->bluecmap = NULL;
+
img->tif = tif;
img->stoponerr = stop;
TIFFGetFieldDefaulted(tif, TIFFTAG_BITSPERSAMPLE, &img->bitspersample);
@@ -224,10 +239,25 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
switch (img->photometric) {
case PHOTOMETRIC_PALETTE:
if (!TIFFGetField(tif, TIFFTAG_COLORMAP,
- &img->redcmap, &img->greencmap, &img->bluecmap)) {
+ &red_orig, &green_orig, &blue_orig)) {
TIFFError(TIFFFileName(tif), "Missing required \"Colormap\" tag");
return (0);
}
+
+ /* copy the colormaps so we can modify them */
+ n_color = (1L << img->bitspersample);
+ img->redcmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color);
+ img->greencmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color);
+ img->bluecmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color);
+ if( !img->redcmap || !img->greencmap || !img->bluecmap ) {
+ TIFFError(TIFFFileName(tif), "Out of memory for colormap copy");
+ return (0);
+ }
+
+ memcpy( img->redcmap, red_orig, n_color * 2 );
+ memcpy( img->greencmap, green_orig, n_color * 2 );
+ memcpy( img->bluecmap, blue_orig, n_color * 2 );
+
/* fall thru... */
case PHOTOMETRIC_MINISWHITE:
case PHOTOMETRIC_MINISBLACK:
@@ -423,7 +453,8 @@ gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
for (row = 0; row < h; row += th) {
nrow = (row + th > h ? h - row : th);
for (col = 0; col < w; col += tw) {
- if (TIFFReadTile(tif, buf, col, row, 0, 0) < 0 && img->stoponerr)
+ if (TIFFReadTile(tif, buf, col+img->col_offset,
+ row+img->row_offset, 0, 0) < 0 && img->stoponerr)
break;
if (col + tw > w) {
/*
@@ -489,13 +520,17 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
for (row = 0; row < h; row += th) {
nrow = (row + th > h ? h - row : th);
for (col = 0; col < w; col += tw) {
- if (TIFFReadTile(tif, r, col, row,0,0) < 0 && img->stoponerr)
+ if (TIFFReadTile(tif, r, col+img->col_offset,
+ row+img->row_offset,0,0) < 0 && img->stoponerr)
break;
- if (TIFFReadTile(tif, g, col, row,0,1) < 0 && img->stoponerr)
+ if (TIFFReadTile(tif, g, col+img->col_offset,
+ row+img->row_offset,0,1) < 0 && img->stoponerr)
break;
- if (TIFFReadTile(tif, b, col, row,0,2) < 0 && img->stoponerr)
+ if (TIFFReadTile(tif, b, col+img->col_offset,
+ row+img->row_offset,0,2) < 0 && img->stoponerr)
break;
- if (alpha && TIFFReadTile(tif,a,col,row,0,3) < 0 && img->stoponerr)
+ if (alpha && TIFFReadTile(tif,a,col+img->col_offset,
+ row+img->row_offset,0,3) < 0 && img->stoponerr)
break;
if (col + tw > w) {
/*
@@ -550,8 +585,10 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
fromskew = (w < imagewidth ? imagewidth - w : 0);
for (row = 0; row < h; row += rowsperstrip) {
nrow = (row + rowsperstrip > h ? h - row : rowsperstrip);
- if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 0),
- buf, nrow*scanline) < 0 && img->stoponerr)
+ if (TIFFReadEncodedStrip(tif,
+ TIFFComputeStrip(tif,row+img->row_offset, 0),
+ buf, nrow*scanline) < 0
+ && img->stoponerr)
break;
(*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, buf);
y += (orientation == ORIENTATION_TOPLEFT ?
@@ -577,7 +614,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
u_char *r, *g, *b, *a;
uint32 row, y, nrow;
tsize_t scanline;
- uint32 rowsperstrip;
+ uint32 rowsperstrip, offset_row;
uint32 imagewidth = img->width;
tsize_t stripsize;
int32 fromskew, toskew;
@@ -602,17 +639,18 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
fromskew = (w < imagewidth ? imagewidth - w : 0);
for (row = 0; row < h; row += rowsperstrip) {
nrow = (row + rowsperstrip > h ? h - row : rowsperstrip);
- if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 0),
+ offset_row = row + img->row_offset;
+ if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 0),
r, nrow*scanline) < 0 && img->stoponerr)
break;
- if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 1),
+ if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 1),
g, nrow*scanline) < 0 && img->stoponerr)
break;
- if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 2),
+ if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 2),
b, nrow*scanline) < 0 && img->stoponerr)
break;
if (alpha &&
- (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 3),
+ (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 3),
a, nrow*scanline) < 0 && img->stoponerr))
break;
(*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, r, g, b, a);
@@ -1848,3 +1886,161 @@ pickTileSeparateCase(TIFFRGBAImage* img)
}
return ((img->put.separate = put) != 0);
}
+
+/*
+ * Read a whole strip off data from the file, and convert to RGBA form.
+ * If this is the last strip, then it will only contain the portion of
+ * the strip that is actually within the image space. The result is
+ * organized in bottom to top form.
+ */
+
+
+int
+TIFFReadRGBAStrip(TIFF* tif, uint32 row, uint32 * raster )
+
+{
+ char emsg[1024];
+ TIFFRGBAImage img;
+ int ok;
+ uint32 rowsperstrip, rows_to_read;
+
+ if( TIFFIsTiled( tif ) )
+ {
+ TIFFError(TIFFFileName(tif),
+ "Can't use TIFFReadRGBAStrip() with tiled file.");
+ return (0);
+ }
+
+ TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
+ if( (row % rowsperstrip) != 0 )
+ {
+ TIFFError(TIFFFileName(tif),
+ "Row passed to TIFFReadRGBAStrip() must be first in a strip.");
+ return (0);
+ }
+
+ if (TIFFRGBAImageBegin(&img, tif, 0, emsg)) {
+
+ img.row_offset = row;
+ img.col_offset = 0;
+
+ if( row + rowsperstrip > img.height )
+ rows_to_read = img.height - row;
+ else
+ rows_to_read = rowsperstrip;
+
+ ok = TIFFRGBAImageGet(&img, raster, img.width, rows_to_read );
+
+ TIFFRGBAImageEnd(&img);
+ } else {
+ TIFFError(TIFFFileName(tif), emsg);
+ ok = 0;
+ }
+
+ return (ok);
+}
+
+/*
+ * Read a whole tile off data from the file, and convert to RGBA form.
+ * The returned RGBA data is organized from bottom to top of tile,
+ * and may include zeroed areas if the tile extends off the image.
+ */
+
+int
+TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster)
+
+{
+ char emsg[1024];
+ TIFFRGBAImage img;
+ int ok;
+ uint32 tile_xsize, tile_ysize;
+ uint32 read_xsize, read_ysize;
+ int i_row;
+
+ /*
+ * Verify that our request is legal - on a tile file, and on a
+ * tile boundary.
+ */
+
+ if( !TIFFIsTiled( tif ) )
+ {
+ TIFFError(TIFFFileName(tif),
+ "Can't use TIFFReadRGBATile() with stripped file.");
+ return (0);
+ }
+
+ TIFFGetFieldDefaulted(tif, TIFFTAG_TILEWIDTH, &tile_xsize);
+ TIFFGetFieldDefaulted(tif, TIFFTAG_TILELENGTH, &tile_ysize);
+ if( (col % tile_xsize) != 0 || (row % tile_ysize) != 0 )
+ {
+ TIFFError(TIFFFileName(tif),
+ "Row/col passed to TIFFReadRGBATile() must be top"
+ "left corner of a tile.");
+ return (0);
+ }
+
+ /*
+ * Setup the RGBA reader.
+ */
+
+ if ( !TIFFRGBAImageBegin(&img, tif, 0, emsg)) {
+ TIFFError(TIFFFileName(tif), emsg);
+ return( 0 );
+ }
+
+ /*
+ * The TIFFRGBAImageGet() function doesn't allow us to get off the
+ * edge of the image, even to fill an otherwise valid tile. So we
+ * figure out how much we can read, and fix up the tile buffer to
+ * a full tile configuration afterwards.
+ */
+
+ if( row + tile_ysize > img.height )
+ read_ysize = img.height - row;
+ else
+ read_ysize = tile_ysize;
+
+ if( col + tile_xsize > img.width )
+ read_xsize = img.width - col;
+ else
+ read_xsize = tile_xsize;
+
+ /*
+ * Read the chunk of imagery.
+ */
+
+ img.row_offset = row;
+ img.col_offset = col;
+
+ ok = TIFFRGBAImageGet(&img, raster, read_xsize, read_ysize );
+
+ TIFFRGBAImageEnd(&img);
+
+ /*
+ * If our read was incomplete we will need to fix up the tile by
+ * shifting the data around as if a full tile of data is being returned.
+ *
+ * This is all the more complicated because the image is organized in
+ * bottom to top format.
+ */
+
+ if( read_xsize == tile_xsize && read_ysize == tile_ysize )
+ return( ok );
+
+ for( i_row = 0; i_row < read_ysize; i_row++ )
+ {
+ _TIFFmemcpy( raster + (tile_ysize - i_row - 1) * tile_xsize,
+ raster + (read_ysize - i_row - 1) * read_xsize,
+ read_xsize * sizeof(uint32) );
+ _TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize+read_xsize,
+ 0, sizeof(uint32) * (tile_xsize - read_xsize) );
+ }
+
+ for( i_row = read_ysize; i_row < tile_ysize; i_row++ )
+ {
+ _TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize,
+ 0, sizeof(uint32) * tile_xsize );
+ }
+
+ return (ok);
+}
diff --git a/libtiff/tif_jpeg.c b/libtiff/tif_jpeg.c
index 74f08883..fbd5982e 100644
--- a/libtiff/tif_jpeg.c
+++ b/libtiff/tif_jpeg.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_jpeg.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_jpeg.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1994-1997 Sam Leffler
diff --git a/libtiff/tif_luv.c b/libtiff/tif_luv.c
index 682e618e..67577399 100644
--- a/libtiff/tif_luv.c
+++ b/libtiff/tif_luv.c
@@ -349,13 +349,12 @@ LogLuvDecodeTile(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
static int
LogL16Encode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
{
- TIFFDirectory* td = &tif->tif_dir;
LogLuvState* sp = EncoderState(tif);
int shft, i, j, npixels;
tidata_t op;
int16* tp;
int16 b;
- int occ, rc, mask, beg;
+ int occ, rc=0, mask, beg;
assert(s == 0);
assert(sp != NULL);
@@ -438,7 +437,6 @@ LogL16Encode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
static int
LogLuvEncode24(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
{
- TIFFDirectory* td = &tif->tif_dir;
LogLuvState* sp = EncoderState(tif);
int i, npixels, occ;
tidata_t op;
@@ -484,13 +482,12 @@ LogLuvEncode24(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
static int
LogLuvEncode32(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
{
- TIFFDirectory* td = &tif->tif_dir;
LogLuvState* sp = EncoderState(tif);
int shft, i, j, npixels;
tidata_t op;
uint32* tp;
uint32 b;
- int occ, rc, mask, beg;
+ int occ, rc=0, mask, beg;
assert(s == 0);
assert(sp != NULL);
diff --git a/libtiff/tif_lzw.c b/libtiff/tif_lzw.c
index 55b3bf91..c0eed2ae 100644
--- a/libtiff/tif_lzw.c
+++ b/libtiff/tif_lzw.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_lzw.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_lzw.c,v 1.2 1999/09/08 19:07:02 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -612,7 +612,7 @@ LZWDecodeCompat(TIFF* tif, tidata_t op0, tsize_t occ0, tsample_t s)
tp = op;
do {
*--tp = codep->value;
- } while (codep = codep->next);
+ } while( (codep = codep->next) != NULL);
} else
*op++ = code, occ--;
}
diff --git a/libtiff/tif_msdos.c b/libtiff/tif_msdos.c
index d5a03017..fa6cfca1 100644
--- a/libtiff/tif_msdos.c
+++ b/libtiff/tif_msdos.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_msdos.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_msdos.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_next.c b/libtiff/tif_next.c
index 4f023c65..da5d0265 100644
--- a/libtiff/tif_next.c
+++ b/libtiff/tif_next.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_next.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_next.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_open.c b/libtiff/tif_open.c
index 9802dddf..e96816c8 100644
--- a/libtiff/tif_open.c
+++ b/libtiff/tif_open.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_open.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_open.c,v 1.2 1999/09/08 19:07:02 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -29,6 +29,8 @@
*/
#include "tiffiop.h"
+void _TIFFSetDefaultCompressionState(TIFF* tif);
+
static const long typemask[13] = {
0L, /* TIFF_NOTYPE */
0x000000ffL, /* TIFF_BYTE */
diff --git a/libtiff/tif_packbits.c b/libtiff/tif_packbits.c
index 68377960..437bef78 100644
--- a/libtiff/tif_packbits.c
+++ b/libtiff/tif_packbits.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_packbits.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_packbits.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_predict.c b/libtiff/tif_predict.c
index 851bf881..8bb2dd91 100644
--- a/libtiff/tif_predict.c
+++ b/libtiff/tif_predict.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_predict.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_predict.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_predict.h b/libtiff/tif_predict.h
index dda6207f..6ccda831 100644
--- a/libtiff/tif_predict.h
+++ b/libtiff/tif_predict.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_predict.h,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_predict.h,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1995-1997 Sam Leffler
diff --git a/libtiff/tif_print.c b/libtiff/tif_print.c
index e1562779..562ce649 100644
--- a/libtiff/tif_print.c
+++ b/libtiff/tif_print.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_print.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_print.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_read.c b/libtiff/tif_read.c
index 0de0fc5a..dca55a77 100644
--- a/libtiff/tif_read.c
+++ b/libtiff/tif_read.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_read.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_read.c,v 1.2 1999/09/08 19:07:02 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -98,7 +98,7 @@ TIFFReadScanline(TIFF* tif, tdata_t buf, uint32 row, tsample_t sample)
if (!TIFFCheckRead(tif, 0))
return (-1);
- if (e = TIFFSeek(tif, row, sample)) {
+ if( (e = TIFFSeek(tif, row, sample)) != 0) {
/*
* Decompress desired row into user buffer.
*/
diff --git a/libtiff/tif_strip.c b/libtiff/tif_strip.c
index c18d84e8..4659dc58 100644
--- a/libtiff/tif_strip.c
+++ b/libtiff/tif_strip.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_strip.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_strip.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
diff --git a/libtiff/tif_swab.c b/libtiff/tif_swab.c
index 0753f6f6..c92c42ff 100644
--- a/libtiff/tif_swab.c
+++ b/libtiff/tif_swab.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_swab.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_swab.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_thunder.c b/libtiff/tif_thunder.c
index 8168c96b..a256e189 100644
--- a/libtiff/tif_thunder.c
+++ b/libtiff/tif_thunder.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_thunder.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_thunder.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_tile.c b/libtiff/tif_tile.c
index cf25161a..fafb3533 100644
--- a/libtiff/tif_tile.c
+++ b/libtiff/tif_tile.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_tile.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_tile.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
diff --git a/libtiff/tif_unix.c b/libtiff/tif_unix.c
index b4120c5c..76e08de2 100644
--- a/libtiff/tif_unix.c
+++ b/libtiff/tif_unix.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_unix.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_unix.c,v 1.2 1999/09/24 03:05:12 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -139,6 +139,12 @@ TIFFOpen(const char* name, const char* mode)
m = _TIFFgetMode(mode, module);
if (m == -1)
return ((TIFF*)0);
+
+/* for cygwin */
+#ifdef O_BINARY
+ m |= O_BINARY;
+#endif
+
#ifdef _AM29K
fd = open(name, m);
#else
diff --git a/libtiff/tif_version.c b/libtiff/tif_version.c
index 0f4ed5d6..d585d303 100644
--- a/libtiff/tif_version.c
+++ b/libtiff/tif_version.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_version.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_version.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1992-1997 Sam Leffler
* Copyright (c) 1992-1997 Silicon Graphics, Inc.
diff --git a/libtiff/tif_vms.c b/libtiff/tif_vms.c
index d15b356f..f5d4f53a 100644
--- a/libtiff/tif_vms.c
+++ b/libtiff/tif_vms.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_vms.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_vms.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_warning.c b/libtiff/tif_warning.c
index e397469c..9c633bfa 100644
--- a/libtiff/tif_warning.c
+++ b/libtiff/tif_warning.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_warning.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_warning.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_win3.c b/libtiff/tif_win3.c
index add91a21..0255c457 100644
--- a/libtiff/tif_win3.c
+++ b/libtiff/tif_win3.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_win3.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_win3.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_win32.c b/libtiff/tif_win32.c
index b88495e0..9e141af7 100644
--- a/libtiff/tif_win32.c
+++ b/libtiff/tif_win32.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_win32.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_win32.c,v 1.3 1999/09/15 01:28:47 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -83,7 +83,6 @@ _tiffSizeProc(thandle_t fd)
return ((toff_t)GetFileSize(fd, NULL));
}
-#pragma argsused
static int
_tiffDummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize)
{
@@ -120,7 +119,6 @@ _tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize)
return(1);
}
-#pragma argsused
static void
_tiffDummyUnmapProc(thandle_t fd, tdata_t base, toff_t size)
{
@@ -176,7 +174,7 @@ TIFFOpen(const char* name, const char* mode)
dwMode = OPEN_ALWAYS;
break;
case O_RDWR|O_CREAT:
- dwMode = CREATE_NEW;
+ dwMode = OPEN_ALWAYS;
break;
case O_RDWR|O_TRUNC:
dwMode = CREATE_ALWAYS;
@@ -250,6 +248,7 @@ _TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c)
static void
Win32WarningHandler(const char* module, const char* fmt, va_list ap)
{
+#ifndef TIF_PLATFORM_CONSOLE
LPTSTR szTitle;
LPTSTR szTmp;
LPCTSTR szTitleText = "%s Warning";
@@ -264,12 +263,20 @@ Win32WarningHandler(const char* module, const char* fmt, va_list ap)
MessageBox(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONINFORMATION);
LocalFree(szTitle);
return;
+#else
+ if (module != NULL)
+ fprintf(stderr, "%s: ", module);
+ fprintf(stderr, "Warning, ");
+ vfprintf(stderr, fmt, ap);
+ fprintf(stderr, ".\n");
+#endif
}
TIFFErrorHandler _TIFFwarningHandler = Win32WarningHandler;
static void
Win32ErrorHandler(const char* module, const char* fmt, va_list ap)
{
+#ifndef TIF_PLATFORM_CONSOLE
LPTSTR szTitle;
LPTSTR szTmp;
LPCTSTR szTitleText = "%s Error";
@@ -284,5 +291,11 @@ Win32ErrorHandler(const char* module, const char* fmt, va_list ap)
MessageBox(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONEXCLAMATION);
LocalFree(szTitle);
return;
+#else
+ if (module != NULL)
+ fprintf(stderr, "%s: ", module);
+ vfprintf(stderr, fmt, ap);
+ fprintf(stderr, ".\n");
+#endif
}
TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler;
diff --git a/libtiff/tif_write.c b/libtiff/tif_write.c
index 7134dc63..dfe2311b 100644
--- a/libtiff/tif_write.c
+++ b/libtiff/tif_write.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_write.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_write.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_zip.c b/libtiff/tif_zip.c
index 4e50a7be..a0e95cfb 100644
--- a/libtiff/tif_zip.c
+++ b/libtiff/tif_zip.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_zip.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_zip.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1995-1997 Sam Leffler
diff --git a/libtiff/tiff.h b/libtiff/tiff.h
index 0170e20b..6132501a 100644
--- a/libtiff/tiff.h
+++ b/libtiff/tiff.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tiff.h,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tiff.h,v 1.2 1999/09/08 12:21:13 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -69,6 +69,14 @@ typedef unsigned long uint32; /* sizeof (uint32) must == 4 */
#endif
#endif /* _TIFF_DATA_TYPEDEFS_ */
+/* For TIFFReassignTagToIgnore */
+enum TIFFIgnoreSense /* IGNORE tag table */
+{
+ TIS_STORE,
+ TIS_EXTRACT,
+ TIS_EMPTY
+};
+
typedef struct {
uint16 tiff_magic; /* magic number (defines byte order) */
uint16 tiff_version; /* TIFF version number */
diff --git a/libtiff/tiffcomp.h b/libtiff/tiffcomp.h
index 5aeb76b6..8cdadbe7 100644
--- a/libtiff/tiffcomp.h
+++ b/libtiff/tiffcomp.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tiffcomp.h,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tiffcomp.h,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1990-1997 Sam Leffler
diff --git a/libtiff/tiffconf.h b/libtiff/tiffconf.h
index 58bed998..1a0dc10a 100644
--- a/libtiff/tiffconf.h
+++ b/libtiff/tiffconf.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tiffconf.h,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tiffconf.h,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/libtiff/tiffio.h b/libtiff/tiffio.h
index 7af245c4..8c09154e 100644
--- a/libtiff/tiffio.h
+++ b/libtiff/tiffio.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tiffio.h,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tiffio.h,v 1.3 1999/09/08 12:21:13 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -164,6 +164,9 @@ struct _TIFFRGBAImage {
uint32** BWmap; /* black&white map */
uint32** PALmap; /* palette image map */
TIFFYCbCrToRGB* ycbcr; /* YCbCr conversion state */
+
+ int row_offset;
+ int col_offset;
};
/*
@@ -255,6 +258,8 @@ extern int TIFFUnlinkDirectory(TIFF*, tdir_t);
extern int TIFFSetField(TIFF*, ttag_t, ...);
extern int TIFFVSetField(TIFF*, ttag_t, va_list);
extern int TIFFWriteDirectory(TIFF *);
+extern int TIFFReassignTagToIgnore(enum TIFFIgnoreSense, int);
+
#if defined(c_plusplus) || defined(__cplusplus)
extern void TIFFPrintDirectory(TIFF*, FILE*, long = 0);
extern int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
@@ -266,6 +271,9 @@ extern int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t);
extern int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t);
extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);
#endif
+
+extern int TIFFReadRGBAStrip(TIFF*, tstrip_t, uint32 * );
+extern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );
extern int TIFFRGBAImageOK(TIFF*, char [1024]);
extern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);
extern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);
diff --git a/libtiff/tiffiop.h b/libtiff/tiffiop.h
index 633e8bf0..15721ff7 100644
--- a/libtiff/tiffiop.h
+++ b/libtiff/tiffiop.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tiffiop.h,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tiffiop.h,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/man/CVS/Entries b/man/CVS/Entries
deleted file mode 100644
index cb97825f..00000000
--- a/man/CVS/Entries
+++ /dev/null
@@ -1,56 +0,0 @@
-/Makefile/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/Makefile.in/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFClose.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFError.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFFlush.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFGetField.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFOpen.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFPrintDirectory.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFRGBAImage.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFReadDirectory.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFReadEncodedStrip.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFReadEncodedTile.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFReadRGBAImage.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFReadRawStrip.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFReadRawTile.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFReadScanline.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFReadTile.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFSetDirectory.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFSetField.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFWarning.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFWriteDirectory.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFWriteEncodedStrip.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFWriteEncodedTile.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFWriteRawStrip.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFWriteRawTile.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFWriteScanline.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFbuffer.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFcodec.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFmemory.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFquery.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFsize.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFstrip.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFswab.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/TIFFtile.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/fax2ps.1/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/fax2tiff.1/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/gif2tiff.1/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/libtiff.3t/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/pal2rgb.1/1.1.1.1/Tue Jul 27 21:50:27 1999//
-/ppm2tiff.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/ras2tiff.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/rgb2ycbcr.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/sgi2tiff.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/thumbnail.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiff2bw.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiff2ps.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffcmp.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffcp.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffdither.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffdump.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffgt.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffinfo.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffmedian.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffsplit.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffsv.1/1.1.1.1/Tue Jul 27 21:50:28 1999//
-D
diff --git a/man/CVS/Repository b/man/CVS/Repository
deleted file mode 100644
index e657bc85..00000000
--- a/man/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/man
diff --git a/man/CVS/Root b/man/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/man/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/man/Makefile.in b/man/Makefile.in
index 64736b1f..cb923427 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -1,5 +1,5 @@
#! smake
-# $Header: /usr/local/cvs/internal/libtiff/man/Makefile.in,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/man/Makefile.in,v 1.2 1999/08/16 18:45:52 warmerda Exp $
#
# @WARNING@
#
@@ -119,6 +119,8 @@ MANDEV=\
lib/TIFFReadEncodedStrip.3t \
lib/TIFFReadEncodedTile.3t \
lib/TIFFReadRGBAImage.3t \
+ lib/TIFFReadRGBAStrip.3t \
+ lib/TIFFReadRGBATile.3t \
lib/TIFFReadRawStrip.3t \
lib/TIFFReadRawTile.3t \
lib/TIFFReadScanline.3t \
@@ -245,6 +247,8 @@ lib/TIFFReadDirectory.3t:: ${SRCDIR}/TIFFReadDirectory.3t; ${MANCVT}
lib/TIFFReadEncodedStrip.3t:: ${SRCDIR}/TIFFReadEncodedStrip.3t;${MANCVT}
lib/TIFFReadEncodedTile.3t:: ${SRCDIR}/TIFFReadEncodedTile.3t; ${MANCVT}
lib/TIFFReadRGBAImage.3t:: ${SRCDIR}/TIFFReadRGBAImage.3t; ${MANCVT}
+lib/TIFFReadRGBATile.3t:: ${SRCDIR}/TIFFReadRGBATile.3t; ${MANCVT}
+lib/TIFFReadRGBAStrip.3t:: ${SRCDIR}/TIFFReadRGBAStrip.3t; ${MANCVT}
lib/TIFFReadRawStrip.3t:: ${SRCDIR}/TIFFReadRawStrip.3t; ${MANCVT}
lib/TIFFReadRawTile.3t:: ${SRCDIR}/TIFFReadRawTile.3t; ${MANCVT}
lib/TIFFReadScanline.3t:: ${SRCDIR}/TIFFReadScanline.3t; ${MANCVT}
@@ -376,6 +380,8 @@ short:
${MV} TIFFReadRawTile.3t rdrtile.3t
${MV} TIFFReadDirectory.3t readdir.3t
${MV} TIFFReadRGBAImage.3t rdimage.3t
+ ${MV} TIFFReadRGBAStrip.3t rdsimage.3t
+ ${MV} TIFFReadRGBATile.3t rdtimage.3t
${MV} TIFFReadScanline.3t readline.3t
${MV} TIFFReadTile.3t readtile.3t
${MV} TIFFRGBAImage.3t rgbaimage.3t
diff --git a/man/TIFFClose.3t b/man/TIFFClose.3t
index d0f49831..aa2b540f 100644
--- a/man/TIFFClose.3t
+++ b/man/TIFFClose.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFClose.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFClose.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFError.3t b/man/TIFFError.3t
index da97ad74..79daddab 100644
--- a/man/TIFFError.3t
+++ b/man/TIFFError.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFError.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFError.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFFlush.3t b/man/TIFFFlush.3t
index 58704d6d..cc38cde4 100644
--- a/man/TIFFFlush.3t
+++ b/man/TIFFFlush.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFFlush.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFFlush.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFGetField.3t b/man/TIFFGetField.3t
index 2f058045..4a626cf8 100644
--- a/man/TIFFGetField.3t
+++ b/man/TIFFGetField.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFGetField.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFGetField.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFOpen.3t b/man/TIFFOpen.3t
index c70a3a6d..07a4853c 100644
--- a/man/TIFFOpen.3t
+++ b/man/TIFFOpen.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFOpen.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFOpen.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFPrintDirectory.3t b/man/TIFFPrintDirectory.3t
index 6c1151cc..90dbe39f 100644
--- a/man/TIFFPrintDirectory.3t
+++ b/man/TIFFPrintDirectory.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFPrintDirectory.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFPrintDirectory.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1991-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFRGBAImage.3t b/man/TIFFRGBAImage.3t
index 2b2036a3..92ba09d8 100644
--- a/man/TIFFRGBAImage.3t
+++ b/man/TIFFRGBAImage.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFRGBAImage.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFRGBAImage.3t,v 1.2 1999/08/16 17:29:55 warmerda Exp $
.\"
.\" Copyright (c) 1991-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -272,4 +272,6 @@ not handled correctly.
.SH "SEE ALSO"
.IR libtiff (3T),
.IR TIFFOpen (3T),
-.IR TIFFReadRGBAImage (3T)
+.IR TIFFReadRGBAImage (3T),
+.IR TIFFReadRGBAStrip (3T),
+.IR TIFFReadRGBATile (3T)
diff --git a/man/TIFFReadDirectory.3t b/man/TIFFReadDirectory.3t
index ce8ebdd6..73552b65 100644
--- a/man/TIFFReadDirectory.3t
+++ b/man/TIFFReadDirectory.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFReadDirectory.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFReadDirectory.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFReadEncodedStrip.3t b/man/TIFFReadEncodedStrip.3t
index 949ed76e..2e469c52 100644
--- a/man/TIFFReadEncodedStrip.3t
+++ b/man/TIFFReadEncodedStrip.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFReadEncodedStrip.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFReadEncodedStrip.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFReadEncodedTile.3t b/man/TIFFReadEncodedTile.3t
index 7cc109d3..82c4ea14 100644
--- a/man/TIFFReadEncodedTile.3t
+++ b/man/TIFFReadEncodedTile.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFReadEncodedTile.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFReadEncodedTile.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFReadRGBAImage.3t b/man/TIFFReadRGBAImage.3t
index 69a4017e..9741bf49 100644
--- a/man/TIFFReadRGBAImage.3t
+++ b/man/TIFFReadRGBAImage.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFReadRGBAImage.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFReadRGBAImage.3t,v 1.2 1999/08/16 17:29:55 warmerda Exp $
.\"
.\" Copyright (c) 1991-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -182,4 +182,6 @@ not handled correctly.
.SH "SEE ALSO"
.IR libtiff (3T),
.IR TIFFOpen (3T),
-.IR TIFFRGBAImage (3T)
+.IR TIFFRGBAImage (3T),
+.IR TIFFReadRGBAStrip (3T),
+.IR TIFFReadRGBATile (3T)
diff --git a/man/TIFFReadRGBAStrip.3t b/man/TIFFReadRGBAStrip.3t
new file mode 100644
index 00000000..4290a26f
--- /dev/null
+++ b/man/TIFFReadRGBAStrip.3t
@@ -0,0 +1,176 @@
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFReadRGBAStrip.3t,v 1.1 1999/08/16 18:37:40 warmerda Exp $
+.\"
+.\" Copyright (c) 1991-1997 Sam Leffler
+.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
+.\"
+.\" Permission to use, copy, modify, distribute, and sell this software and
+.\" its documentation for any purpose is hereby granted without fee, provided
+.\" that (i) the above copyright notices and this permission notice appear in
+.\" all copies of the software and related documentation, and (ii) the names of
+.\" Sam Leffler and Silicon Graphics may not be used in any advertising or
+.\" publicity relating to the software without the specific, prior written
+.\" permission of Sam Leffler and Silicon Graphics.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+.\"
+.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+.\" OF THIS SOFTWARE.
+.\"
+.if n .po 0
+.TH TIFFReadRGBAStrip 3T "December 10, 1998"
+.SH NAME
+TIFFReadRGBAStrip \- read and decode an image strip into a fixed-format raster
+.SH SYNOPSIS
+.nf
+.B "#include <tiffio.h>"
+.ta \w'\fB#define \fP'u +\w'\fBTIFFGetR(abgr) \fP'u
+.B "#define TIFFGetR(abgr) ((abgr) & 0xff)"
+.B "#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)"
+.B "#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)"
+.B "#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)"
+.sp 5p
+.B "int TIFFReadRGBAStrip(TIFF* tif, tstrip_t strip, uint32 * raster )"
+.SH DESCRIPTION
+.IR TIFFReadRGBAStrip
+reads a single strip of a strip-based image into memory,
+storing the result in the user supplied RGBA
+.IR raster .
+The raster is assumed to be an array of
+width times rowsperstrip 32-bit entries, where width
+is the width of the image (TIFFTAG_IMAGEWIDTH) and
+rowsperstrip is the maximum lines in a strip (TIFFTAG_ROWSPERSTRIP).
+
+.PP
+The
+.IR strip
+value should be the strip number (strip zero is the first) as returned by the
+.I TIFFComputeStrip
+function, but always for sample 0.
+
+.PP
+Note that the raster is assume to be organized such that the pixel
+at location (\fIx\fP,\fIy\fP) is \fIraster\fP[\fIy\fP*\fIwidth\fP+\fIx\fP];
+with the raster origin in the
+.I lower-left hand corner
+of the strip. That is bottom to top organization. When reading a partial
+last strip in the file the last line of the image will begin at the
+beginning of the buffer.
+
+.PP
+Raster pixels are 8-bit packed red, green, blue, alpha samples.
+The macros
+.IR TIFFGetR ,
+.IR TIFFGetG ,
+.IR TIFFGetB ,
+and
+.I TIFFGetA
+should be used to access individual samples.
+Images without Associated Alpha matting information have a constant
+Alpha of 1.0 (255).
+.PP
+See the
+.IR TIFFRGBAImage (3T)
+page for more details on how various image types are converted to RGBA
+values.
+.SH NOTES
+Samples must be either 1, 2, 4, 8, or 16 bits.
+Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
+.I SamplesPerPixel
+minus
+.IR ExtraSamples ).
+.PP
+Palette image colormaps that appear to be incorrectly written
+as 8-bit values are automatically scaled to 16-bits.
+.PP
+.I TIFFReadRGBAStrip
+is just a wrapper around the more general
+.IR TIFFRGBAImage (3T)
+facilities. It's main advantage over the similar
+.IR TIFFReadRGBAImage()
+function is that for large images a single
+buffer capable of holding the whole image doesn't need to be allocated,
+only enough for one strip. The
+.IR TIFFReadRGBATile()
+function does a similar operation for tiled images.
+.SH "RETURN VALUES"
+1 is returned if the image was successfully read and converted.
+Otherwise, 0 is returned if an error was encountered.
+.SH DIAGNOSTICS
+All error messages are directed to the
+.IR TIFFError (3T)
+routine.
+.PP
+.BR "Sorry, can not handle %d-bit pictures" .
+The image had
+.I BitsPerSample
+other than 1, 2, 4, 8, or 16.
+.PP
+.BR "Sorry, can not handle %d-channel images" .
+The image had
+.I SamplesPerPixel
+other than 1, 3, or 4.
+.PP
+\fBMissing needed "PhotometricInterpretation" tag\fP.
+The image did not have a tag that describes how to display
+the data.
+.PP
+\fBNo "PhotometricInterpretation" tag, assuming RGB\fP.
+The image was missing a tag that describes how to display it,
+but because it has 3 or 4 samples/pixel, it is assumed to be
+.SM RGB.
+.PP
+\fBNo "PhotometricInterpretation" tag, assuming min-is-black\fP.
+The image was missing a tag that describes how to display it,
+but because it has 1 sample/pixel, it is assumed to be a grayscale
+or bilevel image.
+.PP
+.BR "No space for photometric conversion table" .
+There was insufficient memory for a table used to convert
+image samples to 8-bit
+.SM RGB.
+.PP
+\fBMissing required "Colormap" tag\fP.
+A Palette image did not have a required
+.I Colormap
+tag.
+.PP
+.BR "No space for tile buffer" .
+There was insufficient memory to allocate an i/o buffer.
+.PP
+.BR "No space for strip buffer" .
+There was insufficient memory to allocate an i/o buffer.
+.PP
+.BR "Can not handle format" .
+The image has a format (combination of
+.IR BitsPerSample ,
+.IR SamplesPerPixel ,
+and
+.IR PhotometricInterpretation )
+that
+.I TIFFReadRGBAImage
+can not handle.
+.PP
+.BR "No space for B&W mapping table" .
+There was insufficient memory to allocate a table used to map
+grayscale data to
+.SM RGB.
+.PP
+.BR "No space for Palette mapping table" .
+There was insufficient memory to allocate a table used to map
+data to 8-bit
+.SM RGB.
+.SH BUGS
+Orientations other than bottom-left, or top-left are
+not handled correctly.
+.SH "SEE ALSO"
+.IR libtiff (3T),
+.IR TIFFOpen (3T),
+.IR TIFFRGBAImage (3T),
+.IR TIFFReadRGBAImage (3T),
+.IR TIFFReadRGBATile (3T)
diff --git a/man/TIFFReadRGBATile.3t b/man/TIFFReadRGBATile.3t
new file mode 100644
index 00000000..5e657d06
--- /dev/null
+++ b/man/TIFFReadRGBATile.3t
@@ -0,0 +1,178 @@
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFReadRGBATile.3t,v 1.1 1999/08/16 18:37:40 warmerda Exp $
+.\"
+.\" Copyright (c) 1991-1997 Sam Leffler
+.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
+.\"
+.\" Permission to use, copy, modify, distribute, and sell this software and
+.\" its documentation for any purpose is hereby granted without fee, provided
+.\" that (i) the above copyright notices and this permission notice appear in
+.\" all copies of the software and related documentation, and (ii) the names of
+.\" Sam Leffler and Silicon Graphics may not be used in any advertising or
+.\" publicity relating to the software without the specific, prior written
+.\" permission of Sam Leffler and Silicon Graphics.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+.\"
+.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+.\" OF THIS SOFTWARE.
+.\"
+.if n .po 0
+.TH TIFFReadRGBATile 3T "December 10, 1998"
+.SH NAME
+TIFFReadRGBATile \- read and decode an image tile into a fixed-format raster
+.SH SYNOPSIS
+.nf
+.B "#include <tiffio.h>"
+.ta \w'\fB#define \fP'u +\w'\fBTIFFGetR(abgr) \fP'u
+.B "#define TIFFGetR(abgr) ((abgr) & 0xff)"
+.B "#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)"
+.B "#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)"
+.B "#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)"
+.sp 5p
+.B "int TIFFReadRGBATile(TIFF* tif, uint32 x, uint32 y, uint32 * raster )"
+.SH DESCRIPTION
+.IR TIFFReadRGBATile
+reads a single tile of a tile-based image into memory,
+storing the result in the user supplied RGBA
+.IR raster .
+The raster is assumed to be an array of
+width times length 32-bit entries, where width
+is the width of a tile (TIFFTAG_TILEWIDTH) and
+length is the height of a tile (TIFFTAG_TILELENGTH).
+
+.PP
+The
+.IR x
+and
+.IR y
+values are the offsets from the top left corner to the top left corner
+of the tile to be read. They must be an exact multiple of the tile
+width and length.
+
+.PP
+Note that the raster is assume to be organized such that the pixel
+at location (\fIx\fP,\fIy\fP) is \fIraster\fP[\fIy\fP*\fIwidth\fP+\fIx\fP];
+with the raster origin in the
+.I lower-left hand corner
+of the tile. That is bottom to top organization. Edge tiles which
+partly fall off the image will be filled out with appropriate zeroed
+areas.
+
+.PP
+Raster pixels are 8-bit packed red, green, blue, alpha samples.
+The macros
+.IR TIFFGetR ,
+.IR TIFFGetG ,
+.IR TIFFGetB ,
+and
+.I TIFFGetA
+should be used to access individual samples.
+Images without Associated Alpha matting information have a constant
+Alpha of 1.0 (255).
+.PP
+See the
+.IR TIFFRGBAImage (3T)
+page for more details on how various image types are converted to RGBA
+values.
+.SH NOTES
+Samples must be either 1, 2, 4, 8, or 16 bits.
+Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
+.I SamplesPerPixel
+minus
+.IR ExtraSamples ).
+.PP
+Palette image colormaps that appear to be incorrectly written
+as 8-bit values are automatically scaled to 16-bits.
+.PP
+.I TIFFReadRGBATile
+is just a wrapper around the more general
+.IR TIFFRGBAImage (3T)
+facilities. It's main advantage over the similar
+.IR TIFFReadRGBAImage()
+function is that for large images a single
+buffer capable of holding the whole image doesn't need to be allocated,
+only enough for one tile. The
+.IR TIFFReadRGBAStrip()
+function does a similar operation for stripped images.
+.SH "RETURN VALUES"
+1 is returned if the image was successfully read and converted.
+Otherwise, 0 is returned if an error was encountered.
+.SH DIAGNOSTICS
+All error messages are directed to the
+.IR TIFFError (3T)
+routine.
+.PP
+.BR "Sorry, can not handle %d-bit pictures" .
+The image had
+.I BitsPerSample
+other than 1, 2, 4, 8, or 16.
+.PP
+.BR "Sorry, can not handle %d-channel images" .
+The image had
+.I SamplesPerPixel
+other than 1, 3, or 4.
+.PP
+\fBMissing needed "PhotometricInterpretation" tag\fP.
+The image did not have a tag that describes how to display
+the data.
+.PP
+\fBNo "PhotometricInterpretation" tag, assuming RGB\fP.
+The image was missing a tag that describes how to display it,
+but because it has 3 or 4 samples/pixel, it is assumed to be
+.SM RGB.
+.PP
+\fBNo "PhotometricInterpretation" tag, assuming min-is-black\fP.
+The image was missing a tag that describes how to display it,
+but because it has 1 sample/pixel, it is assumed to be a grayscale
+or bilevel image.
+.PP
+.BR "No space for photometric conversion table" .
+There was insufficient memory for a table used to convert
+image samples to 8-bit
+.SM RGB.
+.PP
+\fBMissing required "Colormap" tag\fP.
+A Palette image did not have a required
+.I Colormap
+tag.
+.PP
+.BR "No space for tile buffer" .
+There was insufficient memory to allocate an i/o buffer.
+.PP
+.BR "No space for strip buffer" .
+There was insufficient memory to allocate an i/o buffer.
+.PP
+.BR "Can not handle format" .
+The image has a format (combination of
+.IR BitsPerSample ,
+.IR SamplesPerPixel ,
+and
+.IR PhotometricInterpretation )
+that
+.I TIFFReadRGBAImage
+can not handle.
+.PP
+.BR "No space for B&W mapping table" .
+There was insufficient memory to allocate a table used to map
+grayscale data to
+.SM RGB.
+.PP
+.BR "No space for Palette mapping table" .
+There was insufficient memory to allocate a table used to map
+data to 8-bit
+.SM RGB.
+.SH BUGS
+Orientations other than bottom-left, or top-left are
+not handled correctly.
+.SH "SEE ALSO"
+.IR libtiff (3T),
+.IR TIFFOpen (3T),
+.IR TIFFRGBAImage (3T),
+.IR TIFFReadRGBAImage (3T),
+.IR TIFFReadRGBAStrip (3T)
diff --git a/man/TIFFReadRawStrip.3t b/man/TIFFReadRawStrip.3t
index 1566d61f..938a0961 100644
--- a/man/TIFFReadRawStrip.3t
+++ b/man/TIFFReadRawStrip.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFReadRawStrip.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFReadRawStrip.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFReadRawTile.3t b/man/TIFFReadRawTile.3t
index 2fabaf64..a001012c 100644
--- a/man/TIFFReadRawTile.3t
+++ b/man/TIFFReadRawTile.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFReadRawTile.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFReadRawTile.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFReadScanline.3t b/man/TIFFReadScanline.3t
index 571ce66d..607ed13f 100644
--- a/man/TIFFReadScanline.3t
+++ b/man/TIFFReadScanline.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFReadScanline.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFReadScanline.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFReadTile.3t b/man/TIFFReadTile.3t
index 3c55f6fe..bb7bf506 100644
--- a/man/TIFFReadTile.3t
+++ b/man/TIFFReadTile.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFReadTile.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFReadTile.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFSetDirectory.3t b/man/TIFFSetDirectory.3t
index bbc1f870..107f833a 100644
--- a/man/TIFFSetDirectory.3t
+++ b/man/TIFFSetDirectory.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFSetDirectory.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFSetDirectory.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFSetField.3t b/man/TIFFSetField.3t
index 1bf5c33d..6a02f5c9 100644
--- a/man/TIFFSetField.3t
+++ b/man/TIFFSetField.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFSetField.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFSetField.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFWarning.3t b/man/TIFFWarning.3t
index 4491807e..89c46c22 100644
--- a/man/TIFFWarning.3t
+++ b/man/TIFFWarning.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFWarning.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFWarning.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFWriteDirectory.3t b/man/TIFFWriteDirectory.3t
index 5fc1b43d..ab2fd265 100644
--- a/man/TIFFWriteDirectory.3t
+++ b/man/TIFFWriteDirectory.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFWriteDirectory.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFWriteDirectory.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFWriteEncodedStrip.3t b/man/TIFFWriteEncodedStrip.3t
index f6da3401..a3435391 100644
--- a/man/TIFFWriteEncodedStrip.3t
+++ b/man/TIFFWriteEncodedStrip.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFWriteEncodedStrip.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFWriteEncodedStrip.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFWriteEncodedTile.3t b/man/TIFFWriteEncodedTile.3t
index 2315576e..007e930b 100644
--- a/man/TIFFWriteEncodedTile.3t
+++ b/man/TIFFWriteEncodedTile.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFWriteEncodedTile.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFWriteEncodedTile.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFWriteRawStrip.3t b/man/TIFFWriteRawStrip.3t
index 48155364..30b3665a 100644
--- a/man/TIFFWriteRawStrip.3t
+++ b/man/TIFFWriteRawStrip.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFWriteRawStrip.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFWriteRawStrip.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFWriteRawTile.3t b/man/TIFFWriteRawTile.3t
index a9262f64..3e2ef313 100644
--- a/man/TIFFWriteRawTile.3t
+++ b/man/TIFFWriteRawTile.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFWriteRawTile.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFWriteRawTile.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFWriteScanline.3t b/man/TIFFWriteScanline.3t
index c883d12b..413c3d6c 100644
--- a/man/TIFFWriteScanline.3t
+++ b/man/TIFFWriteScanline.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFWriteScanline.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFWriteScanline.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFbuffer.3t b/man/TIFFbuffer.3t
index 55b507e1..47b5c19e 100644
--- a/man/TIFFbuffer.3t
+++ b/man/TIFFbuffer.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFbuffer.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFbuffer.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1995 Sam Leffler
.\" Copyright (c) 1995 Silicon Graphics, Inc.
diff --git a/man/TIFFcodec.3t b/man/TIFFcodec.3t
index 34eb4264..2ce0f765 100644
--- a/man/TIFFcodec.3t
+++ b/man/TIFFcodec.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFcodec.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFcodec.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1995 Sam Leffler
.\" Copyright (c) 1995 Silicon Graphics, Inc.
diff --git a/man/TIFFmemory.3t b/man/TIFFmemory.3t
index c0e872f8..f2bb2687 100644
--- a/man/TIFFmemory.3t
+++ b/man/TIFFmemory.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFmemory.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFmemory.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1995 Sam Leffler
.\" Copyright (c) 1995 Silicon Graphics, Inc.
diff --git a/man/TIFFquery.3t b/man/TIFFquery.3t
index 26beeec0..c54eece0 100644
--- a/man/TIFFquery.3t
+++ b/man/TIFFquery.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFquery.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFquery.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFsize.3t b/man/TIFFsize.3t
index eefde345..bf1497a9 100644
--- a/man/TIFFsize.3t
+++ b/man/TIFFsize.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFsize.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFsize.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFstrip.3t b/man/TIFFstrip.3t
index 1f0b6abe..b34fbb49 100644
--- a/man/TIFFstrip.3t
+++ b/man/TIFFstrip.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFstrip.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFstrip.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1992-1997 Sam Leffler
.\" Copyright (c) 1992-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFswab.3t b/man/TIFFswab.3t
index 7cc5b107..6388408e 100644
--- a/man/TIFFswab.3t
+++ b/man/TIFFswab.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFswab.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFswab.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/TIFFtile.3t b/man/TIFFtile.3t
index 3e6210d3..e17af746 100644
--- a/man/TIFFtile.3t
+++ b/man/TIFFtile.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/TIFFtile.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/TIFFtile.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/fax2ps.1 b/man/fax2ps.1
index 0e791ca7..0211e25f 100644
--- a/man/fax2ps.1
+++ b/man/fax2ps.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/fax2ps.1,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/fax2ps.1,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1991-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/fax2tiff.1 b/man/fax2tiff.1
index 7f9dbbf5..22399af3 100644
--- a/man/fax2tiff.1
+++ b/man/fax2tiff.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/fax2tiff.1,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/fax2tiff.1,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1990-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/gif2tiff.1 b/man/gif2tiff.1
index 0772485d..2c763085 100644
--- a/man/gif2tiff.1
+++ b/man/gif2tiff.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/gif2tiff.1,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/gif2tiff.1,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1991-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/libtiff.3t b/man/libtiff.3t
index 5db40e36..95811de5 100644
--- a/man/libtiff.3t
+++ b/man/libtiff.3t
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/libtiff.3t,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/libtiff.3t,v 1.2 1999/09/06 15:25:10 mwelles Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -384,6 +384,14 @@ or for other purposes.
The default value is a pointer to a builtin function that images
packed bilevel data.
.TP
+.B TIFFTAG_IPTCNEWSPHOTO
+Tag contaings image metadata per the IPTC newsphoto spec: Headline,
+captioning, credit, etc... Used by most wire services.
+.TP
+.B TIFFTAG_PHOTOSHOP
+Tag contains Photoshop captioning information and metadata. Photoshop
+uses in parallel and redundantly alongside IPTCNEWSPHOTO information.
+.TP
.B TIFFTAG_JPEGQUALITY
Control the compression quality level used in the baseline algorithm.
Note that quality levels are in the range 0-100 with a default value of 75.
diff --git a/man/pal2rgb.1 b/man/pal2rgb.1
index 579d8e06..cb890217 100644
--- a/man/pal2rgb.1
+++ b/man/pal2rgb.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/pal2rgb.1,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/pal2rgb.1,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
.\"
.\" Copyright (c) 1990-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/ppm2tiff.1 b/man/ppm2tiff.1
index 9c67b5de..3cc403e1 100644
--- a/man/ppm2tiff.1
+++ b/man/ppm2tiff.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/ppm2tiff.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/ppm2tiff.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1991-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/ras2tiff.1 b/man/ras2tiff.1
index ebe1a329..797ba058 100644
--- a/man/ras2tiff.1
+++ b/man/ras2tiff.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/ras2tiff.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/ras2tiff.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1990-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/rgb2ycbcr.1 b/man/rgb2ycbcr.1
index 93ac1407..07abef6d 100644
--- a/man/rgb2ycbcr.1
+++ b/man/rgb2ycbcr.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/rgb2ycbcr.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/rgb2ycbcr.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1991-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/sgi2tiff.1 b/man/sgi2tiff.1
index 3b5c9364..69eede9d 100644
--- a/man/sgi2tiff.1
+++ b/man/sgi2tiff.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/sgi2tiff.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/sgi2tiff.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1991-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/thumbnail.1 b/man/thumbnail.1
index e437b34f..8f44c115 100644
--- a/man/thumbnail.1
+++ b/man/thumbnail.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/thumbnail.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/thumbnail.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1994-1997 Sam Leffler
.\" Copyright (c) 1994-1997 Silicon Graphics, Inc.
diff --git a/man/tiff2bw.1 b/man/tiff2bw.1
index 5b896489..6d04dbb0 100644
--- a/man/tiff2bw.1
+++ b/man/tiff2bw.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/tiff2bw.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/tiff2bw.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/tiff2ps.1 b/man/tiff2ps.1
index ed1f939a..7dc490fb 100644
--- a/man/tiff2ps.1
+++ b/man/tiff2ps.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/tiff2ps.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/tiff2ps.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/tiffcmp.1 b/man/tiffcmp.1
index 0976c492..948ad364 100644
--- a/man/tiffcmp.1
+++ b/man/tiffcmp.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/tiffcmp.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/tiffcmp.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/tiffcp.1 b/man/tiffcp.1
index 6c2719a8..0c8cea5e 100644
--- a/man/tiffcp.1
+++ b/man/tiffcp.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/tiffcp.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/tiffcp.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/tiffdither.1 b/man/tiffdither.1
index 9126bbac..ea2e5072 100644
--- a/man/tiffdither.1
+++ b/man/tiffdither.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/tiffdither.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/tiffdither.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1990-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/tiffdump.1 b/man/tiffdump.1
index 5e4fa208..6c3d2d5a 100644
--- a/man/tiffdump.1
+++ b/man/tiffdump.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/tiffdump.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/tiffdump.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/tiffgt.1 b/man/tiffgt.1
index dbf56bf7..840ca276 100644
--- a/man/tiffgt.1
+++ b/man/tiffgt.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/tiffgt.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/tiffgt.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/tiffinfo.1 b/man/tiffinfo.1
index 91a55040..96a9c56d 100644
--- a/man/tiffinfo.1
+++ b/man/tiffinfo.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/tiffinfo.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/tiffinfo.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/tiffmedian.1 b/man/tiffmedian.1
index 35fa249b..b9a89913 100644
--- a/man/tiffmedian.1
+++ b/man/tiffmedian.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/tiffmedian.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/tiffmedian.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1990-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/man/tiffsplit.1 b/man/tiffsplit.1
index c462f56d..7e13dc1d 100644
--- a/man/tiffsplit.1
+++ b/man/tiffsplit.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/tiffsplit.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/tiffsplit.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1992-1997 Sam Leffler
.\" Copyright (c) 1992-1997 Silicon Graphics, Inc.
diff --git a/man/tiffsv.1 b/man/tiffsv.1
index ec352363..0ad0676c 100644
--- a/man/tiffsv.1
+++ b/man/tiffsv.1
@@ -1,4 +1,4 @@
-.\" $Header: /usr/local/cvs/internal/libtiff/man/tiffsv.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+.\" $Header: /cvsroot/osrs/libtiff/man/tiffsv.1,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/port/CVS/Entries b/port/CVS/Entries
deleted file mode 100644
index 3310f06e..00000000
--- a/port/CVS/Entries
+++ /dev/null
@@ -1,7 +0,0 @@
-/Makefile.in/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/getopt.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/install.sh/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/install.sh.in/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/strcasecmp.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/strtoul.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-D/irix////
diff --git a/port/CVS/Repository b/port/CVS/Repository
deleted file mode 100644
index 561e218d..00000000
--- a/port/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/port
diff --git a/port/CVS/Root b/port/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/port/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/port/Makefile.in b/port/Makefile.in
index 24b3f23a..c09d0141 100644
--- a/port/Makefile.in
+++ b/port/Makefile.in
@@ -1,5 +1,5 @@
#! smake
-# $Header: /usr/local/cvs/internal/libtiff/port/Makefile.in,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/port/Makefile.in,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
#
# @WARNING@
#
diff --git a/port/install.sh.in b/port/install.sh.in
index a96a4e8c..b7879ca0 100644
--- a/port/install.sh.in
+++ b/port/install.sh.in
@@ -1,5 +1,5 @@
#! @SCRIPT_SH@
-# $Header: /usr/local/cvs/internal/libtiff/port/install.sh.in,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/port/install.sh.in,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
#
# @WARNING@
#
diff --git a/port/irix/CVS/Entries b/port/irix/CVS/Entries
deleted file mode 100644
index 41ef34fe..00000000
--- a/port/irix/CVS/Entries
+++ /dev/null
@@ -1,2 +0,0 @@
-/so_locations/1.1.1.1/Tue Jul 27 21:50:28 1999//
-D
diff --git a/port/irix/CVS/Repository b/port/irix/CVS/Repository
deleted file mode 100644
index 74f57ead..00000000
--- a/port/irix/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/port/irix
diff --git a/port/irix/CVS/Root b/port/irix/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/port/irix/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/test_pics.sh b/test_pics.sh
new file mode 100755
index 00000000..8605ead7
--- /dev/null
+++ b/test_pics.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+#
+# The -f force flag will force new logs to overwrite existing ones.
+#
+FORCE=0
+if test "$1" = "-f" ; then
+ FORCE=1
+ shift
+fi
+
+#
+# Loop over all passed TIFF files
+#
+for a in $* ; do
+ BASE=`dirname $a`/`basename $a .tif`
+ tools/tiffdump $a > ${BASE}.rpt.new
+
+ if test $FORCE = 1 ; then
+ mv ${BASE}.rpt.new ${BASE}.rpt
+ continue;
+ fi
+
+ if diff ${BASE}.rpt ${BASE}.rpt.new ; then
+ rm ${BASE}.rpt.new
+ else
+ echo Differences between ${BASE}.rpt and ${BASE}.rpt.new
+ fi
+done
diff --git a/tiff.h b/tiff.h
deleted file mode 100644
index dc41a0dc..00000000
--- a/tiff.h
+++ /dev/null
@@ -1,421 +0,0 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tiff.h,v 1.1.1.1 1999/07/27 21:50:26 mike Exp $ */
-
-/*
- * Copyright (c) 1988-1997 Sam Leffler
- * Copyright (c) 1991-1997 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that (i) the above copyright notices and this permission notice appear in
- * all copies of the software and related documentation, and (ii) the names of
- * Sam Leffler and Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Sam Leffler and Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
- * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
- *
- * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
- * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#ifndef _TIFF_
-#define _TIFF_
-/*
- * Tag Image File Format (TIFF)
- *
- * Based on Rev 6.0 from:
- * Developer's Desk
- * Aldus Corporation
- * 411 First Ave. South
- * Suite 200
- * Seattle, WA 98104
- * 206-622-5500
- */
-#define TIFF_VERSION 42
-
-#define TIFF_BIGENDIAN 0x4d4d
-#define TIFF_LITTLEENDIAN 0x4949
-
-#ifndef _TIFF_DATA_TYPEDEFS_
-#define _TIFF_DATA_TYPEDEFS_
-/*
- * Intrinsic data types required by the file format:
- *
- * 8-bit quantities int8/uint8
- * 16-bit quantities int16/uint16
- * 32-bit quantities int32/uint32
- * strings unsigned char*
- */
-#ifdef __STDC__
-typedef signed char int8; /* NB: non-ANSI compilers may not grok */
-#else
-typedef char int8;
-#endif
-typedef unsigned char uint8;
-typedef short int16;
-typedef unsigned short uint16; /* sizeof (uint16) must == 2 */
-#if defined(__alpha) || (defined(_MIPS_SZLONG) && _MIPS_SZLONG == 64)
-typedef int int32;
-typedef unsigned int uint32; /* sizeof (uint32) must == 4 */
-#else
-typedef long int32;
-typedef unsigned long uint32; /* sizeof (uint32) must == 4 */
-#endif
-#endif /* _TIFF_DATA_TYPEDEFS_ */
-
-typedef struct {
- uint16 tiff_magic; /* magic number (defines byte order) */
- uint16 tiff_version; /* TIFF version number */
- uint32 tiff_diroff; /* byte offset to first directory */
-} TIFFHeader;
-
-/*
- * TIFF Image File Directories are comprised of
- * a table of field descriptors of the form shown
- * below. The table is sorted in ascending order
- * by tag. The values associated with each entry
- * are disjoint and may appear anywhere in the file
- * (so long as they are placed on a word boundary).
- *
- * If the value is 4 bytes or less, then it is placed
- * in the offset field to save space. If the value
- * is less than 4 bytes, it is left-justified in the
- * offset field.
- */
-typedef struct {
- uint16 tdir_tag; /* see below */
- uint16 tdir_type; /* data type; see below */
- uint32 tdir_count; /* number of items; length in spec */
- uint32 tdir_offset; /* byte offset to field data */
-} TIFFDirEntry;
-
-/*
- * NB: In the comments below,
- * - items marked with a + are obsoleted by revision 5.0,
- * - items marked with a ! are introduced in revision 6.0.
- * - items marked with a % are introduced post revision 6.0.
- * - items marked with a $ are obsoleted by revision 6.0.
- */
-
-/*
- * Tag data type information.
- *
- * Note: RATIONALs are the ratio of two 32-bit integer values.
- */
-typedef enum {
- TIFF_NOTYPE = 0, /* placeholder */
- TIFF_BYTE = 1, /* 8-bit unsigned integer */
- TIFF_ASCII = 2, /* 8-bit bytes w/ last byte null */
- TIFF_SHORT = 3, /* 16-bit unsigned integer */
- TIFF_LONG = 4, /* 32-bit unsigned integer */
- TIFF_RATIONAL = 5, /* 64-bit unsigned fraction */
- TIFF_SBYTE = 6, /* !8-bit signed integer */
- TIFF_UNDEFINED = 7, /* !8-bit untyped data */
- TIFF_SSHORT = 8, /* !16-bit signed integer */
- TIFF_SLONG = 9, /* !32-bit signed integer */
- TIFF_SRATIONAL = 10, /* !64-bit signed fraction */
- TIFF_FLOAT = 11, /* !32-bit IEEE floating point */
- TIFF_DOUBLE = 12 /* !64-bit IEEE floating point */
-} TIFFDataType;
-
-/*
- * TIFF Tag Definitions.
- */
-#define TIFFTAG_SUBFILETYPE 254 /* subfile data descriptor */
-#define FILETYPE_REDUCEDIMAGE 0x1 /* reduced resolution version */
-#define FILETYPE_PAGE 0x2 /* one page of many */
-#define FILETYPE_MASK 0x4 /* transparency mask */
-#define TIFFTAG_OSUBFILETYPE 255 /* +kind of data in subfile */
-#define OFILETYPE_IMAGE 1 /* full resolution image data */
-#define OFILETYPE_REDUCEDIMAGE 2 /* reduced size image data */
-#define OFILETYPE_PAGE 3 /* one page of many */
-#define TIFFTAG_IMAGEWIDTH 256 /* image width in pixels */
-#define TIFFTAG_IMAGELENGTH 257 /* image height in pixels */
-#define TIFFTAG_BITSPERSAMPLE 258 /* bits per channel (sample) */
-#define TIFFTAG_COMPRESSION 259 /* data compression technique */
-#define COMPRESSION_NONE 1 /* dump mode */
-#define COMPRESSION_CCITTRLE 2 /* CCITT modified Huffman RLE */
-#define COMPRESSION_CCITTFAX3 3 /* CCITT Group 3 fax encoding */
-#define COMPRESSION_CCITTFAX4 4 /* CCITT Group 4 fax encoding */
-#define COMPRESSION_LZW 5 /* Lempel-Ziv & Welch */
-#define COMPRESSION_OJPEG 6 /* !6.0 JPEG */
-#define COMPRESSION_JPEG 7 /* %JPEG DCT compression */
-#define COMPRESSION_NEXT 32766 /* NeXT 2-bit RLE */
-#define COMPRESSION_CCITTRLEW 32771 /* #1 w/ word alignment */
-#define COMPRESSION_PACKBITS 32773 /* Macintosh RLE */
-#define COMPRESSION_THUNDERSCAN 32809 /* ThunderScan RLE */
-/* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT <dkelly@etsinc.com) */
-#define COMPRESSION_IT8CTPAD 32895 /* IT8 CT w/padding */
-#define COMPRESSION_IT8LW 32896 /* IT8 Linework RLE */
-#define COMPRESSION_IT8MP 32897 /* IT8 Monochrome picture */
-#define COMPRESSION_IT8BL 32898 /* IT8 Binary line art */
-/* compression codes 32908-32911 are reserved for Pixar */
-#define COMPRESSION_PIXARFILM 32908 /* Pixar companded 10bit LZW */
-#define COMPRESSION_PIXARLOG 32909 /* Pixar companded 11bit ZIP */
-#define COMPRESSION_DEFLATE 32946 /* Deflate compression */
-/* compression code 32947 is reserved for Oceana Matrix <dev@oceana.com> */
-#define COMPRESSION_DCS 32947 /* Kodak DCS encoding */
-#define COMPRESSION_JBIG 34661 /* ISO JBIG */
-#define COMPRESSION_SGILOG 34676 /* SGI Log Luminance RLE */
-#define COMPRESSION_SGILOG24 34677 /* SGI Log 24-bit packed */
-#define TIFFTAG_PHOTOMETRIC 262 /* photometric interpretation */
-#define PHOTOMETRIC_MINISWHITE 0 /* min value is white */
-#define PHOTOMETRIC_MINISBLACK 1 /* min value is black */
-#define PHOTOMETRIC_RGB 2 /* RGB color model */
-#define PHOTOMETRIC_PALETTE 3 /* color map indexed */
-#define PHOTOMETRIC_MASK 4 /* $holdout mask */
-#define PHOTOMETRIC_SEPARATED 5 /* !color separations */
-#define PHOTOMETRIC_YCBCR 6 /* !CCIR 601 */
-#define PHOTOMETRIC_CIELAB 8 /* !1976 CIE L*a*b* */
-#define PHOTOMETRIC_LOGL 32844 /* CIE Log2(L) */
-#define PHOTOMETRIC_LOGLUV 32845 /* CIE Log2(L) (u',v') */
-#define TIFFTAG_THRESHHOLDING 263 /* +thresholding used on data */
-#define THRESHHOLD_BILEVEL 1 /* b&w art scan */
-#define THRESHHOLD_HALFTONE 2 /* or dithered scan */
-#define THRESHHOLD_ERRORDIFFUSE 3 /* usually floyd-steinberg */
-#define TIFFTAG_CELLWIDTH 264 /* +dithering matrix width */
-#define TIFFTAG_CELLLENGTH 265 /* +dithering matrix height */
-#define TIFFTAG_FILLORDER 266 /* data order within a byte */
-#define FILLORDER_MSB2LSB 1 /* most significant -> least */
-#define FILLORDER_LSB2MSB 2 /* least significant -> most */
-#define TIFFTAG_DOCUMENTNAME 269 /* name of doc. image is from */
-#define TIFFTAG_IMAGEDESCRIPTION 270 /* info about image */
-#define TIFFTAG_MAKE 271 /* scanner manufacturer name */
-#define TIFFTAG_MODEL 272 /* scanner model name/number */
-#define TIFFTAG_STRIPOFFSETS 273 /* offsets to data strips */
-#define TIFFTAG_ORIENTATION 274 /* +image orientation */
-#define ORIENTATION_TOPLEFT 1 /* row 0 top, col 0 lhs */
-#define ORIENTATION_TOPRIGHT 2 /* row 0 top, col 0 rhs */
-#define ORIENTATION_BOTRIGHT 3 /* row 0 bottom, col 0 rhs */
-#define ORIENTATION_BOTLEFT 4 /* row 0 bottom, col 0 lhs */
-#define ORIENTATION_LEFTTOP 5 /* row 0 lhs, col 0 top */
-#define ORIENTATION_RIGHTTOP 6 /* row 0 rhs, col 0 top */
-#define ORIENTATION_RIGHTBOT 7 /* row 0 rhs, col 0 bottom */
-#define ORIENTATION_LEFTBOT 8 /* row 0 lhs, col 0 bottom */
-#define TIFFTAG_SAMPLESPERPIXEL 277 /* samples per pixel */
-#define TIFFTAG_ROWSPERSTRIP 278 /* rows per strip of data */
-#define TIFFTAG_STRIPBYTECOUNTS 279 /* bytes counts for strips */
-#define TIFFTAG_MINSAMPLEVALUE 280 /* +minimum sample value */
-#define TIFFTAG_MAXSAMPLEVALUE 281 /* +maximum sample value */
-#define TIFFTAG_XRESOLUTION 282 /* pixels/resolution in x */
-#define TIFFTAG_YRESOLUTION 283 /* pixels/resolution in y */
-#define TIFFTAG_PLANARCONFIG 284 /* storage organization */
-#define PLANARCONFIG_CONTIG 1 /* single image plane */
-#define PLANARCONFIG_SEPARATE 2 /* separate planes of data */
-#define TIFFTAG_PAGENAME 285 /* page name image is from */
-#define TIFFTAG_XPOSITION 286 /* x page offset of image lhs */
-#define TIFFTAG_YPOSITION 287 /* y page offset of image lhs */
-#define TIFFTAG_FREEOFFSETS 288 /* +byte offset to free block */
-#define TIFFTAG_FREEBYTECOUNTS 289 /* +sizes of free blocks */
-#define TIFFTAG_GRAYRESPONSEUNIT 290 /* $gray scale curve accuracy */
-#define GRAYRESPONSEUNIT_10S 1 /* tenths of a unit */
-#define GRAYRESPONSEUNIT_100S 2 /* hundredths of a unit */
-#define GRAYRESPONSEUNIT_1000S 3 /* thousandths of a unit */
-#define GRAYRESPONSEUNIT_10000S 4 /* ten-thousandths of a unit */
-#define GRAYRESPONSEUNIT_100000S 5 /* hundred-thousandths */
-#define TIFFTAG_GRAYRESPONSECURVE 291 /* $gray scale response curve */
-#define TIFFTAG_GROUP3OPTIONS 292 /* 32 flag bits */
-#define GROUP3OPT_2DENCODING 0x1 /* 2-dimensional coding */
-#define GROUP3OPT_UNCOMPRESSED 0x2 /* data not compressed */
-#define GROUP3OPT_FILLBITS 0x4 /* fill to byte boundary */
-#define TIFFTAG_GROUP4OPTIONS 293 /* 32 flag bits */
-#define GROUP4OPT_UNCOMPRESSED 0x2 /* data not compressed */
-#define TIFFTAG_RESOLUTIONUNIT 296 /* units of resolutions */
-#define RESUNIT_NONE 1 /* no meaningful units */
-#define RESUNIT_INCH 2 /* english */
-#define RESUNIT_CENTIMETER 3 /* metric */
-#define TIFFTAG_PAGENUMBER 297 /* page numbers of multi-page */
-#define TIFFTAG_COLORRESPONSEUNIT 300 /* $color curve accuracy */
-#define COLORRESPONSEUNIT_10S 1 /* tenths of a unit */
-#define COLORRESPONSEUNIT_100S 2 /* hundredths of a unit */
-#define COLORRESPONSEUNIT_1000S 3 /* thousandths of a unit */
-#define COLORRESPONSEUNIT_10000S 4 /* ten-thousandths of a unit */
-#define COLORRESPONSEUNIT_100000S 5 /* hundred-thousandths */
-#define TIFFTAG_TRANSFERFUNCTION 301 /* !colorimetry info */
-#define TIFFTAG_SOFTWARE 305 /* name & release */
-#define TIFFTAG_DATETIME 306 /* creation date and time */
-#define TIFFTAG_ARTIST 315 /* creator of image */
-#define TIFFTAG_HOSTCOMPUTER 316 /* machine where created */
-#define TIFFTAG_PREDICTOR 317 /* prediction scheme w/ LZW */
-#define TIFFTAG_WHITEPOINT 318 /* image white point */
-#define TIFFTAG_PRIMARYCHROMATICITIES 319 /* !primary chromaticities */
-#define TIFFTAG_COLORMAP 320 /* RGB map for pallette image */
-#define TIFFTAG_HALFTONEHINTS 321 /* !highlight+shadow info */
-#define TIFFTAG_TILEWIDTH 322 /* !rows/data tile */
-#define TIFFTAG_TILELENGTH 323 /* !cols/data tile */
-#define TIFFTAG_TILEOFFSETS 324 /* !offsets to data tiles */
-#define TIFFTAG_TILEBYTECOUNTS 325 /* !byte counts for tiles */
-#define TIFFTAG_BADFAXLINES 326 /* lines w/ wrong pixel count */
-#define TIFFTAG_CLEANFAXDATA 327 /* regenerated line info */
-#define CLEANFAXDATA_CLEAN 0 /* no errors detected */
-#define CLEANFAXDATA_REGENERATED 1 /* receiver regenerated lines */
-#define CLEANFAXDATA_UNCLEAN 2 /* uncorrected errors exist */
-#define TIFFTAG_CONSECUTIVEBADFAXLINES 328 /* max consecutive bad lines */
-#define TIFFTAG_SUBIFD 330 /* subimage descriptors */
-#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 */
-#define EXTRASAMPLE_UNSPECIFIED 0 /* !unspecified data */
-#define EXTRASAMPLE_ASSOCALPHA 1 /* !associated alpha data */
-#define EXTRASAMPLE_UNASSALPHA 2 /* !unassociated alpha data */
-#define TIFFTAG_SAMPLEFORMAT 339 /* !data sample format */
-#define SAMPLEFORMAT_UINT 1 /* !unsigned integer data */
-#define SAMPLEFORMAT_INT 2 /* !signed integer data */
-#define SAMPLEFORMAT_IEEEFP 3 /* !IEEE floating point data */
-#define SAMPLEFORMAT_VOID 4 /* !untyped data */
-#define TIFFTAG_SMINSAMPLEVALUE 340 /* !variable MinSampleValue */
-#define TIFFTAG_SMAXSAMPLEVALUE 341 /* !variable MaxSampleValue */
-#define TIFFTAG_JPEGTABLES 347 /* %JPEG table stream */
-/*
- * Tags 512-521 are obsoleted by Technical Note #2
- * which specifies a revised JPEG-in-TIFF scheme.
- */
-#define TIFFTAG_JPEGPROC 512 /* !JPEG processing algorithm */
-#define JPEGPROC_BASELINE 1 /* !baseline sequential */
-#define JPEGPROC_LOSSLESS 14 /* !Huffman coded lossless */
-#define TIFFTAG_JPEGIFOFFSET 513 /* !pointer to SOI marker */
-#define TIFFTAG_JPEGIFBYTECOUNT 514 /* !JFIF stream length */
-#define TIFFTAG_JPEGRESTARTINTERVAL 515 /* !restart interval length */
-#define TIFFTAG_JPEGLOSSLESSPREDICTORS 517 /* !lossless proc predictor */
-#define TIFFTAG_JPEGPOINTTRANSFORM 518 /* !lossless point transform */
-#define TIFFTAG_JPEGQTABLES 519 /* !Q matrice offsets */
-#define TIFFTAG_JPEGDCTABLES 520 /* !DCT table offsets */
-#define TIFFTAG_JPEGACTABLES 521 /* !AC coefficient offsets */
-#define TIFFTAG_YCBCRCOEFFICIENTS 529 /* !RGB -> YCbCr transform */
-#define TIFFTAG_YCBCRSUBSAMPLING 530 /* !YCbCr subsampling factors */
-#define TIFFTAG_YCBCRPOSITIONING 531 /* !subsample positioning */
-#define YCBCRPOSITION_CENTERED 1 /* !as in PostScript Level 2 */
-#define YCBCRPOSITION_COSITED 2 /* !as in CCIR 601-1 */
-#define TIFFTAG_REFERENCEBLACKWHITE 532 /* !colorimetry info */
-/* tags 32952-32956 are private tags registered to Island Graphics */
-#define TIFFTAG_REFPTS 32953 /* image reference points */
-#define TIFFTAG_REGIONTACKPOINT 32954 /* region-xform tack point */
-#define TIFFTAG_REGIONWARPCORNERS 32955 /* warp quadrilateral */
-#define TIFFTAG_REGIONAFFINE 32956 /* affine transformation mat */
-/* tags 32995-32999 are private tags registered to SGI */
-#define TIFFTAG_MATTEING 32995 /* $use ExtraSamples */
-#define TIFFTAG_DATATYPE 32996 /* $use SampleFormat */
-#define TIFFTAG_IMAGEDEPTH 32997 /* z depth of image */
-#define TIFFTAG_TILEDEPTH 32998 /* z depth/data tile */
-/* tags 33300-33309 are private tags registered to Pixar */
-/*
- * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH
- * are set when an image has been cropped out of a larger image.
- * They reflect the size of the original uncropped image.
- * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used
- * to determine the position of the smaller image in the larger one.
- */
-#define TIFFTAG_PIXAR_IMAGEFULLWIDTH 33300 /* full image size in x */
-#define TIFFTAG_PIXAR_IMAGEFULLLENGTH 33301 /* full image size in y */
-/* tag 33405 is a private tag registered to Eastman Kodak */
-#define TIFFTAG_WRITERSERIALNUMBER 33405 /* device serial number */
-/* tag 33432 is listed in the 6.0 spec w/ unknown ownership */
-#define TIFFTAG_COPYRIGHT 33432 /* copyright string */
-/* IPTC TAG from RichTIFF specifications */
-#define TIFFTAG_RICHTIFFIPTC 33723
-/* 34016-34029 are reserved for ANSI IT8 TIFF/IT <dkelly@etsinc.com) */
-#define TIFFTAG_IT8SITE 34016 /* site name */
-#define TIFFTAG_IT8COLORSEQUENCE 34017 /* color seq. [RGB,CMYK,etc] */
-#define TIFFTAG_IT8HEADER 34018 /* DDES Header */
-#define TIFFTAG_IT8RASTERPADDING 34019 /* raster scanline padding */
-#define TIFFTAG_IT8BITSPERRUNLENGTH 34020 /* # of bits in short run */
-#define TIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH 34021/* # of bits in long run */
-#define TIFFTAG_IT8COLORTABLE 34022 /* LW colortable */
-#define TIFFTAG_IT8IMAGECOLORINDICATOR 34023 /* BP/BL image color switch */
-#define TIFFTAG_IT8BKGCOLORINDICATOR 34024 /* BP/BL bg color switch */
-#define TIFFTAG_IT8IMAGECOLORVALUE 34025 /* BP/BL image color value */
-#define TIFFTAG_IT8BKGCOLORVALUE 34026 /* BP/BL bg color value */
-#define TIFFTAG_IT8PIXELINTENSITYRANGE 34027 /* MP pixel intensity value */
-#define TIFFTAG_IT8TRANSPARENCYINDICATOR 34028 /* HC transparency switch */
-#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 34377 is private tag registered to Adobe for PhotoShop */
-/* 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 */
-#define TIFFTAG_FAXRECVPARAMS 34908 /* encoded Class 2 ses. parms */
-#define TIFFTAG_FAXSUBADDRESS 34909 /* received SubAddr string */
-#define TIFFTAG_FAXRECVTIME 34910 /* receive time (secs) */
-/* tags 37439-37443 are registered to SGI <gregl@sgi.com> */
-#define TIFFTAG_STONITS 37439 /* Sample value to Nits */
-/* tag 34929 is a private tag registered to FedEx */
-#define TIFFTAG_FEDEX_EDR 34929 /* unknown use */
-/* tag 65535 is an undefined tag used by Eastman Kodak */
-#define TIFFTAG_DCSHUESHIFTVALUES 65535 /* hue shift correction data */
-
-/*
- * The following are ``pseudo tags'' that can be
- * used to control codec-specific functionality.
- * These tags are not written to file. Note that
- * these values start at 0xffff+1 so that they'll
- * never collide with Aldus-assigned tags.
- *
- * If you want your private pseudo tags ``registered''
- * (i.e. added to this file), send mail to sam@sgi.com
- * with the appropriate C definitions to add.
- */
-#define TIFFTAG_FAXMODE 65536 /* Group 3/4 format control */
-#define FAXMODE_CLASSIC 0x0000 /* default, include RTC */
-#define FAXMODE_NORTC 0x0001 /* no RTC at end of data */
-#define FAXMODE_NOEOL 0x0002 /* no EOL code at end of row */
-#define FAXMODE_BYTEALIGN 0x0004 /* byte align row */
-#define FAXMODE_WORDALIGN 0x0008 /* word align row */
-#define FAXMODE_CLASSF FAXMODE_NORTC /* TIFF Class F */
-#define TIFFTAG_JPEGQUALITY 65537 /* Compression quality level */
-/* Note: quality level is on the IJG 0-100 scale. Default value is 75 */
-#define TIFFTAG_JPEGCOLORMODE 65538 /* Auto RGB<=>YCbCr convert? */
-#define JPEGCOLORMODE_RAW 0x0000 /* no conversion (default) */
-#define JPEGCOLORMODE_RGB 0x0001 /* do auto conversion */
-#define TIFFTAG_JPEGTABLESMODE 65539 /* What to put in JPEGTables */
-#define JPEGTABLESMODE_QUANT 0x0001 /* include quantization tbls */
-#define JPEGTABLESMODE_HUFF 0x0002 /* include Huffman tbls */
-/* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */
-#define TIFFTAG_FAXFILLFUNC 65540 /* G3/G4 fill function */
-#define TIFFTAG_PIXARLOGDATAFMT 65549 /* PixarLogCodec I/O data sz */
-#define PIXARLOGDATAFMT_8BIT 0 /* regular u_char samples */
-#define PIXARLOGDATAFMT_8BITABGR 1 /* ABGR-order u_chars */
-#define PIXARLOGDATAFMT_11BITLOG 2 /* 11-bit log-encoded (raw) */
-#define PIXARLOGDATAFMT_12BITPICIO 3 /* as per PICIO (1.0==2048) */
-#define PIXARLOGDATAFMT_16BIT 4 /* signed short samples */
-#define PIXARLOGDATAFMT_FLOAT 5 /* IEEE float samples */
-/* 65550-65556 are allocated to Oceana Matrix <dev@oceana.com> */
-#define TIFFTAG_DCSIMAGERTYPE 65550 /* imager model & filter */
-#define DCSIMAGERMODEL_M3 0 /* M3 chip (1280 x 1024) */
-#define DCSIMAGERMODEL_M5 1 /* M5 chip (1536 x 1024) */
-#define DCSIMAGERMODEL_M6 2 /* M6 chip (3072 x 2048) */
-#define DCSIMAGERFILTER_IR 0 /* infrared filter */
-#define DCSIMAGERFILTER_MONO 1 /* monochrome filter */
-#define DCSIMAGERFILTER_CFA 2 /* color filter array */
-#define DCSIMAGERFILTER_OTHER 3 /* other filter */
-#define TIFFTAG_DCSINTERPMODE 65551 /* interpolation mode */
-#define DCSINTERPMODE_NORMAL 0x0 /* whole image, default */
-#define DCSINTERPMODE_PREVIEW 0x1 /* preview of image (384x256) */
-#define TIFFTAG_DCSBALANCEARRAY 65552 /* color balance values */
-#define TIFFTAG_DCSCORRECTMATRIX 65553 /* color correction values */
-#define TIFFTAG_DCSGAMMA 65554 /* gamma value */
-#define TIFFTAG_DCSTOESHOULDERPTS 65555 /* toe & shoulder points */
-#define TIFFTAG_DCSCALIBRATIONFD 65556 /* calibration file desc */
-/* 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 */
-#define TIFFTAG_SGILOGDATAFMT 65560 /* SGILog user data format */
-#define SGILOGDATAFMT_FLOAT 0 /* IEEE float samples */
-#define SGILOGDATAFMT_16BIT 1 /* 16-bit samples */
-#define SGILOGDATAFMT_RAW 2 /* uninterpreted data */
-#define SGILOGDATAFMT_8BIT 3 /* 8-bit RGB monitor values */
-#endif /* _TIFF_ */
diff --git a/tools/CVS/Entries b/tools/CVS/Entries
deleted file mode 100644
index b0860b5f..00000000
--- a/tools/CVS/Entries
+++ /dev/null
@@ -1,26 +0,0 @@
-/Makefile/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/Makefile.in/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/Makefile.lcc/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/fax2ps.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/fax2tiff.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/gif2tiff.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/pal2rgb.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/ppm2tiff.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/ras2tiff.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/rasterfile.h/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/rgb2ycbcr.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/sgi2tiff.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/sgigt.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/sgisv.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/thumbnail.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiff2bw.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiff2ps.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffcmp.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffcp.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffdither.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffdump.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffinfo.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffmedian.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/tiffsplit.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-/ycbcr.c/1.1.1.1/Tue Jul 27 21:50:28 1999//
-D
diff --git a/tools/CVS/Repository b/tools/CVS/Repository
deleted file mode 100644
index 96299f75..00000000
--- a/tools/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs/internal/libtiff/tools
diff --git a/tools/CVS/Root b/tools/CVS/Root
deleted file mode 100644
index 8dff0f68..00000000
--- a/tools/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/cvs
diff --git a/tools/Makefile.in b/tools/Makefile.in
index b80c037e..e7f3c557 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -1,4 +1,4 @@
-# $Header: /usr/local/cvs/internal/libtiff/tools/Makefile.in,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/tools/Makefile.in,v 1.2 1999/08/16 18:26:37 warmerda Exp $
#
# @WARNING@
#
@@ -65,6 +65,7 @@ OBJS= \
ras2tiff.o \
thumbnail.o \
tiff2bw.o \
+ tiff2rgba.o \
tiff2ps.o \
tiffcmp.o \
tiffcp.o \
@@ -84,6 +85,7 @@ TARGETS =\
thumbnail \
ras2tiff \
tiff2bw \
+ tiff2rgba \
tiff2ps \
tiffcmp \
tiffcp \
@@ -172,6 +174,12 @@ tiff2bw: tiff2bw.o ${TIFFLIB}
tiff2bw.o: ${SRCDIR}/tiff2bw.c
${CC} -c ${CFLAGS} ${SRCDIR}/tiff2bw.c
+# convert anything to RGBA.
+tiff2rgba: tiff2rgba.o ${TIFFLIB}
+ ${CC} -o tiff2rgba ${CFLAGS} tiff2rgba.o ${LIBS}
+tiff2rgba.o: ${SRCDIR}/tiff2rgba.c
+ ${CC} -c ${CFLAGS} ${SRCDIR}/tiff2rgba.c
+
# convert B&W image to bilevel w/ FS dithering
tiffdither: tiffdither.o ${TIFFLIB}
${CC} -o tiffdither ${CFLAGS} tiffdither.o ${LIBS}
diff --git a/tools/Makefile.lcc b/tools/Makefile.lcc
index 89423d2f..569b7855 100644
--- a/tools/Makefile.lcc
+++ b/tools/Makefile.lcc
@@ -1,4 +1,4 @@
-# $Header: /usr/local/cvs/internal/libtiff/tools/Makefile.lcc,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $
+# $Header: /cvsroot/osrs/libtiff/tools/Makefile.lcc,v 1.2 1999/08/16 18:26:37 warmerda Exp $
#
# TIFF Library Tools
#
@@ -52,6 +52,7 @@ OBJS=\
ppm2tiff.o \
rgb2ycbcr.o \
tiff2bw.o \
+ tiff2rgba.o \
tiff2ps.o \
tiffcmp.o \
tiffcp.o \
@@ -70,6 +71,7 @@ ALL=\
ppm2tiff.ttp \
rgb2ycbcr.ttp \
tiff2bw.ttp \
+ tiff2rgba.ttp \
tiff2ps.ttp \
tiffcmp.ttp \
tiffcp.ttp \
@@ -101,6 +103,9 @@ tiff2ps.ttp: tiff2ps.c ${LIBTIFF}
# convert RGB image to B&W
tiff2bw.ttp: tiff2bw.c ${GETOPT} ${LIBTIFF}
${CC} -o tiff2bw.ttp ${CFLAGS} tiff2bw.c ${GETOPT} ${LIBS}
+# convert anything to RGBA
+tiff2rgba.ttp: tiff2rgba.c ${GETOPT} ${LIBTIFF}
+ ${CC} -o tiff2rgba.ttp ${CFLAGS} tiff2rgba.c ${GETOPT} ${LIBS}
# convert B&W image to bilevel w/ FS dithering
tiffdither.ttp: tiffdither.c ${LIBTIFF}
${CC} -o tiffdither.ttp ${CFLAGS} tiffdither.c ${LIBS}
diff --git a/tools/Makefile.vc b/tools/Makefile.vc
new file mode 100644
index 00000000..4f6292aa
--- /dev/null
+++ b/tools/Makefile.vc
@@ -0,0 +1,28 @@
+#
+# Simple MS VC++ Makefile
+#
+# To build:
+# C:\libtiff\tools> nmake /f makefile.vc
+#
+TARGETS = tiffcp.exe tiffinfo.exe tiffdump.exe fax2tiff.exe \
+ fax2ps.exe gif2tiff.exe pal2rgb.exe ppm2tiff.exe \
+ rgb2ycbcr.exe thumbnail.exe ras2tiff.exe tiff2bw.exe \
+ tiff2rgba.exe tiff2ps.exe tiffcmp.exe tiffdither.exe \
+ tiffmedian.exe tiffsplit.exe
+
+EXTRA_OBJ = strcasecmp.obj getopt.obj
+
+LIBS = ..\libtiff\libtiff.lib
+
+CFLAGS = /nologo -I..\libtiff /D_WINDOWS
+
+default: $(EXTRA_OBJ) $(TARGETS)
+
+.c.exe:
+ $(CC) $(CFLAGS) $*.c $(EXTRA_OBJ) $(LIBS)
+
+getopt.obj: ..\port\getopt.c
+ $(CC) /c $(CFLAGS) ..\port\getopt.c
+
+strcasecmp.obj: ..\port\strcasecmp.c
+ $(CC) /c $(CFLAGS) ..\port\strcasecmp.c
diff --git a/tools/fax2ps.c b/tools/fax2ps.c
index 36ab150e..a22401f5 100644
--- a/tools/fax2ps.c
+++ b/tools/fax2ps.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/fax2ps.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $" */
+/* $Header: /cvsroot/osrs/libtiff/tools/fax2ps.c,v 1.2 1999/08/17 03:07:43 warmerda Exp $" */
/*
* Copyright (c) 1991-1997 Sam Leffler
@@ -28,10 +28,14 @@
#include <string.h>
#include <stdlib.h>
#include <time.h>
-#ifndef VMS
-#include <unistd.h>
-#else
+
+#if defined(VMS)
#include <unixio.h>
+#elif defined(_WINDOWS)
+#include <io.h>
+#define off_t toff_t
+#else
+#include <unistd.h>
#endif
#include "tiffio.h"
diff --git a/tools/fax2tiff.c b/tools/fax2tiff.c
index 6073c197..d2befdd0 100644
--- a/tools/fax2tiff.c
+++ b/tools/fax2tiff.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/fax2tiff.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/fax2tiff.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1990-1997 Sam Leffler
diff --git a/tools/gif2tiff.c b/tools/gif2tiff.c
index 82be4fb8..efc64355 100644
--- a/tools/gif2tiff.c
+++ b/tools/gif2tiff.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/gif2tiff.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/gif2tiff.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1990-1997 Sam Leffler
diff --git a/tools/pal2rgb.c b/tools/pal2rgb.c
index e90d7d7f..36270db1 100644
--- a/tools/pal2rgb.c
+++ b/tools/pal2rgb.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/pal2rgb.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/pal2rgb.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/tools/ppm2tiff.c b/tools/ppm2tiff.c
index 532a8b68..bbfd7230 100644
--- a/tools/ppm2tiff.c
+++ b/tools/ppm2tiff.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/ppm2tiff.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/ppm2tiff.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
diff --git a/tools/ras2tiff.c b/tools/ras2tiff.c
index 95379205..815d26ed 100644
--- a/tools/ras2tiff.c
+++ b/tools/ras2tiff.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/ras2tiff.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/ras2tiff.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/tools/rasterfile.h b/tools/rasterfile.h
index 849a8397..77abfc75 100644
--- a/tools/rasterfile.h
+++ b/tools/rasterfile.h
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/rasterfile.h,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/rasterfile.h,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Description of header for files containing raster images
diff --git a/tools/rgb2ycbcr.c b/tools/rgb2ycbcr.c
index 27214d3f..6d4dc9b2 100644
--- a/tools/rgb2ycbcr.c
+++ b/tools/rgb2ycbcr.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/rgb2ycbcr.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/rgb2ycbcr.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
diff --git a/tools/sgi2tiff.c b/tools/sgi2tiff.c
index 7b028529..fd8586a3 100644
--- a/tools/sgi2tiff.c
+++ b/tools/sgi2tiff.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/sgi2tiff.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/sgi2tiff.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
diff --git a/tools/sgigt.c b/tools/sgigt.c
index 913e8e5a..880147ce 100644
--- a/tools/sgigt.c
+++ b/tools/sgigt.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/sgigt.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/sgigt.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/tools/sgisv.c b/tools/sgisv.c
index 43a64780..a9b3edf3 100644
--- a/tools/sgisv.c
+++ b/tools/sgisv.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/sgisv.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/sgisv.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1990-1997 Sam Leffler
diff --git a/tools/thumbnail.c b/tools/thumbnail.c
index c588548a..0f2d5d9b 100644
--- a/tools/thumbnail.c
+++ b/tools/thumbnail.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/thumbnail.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/thumbnail.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1994-1997 Sam Leffler
diff --git a/tools/tiff2bw.c b/tools/tiff2bw.c
index 0f7a75f9..cf683b4a 100644
--- a/tools/tiff2bw.c
+++ b/tools/tiff2bw.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/tiff2bw.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/tiff2bw.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/tools/tiff2ps.c b/tools/tiff2ps.c
index 8d4ee8b9..324aaa9a 100644
--- a/tools/tiff2ps.c
+++ b/tools/tiff2ps.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/tiff2ps.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/tiff2ps.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/tools/tiff2rgba.c b/tools/tiff2rgba.c
new file mode 100644
index 00000000..284a3c51
--- /dev/null
+++ b/tools/tiff2rgba.c
@@ -0,0 +1,452 @@
+/* $Header: /cvsroot/osrs/libtiff/tools/tiff2rgba.c,v 1.1 1999/08/16 17:46:08 warmerda Exp $ */
+
+/*
+ * Copyright (c) 1991-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "tiffio.h"
+
+#define streq(a,b) (strcmp(a,b) == 0)
+#define CopyField(tag, v) \
+ if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v)
+
+#ifndef howmany
+#define howmany(x, y) (((x)+((y)-1))/(y))
+#endif
+#define roundup(x, y) (howmany(x,y)*((uint32)(y)))
+
+uint16 compression = COMPRESSION_LZW;
+uint32 rowsperstrip = (uint32) -1;
+int process_by_block = 0; /* default is whole image at once */
+
+
+static int tiffcvt(TIFF* in, TIFF* out);
+static void usage(void);
+
+int
+main(int argc, char* argv[])
+{
+ TIFF *in, *out;
+ int c;
+ extern int optind;
+ extern char *optarg;
+
+ while ((c = getopt(argc, argv, "c:r:t:b")) != -1)
+ switch (c) {
+ case 'b':
+ process_by_block = 1;
+ break;
+
+ case 'c':
+ if (streq(optarg, "none"))
+ compression = COMPRESSION_NONE;
+ else if (streq(optarg, "packbits"))
+ compression = COMPRESSION_PACKBITS;
+ else if (streq(optarg, "lzw"))
+ compression = COMPRESSION_LZW;
+ else if (streq(optarg, "jpeg"))
+ compression = COMPRESSION_JPEG;
+ else
+ usage();
+ break;
+
+ case 'r':
+ rowsperstrip = atoi(optarg);
+ break;
+
+ case 't':
+ rowsperstrip = atoi(optarg);
+ break;
+
+ case '?':
+ usage();
+ /*NOTREACHED*/
+ }
+
+ if (argc - optind < 2)
+ usage();
+
+ out = TIFFOpen(argv[argc-1], "w");
+ if (out == NULL)
+ return (-2);
+
+ for (; optind < argc-1; optind++) {
+ in = TIFFOpen(argv[optind], "r");
+ if (in != NULL) {
+ do {
+ if (!tiffcvt(in, out) ||
+ !TIFFWriteDirectory(out)) {
+ (void) TIFFClose(out);
+ return (1);
+ }
+ } while (TIFFReadDirectory(in));
+ (void) TIFFClose(in);
+ }
+ }
+ (void) TIFFClose(out);
+ return (0);
+}
+
+static int
+cvt_by_tile( TIFF *in, TIFF *out )
+
+{
+ uint32* raster; /* retrieve RGBA image */
+ uint32 width, height; /* image width & height */
+ uint32 tile_width, tile_height;
+ uint32 row, col;
+ uint32 *wrk_line;
+ int ok = 1;
+
+ TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
+ TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
+
+ if( !TIFFGetField(in, TIFFTAG_TILEWIDTH, &tile_width)
+ || !TIFFGetField(in, TIFFTAG_TILELENGTH, &tile_height) ) {
+ TIFFError(TIFFFileName(in), "Source image not tiled");
+ return (0);
+ }
+
+ TIFFSetField(out, TIFFTAG_TILEWIDTH, tile_width );
+ TIFFSetField(out, TIFFTAG_TILELENGTH, tile_height );
+
+ /*
+ * Allocate tile buffer
+ */
+ raster = (uint32*)_TIFFmalloc(tile_width * tile_height * sizeof (uint32));
+ if (raster == 0) {
+ TIFFError(TIFFFileName(in), "No space for raster buffer");
+ return (0);
+ }
+
+ /*
+ * Allocate a scanline buffer for swapping during the vertical
+ * mirroring pass.
+ */
+ wrk_line = (uint32*)_TIFFmalloc(tile_width * sizeof (uint32));
+ if (wrk_line == 0) {
+ TIFFError(TIFFFileName(in), "No space for raster scanline buffer");
+ ok = 0;
+ }
+
+ /*
+ * Loop over the tiles.
+ */
+ for( row = 0; ok && row < height; row += tile_height )
+ {
+ for( col = 0; ok && col < width; col += tile_width )
+ {
+ int i_row;
+
+ /* Read the tile into an RGBA array */
+ if (!TIFFReadRGBATile(in, col, row, raster)) {
+ ok = 0;
+ break;
+ }
+
+ /*
+ * For some reason the TIFFReadRGBATile() function chooses the
+ * lower left corner as the origin. Vertically mirror scanlines.
+ */
+ for( i_row = 0; i_row < tile_height / 2; i_row++ )
+ {
+ uint32 *top_line, *bottom_line;
+
+ top_line = raster + tile_width * i_row;
+ bottom_line = raster + tile_width * (tile_height-i_row-1);
+
+ _TIFFmemcpy(wrk_line, top_line, 4*tile_width);
+ _TIFFmemcpy(top_line, bottom_line, 4*tile_width);
+ _TIFFmemcpy(bottom_line, wrk_line, 4*tile_width);
+ }
+
+ /*
+ * Write out the result in a tile.
+ */
+
+ if( TIFFWriteEncodedTile( out,
+ TIFFComputeTile( out, col, row, 0, 0),
+ raster,
+ 4 * tile_width * tile_height ) == -1 )
+ {
+ ok = 0;
+ break;
+ }
+ }
+ }
+
+ _TIFFfree( raster );
+ _TIFFfree( wrk_line );
+
+ return ok;
+}
+
+static int
+cvt_by_strip( TIFF *in, TIFF *out )
+
+{
+ uint32* raster; /* retrieve RGBA image */
+ uint32 width, height; /* image width & height */
+ uint32 row;
+ uint32 *wrk_line;
+ int ok = 1;
+
+ TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
+ TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
+
+ if( !TIFFGetField(in, TIFFTAG_ROWSPERSTRIP, &rowsperstrip) ) {
+ TIFFError(TIFFFileName(in), "Source image not in strips");
+ return (0);
+ }
+
+ TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
+
+ /*
+ * Allocate strip buffer
+ */
+ raster = (uint32*)_TIFFmalloc(width * rowsperstrip * sizeof (uint32));
+ if (raster == 0) {
+ TIFFError(TIFFFileName(in), "No space for raster buffer");
+ return (0);
+ }
+
+ /*
+ * Allocate a scanline buffer for swapping during the vertical
+ * mirroring pass.
+ */
+ wrk_line = (uint32*)_TIFFmalloc(width * sizeof (uint32));
+ if (wrk_line == 0) {
+ TIFFError(TIFFFileName(in), "No space for raster scanline buffer");
+ ok = 0;
+ }
+
+ /*
+ * Loop over the strips.
+ */
+ for( row = 0; ok && row < height; row += rowsperstrip )
+ {
+ int rows_to_write, i_row;
+
+ /* Read the strip into an RGBA array */
+ if (!TIFFReadRGBAStrip(in, row, raster)) {
+ ok = 0;
+ break;
+ }
+
+ /*
+ * Figure out the number of scanlines actually in this strip.
+ */
+ if( row + rowsperstrip > height )
+ rows_to_write = height - row;
+ else
+ rows_to_write = rowsperstrip;
+
+ /*
+ * For some reason the TIFFReadRGBAStrip() function chooses the
+ * lower left corner as the origin. Vertically mirror scanlines.
+ */
+
+ for( i_row = 0; i_row < rows_to_write / 2; i_row++ )
+ {
+ uint32 *top_line, *bottom_line;
+
+ top_line = raster + width * i_row;
+ bottom_line = raster + width * (rows_to_write-i_row-1);
+
+ _TIFFmemcpy(wrk_line, top_line, 4*width);
+ _TIFFmemcpy(top_line, bottom_line, 4*width);
+ _TIFFmemcpy(bottom_line, wrk_line, 4*width);
+ }
+
+ /*
+ * Write out the result in a strip
+ */
+
+ if( TIFFWriteEncodedStrip( out, row / rowsperstrip, raster,
+ 4 * rows_to_write * width ) == -1 )
+ {
+ ok = 0;
+ break;
+ }
+ }
+
+ _TIFFfree( raster );
+ _TIFFfree( wrk_line );
+
+ return ok;
+}
+
+/*
+ * cvt_whole_image()
+ *
+ * read the whole image into one big RGBA buffer and then write out
+ * strips from that. This is using the traditional TIFFReadRGBAImage()
+ * API that we trust.
+ */
+
+static int
+cvt_whole_image( TIFF *in, TIFF *out )
+
+{
+ uint32* raster; /* retrieve RGBA image */
+ uint32 width, height; /* image width & height */
+ uint32 row;
+ uint32 *wrk_line;
+
+
+ TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
+ TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
+
+ rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip);
+ TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
+
+ raster = (uint32*)_TIFFmalloc(width * height * sizeof (uint32));
+ if (raster == 0) {
+ TIFFError(TIFFFileName(in), "No space for raster buffer");
+ return (0);
+ }
+
+ /* Read the image in one chunk into an RGBA array */
+ if (!TIFFReadRGBAImage(in, width, height, raster, 0)) {
+ _TIFFfree(raster);
+ return (0);
+ }
+
+ /* For some reason the TIFFReadRGBAImage() function chooses the
+ lower left corner as the origin. Vertically mirror scanlines. */
+
+ wrk_line = (uint32*)_TIFFmalloc(width * sizeof (uint32));
+ if (wrk_line == 0) {
+ TIFFError(TIFFFileName(in), "No space for raster scanline buffer");
+ return (0);
+ }
+
+ for( row = 0; row < height / 2; row++ )
+ {
+ uint32 *top_line, *bottom_line;
+
+ top_line = raster + width * row;
+ bottom_line = raster + width * (height-row-1);
+
+ _TIFFmemcpy(wrk_line, top_line, 4*width);
+ _TIFFmemcpy(top_line, bottom_line, 4*width);
+ _TIFFmemcpy(bottom_line, wrk_line, 4*width);
+ }
+
+ _TIFFfree( wrk_line );
+
+
+ /* Write out the result in strips */
+
+ for( row = 0; row < height; row += rowsperstrip )
+ {
+ uint32* raster_strip;
+ int rows_to_write;
+
+ raster_strip = raster + row * width;
+
+ if( row + rowsperstrip > height )
+ rows_to_write = height - row;
+ else
+ rows_to_write = rowsperstrip;
+
+ if( TIFFWriteEncodedStrip( out, row / rowsperstrip,
+ raster_strip,
+ 4 * rows_to_write * width ) == -1 )
+ {
+ _TIFFfree( raster );
+ return 0;
+ }
+ }
+
+ _TIFFfree( raster );
+
+ return 1;
+}
+
+
+static int
+tiffcvt(TIFF* in, TIFF* out)
+{
+ uint32 width, height; /* image width & height */
+ uint16 shortv;
+ float floatv;
+ char *stringv;
+ uint32 longv;
+ uint16 v[1];
+
+ TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
+ TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
+
+ CopyField(TIFFTAG_SUBFILETYPE, longv);
+ TIFFSetField(out, TIFFTAG_IMAGEWIDTH, width);
+ TIFFSetField(out, TIFFTAG_IMAGELENGTH, height);
+ TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 8);
+ TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
+ TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
+
+ CopyField(TIFFTAG_FILLORDER, shortv);
+ TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
+ TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 4);
+ v[0] = EXTRASAMPLE_ASSOCALPHA;
+ TIFFSetField(out, TIFFTAG_EXTRASAMPLES, 1, v);
+ CopyField(TIFFTAG_XRESOLUTION, floatv);
+ CopyField(TIFFTAG_YRESOLUTION, floatv);
+ CopyField(TIFFTAG_RESOLUTIONUNIT, shortv);
+ TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
+ TIFFSetField(out, TIFFTAG_SOFTWARE, TIFFGetVersion());
+ CopyField(TIFFTAG_DOCUMENTNAME, stringv);
+
+ if( process_by_block && TIFFIsTiled( in ) )
+ return( cvt_by_tile( in, out ) );
+ else if( process_by_block )
+ return( cvt_by_strip( in, out ) );
+ else
+ return( cvt_whole_image( in, out ) );
+}
+
+static char* usageMsg[] = {
+ "usage: tiff2rgba [-c comp] [-r rows] [-b] input... output\n",
+ "where comp is one of the following compression algorithms:\n",
+ " jpeg\t\tJPEG encoding\n",
+ " lzw\t\tLempel-Ziv & Welch encoding\n",
+ " packbits\tPackBits encoding\n",
+ " none\t\tno compression\n",
+ "and the other options are:\n",
+ " -r\trows/strip\n",
+ " -b (progress by block rather than as a whole image)\n",
+ NULL
+};
+
+static void
+usage(void)
+{
+ int i;
+ for (i = 0; usageMsg[i]; i++)
+ fprintf(stderr, "%s", usageMsg[i]);
+ exit(-1);
+}
diff --git a/tools/tiffcmp.c b/tools/tiffcmp.c
index b99b9f7c..f5527a87 100644
--- a/tools/tiffcmp.c
+++ b/tools/tiffcmp.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/tiffcmp.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/tiffcmp.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/tools/tiffcp.c b/tools/tiffcp.c
index 2915b184..0a1dd958 100644
--- a/tools/tiffcp.c
+++ b/tools/tiffcp.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/tiffcp.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/tiffcp.c,v 1.2 1999/08/16 18:27:51 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -29,6 +29,7 @@
#include <string.h>
#include <ctype.h>
+#include <assert.h>
#include "tiffio.h"
@@ -71,7 +72,7 @@ main(int argc, char* argv[])
uint32 deftilewidth = (uint32) -1;
uint32 deftilelength = (uint32) -1;
uint32 defrowsperstrip = (uint32) -1;
- uint32 diroff = 0;
+ uint32 diroff = 0, p_diroff = 0;
TIFF* in;
TIFF* out;
char mode[10];
@@ -82,7 +83,7 @@ main(int argc, char* argv[])
*mp++ = 'w';
*mp = '\0';
- while ((c = getopt(argc, argv, "c:f:l:o:p:r:w:aistBLMC")) != -1)
+ while ((c = getopt(argc, argv, "c:f:l:o:z:p:r:w:aistBLMC")) != -1)
switch (c) {
case 'a': /* append to output */
mode[0] = 'a';
@@ -109,6 +110,9 @@ main(int argc, char* argv[])
case 'o': /* initial directory offset */
diroff = strtoul(optarg, NULL, 0);
break;
+ case 'z': /* initial directory offset */
+ p_diroff = strtoul(optarg, NULL, 0);
+ break;
case 'p': /* planar configuration */
if (streq(optarg, "separate"))
defconfig = PLANARCONFIG_SEPARATE;
@@ -162,6 +166,12 @@ main(int argc, char* argv[])
(void) TIFFClose(out);
return (1);
}
+ if (p_diroff != 0 && !TIFFSetDirectory(in, p_diroff)) {
+ TIFFError(TIFFFileName(in),
+ "Error, setting subdirectory at %#x", diroff);
+ (void) TIFFClose(out);
+ return (1);
+ }
do {
config = defconfig;
compression = defcompression;
@@ -175,7 +185,7 @@ main(int argc, char* argv[])
(void) TIFFClose(out);
return (1);
}
- } while (TIFFReadDirectory(in));
+ } while (TIFFReadDirectory(in) && p_diroff == 0 );
(void) TIFFClose(in);
}
(void) TIFFClose(out);
@@ -714,12 +724,20 @@ cpStripToTile(uint8* out, uint8* in,
static void
cpContigBufToSeparateBuf(uint8* out, uint8* in,
- uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp)
+ uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp,
+ int bytes_per_sample )
{
while (rows-- > 0) {
uint32 j = cols;
while (j-- > 0)
- *out++ = *in, in += spp;
+ {
+ int n = bytes_per_sample;
+
+ while( n-- ) {
+ *out++ = *in++;
+ }
+ in += (spp-1) * bytes_per_sample;
+ }
out += outskew;
in += inskew;
}
@@ -727,12 +745,19 @@ cpContigBufToSeparateBuf(uint8* out, uint8* in,
static void
cpSeparateBufToContigBuf(uint8* out, uint8* in,
- uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp)
+ uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp,
+ int bytes_per_sample)
{
while (rows-- > 0) {
uint32 j = cols;
- while (j-- > 0)
- *out = *in++, out += spp;
+ while (j-- > 0) {
+ int n = bytes_per_sample;
+
+ while( n-- ) {
+ *out++ = *in++;
+ }
+ out += (spp-1)*bytes_per_sample;
+ }
out += outskew;
in += inskew;
}
@@ -744,6 +769,7 @@ cpImage(TIFF* in, TIFF* out, readFunc fin, writeFunc fout,
{
int status = FALSE;
tdata_t buf = _TIFFmalloc(TIFFRasterScanlineSize(in) * imagelength);
+
if (buf) {
(*fin)(in, (uint8*)buf, imagelength, imagewidth, spp);
status = (fout)(out, (uint8*)buf, imagelength, imagewidth, spp);
@@ -782,14 +808,16 @@ DECLAREreadFunc(readSeparateStripsIntoBuffer)
for (s = 0; s < spp; s++) {
uint8* bp = bufp + s;
tsize_t n = scanlinesize;
+ uint8* sbuf = scanline;
if (TIFFReadScanline(in, scanline, row, s) < 0 && !ignore)
goto done;
while (n-- > 0)
- *bp = *bufp++, bp += spp;
+ *bp = *sbuf++, bp += spp;
}
- bufp += scanlinesize;
+ bufp += scanlinesize * spp;
}
+
done:
_TIFFfree(scanline);
}
@@ -810,6 +838,7 @@ DECLAREreadFunc(readContigTilesIntoBuffer)
return;
(void) TIFFGetField(in, TIFFTAG_TILEWIDTH, &tw);
(void) TIFFGetField(in, TIFFTAG_TILELENGTH, &tl);
+
for (row = 0; row < imagelength; row += tl) {
uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
uint32 colb = 0;
@@ -823,12 +852,12 @@ DECLAREreadFunc(readContigTilesIntoBuffer)
uint32 width = imagew - colb;
uint32 oskew = tilew - width;
cpStripToTile(bufp + colb,
- tilebuf, nrow, width,
- oskew + iskew, oskew);
+ tilebuf, nrow, width,
+ oskew + iskew, oskew );
} else
cpStripToTile(bufp + colb,
- tilebuf, nrow, tilew,
- iskew, 0);
+ tilebuf, nrow, tilew,
+ iskew, 0);
colb += tilew;
}
bufp += imagew * nrow;
@@ -839,18 +868,23 @@ done:
DECLAREreadFunc(readSeparateTilesIntoBuffer)
{
- uint32 imagew = TIFFScanlineSize(in);
+ uint32 imagew = TIFFRasterScanlineSize(in);
uint32 tilew = TIFFTileRowSize(in);
- int iskew = imagew - tilew;
+ int iskew = imagew - tilew*spp;
tdata_t tilebuf = _TIFFmalloc(TIFFTileSize(in));
uint8* bufp = (uint8*) buf;
uint32 tw, tl;
uint32 row;
+ uint16 bps, bytes_per_sample;
if (tilebuf == 0)
return;
(void) TIFFGetField(in, TIFFTAG_TILEWIDTH, &tw);
(void) TIFFGetField(in, TIFFTAG_TILELENGTH, &tl);
+ (void) TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bps);
+ assert( bps % 8 == 0 );
+ bytes_per_sample = bps/8;
+
for (row = 0; row < imagelength; row += tl) {
uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
uint32 colb = 0;
@@ -866,18 +900,24 @@ DECLAREreadFunc(readSeparateTilesIntoBuffer)
* Tile is clipped horizontally. Calculate
* visible portion and skewing factors.
*/
- if (colb + tilew > imagew) {
+ if (colb + tilew*spp > imagew) {
uint32 width = imagew - colb;
- int oskew = tilew - width;
- cpSeparateBufToContigBuf(bufp+colb+s,
- tilebuf, nrow, width,
- oskew + iskew, oskew, spp);
+ int oskew = tilew*spp - width;
+ cpSeparateBufToContigBuf(
+ bufp+colb+s*bytes_per_sample,
+ tilebuf, nrow,
+ width/(spp*bytes_per_sample),
+ oskew + iskew,
+ oskew/spp, spp,
+ bytes_per_sample);
} else
- cpSeparateBufToContigBuf(bufp+colb+s,
+ cpSeparateBufToContigBuf(
+ bufp+colb+s*bytes_per_sample,
tilebuf, nrow, tw,
- iskew, 0, spp);
+ iskew, 0, spp,
+ bytes_per_sample);
}
- colb += tilew;
+ colb += tilew*spp;
}
bufp += imagew * nrow;
}
@@ -898,7 +938,7 @@ DECLAREwriteFunc(writeBufferToContigStrips)
tsize_t stripsize = TIFFVStripSize(out, nrows);
if (TIFFWriteEncodedStrip(out, strip++, buf, stripsize) < 0)
return (FALSE);
- row += rowsperstrip, buf += stripsize;
+ buf += stripsize;
}
return (TRUE);
}
@@ -923,7 +963,7 @@ DECLAREwriteFunc(writeBufferToSeparateStrips)
cpContigBufToSeparateBuf(
obuf, (uint8*) buf + row*rowsize + s,
- nrows, imagewidth, 0, 0, spp);
+ nrows, imagewidth, 0, 0, spp, 1);
if (TIFFWriteEncodedStrip(out, strip++, obuf, stripsize) < 0) {
_TIFFfree(obuf);
return (FALSE);
@@ -990,11 +1030,16 @@ DECLAREwriteFunc(writeBufferToSeparateTiles)
uint8* bufp = (uint8*) buf;
uint32 tl, tw;
uint32 row;
+ uint16 bps, bytes_per_sample;
if (obuf == NULL)
return (FALSE);
(void) TIFFGetField(out, TIFFTAG_TILELENGTH, &tl);
(void) TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw);
+ (void) TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps);
+ assert( bps % 8 == 0 );
+ bytes_per_sample = bps/8;
+
for (row = 0; row < imagelength; row += tl) {
uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
uint32 colb = 0;
@@ -1008,18 +1053,20 @@ DECLAREwriteFunc(writeBufferToSeparateTiles)
* visible portion and skewing factors.
*/
if (colb + tilew > imagew) {
- uint32 width = imagew - colb;
+ uint32 width = (imagew - colb);
int oskew = tilew - width;
cpContigBufToSeparateBuf(obuf,
bufp + (colb*spp) + s,
- nrow, width,
- oskew, (oskew*spp)+iskew, spp);
+ nrow, width/bytes_per_sample,
+ oskew, (oskew*spp)+iskew, spp,
+ bytes_per_sample);
} else
cpContigBufToSeparateBuf(obuf,
bufp + (colb*spp) + s,
nrow, tilewidth,
- 0, iskew, spp);
+ 0, iskew, spp,
+ bytes_per_sample);
if (TIFFWriteTile(out, obuf, col, row, 0, s) < 0) {
_TIFFfree(obuf);
return (FALSE);
diff --git a/tools/tiffdither.c b/tools/tiffdither.c
index f28d5b65..f4996502 100644
--- a/tools/tiffdither.c
+++ b/tools/tiffdither.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/tiffdither.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/tiffdither.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/tools/tiffdump.c b/tools/tiffdump.c
index 1fb784f8..a112b3cd 100644
--- a/tools/tiffdump.c
+++ b/tools/tiffdump.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/tiffdump.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/tiffdump.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/tools/tiffinfo.c b/tools/tiffinfo.c
index bd01532f..e4bf1568 100644
--- a/tools/tiffinfo.c
+++ b/tools/tiffinfo.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/tiffinfo.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/tiffinfo.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/tools/tiffmedian.c b/tools/tiffmedian.c
index f2b49f5b..9c3de19a 100644
--- a/tools/tiffmedian.c
+++ b/tools/tiffmedian.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/tiffmedian.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/tiffmedian.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Apply median cut on an image.
diff --git a/tools/tiffsplit.c b/tools/tiffsplit.c
index c5ba69bc..0afc43d3 100644
--- a/tools/tiffsplit.c
+++ b/tools/tiffsplit.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/tools/tiffsplit.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/tools/tiffsplit.c,v 1.1.1.1 1999/07/27 21:50:28 mike Exp $ */
/*
* Copyright (c) 1992-1997 Sam Leffler