Imported Upstream version 4.0.7 80/127880/1 upstream/4.0.7
authorJiyong Min <jiyong.min@samsung.com>
Tue, 2 May 2017 07:00:25 +0000 (16:00 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Tue, 2 May 2017 07:04:16 +0000 (16:04 +0900)
Change-Id: I65175a4698a93b03aed6ebe4d68ab5e64deb4816
Signed-off-by: jiyong min <jiyong.min@samsung.com>
293 files changed:
ChangeLog
Makefile.in
RELEASE-DATE
VERSION
build/Makefile.in
config/ltmain.sh
configure
configure.ac
contrib/Makefile.in
contrib/addtiffo/Makefile.in
contrib/dbs/Makefile.in
contrib/dbs/xtiff/Makefile.in
contrib/iptcutil/Makefile.in
contrib/mfs/Makefile.in
contrib/pds/Makefile.in
contrib/ras/Makefile.in
contrib/stream/Makefile.in
contrib/tags/Makefile.in
contrib/win_dib/Makefile.in
html/Makefile.am
html/Makefile.in
html/addingtags.html
html/bugs.html
html/contrib.html
html/document.html
html/images.html
html/images/Makefile.in
html/index.html
html/internals.html
html/intro.html
html/libtiff.html
html/man/CMakeLists.txt
html/man/Makefile.am
html/man/Makefile.in
html/man/TIFFClose.3tiff.html
html/man/TIFFDataWidth.3tiff.html
html/man/TIFFError.3tiff.html
html/man/TIFFFieldDataType.3tiff.html
html/man/TIFFFieldName.3tiff.html
html/man/TIFFFieldPassCount.3tiff.html
html/man/TIFFFieldReadCount.3tiff.html
html/man/TIFFFieldTag.3tiff.html
html/man/TIFFFieldWriteCount.3tiff.html
html/man/TIFFFlush.3tiff.html
html/man/TIFFGetField.3tiff.html
html/man/TIFFRGBAImage.3tiff.html
html/man/TIFFReadDirectory.3tiff.html
html/man/TIFFReadEncodedStrip.3tiff.html
html/man/TIFFReadEncodedTile.3tiff.html
html/man/TIFFReadRGBAImage.3tiff.html
html/man/TIFFReadRGBAStrip.3tiff.html
html/man/TIFFReadRGBATile.3tiff.html
html/man/TIFFReadRawStrip.3tiff.html
html/man/TIFFReadRawTile.3tiff.html
html/man/TIFFReadScanline.3tiff.html
html/man/TIFFReadTile.3tiff.html
html/man/TIFFSetDirectory.3tiff.html
html/man/TIFFSetField.3tiff.html
html/man/TIFFWarning.3tiff.html
html/man/TIFFWriteDirectory.3tiff.html
html/man/TIFFWriteEncodedStrip.3tiff.html
html/man/TIFFWriteEncodedTile.3tiff.html
html/man/TIFFWriteRawStrip.3tiff.html
html/man/TIFFWriteRawTile.3tiff.html
html/man/TIFFWriteScanline.3tiff.html
html/man/TIFFWriteTile.3tiff.html
html/man/TIFFbuffer.3tiff.html
html/man/TIFFcodec.3tiff.html
html/man/TIFFcolor.3tiff.html
html/man/TIFFmemory.3tiff.html
html/man/TIFFsize.3tiff.html
html/man/TIFFstrip.3tiff.html
html/man/TIFFswab.3tiff.html
html/man/TIFFtile.3tiff.html
html/man/bmp2tiff.1.html [deleted file]
html/man/fax2ps.1.html
html/man/fax2tiff.1.html
html/man/gif2tiff.1.html [deleted file]
html/man/index.html
html/man/pal2rgb.1.html
html/man/ppm2tiff.1.html
html/man/ras2tiff.1.html [deleted file]
html/man/raw2tiff.1.html
html/man/rgb2ycbcr.1.html
html/man/sgi2tiff.1.html [deleted file]
html/man/thumbnail.1.html
html/man/tiff2bw.1.html
html/man/tiff2pdf.1.html
html/man/tiff2ps.1.html
html/man/tiff2rgba.1.html
html/man/tiffcmp.1.html
html/man/tiffcp.1.html
html/man/tiffcrop.1.html
html/man/tiffdither.1.html
html/man/tiffdump.1.html
html/man/tiffgt.1.html
html/man/tiffinfo.1.html
html/man/tiffmedian.1.html
html/man/tiffset.1.html
html/man/tiffsplit.1.html
html/man/tiffsv.1.html [deleted file]
html/misc.html
html/support.html
html/tools.html
html/v3.4beta007.html
html/v3.4beta016.html
html/v3.4beta018.html
html/v3.4beta024.html
html/v3.4beta028.html
html/v3.4beta029.html
html/v3.4beta031.html
html/v3.4beta032.html
html/v3.4beta033.html
html/v3.4beta034.html
html/v3.4beta035.html
html/v3.4beta036.html
html/v3.5.1.html
html/v3.5.2.html
html/v3.5.3.html
html/v3.5.4.html
html/v3.5.5.html
html/v3.5.6-beta.html
html/v3.5.7.html
html/v3.6.0.html
html/v3.6.1.html
html/v3.7.0.html
html/v3.7.0alpha.html
html/v3.7.0beta.html
html/v3.7.0beta2.html
html/v3.7.1.html
html/v3.7.2.html
html/v3.7.3.html
html/v3.7.4.html
html/v3.8.0.html
html/v3.8.1.html
html/v3.8.2.html
html/v3.9.0beta.html
html/v3.9.1.html
html/v3.9.2.html
html/v4.0.0.html
html/v4.0.1.html
html/v4.0.2.html
html/v4.0.3.html
html/v4.0.4.html
html/v4.0.4beta.html
html/v4.0.5.html
html/v4.0.6.html
html/v4.0.7.html [new file with mode: 0644]
libtiff/Makefile.in
libtiff/libtiff.def
libtiff/tif_aux.c
libtiff/tif_close.c
libtiff/tif_color.c
libtiff/tif_compress.c
libtiff/tif_config.vc.h
libtiff/tif_dir.c
libtiff/tif_dirinfo.c
libtiff/tif_dirread.c
libtiff/tif_dirwrite.c
libtiff/tif_dumpmode.c
libtiff/tif_extension.c
libtiff/tif_fax3.c
libtiff/tif_fax3.h
libtiff/tif_getimage.c
libtiff/tif_jpeg.c
libtiff/tif_jpeg_12.c
libtiff/tif_luv.c
libtiff/tif_lzma.c
libtiff/tif_lzw.c
libtiff/tif_next.c
libtiff/tif_ojpeg.c
libtiff/tif_open.c
libtiff/tif_packbits.c
libtiff/tif_pixarlog.c
libtiff/tif_predict.c
libtiff/tif_predict.h
libtiff/tif_print.c
libtiff/tif_read.c
libtiff/tif_strip.c
libtiff/tif_swab.c
libtiff/tif_thunder.c
libtiff/tif_write.c
libtiff/tif_zip.c
libtiff/tiff.h
libtiff/tiffio.h
libtiff/tiffiop.h
libtiff/tiffvers.h
libtiff/uvcode.h
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
man/CMakeLists.txt
man/Makefile.am
man/Makefile.in
man/TIFFClose.3tiff
man/TIFFDataWidth.3tiff
man/TIFFError.3tiff
man/TIFFFieldDataType.3tiff
man/TIFFFieldName.3tiff
man/TIFFFieldPassCount.3tiff
man/TIFFFieldReadCount.3tiff
man/TIFFFieldTag.3tiff
man/TIFFFieldWriteCount.3tiff
man/TIFFFlush.3tiff
man/TIFFGetField.3tiff
man/TIFFRGBAImage.3tiff
man/TIFFReadDirectory.3tiff
man/TIFFReadEncodedStrip.3tiff
man/TIFFReadEncodedTile.3tiff
man/TIFFReadRGBAImage.3tiff
man/TIFFReadRGBAStrip.3tiff
man/TIFFReadRGBATile.3tiff
man/TIFFReadRawStrip.3tiff
man/TIFFReadRawTile.3tiff
man/TIFFReadScanline.3tiff
man/TIFFReadTile.3tiff
man/TIFFSetDirectory.3tiff
man/TIFFSetField.3tiff
man/TIFFWarning.3tiff
man/TIFFWriteDirectory.3tiff
man/TIFFWriteEncodedStrip.3tiff
man/TIFFWriteEncodedTile.3tiff
man/TIFFWriteRawStrip.3tiff
man/TIFFWriteRawTile.3tiff
man/TIFFWriteScanline.3tiff
man/TIFFWriteTile.3tiff
man/TIFFbuffer.3tiff
man/TIFFcodec.3tiff
man/TIFFcolor.3tiff
man/TIFFmemory.3tiff
man/TIFFsize.3tiff
man/TIFFstrip.3tiff
man/TIFFswab.3tiff
man/TIFFtile.3tiff
man/bmp2tiff.1 [deleted file]
man/fax2ps.1
man/fax2tiff.1
man/gif2tiff.1 [deleted file]
man/libtiff.3tiff
man/pal2rgb.1
man/ppm2tiff.1
man/ras2tiff.1 [deleted file]
man/raw2tiff.1
man/rgb2ycbcr.1
man/sgi2tiff.1 [deleted file]
man/thumbnail.1
man/tiff2bw.1
man/tiff2pdf.1
man/tiff2ps.1
man/tiff2rgba.1
man/tiffcmp.1
man/tiffcp.1
man/tiffcrop.1
man/tiffdither.1
man/tiffdump.1
man/tiffgt.1
man/tiffinfo.1
man/tiffmedian.1
man/tiffset.1
man/tiffsplit.1
man/tiffsv.1 [deleted file]
port/Makefile.in
test/Makefile.am
test/Makefile.in
test/bmp2tiff_palette.sh [deleted file]
test/bmp2tiff_rgb.sh [deleted file]
test/common.sh
test/gif2tiff.sh [deleted file]
test/images/palette-1c-8b.bmp [deleted file]
test/images/palette-1c-8b.gif [deleted file]
test/images/rgb-3c-8b.bmp [deleted file]
tools/CMakeLists.txt
tools/Makefile.am
tools/Makefile.in
tools/Makefile.vc
tools/bmp2tiff.c [deleted file]
tools/fax2tiff.c
tools/gif2tiff.c [deleted file]
tools/ras2tiff.c [deleted file]
tools/rasterfile.h [deleted file]
tools/rgb2ycbcr.c
tools/sgi2tiff.c [deleted file]
tools/sgisv.c [deleted file]
tools/tiff2bw.c
tools/tiff2pdf.c
tools/tiff2rgba.c
tools/tiffcp.c
tools/tiffcrop.c
tools/tiffdump.c
tools/tiffinfo.c
tools/ycbcr.c [deleted file]

index 5b77723..9b9d397 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,485 @@
+2016-11-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       * libtiff 4.0.7 released.
+
+       * configure.ac: Update for 4.0.7 release.
+
+       * tools/tiffdump.c (ReadDirectory): Remove uint32 cast to
+       _TIFFmalloc() argument which resulted in Coverity report.  Added
+       more mutiplication overflow checks.
+
+2016-11-18 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiffcrop.c: Fix memory leak in (recent) error code path.
+       Fixes Coverity 1394415.
+
+2016-11-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       * libtiff/tif_getimage.c: Fix some benign warnings which appear in
+       64-bit compilation under Microsoft Visual Studio of the form
+       "Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit
+       value.  Results might not be an expected value.".  Problem was
+       reported on November 16, 2016 on the tiff mailing list.
+
+2016-11-16 Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_dirread.c: in TIFFFetchNormalTag(), do not dereference
+       NULL pointer when values of tags with TIFF_SETGET_C16_ASCII / TIFF_SETGET_C32_ASCII
+       access are 0-byte arrays.
+       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2593 (regression introduced
+       by previous fix done on 2016-11-11 for CVE-2016-9297).
+       Reported by Henri Salo. Assigned as CVE-2016-9448
+
+2016-11-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       * tools/tiffinfo.c (TIFFReadContigTileData): Fix signed/unsigned
+       comparison warning.
+       (TIFFReadSeparateTileData): Fix signed/unsigned comparison
+       warning.
+
+       * tools/tiffcrop.c (readContigTilesIntoBuffer): Fix
+       signed/unsigned comparison warning.
+
+       * html/v4.0.7.html: Add a file to document the pending 4.0.7
+       release.
+
+2016-11-11 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiff2pdf.c: avoid undefined behaviour related to overlapping
+       of source and destination buffer in memcpy() call in
+       t2p_sample_rgbaa_to_rgb()
+       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2577
+
+2016-11-11 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiff2pdf.c: fix potential integer overflows on 32 bit builds
+       in t2p_read_tiff_size()
+       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2576
+
+2016-11-11 Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_aux.c: fix crash in TIFFVGetFieldDefaulted()
+       when requesting Predictor tag and that the zip/lzw codec is not
+       configured.
+       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2591
+
+2016-11-11 Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_dirread.c: in TIFFFetchNormalTag(), make sure that
+       values of tags with TIFF_SETGET_C16_ASCII / TIFF_SETGET_C32_ASCII
+       access are null terminated, to avoid potential read outside buffer
+       in _TIFFPrintField().
+       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2590 (CVE-2016-9297)
+
+2016-11-11 Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_dirread.c: reject images with OJPEG compression that
+       have no TileOffsets/StripOffsets tag, when OJPEG compression is
+       disabled. Prevent null pointer dereference in TIFFReadRawStrip1()
+       and other functions that expect td_stripbytecount to be non NULL.
+       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2585
+
+2016-11-11 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiffcrop.c: fix multiple uint32 overflows in
+       writeBufferToSeparateStrips(), writeBufferToContigTiles() and
+       writeBufferToSeparateTiles() that could cause heap buffer overflows.
+       Reported by Henri Salo from Nixu Corporation.
+       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2592
+
+2016-11-10 Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_strip.c: make TIFFNumberOfStrips() return the td->td_nstrips
+       value when it is non-zero, instead of recomputing it. This is needed in
+       TIFF_STRIPCHOP mode where td_nstrips is modified. Fixes a read outsize of
+       array in tiffsplit (or other utilities using TIFFNumberOfStrips()).
+       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2587 (CVE-2016-9273)
+
+2016-11-04 Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_predic.c: fix memory leaks in error code paths added in
+       previous commit (fix for MSVR 35105)
+
+2016-10-31 Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_predict.h, libtiff/tif_predict.c:
+       Replace assertions by runtime checks to avoid assertions in debug mode,
+       or buffer overflows in release mode. Can happen when dealing with
+       unusual tile size like YCbCr with subsampling. Reported as MSVR 35105
+       by Axel Souchet & Vishal Chauhan from the MSRC Vulnerabilities & Mitigations
+       team.
+
+2016-10-26 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/fax2tiff.c: fix segfault when specifying -r without
+       argument. Patch by Yuriy M. Kaminskiy.
+       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2572
+
+2016-10-25 Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_dir.c: discard values of SMinSampleValue and
+       SMaxSampleValue when they have been read and the value of
+       SamplesPerPixel is changed afterwards (like when reading a
+       OJPEG compressed image with a missing SamplesPerPixel tag,
+       and whose photometric is RGB or YCbCr, forcing SamplesPerPixel
+       being 3). Otherwise when rewriting the directory (for example
+       with tiffset, we will expect 3 values whereas the array had been
+       allocated with just one), thus causing a out of bound read access.
+       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2500
+       (CVE-2014-8127, duplicate: CVE-2016-3658)
+       
+       * libtiff/tif_dirwrite.c: avoid null pointer dereference on td_stripoffset
+       when writing directory, if FIELD_STRIPOFFSETS was artificially set
+       for a hack case in OJPEG case.
+       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2500
+       (CVE-2014-8127, duplicate: CVE-2016-3658)
+
+2016-10-25 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiffinfo.c: fix out-of-bound read on some tiled images.
+       (http://bugzilla.maptools.org/show_bug.cgi?id=2517)
+
+       * libtiff/tif_compress.c: make TIFFNoDecode() return 0 to indicate an
+       error and make upper level read routines treat it accordingly.
+       (linked to the test case of http://bugzilla.maptools.org/show_bug.cgi?id=2517)
+
+2016-10-14 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiffcrop.c: fix out-of-bound read of up to 3 bytes in
+       readContigTilesIntoBuffer(). Reported as MSVR 35092 by Axel Souchet
+       & Vishal Chauhan from the MSRC Vulnerabilities & Mitigations team.
+
+2016-10-09 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiff2pdf.c: fix write buffer overflow of 2 bytes on JPEG
+       compressed images. Reported by Tyler Bohan of Cisco Talos as
+       TALOS-CAN-0187 / CVE-2016-5652.
+       Also prevents writing 2 extra uninitialized bytes to the file stream.
+
+2016-10-08 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiffcp.c: fix out-of-bounds write on tiled images with odd
+       tile width vs image width. Reported as MSVR 35103
+       by Axel Souchet and Vishal Chauhan from the MSRC Vulnerabilities &
+       Mitigations team.
+
+2016-10-08 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiff2pdf.c: fix read -largely- outsize of buffer in
+       t2p_readwrite_pdf_image_tile(), causing crash, when reading a
+       JPEG compressed image with TIFFTAG_JPEGTABLES length being one.
+       Reported as MSVR 35101 by Axel Souchet and Vishal Chauhan from
+       the MSRC Vulnerabilities & Mitigations team. CVE-2016-9453
+
+2016-10-08 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiffcp.c: fix read of undefined variable in case of missing
+       required tags. Found on test case of MSVR 35100.
+       * tools/tiffcrop.c: fix read of undefined buffer in
+       readContigStripsIntoBuffer() due to uint16 overflow. Probably not a
+       security issue but I can be wrong. Reported as MSVR 35100 by Axel
+       Souchet from the MSRC Vulnerabilities & Mitigations team.
+
+2016-09-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       * html: Change as many remotesensing.org broken links to a working
+       URL as possible.
+
+2016-09-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       * libtiff/tif_getimage.c (TIFFRGBAImageOK): Reject attempts to
+       read floating point images.
+
+       * libtiff/tif_predict.c (PredictorSetup): Enforce bits-per-sample
+       requirements of floating point predictor (3).  Fixes CVE-2016-3622
+       "Divide By Zero in the tiff2rgba tool."
+
+2016-09-23 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiffcrop.c: fix various out-of-bounds write vulnerabilities
+       in heap or stack allocated buffers. Reported as MSVR 35093,
+       MSVR 35096 and MSVR 35097. Discovered by Axel Souchet and Vishal
+       Chauhan from the MSRC Vulnerabilities & Mitigations team.
+       * tools/tiff2pdf.c: fix out-of-bounds write vulnerabilities in
+       heap allocate buffer in t2p_process_jpeg_strip(). Reported as MSVR
+       35098. Discovered by Axel Souchet and Vishal Chauhan from the MSRC
+       Vulnerabilities & Mitigations team.
+       * libtiff/tif_pixarlog.c: fix out-of-bounds write vulnerabilities
+       in heap allocated buffers. Reported as MSVR 35094. Discovered by
+       Axel Souchet and Vishal Chauhan from the MSRC Vulnerabilities &
+       Mitigations team.
+       * libtiff/tif_write.c: fix issue in error code path of TIFFFlushData1()
+       that didn't reset the tif_rawcc and tif_rawcp members. I'm not
+       completely sure if that could happen in practice outside of the odd
+       behaviour of t2p_seekproc() of tiff2pdf). The report points that a
+       better fix could be to check the return value of TIFFFlushData1() in
+       places where it isn't done currently, but it seems this patch is enough.
+       Reported as MSVR 35095. Discovered by Axel Souchet & Vishal Chauhan &
+       Suha Can from the MSRC Vulnerabilities & Mitigations team.
+
+2016-09-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       * html/man/index.html: Comment out links to documentation for
+       abandoned utilities.
+
+2016-09-17 Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_lzma.c: typo fix in comment
+
+2016-09-04 Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/*.c: fix warnings raised by clang 3.9 -Wcomma
+
+2016-09-03 Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_dirwrite.c, libtiff/tif_color.c: fix warnings raised
+       by GCC 5 / clang -Wfloat-conversion
+
+2016-08-16 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiffcrop.c: fix C99'ism.
+
+2016-08-15 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiff2bw.c: fix weight computation that could result of color
+       value overflow (no security implication). Fix bugzilla #2550.
+       Patch by Frank Freudenberg.
+
+2016-08-15 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/rgb2ycbcr.c: validate values of -v and -h parameters to
+       avoid potential divide by zero. Fixes CVE-2016-3623 (bugzilla #2569)
+
+2016-08-15 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiffcrop.c: Fix out-of-bounds write in loadImage().
+       From patch libtiff-CVE-2016-3991.patch from
+       libtiff-4.0.3-25.el7_2.src.rpm by Nikola Forro (bugzilla #2543)
+
+2016-08-15 Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_pixarlog.c: Fix write buffer overflow in PixarLogEncode
+       if more input samples are provided than expected by PixarLogSetupEncode.
+       Idea based on libtiff-CVE-2016-3990.patch from
+       libtiff-4.0.3-25.el7_2.src.rpm by Nikola Forro, but with different and
+       simpler check. (bugzilla #2544)
+
+2016-08-15 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiff2rgba.c: Fix integer overflow in size of allocated
+       buffer, when -b mode is enabled, that could result in out-of-bounds
+       write. Based initially on patch tiff-CVE-2016-3945.patch from
+       libtiff-4.0.3-25.el7_2.src.rpm by Nikola Forro, with correction for
+       invalid tests that rejected valid files. (bugzilla #2545)
+
+2016-07-11 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiffcrop.c: Avoid access outside of stack allocated array
+       on a tiled separate TIFF with more than 8 samples per pixel.
+       Reported by Kaixiang Zhang of the Cloud Security Team, Qihoo 360
+       (CVE-2016-5321 / CVE-2016-5323 , bugzilla #2558 / #2559)
+
+2016-07-10 Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_read.c: Fix out-of-bounds read on
+       memory-mapped files in TIFFReadRawStrip1() and TIFFReadRawTile1()
+       when stripoffset is beyond tmsize_t max value (reported by
+       Mathias Svensson)
+
+2016-07-10 Even Rouault <even.rouault at spatialys.com>
+
+       * tools/tiffdump.c: fix a few misaligned 64-bit reads warned
+       by -fsanitize
+
+2016-07-03 Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_read.c: make TIFFReadEncodedStrip() and
+       TIFFReadEncodedTile() directly use user provided buffer when
+       no compression (and other conditions) to save a memcpy().
+
+       * libtiff/tif_write.c: make TIFFWriteEncodedStrip() and
+       TIFFWriteEncodedTile() directly use user provided buffer when
+       no compression to save a memcpy().
+
+2016-07-01  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_luv.c: validate that for COMPRESSION_SGILOG and
+       PHOTOMETRIC_LOGL, there is only one sample per pixel. Avoid
+       potential invalid memory write on corrupted/unexpected images when
+       using the TIFFRGBAImageBegin() interface (reported by
+       Clay Wood)
+
+2016-06-28  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_pixarlog.c: fix potential buffer write overrun in
+       PixarLogDecode() on corrupted/unexpected images (reported by Mathias Svensson)
+       (CVE-2016-5875)
+
+2016-06-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       * libtiff/libtiff.def: Added _TIFFMultiply32 and _TIFFMultiply64
+       to libtiff.def
+
+2016-06-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       * tools/Makefile.am: The libtiff tools bmp2tiff, gif2tiff,
+       ras2tiff, sgi2tiff, sgisv, and ycbcr are completely removed from
+       the distribution.  The libtiff tools rgb2ycbcr and thumbnail are
+       only built in the build tree for testing.  Old files are put in
+       new 'archive' subdirectory of the source repository, but not in
+       distribution archives.  These changes are made in order to lessen
+       the maintenance burden.
+
+2016-05-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       * libtiff/tif_config.vc.h (HAVE_SNPRINTF): Add a '1' to the
+       HAVE_SNPRINTF definition.'
+
+2016-05-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       * libtiff/tif_config.vc.h (HAVE_SNPRINTF): Applied patch by Edward
+       Lam to define HAVE_SNPRINTF for Visual Studio 2015.
+
+2016-04-27  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_dirread.c: when compiled with DEFER_STRILE_LOAD,
+       fix regression, introduced on 2014-12-23, when reading a one-strip
+       file without a StripByteCounts tag. GDAL #6490
+
+2016-04-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       * html/bugs.html: Replace Andrey Kiselev with Bob Friesenhahn for
+       purposes of security issue reporting.
+
+2016-01-23  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/*: upstream typo fixes (mostly contributed by Kurt Schwehr)
+       coming from GDAL internal libtiff
+
+2016-01-09  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_fax3.h: make Param member of TIFFFaxTabEnt structure
+       a uint16 to reduce size of the binary.
+
+2016-01-03  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_read.c, tif_dirread.c: fix indentation issues raised
+       by GCC 6 -Wmisleading-indentation
+
+2015-12-27  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_pixarlog.c: avoid zlib error messages to pass a NULL
+       string to %s formatter, which is undefined behaviour in sprintf().
+
+2015-12-27  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_next.c: fix potential out-of-bound write in NeXTDecode()
+       triggered by http://lcamtuf.coredump.cx/afl/vulns/libtiff5.tif
+       (bugzilla #2508)
+
+2015-12-27  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_luv.c: fix potential out-of-bound writes in decode
+       functions in non debug builds by replacing assert()s by regular if
+       checks (bugzilla #2522).
+       Fix potential out-of-bound reads in case of short input data.
+
+2015-12-26  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_getimage.c: fix out-of-bound reads in TIFFRGBAImage
+       interface in case of unsupported values of SamplesPerPixel/ExtraSamples
+       for LogLUV / CIELab. Add explicit call to TIFFRGBAImageOK() in
+       TIFFRGBAImageBegin(). Fix CVE-2015-8665 reported by limingxing and
+       CVE-2015-8683 reported by zzf of Alibaba.
+
+2015-12-21  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_dirread.c: workaround false positive warning of Clang Static
+       Analyzer about null pointer dereference in TIFFCheckDirOffset().
+
+2015-12-19  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_fax3.c: remove dead assignment in Fax3PutEOLgdal(). Found
+       by Clang Static Analyzer
+
+2015-12-18  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_dirwrite.c: fix truncation to 32 bit of file offsets in
+       TIFFLinkDirectory() and TIFFWriteDirectorySec() when aligning directory
+       offsets on a even offset (affects BigTIFF). This was a regression of the
+       changeset of 2015-10-19.
+
+2015-12-12  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_write.c: TIFFWriteEncodedStrip() and TIFFWriteEncodedTile()
+       should return -1 in case of failure of tif_encodestrip() as documented
+       * libtiff/tif_dumpmode.c: DumpModeEncode() should return 0 in case of
+       failure so that the above mentionned functions detect the error.
+
+2015-12-06  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/uvcode.h: const'ify uv_code array
+
+2015-12-06  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_dirinfo.c: const'ify tiffFields, exifFields,
+       tiffFieldArray and exifFieldArray arrays
+
+2015-12-06  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_print.c: constify photoNames and orientNames arrays
+
+2015-12-06  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_close.c, libtiff/tif_extension.c : rename link
+       variable to avoid -Wshadow warnings
+
+2015-11-22  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/*.c: fix typos in comments (patch by Kurt Schwehr)
+2015-11-22  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/*.c: fix MSVC warnings related to cast shortening and
+       assignment within conditional expression
+
+2015-11-18  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/*.c: fix clang -Wshorten-64-to-32 warnings
+
+2015-11-18  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_dirread.c: initialize double* data at line 3693 to NULL
+       to please MSVC 2013
+
+2015-11-17  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_dirread.c: prevent reading ColorMap or TransferFunction
+       if BitsPerPixel > 24, so as to avoid huge memory allocation and file
+       read attempts
+
+2015-11-02  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_dirread.c: remove duplicated assignment (reported by
+       Clang static analyzer)
+
+2015-10-28  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_dir.c, libtiff/tif_dirinfo.c, libtiff/tif_compress.c,
+       libtiff/tif_jpeg_12.c: suppress warnings about 'no previous
+       declaration/prototype'
+
+2015-10-19  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tiffiop.h, libtiff/tif_dirwrite.c: suffix constants by U to fix 
+       'warning: negative integer implicitly converted to unsigned type' warning
+       (part of -Wconversion)
+
+2015-10-17  Even Rouault <even.rouault at spatialys.com>
+
+       * libtiff/tif_dir.c, libtiff/tif_dirread.c, libtiff/tif_getimage.c,
+         libtiff/tif_print.c: fix -Wshadow warnings (only in libtiff/)
+
 2015-09-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
 
        * libtiff 4.0.6 released.
index e988c65..c9c0645 100644 (file)
@@ -326,6 +326,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index ae758a7..fb9e3f6 100644 (file)
@@ -1 +1 @@
-20150912
+20161119
diff --git a/VERSION b/VERSION
index d13e837..43beb40 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.0.6
+4.0.7
index 912f83d..69d54d1 100644 (file)
@@ -270,6 +270,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index 5eca4ae..0f0a2da 100644 (file)
@@ -2,11 +2,11 @@
 ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
 ##               by inline-source v2014-01-03.01
 
-# libtool (GNU libtool) 2.4.4
+# libtool (GNU libtool) 2.4.6
 # Provide generalized library-building support services.
 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2015 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -31,8 +31,8 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION=2.4.4
-package_revision=2.4.4
+VERSION=2.4.6
+package_revision=2.4.6
 
 
 ## ------ ##
@@ -64,12 +64,12 @@ package_revision=2.4.4
 # libraries, which are installed to $pkgauxdir.
 
 # Set a version string for this script.
-scriptversion=2014-01-03.01; # UTC
+scriptversion=2015-01-20.17; # UTC
 
 # General shell script boiler plate, and helper functions.
 # Written by Gary V. Vaughan, 2004
 
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2015 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -192,7 +192,7 @@ func_path_progs ()
 
     _G_path_prog_max=0
     _G_path_prog_found=false
-    _G_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
     for _G_dir in $_G_PATH; do
       IFS=$_G_save_IFS
       test -z "$_G_dir" && _G_dir=.
@@ -1375,7 +1375,7 @@ scriptversion=2014-01-07.03; # UTC
 # A portable, pluggable option parser for Bourne shell.
 # Written by Gary V. Vaughan, 2010
 
-# Copyright (C) 2010-2014 Free Software Foundation, Inc.
+# Copyright (C) 2010-2015 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -1977,7 +1977,7 @@ func_version ()
 # End:
 
 # Set a version string.
-scriptversion='(GNU libtool) 2.4.4'
+scriptversion='(GNU libtool) 2.4.6'
 
 
 # func_echo ARG...
@@ -2039,7 +2039,12 @@ usage_message="Options:
 "
 
 # Additional text appended to 'usage_message' in response to '--help'.
-long_help_message=$long_help_message"
+func_help ()
+{
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message
 
 MODE must be one of the following:
 
@@ -2063,13 +2068,15 @@ include the following information:
        compiler:       $LTCC
        compiler flags: $LTCFLAGS
        linker:         $LD (gnu? $with_gnu_ld)
-       version:        $progname (GNU libtool) 2.4.4
+       version:        $progname (GNU libtool) 2.4.6
        automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
        autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
 
 Report bugs to <bug-libtool@gnu.org>.
 GNU libtool home page: <http://www.gnu.org/software/libtool/>.
 General help using GNU software: <http://www.gnu.org/gethelp/>."
+    exit 0
+}
 
 
 # func_lo2o OBJECT-NAME
@@ -6461,6 +6468,24 @@ func_win32_import_lib_p ()
     esac
 }
 
+# func_suncc_cstd_abi
+# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
+# Several compiler flags select an ABI that is incompatible with the
+# Cstd library. Avoid specifying it if any are in CXXFLAGS.
+func_suncc_cstd_abi ()
+{
+    $debug_cmd
+
+    case " $compile_command " in
+    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
+      suncc_use_cstd_abi=no
+      ;;
+    *)
+      suncc_use_cstd_abi=yes
+      ;;
+    esac
+}
+
 # func_mode_link arg...
 func_mode_link ()
 {
@@ -7437,6 +7462,9 @@ func_mode_link ()
     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
 
+    # Definition is injected by LT_CONFIG during libtool generation.
+    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
+
     func_dirname "$output" "/" ""
     output_objdir=$func_dirname_result$objdir
     func_to_tool_file "$output_objdir/"
@@ -8599,6 +8627,37 @@ func_mode_link ()
          eval $var=\"$tmp_libs\"
        done # for var
       fi
+
+      # Add Sun CC postdeps if required:
+      test CXX = "$tagname" && {
+        case $host_os in
+        linux*)
+          case `$CC -V 2>&1 | sed 5q` in
+          *Sun\ C*) # Sun C++ 5.9
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+
+        solaris*)
+          func_cc_basename "$CC"
+          case $func_cc_basename_result in
+          CC* | sunCC*)
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+        esac
+      }
+
       # Last step: remove runtime libs from dependency_libs
       # (they stay in deplibs)
       tmp_libs=
index 0960c0d..db23694 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for LibTIFF Software 4.0.6.
+# Generated by GNU Autoconf 2.69 for LibTIFF Software 4.0.7.
 #
 # Report bugs to <tiff@lists.maptools.org>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='LibTIFF Software'
 PACKAGE_TARNAME='tiff'
-PACKAGE_VERSION='4.0.6'
-PACKAGE_STRING='LibTIFF Software 4.0.6'
+PACKAGE_VERSION='4.0.7'
+PACKAGE_STRING='LibTIFF Software 4.0.7'
 PACKAGE_BUGREPORT='tiff@lists.maptools.org'
 PACKAGE_URL=''
 
@@ -675,6 +675,7 @@ ac_ct_CXX
 CXXFLAGS
 CXX
 CPP
+LT_SYS_LIBRARY_PATH
 OTOOL64
 OTOOL
 LIPO
@@ -860,6 +861,7 @@ CFLAGS
 LDFLAGS
 LIBS
 CPPFLAGS
+LT_SYS_LIBRARY_PATH
 CPP
 CXX
 CXXFLAGS
@@ -1406,7 +1408,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures LibTIFF Software 4.0.6 to adapt to many kinds of systems.
+\`configure' configures LibTIFF Software 4.0.7 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1480,7 +1482,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of LibTIFF Software 4.0.6:";;
+     short | recursive ) echo "Configuration of LibTIFF Software 4.0.7:";;
    esac
   cat <<\_ACEOF
 
@@ -1592,6 +1594,8 @@ Some influential environment variables:
   LIBS        libraries to pass to the linker, e.g. -l<library>
   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
+  LT_SYS_LIBRARY_PATH
+              User-defined run-time library search path.
   CPP         C preprocessor
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
@@ -1664,7 +1668,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-LibTIFF Software configure 4.0.6
+LibTIFF Software configure 4.0.7
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2437,7 +2441,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by LibTIFF Software $as_me 4.0.6, which was
+It was created by LibTIFF Software $as_me 4.0.7, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3380,7 +3384,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='tiff'
- VERSION='4.0.6'
+ VERSION='4.0.7'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3584,13 +3588,13 @@ fi
 
 LIBTIFF_MAJOR_VERSION=4
 LIBTIFF_MINOR_VERSION=0
-LIBTIFF_MICRO_VERSION=6
+LIBTIFF_MICRO_VERSION=7
 LIBTIFF_ALPHA_VERSION=
 LIBTIFF_VERSION=$LIBTIFF_MAJOR_VERSION.$LIBTIFF_MINOR_VERSION.$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION
 LIBTIFF_RELEASE_DATE=`date +"%Y%m%d"`
 
 LIBTIFF_CURRENT=7
-LIBTIFF_REVISION=4
+LIBTIFF_REVISION=5
 LIBTIFF_AGE=2
 LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE
 
@@ -4884,8 +4888,8 @@ esac
 
 
 
-macro_version='2.4.4'
-macro_revision='2.4.4'
+macro_version='2.4.6'
+macro_revision='2.4.6'
 
 
 
@@ -7219,6 +7223,21 @@ $as_echo "$lt_cv_truncate_bin" >&6; }
 
 
 
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
 # Check whether --enable-libtool-lock was given.
 if test "${enable_libtool_lock+set}" = set; then :
   enableval=$enable_libtool_lock;
@@ -8226,6 +8245,41 @@ $as_echo "$lt_cv_ld_force_load" >&6; }
     ;;
   esac
 
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -9111,15 +9165,8 @@ test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
 test -z "$LD" && LD=ld
 test -z "$ac_objext" && ac_objext=o
 
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
 
 
 # Only perform the check for file, if the check method requires it
@@ -11578,6 +11625,8 @@ hardcode_into_libs=no
 # flags to be left without arguments
 need_version=unknown
 
+
+
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
@@ -11866,6 +11915,7 @@ freebsd* | dragonfly*)
   case $version_type in
     freebsd-elf*)
       library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;
@@ -11925,10 +11975,11 @@ hpux9* | hpux10* | hpux11*)
     soname_spec='$libname$release$shared_ext$major'
     if test 32 = "$HPUX_IA64_MODE"; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
     fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
   hppa*64*)
     shrext_cmds='.sl'
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
 if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
   sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
 fi
+
 if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
   sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
 fi
 
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+
+
+
+
+
 
 
 
@@ -13725,15 +13796,8 @@ $RM -r conftest*
   CFLAGS=$CXXFLAGS
   compiler=$CC
   compiler_CXX=$CC
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+  func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
 
 
   if test -n "$compiler"; then
@@ -15120,51 +15184,6 @@ interix[3-9]*)
   postdep_objects_CXX=
   postdeps_CXX=
   ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test yes != "$solaris_use_stlport4"; then
-      postdeps_CXX='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC* | sunCC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test yes != "$solaris_use_stlport4"; then
-      postdeps_CXX='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
 esac
 
 
@@ -15988,6 +16007,8 @@ hardcode_into_libs=no
 # flags to be left without arguments
 need_version=unknown
 
+
+
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
@@ -16274,6 +16295,7 @@ freebsd* | dragonfly*)
   case $version_type in
     freebsd-elf*)
       library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;
@@ -16333,10 +16355,11 @@ hpux9* | hpux10* | hpux11*)
     soname_spec='$libname$release$shared_ext$major'
     if test 32 = "$HPUX_IA64_MODE"; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
     fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
   hppa*64*)
     shrext_cmds='.sl'
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
 if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
   sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
 fi
+
 if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
   sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
 fi
 
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+
+
 
 
 
@@ -21460,7 +21500,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by LibTIFF Software $as_me 4.0.6, which was
+This file was extended by LibTIFF Software $as_me 4.0.7, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21526,7 +21566,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-LibTIFF Software config.status 4.0.6
+LibTIFF Software config.status 4.0.7
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -21783,7 +21823,8 @@ finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
 finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
 hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
 sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
+configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
 hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
 enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
 enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
@@ -21987,7 +22028,8 @@ postinstall_cmds \
 postuninstall_cmds \
 finish_cmds \
 sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec \
+configure_time_dlsearch_path \
+configure_time_lt_sys_library_path \
 reload_cmds_CXX \
 old_archive_cmds_CXX \
 old_archive_from_new_cmds_CXX \
@@ -22797,6 +22839,9 @@ $as_echo X"$file" |
 # The names of the tagged configurations supported by this script.
 available_tags='CXX '
 
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
 # ### BEGIN LIBTOOL CONFIG
 
 # Which release of libtool.m4 was used?
@@ -23049,8 +23094,11 @@ hardcode_into_libs=$hardcode_into_libs
 # Compile-time system search path for libraries.
 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
-# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+# Detected run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
+
+# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
+configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
 
 # Whether dlopen is supported.
 dlopen_support=$enable_dlopen
@@ -23215,6 +23263,65 @@ compiler_lib_search_path=$lt_compiler_lib_search_path
 
 _LT_EOF
 
+    cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
   case $host_os in
   aix3*)
     cat <<\_LT_EOF >> "$cfgfile"
index 33ffb0d..23d543c 100644 (file)
@@ -25,7 +25,7 @@ dnl OF THIS SOFTWARE.
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.64)
-AC_INIT([LibTIFF Software],[4.0.6],[tiff@lists.maptools.org],[tiff])
+AC_INIT([LibTIFF Software],[4.0.7],[tiff@lists.maptools.org],[tiff])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_MACRO_DIR(m4)
 AC_LANG(C)
@@ -41,7 +41,7 @@ dnl Versioning.
 dnl Don't fill the ALPHA_VERSION field, if not applicable.
 LIBTIFF_MAJOR_VERSION=4
 LIBTIFF_MINOR_VERSION=0
-LIBTIFF_MICRO_VERSION=6
+LIBTIFF_MICRO_VERSION=7
 LIBTIFF_ALPHA_VERSION=
 LIBTIFF_VERSION=$LIBTIFF_MAJOR_VERSION.$LIBTIFF_MINOR_VERSION.$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION
 dnl This will be used with the 'make release' target
@@ -77,7 +77,7 @@ dnl     increment age.
 dnl  6. If any interfaces have been removed since the last public release,
 dnl     then set age to 0.                                
 LIBTIFF_CURRENT=7
-LIBTIFF_REVISION=4
+LIBTIFF_REVISION=5
 LIBTIFF_AGE=2
 LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE
 
index e7eab07..1d1d029 100644 (file)
@@ -269,6 +269,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index 965538c..24c604e 100644 (file)
@@ -260,6 +260,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index b8ecf5c..e3503e1 100644 (file)
@@ -313,6 +313,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index 78607e5..08993c4 100644 (file)
@@ -212,6 +212,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index 31a68d7..0ee5ad3 100644 (file)
@@ -259,6 +259,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index 0ac42ef..0a3b840 100644 (file)
@@ -209,6 +209,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index e5349eb..29e48aa 100644 (file)
@@ -209,6 +209,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index 5eb9312..67075ac 100644 (file)
@@ -209,6 +209,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index a72e6d4..a7e314c 100644 (file)
@@ -209,6 +209,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index 866c2dd..ec8302c 100644 (file)
@@ -209,6 +209,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index 7515feb..4780578 100644 (file)
@@ -209,6 +209,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index 07f4f87..01549ba 100644 (file)
@@ -83,7 +83,8 @@ docfiles = \
        v4.0.4beta.html \
        v4.0.4.html \
        v4.0.5.html \
-       v4.0.6.html
+       v4.0.6.html \
+       v4.0.7.html
 
 dist_doc_DATA = $(docfiles)
 
index 4e6398f..3cb22e6 100644 (file)
@@ -301,6 +301,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -445,7 +446,8 @@ docfiles = \
        v4.0.4beta.html \
        v4.0.4.html \
        v4.0.5.html \
-       v4.0.6.html
+       v4.0.6.html \
+       v4.0.7.html
 
 dist_doc_DATA = $(docfiles)
 SUBDIRS = images man
index 452821c..4e89205 100644 (file)
@@ -285,7 +285,7 @@ is room for, just increase <TT>FIELD_SETLONGS</TT> at the top of
 
 <HR>
 
-Last updated: $Date: 2004/09/10 14:43:18 $
+Last updated: $Date: 2016-09-25 20:05:44 $
 
 </BODY>
 
index 2ff4873..07fc78b 100644 (file)
@@ -31,9 +31,9 @@ If you'd like to enter a new bug, you can do so at
 If you'd like to inform us about some kind of security issue that should not
 be disclosed for a period of time, then you can contact maintainers directly.
 Send a copies of your report to the following people: Frank Warmerdam
-<a href="mailto:warmerdam@pobox.com">&lt;warmerdam@pobox.com&gt;</a>,
-Andrey Kiselev
-<a href="mailto:dron@ak4719.spb.edu">&lt;dron@ak4719.spb.edu&gt;</a>.
+<a href="mailto:warmerdam@pobox.com">&lt;warmerdam@pobox.com&gt;</a> and
+Bob Friesenhahn
+<a href="mailto:bfriesen@simple.dallas.tx.us">&lt;bfriesen@simple.dallas.tx.us&gt;</a>.
 <P>
 
 Of course, reporting bugs is no substitute for discussion.  The 
@@ -56,6 +56,6 @@ Systems</a>. <p>
 
 <HR>
 
-Last updated: $Date: 2015-01-05 19:49:37 $
+Last updated: $Date: 2016-04-08 02:34:03 $
 </BODY>
 </HTML>
index d138900..f20a1cb 100644 (file)
@@ -203,7 +203,7 @@ their authors.
 <P>
 <HR>
 
-Last updated: $Date: 2006/01/03 01:42:30 $
+Last updated: $Date: 2016-09-25 20:05:44 $
 
 </BODY>
 </HTML>
index 73fc8af..936635b 100644 (file)
@@ -14,8 +14,8 @@ TIFF Documentation
 <P>
 A copy of the 6.0 specification is available from Adobe at
 <A HREF="http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf">http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf</A>, or from the libtiff
-ftp site at <a href="ftp://ftp.remotesensing.org/pub/libtiff/doc/TIFF6.pdf">
-ftp://ftp.remotesensing.org/pub/libtiff/doc/TIFF6.pdf</A>.<p>
+ftp site at <a href="ftp://download.osgeo.org/libtiff/doc/TIFF6.pdf">
+ftp://download.osgeo.org/libtiff/doc/TIFF6.pdf</A>.<p>
 
 <P>
 Draft <a href="TIFFTechNote2.html">TIFF Technical Note #2</A> covers problems 
@@ -45,7 +45,7 @@ a TIFF variation supporting files larger than 4GB.
 <HR>
 
 <ADDRESS>
- Last updated: $Date: 2006/07/10 18:13:52 $
+ Last updated: $Date: 2016-09-25 20:05:44 $
 </ADDRESS>
 
 </BODY>
index 150ed0c..b2c5664 100644 (file)
@@ -22,8 +22,8 @@ the same directory as this software.
 
 <P>
 The latest archive of test images is located at
-<A HREF="ftp://ftp.remotesensing.org/pub/libtiff/pics-3.8.0.tar.gz">
-ftp://ftp.remotesensing.org/pub/libtiff/pics-3.8.0.tar.gz</A>
+<A HREF="ftp://download.osgeo.org/libtiff/pics-3.8.0.tar.gz">
+ftp://download.osgeo.org/libtiff/pics-3.8.0.tar.gz</A>
 
 <P>
 There are two other good sources for TIFF test images:
@@ -35,7 +35,7 @@ of images with different storage characteristics.
 <P>
 <HR>
 
-Last updated: $Date: 2006/01/02 23:50:44 $
+Last updated: $Date: 2016-09-25 20:05:44 $
 
 </BODY>
 </HTML>
index b505d31..80b74bf 100644 (file)
@@ -240,6 +240,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index 2f0c55e..71af0af 100644 (file)
   <hr>
   <table cellspacing="0" cellpadding="0" border="0">
     <tr>
-      <th>Home Page</th>
-      <td><a href="http://www.remotesensing.org/libtiff/" title="Home of the LibTIFF software">http://www.remotesensing.org/libtiff/</a></td>
+      <th>Home Page #1</th>
+      <td><a href="http://www.simplesystems.org/libtiff/" title="Home of the LibTIFF software">http://www.simplesystems.org/libtiff/</a></td>
     </tr>
     <tr>
-      <th>Home Page Mirror</th>
+      <th>Home Page #2</th>
       <td><a href="http://libtiff.maptools.org/" title="Mirror of the LibTIFF software">http://libtiff.maptools.org/</a></td>
     </tr>
     <tr>
       <th>Latest Stable Release</th>
-      <td><a href="v4.0.6.html">v4.0.6</a></td>
+      <td><a href="v4.0.7.html">v4.0.7</a></td>
     </tr>
     <tr>
       <th>Master Download Site</th>
-      <td><a href="http://download.osgeo.org/libtiff">download.osgeo.org</a>, directory libtiff</td>
-    </tr>
-    <tr>
-      <th>Windows Binaries</th>
-      <td><a href="http://gnuwin32.sourceforge.net/packages/libtiff.htm">GnuWin32 Project</a></td>
+      <td><a href="ftp://download.osgeo.org/libtiff">download.osgeo.org</a>, directory libtiff</td>
     </tr>
     <tr>
       <th>Mailing List</th>
@@ -75,7 +71,8 @@
     machines.
   </p>
   <p>
-    The software was originally authored and maintained by Sam Leffler.
+    The software was originally authored and maintained by Sam Leffler
+    but has been maintained by a cast of others since 1999.
   </p>
   <p>
     Questions should be sent to the TIFF mailing list:
@@ -89,7 +86,7 @@
     <a href="http://pobox.com/~warmerdam">Frank Warmerdam</a>,
     <a href="mailto:dron@ak4719.spb.edu">Andrey Kiselev</a>,
     <a href="mailto:bfriesen@GraphicsMagick.org">Bob Friesenhahn</a>, 
-    Joris Van Damme and Lee Howard.
+    Joris Van Damme, Lee Howard and Even Rouault.
   </p>
   <p>
     The following sections are included in this documentation:
   </ul>
   <hr>
   <p>
-    Last updated  $Date: 2015-09-12 19:46:25 $.
+    Last updated  $Date: 2016-09-25 20:05:44 $.
   </p>
 </body>
 </html>
index 3cc9673..8d94e5c 100644 (file)
@@ -565,7 +565,7 @@ the portability of your TIFF files.
 <P>
 <HR>
 
-Last updated: $Date: 2004/09/10 14:47:31 $
+Last updated: $Date: 2016-09-25 20:05:44 $
 
 </BODY>
 
index 61c01d4..83902f6 100644 (file)
@@ -62,7 +62,7 @@ application.
 <P>
 <HR>
 
-Last updated: $Date: 1999/08/09 20:21:21 $
+Last updated: $Date: 2016-09-25 20:05:44 $
 
 </BODY>
 </HTML>
index 6a2c42e..b1de7a2 100644 (file)
@@ -45,7 +45,7 @@
     to the capabilities of the library; it is not an attempt to describe
     everything a developer needs to know about the library or about TIFF.
     Detailed information on the interfaces to the library are given in
-    the <a href="http://www.remotesensing.org/libtiff/man/index.html">UNIX 
+    the <a href="http://www.simplesystems.org/libtiff/man/index.html">UNIX 
     manual pages</a> that accompany this software.
   </p>
   <p>
   </p>
   <hr>
   <p>
-    Last updated: $Date: 2005/12/28 06:53:18 $
+    Last updated: $Date: 2016-09-25 20:05:44 $
   </p>
 </body>
 </html>
index f7c98ac..cb92ea2 100644 (file)
@@ -69,16 +69,12 @@ set(docfiles
     TIFFWriteRawTile.3tiff.html
     TIFFWriteScanline.3tiff.html
     TIFFWriteTile.3tiff.html
-    bmp2tiff.1.html
     fax2ps.1.html
     fax2tiff.1.html
-    gif2tiff.1.html
     pal2rgb.1.html
     ppm2tiff.1.html
-    ras2tiff.1.html
     raw2tiff.1.html
     rgb2ycbcr.1.html
-    sgi2tiff.1.html
     thumbnail.1.html
     tiff2bw.1.html
     tiff2pdf.1.html
@@ -93,8 +89,7 @@ set(docfiles
     tiffinfo.1.html
     tiffmedian.1.html
     tiffset.1.html
-    tiffsplit.1.html
-    tiffsv.1.html)
+    tiffsplit.1.html)
 
 set(doc_DATA ${indexfile} ${docfiles})
 
index 175067e..587296c 100644 (file)
@@ -76,16 +76,12 @@ docfiles = \
        TIFFWriteRawTile.3tiff.html \
        TIFFWriteScanline.3tiff.html \
        TIFFWriteTile.3tiff.html \
-       bmp2tiff.1.html \
        fax2ps.1.html \
        fax2tiff.1.html \
-       gif2tiff.1.html \
        pal2rgb.1.html \
        ppm2tiff.1.html \
-       ras2tiff.1.html \
        raw2tiff.1.html \
        rgb2ycbcr.1.html \
-       sgi2tiff.1.html \
        thumbnail.1.html \
        tiff2bw.1.html \
        tiff2pdf.1.html \
@@ -100,8 +96,7 @@ docfiles = \
        tiffinfo.1.html \
        tiffmedian.1.html \
        tiffset.1.html \
-       tiffsplit.1.html \
-       tiffsv.1.html
+       tiffsplit.1.html
 
 dist_doc_DATA = $(indexfile) $(docfiles)
 
index 30e4113..7f4648c 100644 (file)
@@ -240,6 +240,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -377,16 +378,12 @@ docfiles = \
        TIFFWriteRawTile.3tiff.html \
        TIFFWriteScanline.3tiff.html \
        TIFFWriteTile.3tiff.html \
-       bmp2tiff.1.html \
        fax2ps.1.html \
        fax2tiff.1.html \
-       gif2tiff.1.html \
        pal2rgb.1.html \
        ppm2tiff.1.html \
-       ras2tiff.1.html \
        raw2tiff.1.html \
        rgb2ycbcr.1.html \
-       sgi2tiff.1.html \
        thumbnail.1.html \
        tiff2bw.1.html \
        tiff2pdf.1.html \
@@ -401,8 +398,7 @@ docfiles = \
        tiffinfo.1.html \
        tiffmedian.1.html \
        tiffset.1.html \
-       tiffsplit.1.html \
-       tiffsv.1.html
+       tiffsplit.1.html
 
 dist_doc_DATA = $(indexfile) $(docfiles)
 INDEXSTART = '<HTML><HEAD><TITLE>Libtiff HTML manpage index</TITLE></HEAD><BODY BGCOLOR=white><ul><H2>Man Pages</h2><p>'
index 720ca32..908dcc7 100644 (file)
@@ -79,7 +79,7 @@ warning messages are directed to the
 <p><b>libtiff</b>(3TIFF), <b>TIFFOpen</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 575e3cb..9eede06 100644 (file)
@@ -90,7 +90,7 @@ supplied.</p>
 <p><b>libtiff</b>(3TIFF),</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 721cec7..cd30c7e 100644 (file)
@@ -98,7 +98,7 @@ previous error handling function.</p>
 <b>printf</b>(3)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index d6a463f..2270a5c 100644 (file)
@@ -83,7 +83,7 @@ returns a member of the enum type <b>TIFFDataType</b>.</p>
 <p style="margin-left:11%; margin-top: 1em"><b>libtiff</b>(3TIFF),</p>
 
 <p style="margin-left:11%; margin-top: 1em">Libtiff library
-home page: <b>http://www.remotesensing.org/libtiff/</b></p>
+home page: <b>http://www.simplesystems.org/libtiff/</b></p>
 <hr>
 </body>
 </html>
index b270d4a..df4ee50 100644 (file)
@@ -80,7 +80,7 @@ returns a constant C string.</p>
 <p style="margin-left:11%; margin-top: 1em"><b>libtiff</b>(3TIFF),</p>
 
 <p style="margin-left:11%; margin-top: 1em">Libtiff library
-home page: <b>http://www.remotesensing.org/libtiff/</b></p>
+home page: <b>http://www.simplesystems.org/libtiff/</b></p>
 <hr>
 </body>
 </html>
index 480f736..5dc3126 100644 (file)
@@ -92,7 +92,7 @@ returns an integer that is always 1 (true) or 0 (false).</p>
 <p style="margin-left:11%; margin-top: 1em"><b>libtiff</b>(3TIFF),</p>
 
 <p style="margin-left:11%; margin-top: 1em">Libtiff library
-home page: <b>http://www.remotesensing.org/libtiff/</b></p>
+home page: <b>http://www.simplesystems.org/libtiff/</b></p>
 <hr>
 </body>
 </html>
index c77d4d3..d800a86 100644 (file)
@@ -95,7 +95,7 @@ returns an integer.</p>
 <p style="margin-left:11%; margin-top: 1em"><b>libtiff</b>(3TIFF),</p>
 
 <p style="margin-left:11%; margin-top: 1em">Libtiff library
-home page: <b>http://www.remotesensing.org/libtiff/</b></p>
+home page: <b>http://www.simplesystems.org/libtiff/</b></p>
 <hr>
 </body>
 </html>
index d1cc04a..b1fdea0 100644 (file)
@@ -82,7 +82,7 @@ returns an integer tag value.</p>
 <p style="margin-left:11%; margin-top: 1em"><b>libtiff</b>(3TIFF),</p>
 
 <p style="margin-left:11%; margin-top: 1em">Libtiff library
-home page: <b>http://www.remotesensing.org/libtiff/</b></p>
+home page: <b>http://www.simplesystems.org/libtiff/</b></p>
 <hr>
 </body>
 </html>
index d72a8e3..0d446bc 100644 (file)
@@ -102,7 +102,7 @@ returns an integer.</p>
 <p style="margin-left:11%; margin-top: 1em"><b>libtiff</b>(3TIFF),</p>
 
 <p style="margin-left:11%; margin-top: 1em">Libtiff library
-home page: <b>http://www.remotesensing.org/libtiff/</b></p>
+home page: <b>http://www.simplesystems.org/libtiff/</b></p>
 <hr>
 </body>
 </html>
index 742f3ae..77782e6 100644 (file)
@@ -105,7 +105,7 @@ returned.</p>
 <b>libtiff</b>(3TIFF),</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index bd2f78b..cbbb8be 100644 (file)
@@ -1963,7 +1963,7 @@ field, tag 0x%x</b>. An unknown tag was supplied.</p>
 <b>TIFFWriteDirectory</b>(3TIFF) <b>libtiff</b>(3TIFF),</p>
 
 <p style="margin-left:11%; margin-top: 1em">Libtiff library
-home page: <b>http://www.remotesensing.org/libtiff/</b></p>
+home page: <b>http://www.simplesystems.org/libtiff/</b></p>
 <hr>
 </body>
 </html>
index 08a9924..83581f1 100644 (file)
@@ -311,7 +311,7 @@ insufficient memory to allocate a table used to map data to
 <b>TIFFReadRGBATile</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 82350ad..1e32f7c 100644 (file)
@@ -210,7 +210,7 @@ size.</big></p>
 <b>libtiff</b>(3TIFF)</big></p>
 <!-- INDENTATION -->
 <p><big>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></big></p>
+<b>http://www.simplesystems.org/libtiff/</b></big></p>
 </td>
 </table>
 <hr>
index d5c4c15..c942063 100644 (file)
@@ -125,7 +125,7 @@ returns &minus;1 if an error was encountered.</big></p>
 <b>libtiff</b>(3TIFF)</big></p>
 <!-- INDENTATION -->
 <p><big>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></big></p>
+<b>http://www.simplesystems.org/libtiff/</b></big></p>
 </td>
 </table>
 <hr>
index b42dc09..92eb72a 100644 (file)
@@ -122,7 +122,7 @@ opposite to the native machine byte order,</p>
 <b>TIFFReadTile</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 1ebb09b..f648f09 100644 (file)
@@ -293,7 +293,7 @@ insufficient memory to allocate a table used to map data to
 <b>TIFFReadRGBATile</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 37d36d3..3358df7 100644 (file)
@@ -200,7 +200,7 @@ insufficient memory to allocate a table used to map data to
 <b>TIFFReadRGBATile</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 6bd298a..bdbb43c 100644 (file)
@@ -253,7 +253,7 @@ insufficient memory to allocate a table used to map data to
 <b>TIFFReadRGBAStrip</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 4dd1fbc..4fe1a99 100644 (file)
@@ -101,7 +101,7 @@ typically be at least as large as the number returned by
 <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index e74295b..0065d2c 100644 (file)
@@ -103,7 +103,7 @@ typically be at least as large as the value returned by
 <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index e825e4c..79f17fc 100644 (file)
@@ -149,7 +149,7 @@ interfaces to read these formats.</p>
 <b>TIFFReadRawStrip</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index be245f8..2605480 100644 (file)
@@ -125,7 +125,7 @@ returned.</p>
 <b>TIFFReadRawTile</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 9047b0b..c343405 100644 (file)
@@ -114,7 +114,7 @@ file.</p>
 <i>TIFFWriteDirectory</i>(3TIFF), <i>libtiff</i>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index f160fed..ce6a88b 100644 (file)
@@ -1859,7 +1859,7 @@ for the named tag.</p>
 <b>TIFFReadDirectory</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
 
 <p style="margin-left:11%; margin-top: 1em">Libtiff library
-home page: <b>http://www.remotesensing.org/libtiff/</b></p>
+home page: <b>http://www.simplesystems.org/libtiff/</b></p>
 <hr>
 </body>
 </html>
index 18f2e8b..856cd40 100644 (file)
@@ -100,7 +100,7 @@ previous error handling function.</p>
 <b>printf</b>(3)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 1e72a5b..9aff8c4 100644 (file)
@@ -168,7 +168,7 @@ the directory that is being written.</p>
 <b>TIFFSetDirectory</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 3b90199..cf7a488 100644 (file)
@@ -145,7 +145,7 @@ and byte counts.</big></p>
 <b>libtiff</b>(3TIFF)</big></p>
 <!-- INDENTATION -->
 <p><big>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></big></p>
+<b>http://www.simplesystems.org/libtiff/</b></big></p>
 </td>
 </table>
 <hr>
index 5e85f6d..8cd4411 100644 (file)
@@ -139,7 +139,7 @@ byte counts.</big></p>
 <b>libtiff</b>(3TIFF)</big></p>
 <!-- INDENTATION -->
 <p><big>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></big></p>
+<b>http://www.simplesystems.org/libtiff/</b></big></p>
 </td>
 </table>
 <hr>
index 9a3ef0c..3379b8b 100644 (file)
@@ -136,7 +136,7 @@ specified image dimensions.</p>
 <b>TIFFWriteScanline</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 639af6c..92d64f0 100644 (file)
@@ -120,7 +120,7 @@ specified image dimensions.</p>
 <b>TIFFWriteScanline</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 4c68f9d..8f30021 100644 (file)
@@ -198,7 +198,7 @@ block-interleaved samples.</p>
 <b>TIFFWriteRawStrip</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 6f6ffd2..d450ee1 100644 (file)
@@ -107,7 +107,7 @@ returned.</p>
 <b>TIFFWriteRawTile</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 09009b5..d96621d 100644 (file)
@@ -108,7 +108,7 @@ allocate space for a data buffer.</p>
 <p><b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index d200754..e18c0ed 100644 (file)
@@ -108,7 +108,7 @@ schemes.</p>
 <p><b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index edf423b..e598ae6 100644 (file)
@@ -967,7 +967,7 @@ _TIFFfree(cielab);</p></td>
 <p><b>TIFFRGBAImage</b>(3TIFF) <b>libtiff</b>(3TIFF),</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index c3f38e0..39fa789 100644 (file)
@@ -102,7 +102,7 @@ repsectively.</p>
 <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 5a14254..f2e2b77 100644 (file)
@@ -87,7 +87,7 @@ planes.</p>
 <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index b8bc7c6..ae6b790 100644 (file)
@@ -121,7 +121,7 @@ the image.</p>
 <b>TIFFWriteRawStrip</b>(3TIFF), <b>libtiff</b>(3TIFF),</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 80d1db4..3f7ebfe 100644 (file)
@@ -102,7 +102,7 @@ table that can be used as an <i>identity function</i>; i.e.
 <p><b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index addeb51..b69cc91 100644 (file)
@@ -133,7 +133,7 @@ the image.</p>
 <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
diff --git a/html/man/bmp2tiff.1.html b/html/man/bmp2tiff.1.html
deleted file mode 100644 (file)
index 1104a49..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-<!-- Creator     : groff version 1.18.1 -->
-<!-- CreationDate: Sun Mar  6 13:59:56 2005 -->
-<html>
-<head>
-<meta name="generator" content="groff -Thtml, see www.gnu.org">
-<meta name="Content-Style" content="text/css">
-<title>BMP2TIFF</title>
-</head>
-<body>
-
-<h1 align=center>BMP2TIFF</h1>
-<a href="#NAME">NAME</a><br>
-<a href="#SYNOPSIS">SYNOPSIS</a><br>
-<a href="#DESCRIPTION">DESCRIPTION</a><br>
-<a href="#OPTIONS">OPTIONS</a><br>
-<a href="#SEE ALSO">SEE ALSO</a><br>
-
-<hr>
-<a name="NAME"></a>
-<h2>NAME</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p>bmp2tiff &minus; create a <small>TIFF</small> file from a
-Microsoft Windows Device Independent Bitmap image file</p>
-</td>
-</table>
-<a name="SYNOPSIS"></a>
-<h2>SYNOPSIS</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><b>bmp2tiff</b> [ <i>options</i> ] <i>input.bmp
-output.tiff</i></p>
-</td>
-</table>
-<a name="DESCRIPTION"></a>
-<h2>DESCRIPTION</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><i>bmp2tiff</i> converts a Microsoft Windows Device
-Independent Bitmap image file to <small>TIFF.</small> By
-default, the <small>TIFF</small> image is created with data
-samples packed (<i>PlanarConfiguration</i>=1), compressed
-with the PackBits algorithm
-(<i>Compression</i>=<i>32773),</i> and with each strip no
-more than 8 kilobytes. These characteristics can overridden,
-or explicitly specified with the options described
-below.</p>
-</td>
-</table>
-<a name="OPTIONS"></a>
-<h2>OPTIONS</h2>
-<!-- TABS -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="5" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="11%"></td>
-<td width="2%">
-
-<p><b>&minus;c</b></p>
-</td>
-<td width="5%"></td>
-<td width="80%">
-
-<p>Specify a compression scheme to use when writing image
-data: <b>&minus;c none</b> for no compression, <b>-c
-packbits</b> for the PackBits compression algorithm (the
-default), <b>-c jpeg</b> for the baseline JPEG compression
-algorithm, <b>-c zip</b> for the Deflate compression
-algorithm, and <b>&minus;c lzw</b> for Lempel-Ziv &amp;
-Welch.</p>
-</td>
-<td width="0%">
-</td>
-</table>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><b>&minus;r &lt;number&gt;</b></p></td>
-</table>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="19%"></td>
-<td width="80%">
-<p>Write data with a specified number of rows per strip; by
-default the number of rows/strip is selected so that each
-strip is approximately 8 kilobytes.</p>
-</td>
-</table>
-<a name="SEE ALSO"></a>
-<h2>SEE ALSO</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><i>gif2tiff</i>(1), <i>pal2rgb</i>(1),
-<i>ppm2tiff</i>(1), <i>raw2tiff</i>(1), <i>ras2tiff</i>(1),
-<i>sgi2tiff</i>(1), <i>libtiff</i>(3TIFF)</p>
-</td>
-</table>
-<hr>
-</body>
-</html>
index aba6fc3..7c5c1f3 100644 (file)
@@ -244,7 +244,7 @@ PostScript to image the bitmap raster instead.</p>
 <p><b>tiff2ps</b>(1), <b>libtiff</b>(3)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 3aac8c7..a1c1b0b 100644 (file)
@@ -599,7 +599,7 @@ TIFF 5.0 specification prepared by Cygnet Technologies.</p>
 <b>tiffgt</b>(1), <b>libtiff</b>(3)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
diff --git a/html/man/gif2tiff.1.html b/html/man/gif2tiff.1.html
deleted file mode 100644 (file)
index c507353..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-<!-- Creator     : groff version 1.18.1 -->
-<!-- CreationDate: Sat Feb 24 18:37:19 2007 -->
-<html>
-<head>
-<meta name="generator" content="groff -Thtml, see www.gnu.org">
-<meta name="Content-Style" content="text/css">
-<title>GIF2TIFF</title>
-</head>
-<body>
-
-<h1 align=center>GIF2TIFF</h1>
-<a href="#NAME">NAME</a><br>
-<a href="#SYNOPSIS">SYNOPSIS</a><br>
-<a href="#DESCRIPTION">DESCRIPTION</a><br>
-<a href="#OPTIONS">OPTIONS</a><br>
-<a href="#NOTES">NOTES</a><br>
-<a href="#BUGS">BUGS</a><br>
-<a href="#SEE ALSO">SEE ALSO</a><br>
-
-<hr>
-<a name="NAME"></a>
-<h2>NAME</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p>gif2tiff &minus; create a <small>TIFF</small> file from a
-GIF87 format image file</p>
-</td>
-</table>
-<a name="SYNOPSIS"></a>
-<h2>SYNOPSIS</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><b>gif2tiff</b> [ <i>options</i> ] <i>input.gif
-output.tif</i></p>
-</td>
-</table>
-<a name="DESCRIPTION"></a>
-<h2>DESCRIPTION</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><i>Gif2tiff</i> converts a file in the GIF87 format to
-<small>TIFF.</small> The <small>TIFF</small> image is
-created as a palette image, with samples compressed with the
-Lempel-Ziv &amp; Welch algorithm (<i>Compression</i>=5).
-These characteristics can overridden, or explicitly
-specified with the options described below.</p>
-</td>
-</table>
-<a name="OPTIONS"></a>
-<h2>OPTIONS</h2>
-<!-- TABS -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="5" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="10%"></td>
-<td width="3%">
-
-<p><b>&minus;c</b></p>
-</td>
-<td width="5%"></td>
-<td width="80%">
-
-<p>Specify a compression scheme to use when writing image
-data: <b>&minus;c none</b> for no compression, <b>&minus;c
-packbits</b> for the PackBits compression algorithm,
-<b>&minus;c zip</b> for the Deflate compression algorithm,
-and <b>&minus;c lzw</b> for Lempel-Ziv &amp; Welch (the
-default).</p>
-</td>
-<td width="0%">
-</td>
-<tr valign="top" align="left">
-<td width="10%"></td>
-<td width="3%">
-
-<p><b>&minus;r</b></p>
-</td>
-<td width="5%"></td>
-<td width="80%">
-
-<p>Write data with a specified number of rows per strip; by
-default the number of rows/strip is selected so that each
-strip is approximately 8 kilobytes.</p>
-</td>
-<td width="0%">
-</td>
-</table>
-<a name="NOTES"></a>
-<h2>NOTES</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p>The program is based on Paul Haeberli&rsquo;s
-<i>fromgif</i> program which, in turn, is based on Marcel
-J.E. Mol&rsquo;s GIF reader.</p>
-</td>
-</table>
-<a name="BUGS"></a>
-<h2>BUGS</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p>Should have more options to control output format.</p>
-</td>
-</table>
-<a name="SEE ALSO"></a>
-<h2>SEE ALSO</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><b>pal2rgb</b>(1), <b>tiffinfo</b>(1), <b>tiffcp</b>(1),
-<b>tiffmedian</b>(1), <b>libtiff</b>(3)</p>
-<!-- INDENTATION -->
-<p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
-</td>
-</table>
-<hr>
-</body>
-</html>
index 7e9e8d2..4456f99 100644 (file)
 <li><A HREF=TIFFWriteTile.3tiff.html>TIFFWriteTile.3tiff.html</a>
 <li><A HREF=fax2ps.1.html>fax2ps.1.html</a>
 <li><A HREF=fax2tiff.1.html>fax2tiff.1.html</a>
-<li><A HREF=gif2tiff.1.html>gif2tiff.1.html</a>
+<!-- <li><A HREF=gif2tiff.1.html>gif2tiff.1.html</a> -->
 <li><A HREF=pal2rgb.1.html>pal2rgb.1.html</a>
 <li><A HREF=ppm2tiff.1.html>ppm2tiff.1.html</a>
-<li><A HREF=ras2tiff.1.html>ras2tiff.1.html</a>
+<!-- <li><A HREF=ras2tiff.1.html>ras2tiff.1.html</a> -->
 <li><A HREF=raw2tiff.1.html>raw2tiff.1.html</a>
 <li><A HREF=rgb2ycbcr.1.html>rgb2ycbcr.1.html</a>
-<li><A HREF=sgi2tiff.1.html>sgi2tiff.1.html</a>
+<!-- <li><A HREF=sgi2tiff.1.html>sgi2tiff.1.html</a> -->
 <li><A HREF=thumbnail.1.html>thumbnail.1.html</a>
 <li><A HREF=tiff2bw.1.html>tiff2bw.1.html</a>
 <li><A HREF=tiff2pdf.1.html>tiff2pdf.1.html</a>
@@ -60,5 +60,5 @@
 <li><A HREF=tiffmedian.1.html>tiffmedian.1.html</a>
 <li><A HREF=tiffset.1.html>tiffset.1.html</a>
 <li><A HREF=tiffsplit.1.html>tiffsplit.1.html</a>
-<li><A HREF=tiffsv.1.html>tiffsv.1.html</a>
+<!-- <li><A HREF=tiffsv.1.html>tiffsv.1.html</a> -->
 </ul></BODY></HTML>
index d06ddb6..42ecdc1 100644 (file)
@@ -181,7 +181,7 @@ has approximately 8 kilobytes of data in it.</p>
 <b>tiffmedian</b>(1), <b>libtiff</b>(3)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index e3c664e..79a89f2 100644 (file)
@@ -133,7 +133,7 @@ resolution (in dots/inch).</p>
 <b>tiffmedian</b>(1), <b>libtiff</b>(3)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
diff --git a/html/man/ras2tiff.1.html b/html/man/ras2tiff.1.html
deleted file mode 100644 (file)
index 2c652ab..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-<!-- Creator     : groff version 1.18.1 -->
-<!-- CreationDate: Sat Feb 24 18:37:19 2007 -->
-<html>
-<head>
-<meta name="generator" content="groff -Thtml, see www.gnu.org">
-<meta name="Content-Style" content="text/css">
-<title>RAS2TIFF</title>
-</head>
-<body>
-
-<h1 align=center>RAS2TIFF</h1>
-<a href="#NAME">NAME</a><br>
-<a href="#SYNOPSIS">SYNOPSIS</a><br>
-<a href="#DESCRIPTION">DESCRIPTION</a><br>
-<a href="#OPTIONS">OPTIONS</a><br>
-<a href="#BUGS">BUGS</a><br>
-<a href="#SEE ALSO">SEE ALSO</a><br>
-
-<hr>
-<a name="NAME"></a>
-<h2>NAME</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p>ras2tiff &minus; create a <small>TIFF</small> file from a
-Sun rasterfile</p>
-</td>
-</table>
-<a name="SYNOPSIS"></a>
-<h2>SYNOPSIS</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><b>ras2tiff</b> [ <i>options</i> ] <i>input.ras
-output.tif</i></p>
-</td>
-</table>
-<a name="DESCRIPTION"></a>
-<h2>DESCRIPTION</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><i>ras2tiff</i> converts a file in the Sun rasterfile
-format to <small>TIFF.</small> By default, the
-<small>TIFF</small> image is created with data samples
-packed (<i>PlanarConfiguration</i>=1), compressed with the
-Lempel-Ziv &amp; Welch algorithm (<i>Compression</i>=5), and
-with each strip no more than 8 kilobytes. These
-characteristics can overridden, or explicitly specified with
-the options described below.</p>
-<!-- INDENTATION -->
-<p>Any colormap information in the rasterfile is carried
-over to the <small>TIFF</small> file by including a
-<i>Colormap</i> tag in the output file. If the rasterfile
-has a colormap, the <i>PhotometricInterpretation</i> tag is
-set to 3 (palette); otherwise it is set to 2 (RGB) if the
-depth is 24 or 1 (min-is-black) if the depth is not 24.</p>
-</td>
-</table>
-<a name="OPTIONS"></a>
-<h2>OPTIONS</h2>
-<!-- TABS -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="5" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="10%"></td>
-<td width="2%">
-
-<p><b>&minus;c</b></p>
-</td>
-<td width="6%"></td>
-<td width="80%">
-
-<p>Specify a compression scheme to use when writing image
-data: <b>&minus;c none</b> for no compression, <b>&minus;c
-packbits</b> for the PackBits compression algorithm,
-<b>&minus;c jpeg</b> for the baseline JPEG compression
-algorithm, <b>&minus;c zip</b> for the Deflate compression
-algorithm, and <b>&minus;c lzw</b> for Lempel-Ziv &amp;
-Welch (the default).</p>
-</td>
-<td width="0%">
-</td>
-<tr valign="top" align="left">
-<td width="10%"></td>
-<td width="2%">
-
-<p><b>&minus;r</b></p>
-</td>
-<td width="6%"></td>
-<td width="80%">
-
-<p>Write data with a specified number of rows per strip; by
-default the number of rows/strip is selected so that each
-strip is approximately 8 kilobytes.</p>
-</td>
-<td width="0%">
-</td>
-</table>
-<a name="BUGS"></a>
-<h2>BUGS</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p>Does not handle all possible rasterfiles. In particular,
-<i>ras2tiff</i> does not handle run-length encoded
-images.</p>
-</td>
-</table>
-<a name="SEE ALSO"></a>
-<h2>SEE ALSO</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><b>pal2rgb</b>(1), <b>tiffinfo</b>(1), <b>tiffcp</b>(1),
-<b>tiffmedian</b>(1), <b>libtiff</b>(3)</p>
-<!-- INDENTATION -->
-<p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
-</td>
-</table>
-<hr>
-</body>
-</html>
index ce47e9f..59d5506 100644 (file)
@@ -502,7 +502,7 @@ images guessing method will work fine.</p>
 <b>tiffmedian</b>(1), <b>libtiff</b>(3)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index dcd88d1..6e481f7 100644 (file)
@@ -147,7 +147,7 @@ strip is approximately 8 kilobytes.</p>
 <b>libtiff</b>(3)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
diff --git a/html/man/sgi2tiff.1.html b/html/man/sgi2tiff.1.html
deleted file mode 100644 (file)
index 7665a6e..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-<!-- Creator     : groff version 1.18.1 -->
-<!-- CreationDate: Sat Feb 24 18:37:19 2007 -->
-<html>
-<head>
-<meta name="generator" content="groff -Thtml, see www.gnu.org">
-<meta name="Content-Style" content="text/css">
-<title>SGI2TIFF</title>
-</head>
-<body>
-
-<h1 align=center>SGI2TIFF</h1>
-<a href="#NAME">NAME</a><br>
-<a href="#SYNOPSIS">SYNOPSIS</a><br>
-<a href="#DESCRIPTION">DESCRIPTION</a><br>
-<a href="#OPTIONS">OPTIONS</a><br>
-<a href="#BUGS">BUGS</a><br>
-<a href="#SEE ALSO">SEE ALSO</a><br>
-
-<hr>
-<a name="NAME"></a>
-<h2>NAME</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p>sgi2tiff &minus; create a <small>TIFF</small> file from
-an <small>SGI</small> image file</p>
-</td>
-</table>
-<a name="SYNOPSIS"></a>
-<h2>SYNOPSIS</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><b>sgi2tiff</b> [ <i>options</i> ] <i>input.rgb
-output.tif</i></p>
-</td>
-</table>
-<a name="DESCRIPTION"></a>
-<h2>DESCRIPTION</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><i>sgi2tiff</i> converts a file in the <small>SGI</small>
-image format to <small>TIFF.</small> By default, the
-<small>TIFF</small> image is created with data samples
-packed (<i>PlanarConfiguration</i>=1), compressed with the
-Lempel-Ziv &amp; Welch algorithm (<i>Compression</i>=5), and
-with each strip no more than 8 kilobytes. These
-characteristics can overridden, or explicitly specified with
-the options described below.</p>
-</td>
-</table>
-<a name="OPTIONS"></a>
-<h2>OPTIONS</h2>
-<!-- TABS -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="5" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="10%"></td>
-<td width="3%">
-
-<p><b>&minus;c</b></p>
-</td>
-<td width="5%"></td>
-<td width="80%">
-
-<p>Specify a compression scheme to use when writing image
-data: <b>&minus;c none</b> for no compression, <b>&minus;c
-packbits</b> for the PackBits compression algorithm),
-<b>&minus;c jpeg</b> for the baseline JPEG compression
-algorithm, <b>&minus;c zip</b> for the Deflate compression
-algorithm, and <b>&minus;c lzw</b> for Lempel-Ziv &amp;
-Welch (the default).</p>
-</td>
-<td width="0%">
-</td>
-<tr valign="top" align="left">
-<td width="10%"></td>
-<td width="3%">
-
-<p><b>&minus;p</b></p>
-</td>
-<td width="5%"></td>
-<td width="80%">
-
-<p>Explicitly select the planar configuration used in
-organizing data samples in the output image: <b>&minus;p
-contig</b> for samples packed contiguously, and <b>&minus;p
-separate</b> for samples stored separately. By default
-samples are packed.</p>
-</td>
-<td width="0%">
-</td>
-<tr valign="top" align="left">
-<td width="10%"></td>
-<td width="3%">
-
-<p><b>&minus;r</b></p>
-</td>
-<td width="5%"></td>
-<td width="80%">
-
-<p>Write data with a specified number of rows per strip; by
-default the number of rows/strip is selected so that each
-strip is approximately 8 kilobytes.</p>
-</td>
-<td width="0%">
-</td>
-</table>
-<a name="BUGS"></a>
-<h2>BUGS</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p>Does not record colormap information.</p>
-</td>
-</table>
-<a name="SEE ALSO"></a>
-<h2>SEE ALSO</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><b>tiffinfo</b>(1), <b>tiffcp</b>(1),
-<b>tiffmedian</b>(1), <b>libtiff</b>(3)</p>
-<!-- INDENTATION -->
-<p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
-</td>
-</table>
-<hr>
-</body>
-</html>
index 2d1f3c9..8b11413 100644 (file)
@@ -140,7 +140,7 @@ thumbnail images.</p>
 <b>libtiff</b>(3)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 1ebb4d3..413808e 100644 (file)
@@ -153,7 +153,7 @@ strip is approximately 8 kilobytes.</p>
 <b>tiffmedian</b>(1), <b>libtiff</b>(3)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 3b6dd4b..1feaf6b 100644 (file)
@@ -601,7 +601,7 @@ page, compressing the output with JPEG, with JPEG quality
 <b>tiff2ps</b>(1)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 7e2ce15..7b309b0 100644 (file)
@@ -631,7 +631,7 @@ Level I output.</p>
 <b>tiffsv</b>(1), <b>libtiff</b>(3)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 35e06a5..203f7de 100644 (file)
@@ -154,7 +154,7 @@ a pure RGB file. Currently this does not work if the
 <b>libtiff</b>(3)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index acd2e90..d1474ca 100644 (file)
@@ -148,7 +148,7 @@ may be off in some exotic cases.</p>
 <b>tiffmedian</b>(1), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index c0c7da0..a376f94 100644 (file)
@@ -561,7 +561,7 @@ with image numbers, as follows:</p></td>
 <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 9c1edbb..4c868db 100644 (file)
@@ -676,7 +676,7 @@ decompressing) with the command:</p></td>
 <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 1945c5b..40e3d6e 100644 (file)
@@ -188,7 +188,7 @@ threshold value is 128.</p>
 <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index c37d2ee..7a23feb 100644 (file)
@@ -137,7 +137,7 @@ using the usual C-style syntax; i.e. a leading
 <p><b>tiffinfo</b>(1), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 5a04996..d8fcef5 100644 (file)
@@ -543,7 +543,7 @@ manager.</p>
 <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index d3a013c..9accdd5 100644 (file)
@@ -188,7 +188,7 @@ in a directory.</p>
 <b>tiffmedian</b>(1), <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 7831051..ec6d0b1 100644 (file)
@@ -175,7 +175,7 @@ more than 8 kilobytes of data appear in a strip.</p>
 Paul Heckbert, SIGGRAPH proceedings, 1982, pp. 297-307.</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 7192d6e..0c30b01 100644 (file)
@@ -168,7 +168,7 @@ tiffset &minus;s 283 300.0 a.tif
 <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
index 4de5c81..5cf8dd8 100644 (file)
@@ -94,7 +94,7 @@ tags&rsquo;&rsquo; is copied when splitting.</p>
 <b>libtiff</b>(3TIFF)</p>
 <!-- INDENTATION -->
 <p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
+<b>http://www.simplesystems.org/libtiff/</b></p>
 </td>
 </table>
 <hr>
diff --git a/html/man/tiffsv.1.html b/html/man/tiffsv.1.html
deleted file mode 100644 (file)
index f9921a4..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-<!-- Creator     : groff version 1.18.1 -->
-<!-- CreationDate: Sat Feb 24 18:37:20 2007 -->
-<html>
-<head>
-<meta name="generator" content="groff -Thtml, see www.gnu.org">
-<meta name="Content-Style" content="text/css">
-<title>TIFFSV</title>
-</head>
-<body>
-
-<h1 align=center>TIFFSV</h1>
-<a href="#NAME">NAME</a><br>
-<a href="#SYNOPSIS">SYNOPSIS</a><br>
-<a href="#DESCRIPTION">DESCRIPTION</a><br>
-<a href="#OPTIONS">OPTIONS</a><br>
-<a href="#NOTE">NOTE</a><br>
-<a href="#BUGS">BUGS</a><br>
-<a href="#SEE ALSO">SEE ALSO</a><br>
-
-<hr>
-<a name="NAME"></a>
-<h2>NAME</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p>tiffsv &minus; save an image from the framebuffer in a
-<small>TIFF</small> file (Silicon Graphics version)</p>
-</td>
-</table>
-<a name="SYNOPSIS"></a>
-<h2>SYNOPSIS</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><b>tiffsv</b> [ <i>options</i> ] <i>output.tif</i> [
-<i>x1 x2 y1 y2</i> ]</p>
-</td>
-</table>
-<a name="DESCRIPTION"></a>
-<h2>DESCRIPTION</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><i>tiffsv</i> saves all or part of the framebuffer in a
-file using the Tag Image File Format, Revision 6.0. By
-default, the image is saved with data samples packed
-(<i>PlanarConfiguration</i>=1), compressed with the
-Lempel-Ziv &amp; Welch algorithm (<i>Compression</i>=5), and
-with each strip no more than 8 kilobytes. These
-characteristics can be overridden, or explicitly specified
-with the options described below.</p>
-</td>
-</table>
-<a name="OPTIONS"></a>
-<h2>OPTIONS</h2>
-<!-- TABS -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="5" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="10%"></td>
-<td width="3%">
-
-<p><b>&minus;b</b></p>
-</td>
-<td width="5%"></td>
-<td width="80%">
-
-<p>Save the image as a greyscale image as if it were
-processed by <i>tiff2bw</i>(1). This option is included for
-compatibility with the standard <i>scrsave</i>(6D)
-program.</p>
-</td>
-<td width="0%">
-</td>
-<tr valign="top" align="left">
-<td width="10%"></td>
-<td width="3%">
-
-<p><b>&minus;c</b></p>
-</td>
-<td width="5%"></td>
-<td width="80%">
-
-<p>Specify the compression to use for data written to the
-output file: <b>none</b> for no compression, <b>packbits</b>
-for PackBits compression, <b>jpeg</b> for baseline JPEG
-compression, <b>zip</b> for Deflate compression, and
-<b>lzw</b> for Lempel-Ziv &amp; Welch compression
-(default).</p>
-</td>
-<td width="0%">
-</td>
-</table>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="17%"></td>
-<td width="82%">
-<p><small>LZW</small> compression can be specified together
-with a <i>predictor</i> value. A predictor value of 2 causes
-each scanline of the output image to undergo horizontal
-differencing before it is encoded; a value of 1 forces each
-scanline to be encoded without differencing. LZW-specific
-options are specified by appending a
-&lsquo;&lsquo;:&rsquo;&rsquo;-separated list to the
-&lsquo;&lsquo;lzw&rsquo;&rsquo; option; e.g. <b>&minus;c
-lzw:2</b> for <small>LZW</small> compression with horizontal
-differencing.</p>
-</td>
-</table>
-<!-- TABS -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="5" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="10%"></td>
-<td width="3%">
-
-<p><b>&minus;p</b></p>
-</td>
-<td width="5%"></td>
-<td width="80%">
-
-<p>Specify the planar configuration to use in writing image
-data. By default, <i>tiffsv</i> will create a new file with
-the data samples packed contiguously. Specifying <b>&minus;p
-contig</b> will force data to be written with multi-sample
-data packed together, while <b>&minus;p separate</b> will
-force samples to be written in separate planes.</p>
-</td>
-<td width="0%">
-</td>
-<tr valign="top" align="left">
-<td width="10%"></td>
-<td width="3%">
-
-<p><b>&minus;r</b></p>
-</td>
-<td width="5%"></td>
-<td width="80%">
-
-<p>Specify the number of rows (scanlines) in each strip of
-data written to the output file. By default, <i>tiffsv</i>
-attempts to set the rows/strip that no more than 8 kilobytes
-of data appear in a strip.</p>
-</td>
-<td width="0%">
-</td>
-</table>
-<a name="NOTE"></a>
-<h2>NOTE</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p>Except for the use of <small>TIFF,</small> this program
-is equivalent to the standard <i>scrsave</i> program. This
-means, for example, that you can use it in conjunction with
-the standard <i>icut</i> program simply by creating a link
-called <i>scrsave</i>, or by creating a shell script called
-<i>scrsave</i> that invokes <i>tiffgt</i> with the
-appropriate options.</p>
-</td>
-</table>
-<a name="BUGS"></a>
-<h2>BUGS</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p>If data are saved compressed and in separate planes, then
-the rows in each strip is silently set to one to avoid
-limitations in the <b>libtiff</b>(3TIFF) library.</p>
-</td>
-</table>
-<a name="SEE ALSO"></a>
-<h2>SEE ALSO</h2>
-<!-- INDENTATION -->
-<table width="100%" border=0 rules="none" frame="void"
-       cols="2" cellspacing="0" cellpadding="0">
-<tr valign="top" align="left">
-<td width="8%"></td>
-<td width="91%">
-<p><b>scrsave</b>(6D) <b>pal2rgb</b>(1), <b>tiffdump</b>(1),
-<b>tiffgt</b>(1), <b>tiffinfo</b>(1), <b>tiffcp</b>(1),
-<b>tiffmedian</b>(1), <b>libtiff</b>(3TIFF)</p>
-<!-- INDENTATION -->
-<p>Libtiff library home page:
-<b>http://www.remotesensing.org/libtiff/</b></p>
-</td>
-</table>
-<hr>
-</body>
-</html>
index aed91a9..b30eb67 100644 (file)
@@ -77,6 +77,7 @@ the more persistent contributors have been:
     Joris Van Damme
     Tavis Ormandy
     Richard Nolde
+    Even Rouault
 </PRE>
 
 (my apology to anyone that was inadvertently not listed.)
@@ -111,6 +112,6 @@ OF THIS SOFTWARE.
 <HR>
 
 
-Last updated: $Date: 2007/02/24 15:47:04 $
+Last updated: $Date: 2016-09-25 20:05:44 $
 </BODY>
 </HTML>
index f6f5d60..2330d40 100644 (file)
   </p>
   <hr>
   <p>
-    Last updated: $Date: 2005/12/28 06:53:18 $
+    Last updated: $Date: 2016-09-25 20:05:45 $
   </p>
 </body>
 </html>
index 65e9c0d..7b99d71 100644 (file)
@@ -26,21 +26,10 @@ examples for writing programs to display and save TIFF images.
 The software makes extensive use of the <tt>TIFFRGBAImage</tt>
 facilities described elsewhere.</td>
 </tr>
-<tr>
-<td valign="top" width="10%"><tt><a href="man/tiffsv.1.html">tiffsv</a></tt></td>
-<td>A program to save all or part of a screen dump on a Silicon
-Graphics system. As for <tt>tiffgt</tt> this code, while written to
-use the IRIS GL, can be easily tailored to other devices.</td>
-</tr>
 </table>
 <h3>Device-independent Programs</h3>
 The remaining programs should be device-independent:
 <table border cellpadding="3">
-<tr>
-<td valign="top" width="10%"><tt><a href="man/bmp2tiff.1.html">bmp2tiff</a></tt></td>
-<td>Convert BMP images to TIFF</td>
-</tr>
-<tr>
 <td valign="top" width="10%"><tt><a href="man/fax2ps.1.html">fax2ps</a></tt></td>
 <td>Convert a Group 3- or Group 4- compressed TIFF to PostScript
 that is significantly more compressed than is generated by
@@ -50,11 +39,6 @@ that is significantly more compressed than is generated by
 <td valign="top" width="10%"><tt><a href="man/fax2tiff.1.html">fax2tiff</a></tt></td>
 <td>Convert raw Group 3 or Group 4 facsimile data to TIFF</td>
 </tr>
-<tr>
-<td valign="top" width="10%"><tt><a href="man/gif2tiff.1.html">gif2tiff</a></tt></td>
-<td>A quick hack that converts GIF 87a (old) format images to TIFF</td>
-</tr>
-<tr>
 <td valign="top" width="10%"><tt><a href="man/pal2rgb.1.html">pal2rgb</a></tt></td>
 <td>Convert a Palette-style image to a full color RGB image by
 applying the colormap</td>
@@ -63,12 +47,6 @@ applying the colormap</td>
 <td valign="top" width="10%"><tt><a href="man/ppm2tiff.1.html">ppm2tiff</a></tt></td>
 <td>A quick hack that converts 8-bit PPM format images to TIFF</td>
 </tr>
-<tr>
-<td valign="top" width="10%"><tt><a href="man/ras2tiff.1.html">ras2tiff</a></tt></td>
-<td>A quick hack that converts Sun rasterfile format images to TIFF
--- it's less than complete</td>
-</tr>
-<tr>
 <td valign="top" width="10%"><tt><a href="man/raw2tiff.1.html">raw2tiff</a></tt></td>
 <td>Create a TIFF file from raw data</td>
 </tr>
@@ -78,11 +56,6 @@ applying the colormap</td>
 TIFF image; it's mainly provided for testing</td>
 </tr>
 <tr>
-<td valign="top" width="10%"><tt><a href="man/sgi2tiff.1.html">sgi2tiff</a></tt></td>
-<td>A program to convert SGI image files to TIFF. This program is
-only useful on SGI machines as it uses <tt>-limage</tt>.</td>
-</tr>
-<tr>
 <td valign="top" width="10%"><tt><a href="man/thumbnail.1.html">thumbnail</a></tt></tt></td>
 <td>Copy a bilevel TIFF to one that includes 8-bit greyscale
 "thumbnail images" for each page; it is provided as an example of
@@ -159,6 +132,6 @@ multi-image file</td>
 <p>Check out the manual pages for details about the above
 programs.</p>
 <hr>
-Last updated: $Date: 2009-10-28 22:13:37 $
+Last updated: $Date: 2016-06-05 19:54:00 $
 </body>
 </html>
index c535d27..10a2946 100644 (file)
@@ -105,7 +105,7 @@ The following information is located here:
 
 <ADDRESS>
 <A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
-Last updated $Date: 1999/08/09 20:21:21 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 </ADDRESS>
 
 </BODY>
index 22f185f..133a469 100644 (file)
@@ -115,7 +115,7 @@ The following information is located here:
 
 <ADDRESS>
 <A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
-Last updated $Date: 1999/08/09 20:21:21 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 </ADDRESS>
 
 </BODY>
index ac1877f..1256c8a 100644 (file)
@@ -77,7 +77,7 @@ The following information is located here:
 
 <ADDRESS>
 <A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
-Last updated $Date: 1999/08/09 20:21:21 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 </ADDRESS>
 
 </BODY>
index 25a3347..09da926 100644 (file)
@@ -132,7 +132,7 @@ The following information is located here:
 
 <ADDRESS>
 <A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
-Last updated $Date: 1999/08/09 20:21:21 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 </ADDRESS>
 
 </BODY>
index ff7ef69..827229e 100644 (file)
@@ -139,7 +139,7 @@ The following information is located here:
 
 <ADDRESS>
 <A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
-Last updated $Date: 1999/08/09 20:21:21 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 </ADDRESS>
 
 </BODY>
index f2a3d3f..442a2f3 100644 (file)
@@ -79,7 +79,7 @@ The following information is located here:
 
 <ADDRESS>
 <A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
-Last updated $Date: 1999/08/09 20:21:21 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 </ADDRESS>
 
 </BODY>
index d5b7eac..5f350c7 100644 (file)
@@ -87,7 +87,7 @@ The following information is located here:
 
 <ADDRESS>
 <A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
-Last updated $Date: 1999/08/09 20:21:21 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 </ADDRESS>
 
 </BODY>
index bc14ef3..87d18cd 100644 (file)
@@ -83,7 +83,7 @@ The following information is located here:
 
 <ADDRESS>
 <A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
-Last updated $Date: 1999/08/09 20:21:21 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 </ADDRESS>
 
 </BODY>
index 8d8345a..a6a6bbe 100644 (file)
@@ -75,7 +75,7 @@ The following information is located here:
 
 <ADDRESS>
 <A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
-Last updated $Date: 1999/08/09 20:21:21 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 </ADDRESS>
 
 </BODY>
index 77d9863..c7ac9bd 100644 (file)
@@ -61,7 +61,7 @@ The following information is located here:
 
 <ADDRESS>
 <A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
-Last updated $Date: 1999/08/09 20:21:21 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 </ADDRESS>
 
 </BODY>
index 22fb2b8..72c0090 100644 (file)
@@ -56,7 +56,7 @@ The following information is located here:
 
 <ADDRESS>
 <A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
-Last updated $Date: 1999/08/09 20:21:21 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 </ADDRESS>
 
 </BODY>
index e36754d..7a2fa8b 100644 (file)
@@ -110,7 +110,7 @@ The following information is located here:
 
 <ADDRESS>
 <A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
-Last updated $Date: 1999/08/09 20:21:21 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 </ADDRESS>
 
 </BODY>
index 0c88de9..365700c 100644 (file)
@@ -18,7 +18,7 @@ Changes in TIFF v3.5.1
 <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.remotesensing.org/libtiff/>http://www.remotesensing.org/libtiff</a> 
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff//>http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -69,7 +69,7 @@ utility.
 
 <HR>
 
-Last updated $Date: 2006/01/03 01:42:30 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index 71b486a..48ad398 100644 (file)
@@ -18,7 +18,7 @@ Changes in TIFF v3.5.2
 <B>Current Version</B>: v3.5.2<BR>
 <B>Previous Version</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, directory graphics/tiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff/">http://www.remotesensing.org/libtiff</a> 
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff//">http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -102,7 +102,7 @@ The following information is located here:
 
 <HR>
 
-Last updated $Date: 2004/11/26 14:37:20 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index e7910d9..78f4698 100644 (file)
@@ -18,7 +18,7 @@ Changes in TIFF v3.5.3
 <B>Current Version</B>: v3.5.3<BR>
 <B>Previous Version</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</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff/">http://www.remotesensing.org/libtiff</a> 
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff//">http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -126,7 +126,7 @@ LZW decompression is unchanged.
 
 <HR>
 
-Last updated $Date: 2004/11/26 14:37:20 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index 714621e..1d988bf 100644 (file)
@@ -18,7 +18,7 @@ Changes in TIFF v3.5.4
 <B>Current Version</B>: v3.5.4<BR>
 <B>Previous Version</B>: <A HREF=v3.5.3.html>v3.5.3</a><BR>
 <B>Master FTP Site</B>: <A HREF="ftp://ftp.onshore.com/pub/libtiff">ftp.onshore.com</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff/">http://www.remotesensing.org/libtiff</a> 
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff//">http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -82,7 +82,7 @@ The following information is located here:
 
 <HR>
 
-Last updated $Date: 2006/01/03 01:45:41 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index 20be92f..0b67f5c 100644 (file)
@@ -18,7 +18,7 @@ Changes in TIFF v3.5.5
 <B>Current Version</B>: v3.5.5<BR>
 <B>Previous Version</B>: <A HREF=v3.5.4.html>v3.5.4</a><BR>
 <B>Master FTP Site</B>: <A HREF="ftp://ftp.onshore.com/pub/libtiff">ftp.onshore.com</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff/">http://www.remotesensing.org/libtiff</a> 
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff//">http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -149,7 +149,7 @@ The following information is located here:
 
 <HR>
 
-Last updated $Date: 2004/11/26 14:37:20 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index 682f845..b552c37 100644 (file)
@@ -18,7 +18,7 @@ Changes in TIFF v3.5.6
 <B>Current Version</B>: v3.5.6beta<BR>
 <B>Previous Version</B>: <A HREF=v3.5.5.html>v3.5.5</a><BR>
 <B>Master FTP Site</B>: <A HREF="ftp://ftp.onshore.com/pub/libtiff">ftp.onshore.com</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff/">http://www.remotesensing.org/libtiff</a> 
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff//">http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -179,7 +179,7 @@ The following information is located here:
 
 <HR>
 
-Last updated $Date: 2006/03/18 17:12:47 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index 528df74..96f4791 100644 (file)
@@ -17,8 +17,8 @@ Changes in TIFF v3.5.7
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.5.7<BR>
 <B>Previous Version</B>: <A HREF=v3.5.6-beta.html>v3.5.6 Beta</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff/">http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff//">http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -253,7 +253,7 @@ Updated bug section of tiffcmp.1 to note tiled file issues.
 
 <HR>
 
-Last updated $Date: 2004/11/26 14:37:20 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index 888e547..c53cd15 100644 (file)
@@ -17,10 +17,10 @@ Changes in TIFF v3.6.0
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.6.0<BR>
 <B>Previous Version</B>: <A HREF=v3.5.7.html>v3.5.7</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -428,7 +428,7 @@ KIT:</B></A>
 
 <HR>
 
-Last updated $Date: 2003/10/04 11:38:17 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index d106062..3d6d838 100644 (file)
@@ -17,10 +17,10 @@ Changes in TIFF v3.6.1
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.6.1<BR>
 <B>Previous Version</B>: <A HREF=v3.6.0.html>v3.6.0</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -193,7 +193,7 @@ KIT:</B></A>
 
 <HR>
 
-Last updated $Date: 2003/12/24 22:14:15 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index 413f2c6..777782f 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.7.0<BR>
 <B>Previous Version</B>: <A HREF=v3.7.0beta2.html>v3.7.0beta2</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -138,7 +138,7 @@ KIT:</B></A>
 
 <HR>
 
-Last updated $Date: 2004/12/20 19:31:44 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index 95c633c..5f1aed9 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.7.0alpha<BR>
 <B>Previous Version</B>: <A HREF=v3.6.1.html>v3.6.1</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -243,7 +243,7 @@ KIT:</B></A>
 
 <HR>
 
-Last updated $Date: 2006/03/18 17:12:47 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index 7d7c868..6ec852b 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.7.0beta<BR>
 <B>Previous Version</B>: <A HREF=v3.7.0alpha.html>v3.7.0alpha</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -156,7 +156,7 @@ KIT:</B></A>
 
 <HR>
 
-Last updated $Date: 2006/03/18 17:12:47 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index 67dd8da..4c43017 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.7.0beta2<BR>
 <B>Previous Version</B>: <A HREF=v3.7.0beta.html>v3.7.0beta</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -125,7 +125,7 @@ KIT:</B></A>
 
 <HR>
 
-Last updated $Date: 2006/03/18 17:12:47 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index b888792..6794a8d 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.7.1<BR>
 <B>Previous Version</B>: <A HREF=v3.7.0.html>v3.7.0</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -227,7 +227,7 @@ The following information is located here:
 
 </UL>
 
-Last updated $Date: 2004/12/20 19:31:44 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index 6cb6f7c..45347b7 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.7.2<BR>
 <B>Previous Version</B>: <A HREF=v3.7.1.html>v3.7.1</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -216,7 +216,7 @@ The following information is located here:
 
 </UL>
 
-Last updated $Date: 2005/03/15 15:17:44 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index d698451..28981ae 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.7.3<BR>
 <B>Previous Version</B>: <A HREF=v3.7.2.html>v3.7.2</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -224,7 +224,7 @@ The following information is located here:
 
 </UL>
 
-Last updated $Date: 2006/01/04 22:04:46 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index 9437320..8b4e5dd 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.7.4<BR>
 <B>Previous Version</B>: <A HREF=v3.7.3.html>v3.7.3</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -127,7 +127,7 @@ The following information is located here:
 
 </UL>
 
-Last updated $Date: 2005/11/03 14:18:43 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index 914dcb0..05a96c7 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.8.0<BR>
 <B>Previous Version</B>: <A HREF=v3.7.4.html>v3.7.4</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -193,7 +193,7 @@ The following information is located here:
 
 </UL>
 
-Last updated $Date: 2006/01/04 23:38:38 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index 9fea140..c4710f1 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.8.1<BR>
 <B>Previous Version</B>: <A HREF=v3.8.0.html>v3.8.0</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -211,7 +211,7 @@ The following information is located here:
 <UL> 
 </UL>
 
-Last updated $Date: 2006/03/13 14:52:12 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
 
 </BODY>
 </HTML>
index e648127..8d64ef7 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.8.2<BR>
 <B>Previous Version</B>: <A HREF=v3.8.1.html>v3.8.1</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -131,7 +131,7 @@ The following information is located here:
 <UL> 
 </UL>
 
-Last updated $Date: 2006/03/23 14:54:01 $.
+Last updated $Date: 2016-09-25 20:05:46 $.
 
 </BODY>
 </HTML>
index d7d8821..52def61 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.9.0beta<BR>
 <B>Previous Version</B>: <A HREF=v3.8.2.html>v3.8.2</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -298,7 +298,7 @@ The following information is located here:
 
 </UL>
 
-Last updated $Date: 2009-08-20 22:57:39 $.
+Last updated $Date: 2016-09-25 20:05:46 $.
 
 </BODY>
 </HTML>
index c97d94f..0cffd21 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.9.1<BR>
 <B>Previous Version</B>: <A HREF=v3.9.1.html>v3.9.1</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -109,7 +109,7 @@ information is located here:
 
 </UL>
 
-Last updated $Date: 2009-08-28 18:54:11 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
 
 </BODY>
 </HTML>
index bb76794..83f2cc9 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v3.9.2<BR>
 <B>Previous Version</B>: <A HREF=v3.9.1.html>v3.9.1</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -116,7 +116,7 @@ information is located here:
 
 </UL>
 
-Last updated $Date: 2009-11-04 17:38:13 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
 
 </BODY>
 </HTML>
index 9694a1e..d869c17 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v4.0.0<BR>
 <B>Previous Version</B>: <A HREF=v3.9.5.html>v3.9.5</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://download.osgeo.org/libtiff">
-http://download.osgeo.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+ftp://download.osgeo.org/libtiff</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -263,7 +263,7 @@ Other important backward incompatible changes in the public API:
 <UL> 
 </UL>
 
-Last updated $Date: 2011-04-09 21:01:00 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
 
 </BODY>
 </HTML>
index 1f113c1..d75cd24 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v4.0.1<BR>
 <B>Previous Version</B>: <A HREF=v4.0.0.html>v4.0.0</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -107,7 +107,7 @@ information is located here:
 
 </UL>
 
-Last updated $Date: 2012-02-18 21:53:27 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
 
 </BODY>
 </HTML>
index 2c44e34..8dade5f 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v4.0.2<BR>
 <B>Previous Version</B>: <A HREF=v4.0.1.html>v4.0.1</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -112,7 +112,7 @@ information is located here:
 
 </UL>
 
-Last updated $Date: 2012-09-22 16:12:44 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
 
 </BODY>
 </HTML>
index c640c86..1e9e792 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v4.0.3<BR>
 <B>Previous Version</B>: <A HREF=v4.0.2.html>v4.0.2</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -119,7 +119,7 @@ information is located here:
 
 </UL>
 
-Last updated $Date: 2012-09-22 16:12:44 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
 
 </BODY>
 </HTML>
index 193644b..6ddf2a1 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v4.0.4<BR>
 <B>Previous Version</B>: <A HREF=v4.0.4beta.html>v4.0.4beta</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -268,7 +268,7 @@ information is located here:
 
 </UL>
 
-Last updated $Date: 2015-06-18 03:08:06 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
 
 </BODY>
 </HTML>
index aeebad0..28c543f 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v4.0.4beta<BR>
 <B>Previous Version</B>: <A HREF=v4.0.3.html>v4.0.3</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -285,7 +285,7 @@ information is located here:
         protect against overflow of fixed-size buffers.
 </UL>
 
-Last updated $Date: 2015-01-26 15:14:45 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
 
 </BODY>
 </HTML>
index 16e3a6e..ac91d72 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v4.0.5<BR>
 <B>Previous Version</B>: <A HREF=v4.0.4.html>v4.0.4</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -142,7 +142,7 @@ information is located here:
 
 </UL>
 
-Last updated $Date: 2015-08-28 16:04:56 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
 
 </BODY>
 </HTML>
index bf7cb7d..3174919 100644 (file)
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 <B>Current Version</B>: v4.0.6<BR>
 <B>Previous Version</B>: <A HREF=v4.0.5.html>v4.0.5</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff">
-ftp.remotesensing.org</a>, directory pub/libtiff</A><BR>
-<B>Master HTTP Site</B>: <A HREF="http://www.remotesensing.org/libtiff">
-http://www.remotesensing.org/libtiff</a> 
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a> 
 <HR SIZE=4 WIDTH=65% ALIGN=left>
 </UL>
 
@@ -133,7 +133,7 @@ information is located here:
 
 </UL>
 
-Last updated $Date: 2015-09-12 19:29:47 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
 
 </BODY>
 </HTML>
diff --git a/html/v4.0.7.html b/html/v4.0.7.html
new file mode 100644 (file)
index 0000000..151861f
--- /dev/null
@@ -0,0 +1,411 @@
+<HTML>
+<HEAD>
+<TITLE>
+       Changes in TIFF v4.0.7
+</TITLE>
+</HEAD>
+
+<BODY BGCOLOR=white>
+<FONT FACE="Helvetica, Arial, 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>: v4.0.7<BR>
+<B>Previous Version</B>: <A HREF=v4.0.6.html>v4.0.6</a><BR>
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site #1</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a><BR>
+<B>Master HTTP Site #2</B>: <A HREF="http://libtiff.maptools.org/">
+http://libtiff.maptools.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="#highlights">Major Changes</A>
+<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>
+<LI><A HREF="#contrib">Changes in the contrib area</A>
+</UL>
+<p> 
+<P><HR WIDTH=65% ALIGN=left>
+
+<!--------------------------------------------------------------------------->
+
+<A NAME="highlights"><B><FONT SIZE=+3>M</FONT>AJOR CHANGES:</B></A>
+
+<UL>
+
+       <LI> The libtiff tools bmp2tiff, gif2tiff, ras2tiff, sgi2tiff,
+        sgisv, and ycbcr are completely removed from the distribution.
+        These tools were written in the late 1980s and early 1990s for
+        test and demonstration purposes.  In some cases the tools were
+        never updated to support updates to the file format, or the
+        file formats are now rarely used.  In all cases these tools
+        increased the libtiff security and maintenance exposure beyond
+        the value offered by the tool.
+
+</UL>
+
+
+<P><HR WIDTH=65% ALIGN=left>
+<!--------------------------------------------------------------------------->
+
+<A NAME="configure"><B><FONT SIZE=+3>C</FONT>HANGES IN THE SOFTWARE CONFIGURATION:</B></A>
+
+<UL>
+
+  <LI> None
+
+</UL>
+
+<P><HR WIDTH=65% ALIGN=left>
+
+<!--------------------------------------------------------------------------->
+
+<A NAME="libtiff"><B><FONT SIZE=+3>C</FONT>HANGES IN LIBTIFF:</B></A>
+
+<UL>
+
+    <LI> libtiff/tif_dirread.c: in TIFFFetchNormalTag(), do not
+        dereference NULL pointer when values of tags with
+        TIFF_SETGET_C16_ASCII / TIFF_SETGET_C32_ASCII access are
+        0-byte arrays.  Fixes
+        http://bugzilla.maptools.org/show_bug.cgi?id=2593 (regression
+        introduced by previous fix done on 2016-11-11 for
+        CVE-2016-9297).  Reported by Henri Salo. Assigned as
+        CVE-2016-9448
+
+    <LI> libtiff/tif_aux.c: fix crash in TIFFVGetFieldDefaulted() when
+        requesting Predictor tag and that the zip/lzw codec is not
+        configured.  Fixes
+        http://bugzilla.maptools.org/show_bug.cgi?id=2591
+
+    <LI> libtiff/tif_dirread.c: in TIFFFetchNormalTag(), make sure
+        that values of tags with TIFF_SETGET_C16_ASCII /
+        TIFF_SETGET_C32_ASCII access are null terminated, to avoid
+        potential read outside buffer in _TIFFPrintField().  Fixes
+        http://bugzilla.maptools.org/show_bug.cgi?id=2590
+
+    <LI> libtiff/tif_dirread.c: reject images with OJPEG compression
+        that have no TileOffsets/StripOffsets tag, when OJPEG
+        compression is disabled. Prevent null pointer dereference in
+        TIFFReadRawStrip1() and other functions that expect
+        td_stripbytecount to be non NULL.  Fixes
+        http://bugzilla.maptools.org/show_bug.cgi?id=2585
+
+    <LI> libtiff/tif_strip.c: make TIFFNumberOfStrips() return the
+        td->td_nstrips value when it is non-zero, instead of
+        recomputing it. This is needed in TIFF_STRIPCHOP mode where
+        td_nstrips is modified. Fixes a read outsize of array in
+        tiffsplit (or other utilities using TIFFNumberOfStrips()).
+        Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2587
+        (CVE-2016-9273)
+
+    <LI> libtiff/tif_predict.h, libtiff/tif_predict.c: Replace
+        assertions by runtime checks to avoid assertions in debug
+        mode, or buffer overflows in release mode. Can happen when
+        dealing with unusual tile size like YCbCr with
+        subsampling. Reported as MSVR 35105 by Axel Souchet & Vishal
+        Chauhan from the MSRC Vulnerabilities & Mitigations
+
+    <LI> libtiff/tif_dir.c: discard values of SMinSampleValue and
+        SMaxSampleValue when they have been read and the value of
+        SamplesPerPixel is changed afterwards (like when reading a
+        OJPEG compressed image with a missing SamplesPerPixel tag, and
+        whose photometric is RGB or YCbCr, forcing SamplesPerPixel
+        being 3). Otherwise when rewriting the directory (for example
+        with tiffset, we will expect 3 values whereas the array had
+        been allocated with just one), thus causing a out of bound
+        read access.  Fixes
+        http://bugzilla.maptools.org/show_bug.cgi?id=2500
+        (CVE-2014-8127, duplicate: CVE-2016-3658)
+
+    <LI> libtiff/tif_dirwrite.c: avoid null pointer dereference on
+        td_stripoffset when writing directory, if FIELD_STRIPOFFSETS
+        was artificially set for a hack case in OJPEG case.  Fixes
+        http://bugzilla.maptools.org/show_bug.cgi?id=2500
+        (CVE-2014-8127, duplicate: CVE-2016-3658)
+
+    <LI> libtiff/tif_getimage.c (TIFFRGBAImageOK): Reject attempts to
+        read floating point images.
+
+    <LI> libtiff/tif_predict.c (PredictorSetup): Enforce
+        bits-per-sample requirements of floating point predictor (3).
+        Fixes CVE-2016-3622 "Divide By Zero in the tiff2rgba tool."
+
+    <LI> libtiff/tif_pixarlog.c: fix out-of-bounds write vulnerabilities
+        in heap allocated buffers. Reported as MSVR 35094. Discovered by
+        Axel Souchet and Vishal Chauhan from the MSRC Vulnerabilities &
+        Mitigations team.
+
+    <LI> libtiff/tif_write.c: fix issue in error code path of
+        TIFFFlushData1() that didn't reset the tif_rawcc and tif_rawcp
+        members. I'm not completely sure if that could happen in
+        practice outside of the odd behaviour of t2p_seekproc() of
+        tiff2pdf). The report points that a better fix could be to
+        check the return value of TIFFFlushData1() in places where it
+        isn't done currently, but it seems this patch is enough.
+        Reported as MSVR 35095. Discovered by Axel Souchet & Vishal
+        Chauhan & Suha Can from the MSRC Vulnerabilities & Mitigations
+        team.
+
+    <LI> libtiff/tif_pixarlog.c: Fix write buffer overflow in
+        PixarLogEncode if more input samples are provided than
+        expected by PixarLogSetupEncode.  Idea based on
+        libtiff-CVE-2016-3990.patch from
+        libtiff-4.0.3-25.el7_2.src.rpm by Nikola Forro, but with
+        different and simpler check. (bugzilla #2544)
+
+    <LI> libtiff/tif_read.c: Fix out-of-bounds read on memory-mapped
+        files in TIFFReadRawStrip1() and TIFFReadRawTile1() when
+        stripoffset is beyond tmsize_t max value (reported by Mathias
+        Svensson)
+
+    <LI> libtiff/tif_read.c: make TIFFReadEncodedStrip() and
+        TIFFReadEncodedTile() directly use user provided buffer when
+        no compression (and other conditions) to save a memcpy()
+
+    <LI> libtiff/tif_write.c: make TIFFWriteEncodedStrip() and
+        TIFFWriteEncodedTile() directly use user provided buffer when
+        no compression to save a memcpy().
+
+    <LI> libtiff/tif_luv.c: validate that for COMPRESSION_SGILOG and
+        PHOTOMETRIC_LOGL, there is only one sample per pixel. Avoid
+        potential invalid memory write on corrupted/unexpected images
+        when using the TIFFRGBAImageBegin() interface (reported by
+        Clay Wood)
+
+    <LI> libtiff/tif_pixarlog.c: fix potential buffer write overrun in
+        PixarLogDecode() on corrupted/unexpected images (reported by
+        Mathias Svensson) (CVE-2016-5875)
+
+    <LI> libtiff/libtiff.def: Added _TIFFMultiply32 and
+        _TIFFMultiply64 to libtiff.def
+
+     <LI> libtiff/tif_config.vc.h (HAVE_SNPRINTF): Add a '1' to the
+        HAVE_SNPRINTF definition.
+
+    <LI> libtiff/tif_config.vc.h (HAVE_SNPRINTF): Applied patch by
+        Edward Lam to define HAVE_SNPRINTF for Visual Studio 2015.
+
+    <LI> libtiff/tif_dirread.c: when compiled with DEFER_STRILE_LOAD,
+        fix regression, introduced on 2014-12-23, when reading a
+        one-strip file without a StripByteCounts tag. GDAL #6490
+
+    <LI> libtiff/*: upstream typo fixes (mostly contributed by Kurt
+        Schwehr) coming from GDAL internal libtiff
+
+    <LI> libtiff/tif_fax3.h: make Param member of TIFFFaxTabEnt
+        structure a uint16 to reduce size of the binary.
+
+    <LI> libtiff/tif_read.c, tif_dirread.c: fix indentation issues
+        raised by GCC 6 -Wmisleading-indentation
+
+    <LI> libtiff/tif_pixarlog.c: avoid zlib error messages to pass a
+        NULL string to %s formatter, which is undefined behaviour in
+        sprintf().
+
+    <LI> libtiff/tif_next.c: fix potential out-of-bound write in NeXTDecode()
+        triggered by http://lcamtuf.coredump.cx/afl/vulns/libtiff5.tif
+        (bugzilla #2508)
+
+    <LI> libtiff/tif_luv.c: fix potential out-of-bound writes in
+        decode functions in non debug builds by replacing assert()s by
+        regular if checks (bugzilla #2522).  Fix potential
+        out-of-bound reads in case of short input data.
+
+    <LI> libtiff/tif_getimage.c: fix out-of-bound reads in
+        TIFFRGBAImage interface in case of unsupported values of
+        SamplesPerPixel/ExtraSamples for LogLUV / CIELab. Add explicit
+        call to TIFFRGBAImageOK() in TIFFRGBAImageBegin(). Fix
+        CVE-2015-8665 reported by limingxing and CVE-2015-8683
+        reported by zzf of Alibaba.
+
+    <LI> libtiff/tif_dirread.c: workaround false positive warning of
+        Clang Static Analyzer about null pointer dereference in
+        TIFFCheckDirOffset().
+
+    <LI> libtiff/tif_fax3.c: remove dead assignment in
+        Fax3PutEOLgdal(). Found by Clang Static Analyzer
+
+    <LI> libtiff/tif_dirwrite.c: fix truncation to 32 bit of file
+        offsets in TIFFLinkDirectory() and TIFFWriteDirectorySec()
+        when aligning directory offsets on a even offset (affects
+        BigTIFF). This was a regression of the changeset of
+        2015-10-19.
+
+    <LI> libtiff/tif_write.c: TIFFWriteEncodedStrip() and
+        TIFFWriteEncodedTile() should return -1 in case of failure of
+        tif_encodestrip() as documented
+
+    <LI> libtiff/tif_dumpmode.c: DumpModeEncode() should return 0 in
+        case of failure so that the above mentionned functions detect
+        the error.
+
+    <LI> libtiff/*.c: fix MSVC warnings related to cast shortening and
+        assignment within conditional expression
+
+    <LI> libtiff/*.c: fix clang -Wshorten-64-to-32 warnings
+
+    <LI> libtiff/tif_dirread.c: prevent reading ColorMap or
+        TransferFunction if BitsPerPixel > 24, so as to avoid huge
+        memory allocation and file read attempts
+
+    <LI> libtiff/tif_dirread.c: remove duplicated assignment (reported
+        by Clang static analyzer)
+
+    <LI> libtiff/tif_dir.c, libtiff/tif_dirinfo.c,
+        libtiff/tif_compress.c, libtiff/tif_jpeg_12.c: suppress
+        warnings about 'no previous declaration/prototype'
+
+    <LI> libtiff/tiffiop.h, libtiff/tif_dirwrite.c: suffix constants
+        by U to fix 'warning: negative integer implicitly converted to
+        unsigned type' warning (part of -Wconversion)
+
+    <LI> libtiff/tif_dir.c, libtiff/tif_dirread.c,
+          libtiff/tif_getimage.c, libtiff/tif_print.c: fix -Wshadow
+          warnings (only in libtiff/)
+
+</UL>
+
+<P><HR WIDTH=65% ALIGN=left>
+
+<!-------------------------------------------------------------------------->
+       
+<A NAME="tools"><B><FONT SIZE=+3>C</FONT>HANGES IN THE TOOLS:</B></A>
+
+<UL>
+
+    <LI> tools/Makefile.am: The libtiff tools bmp2tiff, gif2tiff,
+        ras2tiff, sgi2tiff, sgisv, and ycbcr are completely removed
+        from the distribution.  The libtiff tools rgb2ycbcr and
+        thumbnail are only built in the build tree for testing.  Old
+        files are put in new 'archive' subdirectory of the source
+        repository, but not in distribution archives.  These changes
+        are made in order to lessen the maintenance burden.
+
+    <LI> tools/tiff2pdf.c: avoid undefined behaviour related to
+        overlapping of source and destination buffer in memcpy() call
+        in t2p_sample_rgbaa_to_rgb() Fixes
+        http://bugzilla.maptools.org/show_bug.cgi?id=2577
+
+    <LI> tools/tiff2pdf.c: fix potential integer overflows on 32 bit
+        builds in t2p_read_tiff_size() Fixes
+        http://bugzilla.maptools.org/show_bug.cgi?id=2576
+
+    <LI> tools/fax2tiff.c: fix segfault when specifying -r without
+        argument. Patch by Yuriy M. Kaminskiy.  Fixes
+        http://bugzilla.maptools.org/show_bug.cgi?id=2572
+
+    <LI> tools/tiffinfo.c: fix out-of-bound read on some tiled images.
+        (http://bugzilla.maptools.org/show_bug.cgi?id=2517)
+
+    <LI> tools/tiffcrop.c: fix multiple uint32 overflows in
+        writeBufferToSeparateStrips(), writeBufferToContigTiles() and
+        writeBufferToSeparateTiles() that could cause heap buffer
+        overflows.  Reported by Henri Salo from Nixu Corporation.
+        Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2592
+
+    <LI> tools/tiffcrop.c: fix out-of-bound read of up to 3 bytes in
+        readContigTilesIntoBuffer(). Reported as MSVR 35092 by Axel
+        Souchet & Vishal Chauhan from the MSRC Vulnerabilities &
+        Mitigations team.
+
+    <LI> tools/tiff2pdf.c: fix write buffer overflow of 2 bytes on
+        JPEG compressed images. Reported by Tyler Bohan of Cisco Talos
+        as TALOS-CAN-0187 / CVE-2016-5652.  Also prevents writing 2
+        extra uninitialized bytes to the file stream.
+
+    <LI> tools/tiffcp.c: fix out-of-bounds write on tiled images with odd
+        tile width vs image width. Reported as MSVR 35103
+        by Axel Souchet and Vishal Chauhan from the MSRC Vulnerabilities &
+        Mitigations team.
+
+    <LI> tools/tiff2pdf.c: fix read -largely- outsize of buffer in
+        t2p_readwrite_pdf_image_tile(), causing crash, when reading a
+        JPEG compressed image with TIFFTAG_JPEGTABLES length being
+        one.  Reported as MSVR 35101 by Axel Souchet and Vishal
+        Chauhan from the MSRC Vulnerabilities & Mitigations team.
+
+    <LI> tools/tiffcp.c: fix read of undefined variable in case of
+        missing required tags. Found on test case of MSVR 35100.
+
+    <LI> tools/tiffcrop.c: fix read of undefined buffer in
+        readContigStripsIntoBuffer() due to uint16 overflow. Probably
+        not a security issue but I can be wrong. Reported as MSVR
+        35100 by Axel Souchet from the MSRC Vulnerabilities &
+        Mitigations team.
+
+    <LI> tools/tiffcrop.c: fix various out-of-bounds write
+        vulnerabilities in heap or stack allocated buffers. Reported
+        as MSVR 35093, MSVR 35096 and MSVR 35097. Discovered by Axel
+        Souchet and Vishal Chauhan from the MSRC Vulnerabilities &
+        Mitigations team.
+
+    <LI> tools/tiff2pdf.c: fix out-of-bounds write vulnerabilities in
+        heap allocate buffer in t2p_process_jpeg_strip(). Reported as
+        MSVR 35098. Discovered by Axel Souchet and Vishal Chauhan from
+        the MSRC Vulnerabilities & Mitigations team.
+
+    <LI> tools/tiff2bw.c: fix weight computation that could result of
+        color value overflow (no security implication). Fix bugzilla
+        #2550.  Patch by Frank Freudenberg.
+
+    <LI> tools/rgb2ycbcr.c: validate values of -v and -h parameters to
+        avoid potential divide by zero. Fixes CVE-2016-3623 (bugzilla #2569)
+
+    <LI> tools/tiffcrop.c: Fix out-of-bounds write in loadImage().
+        From patch libtiff-CVE-2016-3991.patch from
+        libtiff-4.0.3-25.el7_2.src.rpm by Nikola Forro (bugzilla
+        #2543)
+
+    <LI> tools/tiff2rgba.c: Fix integer overflow in size of allocated
+        buffer, when -b mode is enabled, that could result in
+        out-of-bounds write. Based initially on patch
+        tiff-CVE-2016-3945.patch from libtiff-4.0.3-25.el7_2.src.rpm
+        by Nikola Forro, with correction for invalid tests that
+        rejected valid files. (bugzilla #2545)
+
+    <LI> tools/tiffcrop.c: Avoid access outside of stack allocated
+        array on a tiled separate TIFF with more than 8 samples per
+        pixel.  Reported by Kaixiang Zhang of the Cloud Security Team,
+        Qihoo 360 (CVE-2016-5321 / CVE-2016-5323 , bugzilla #2558 /
+        #2559)
+
+    <LI> tools/tiffdump.c: fix a few misaligned 64-bit reads warned by
+        -fsanitize
+
+    <LI> tools/tiffdump.c (ReadDirectory): Remove uint32 cast to
+        _TIFFmalloc() argument which resulted in Coverity report.
+        Added more mutiplication overflow checks.
+
+</UL>
+
+<P><HR WIDTH=65% ALIGN=left>
+
+<!--------------------------------------------------------------------------->
+
+<A NAME="contrib"><B><FONT SIZE=+3>C</FONT>HANGES IN THE CONTRIB AREA:</B></A>
+
+<UL> 
+
+  <LI> None
+
+</UL>
+
+Last updated $Date: 2016-11-12 21:43:44 $.
+
+</BODY>
+</HTML>
index 7343e8f..62fb7bc 100644 (file)
@@ -361,6 +361,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index 98228f1..acf8609 100644 (file)
@@ -162,3 +162,5 @@ EXPORTS     TIFFAccessTagMethods
        _TIFFmemcpy
        _TIFFmemset
        _TIFFrealloc
+        _TIFFMultiply32
+        _TIFFMultiply64
index 927150a..3d35ba9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_aux.c,v 1.26 2010-07-01 15:33:28 dron Exp $ */
+/* $Id: tif_aux.c,v 1.29 2016-11-11 20:45:53 erouault Exp $ */
 
 /*
  * Copyright (c) 1991-1997 Sam Leffler
@@ -100,7 +100,8 @@ TIFFDefaultTransferFunction(TIFFDirectory* td)
 
        n = ((tmsize_t)1)<<td->td_bitspersample;
        nbytes = n * sizeof (uint16);
-       if (!(tf[0] = (uint16 *)_TIFFmalloc(nbytes)))
+        tf[0] = (uint16 *)_TIFFmalloc(nbytes);
+       if (tf[0] == NULL)
                return 0;
        tf[0][0] = 0;
        for (i = 1; i < n; i++) {
@@ -109,10 +110,12 @@ TIFFDefaultTransferFunction(TIFFDirectory* td)
        }
 
        if (td->td_samplesperpixel - td->td_extrasamples > 1) {
-               if (!(tf[1] = (uint16 *)_TIFFmalloc(nbytes)))
+                tf[1] = (uint16 *)_TIFFmalloc(nbytes);
+               if(tf[1] == NULL)
                        goto bad;
                _TIFFmemcpy(tf[1], tf[0], nbytes);
-               if (!(tf[2] = (uint16 *)_TIFFmalloc(nbytes)))
+                tf[2] = (uint16 *)_TIFFmalloc(nbytes);
+               if (tf[2] == NULL)
                        goto bad;
                _TIFFmemcpy(tf[2], tf[0], nbytes);
        }
@@ -134,7 +137,8 @@ TIFFDefaultRefBlackWhite(TIFFDirectory* td)
 {
        int i;
 
-       if (!(td->td_refblackwhite = (float *)_TIFFmalloc(6*sizeof (float))))
+        td->td_refblackwhite = (float *)_TIFFmalloc(6*sizeof (float));
+       if (td->td_refblackwhite == NULL)
                return 0;
         if (td->td_photometric == PHOTOMETRIC_YCBCR) {
                /*
@@ -163,7 +167,7 @@ TIFFDefaultRefBlackWhite(TIFFDirectory* td)
  * value if the tag is not present in the directory.
  *
  * NB: We use the value in the directory, rather than
- *     explcit values so that defaults exist only one
+ *     explicit values so that defaults exist only one
  *     place in the library -- in TIFFDefaultDirectory.
  */
 int
@@ -208,11 +212,18 @@ TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap)
                *va_arg(ap, uint16 *) = td->td_resolutionunit;
                return (1);
        case TIFFTAG_PREDICTOR:
-                {
-                       TIFFPredictorState* sp = (TIFFPredictorState*) tif->tif_data;
-                       *va_arg(ap, uint16*) = (uint16) sp->predictor;
-                       return 1;
-                }
+    {
+        TIFFPredictorState* sp = (TIFFPredictorState*) tif->tif_data;
+        if( sp == NULL )
+        {
+            TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+                         "Cannot get \"Predictor\" tag as plugin is not configured");
+            *va_arg(ap, uint16*) = 0;
+            return 0;
+        }
+        *va_arg(ap, uint16*) = (uint16) sp->predictor;
+        return 1;
+    }
        case TIFFTAG_DOTRANGE:
                *va_arg(ap, uint16 *) = 0;
                *va_arg(ap, uint16 *) = (1<<td->td_bitspersample)-1;
index 13d2bab..a0cb661 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_close.c,v 1.19 2010-03-10 18:56:48 bfriesen Exp $ */
+/* $Id: tif_close.c,v 1.21 2016-01-23 21:20:34 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -36,7 +36,7 @@
 
 /**
  * Auxiliary function to free the TIFF structure. Given structure will be
- * completetly freed, so you should save opened file handle and pointer
+ * completely freed, so you should save opened file handle and pointer
  * to the close procedure in external variables before calling
  * _TIFFCleanup(), if you will need these ones to close the file.
  * 
@@ -62,11 +62,11 @@ TIFFCleanup(TIFF* tif)
          */
        while( tif->tif_clientinfo )
        {
-               TIFFClientInfoLink *link = tif->tif_clientinfo;
+               TIFFClientInfoLink *psLink = tif->tif_clientinfo;
 
-               tif->tif_clientinfo = link->next;
-               _TIFFfree( link->name );
-               _TIFFfree( link );
+               tif->tif_clientinfo = psLink->next;
+               _TIFFfree( psLink->name );
+               _TIFFfree( psLink );
        }
 
        if (tif->tif_rawdata && (tif->tif_flags&TIFF_MYBUFFER))
index be4850c..89194c2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_color.c,v 1.19 2010-12-14 02:22:42 faxguy Exp $ */
+/* $Id: tif_color.c,v 1.22 2016-09-04 21:32:56 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -126,37 +126,37 @@ TIFFCIELabToRGBInit(TIFFCIELabToRGB* cielab,
                    const TIFFDisplay *display, float *refWhite)
 {
        int i;
-       double gamma;
+       double dfGamma;
 
        cielab->range = CIELABTORGB_TABLE_RANGE;
 
        _TIFFmemcpy(&cielab->display, display, sizeof(TIFFDisplay));
 
        /* Red */
-       gamma = 1.0 / cielab->display.d_gammaR ;
+       dfGamma = 1.0 / cielab->display.d_gammaR ;
        cielab->rstep =
                (cielab->display.d_YCR - cielab->display.d_Y0R) / cielab->range;
        for(i = 0; i <= cielab->range; i++) {
                cielab->Yr2r[i] = cielab->display.d_Vrwr
-                   * ((float)pow((double)i / cielab->range, gamma));
+                   * ((float)pow((double)i / cielab->range, dfGamma));
        }
 
        /* Green */
-       gamma = 1.0 / cielab->display.d_gammaG ;
+       dfGamma = 1.0 / cielab->display.d_gammaG ;
        cielab->gstep =
            (cielab->display.d_YCR - cielab->display.d_Y0R) / cielab->range;
        for(i = 0; i <= cielab->range; i++) {
                cielab->Yg2g[i] = cielab->display.d_Vrwg
-                   * ((float)pow((double)i / cielab->range, gamma));
+                   * ((float)pow((double)i / cielab->range, dfGamma));
        }
 
        /* Blue */
-       gamma = 1.0 / cielab->display.d_gammaB ;
+       dfGamma = 1.0 / cielab->display.d_gammaB ;
        cielab->bstep =
            (cielab->display.d_YCR - cielab->display.d_Y0R) / cielab->range;
        for(i = 0; i <= cielab->range; i++) {
                cielab->Yb2b[i] = cielab->display.d_Vrwb
-                   * ((float)pow((double)i / cielab->range, gamma));
+                   * ((float)pow((double)i / cielab->range, dfGamma));
        }
 
        /* Init reference white point */
@@ -175,7 +175,7 @@ TIFFCIELabToRGBInit(TIFFCIELabToRGB* cielab,
 #define        SHIFT                   16
 #define        FIX(x)                  ((int32)((x) * (1L<<SHIFT) + 0.5))
 #define        ONE_HALF                ((int32)(1<<(SHIFT-1)))
-#define        Code2V(c, RB, RW, CR)   ((((c)-(int32)(RB))*(float)(CR))/(float)(((RW)-(RB)) ? ((RW)-(RB)) : 1))
+#define        Code2V(c, RB, RW, CR)   ((((c)-(int32)(RB))*(float)(CR))/(float)(((RW)-(RB)!=0) ? ((RW)-(RB)) : 1))
 #define        CLAMP(f,min,max)        ((f)<(min)?(min):(f)>(max)?(max):(f))
 #define HICLAMP(f,max)         ((f)>(max)?(max):(f))
 
@@ -186,7 +186,9 @@ TIFFYCbCrtoRGB(TIFFYCbCrToRGB *ycbcr, uint32 Y, int32 Cb, int32 Cr,
        int32 i;
 
        /* XXX: Only 8-bit YCbCr input supported for now */
-       Y = HICLAMP(Y, 255), Cb = CLAMP(Cb, 0, 255), Cr = CLAMP(Cr, 0, 255);
+       Y = HICLAMP(Y, 255);
+       Cb = CLAMP(Cb, 0, 255);
+       Cr = CLAMP(Cr, 0, 255);
 
        i = ycbcr->Y_tab[Y] + ycbcr->Cr_r_tab[Cr];
        *r = CLAMP(i, 0, 255);
index 20e72fd..b571d19 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_compress.c,v 1.22 2010-03-10 18:56:48 bfriesen Exp $ */
+/* $Id: tif_compress.c,v 1.25 2016-10-25 20:04:22 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -82,10 +82,10 @@ TIFFNoDecode(TIFF* tif, const char* method)
                TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
                             "Compression scheme %u %s decoding is not implemented",
                             tif->tif_dir.td_compression, method);
-       return (-1);
+       return (0);
 }
 
-int
+static int
 _TIFFNoFixupTags(TIFF* tif)
 {
        (void) tif;
@@ -227,7 +227,7 @@ TIFFUnRegisterCODEC(TIFFCodec* c)
        codec_t* cd;
        codec_t** pcd;
 
-       for (pcd = &registeredCODECS; (cd = *pcd); pcd = &cd->next)
+       for (pcd = &registeredCODECS; (cd = *pcd) != NULL; pcd = &cd->next)
                if (cd->info == c) {
                        *pcd = cd->next;
                        _TIFFfree(cd);
index 7e6c5c2..5cebfa0 100644 (file)
 /* Visual Studio 2015 / VC 14 / MSVC 19.00 finally has snprintf() */
 #if defined(_MSC_VER) && _MSC_VER < 1900
 #define snprintf _snprintf
+#else
+#define HAVE_SNPRINTF 1
 #endif
 
 /* Define to 1 if your processor stores words with the most significant byte
index 73212c0..ad21655 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_dir.c,v 1.121 2015-05-31 23:11:43 bfriesen Exp $ */
+/* $Id: tif_dir.c,v 1.127 2016-10-25 21:35:15 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
 static void
 setByteArray(void** vpp, void* vp, size_t nmemb, size_t elem_size)
 {
-       if (*vpp)
-               _TIFFfree(*vpp), *vpp = 0;
+       if (*vpp) {
+               _TIFFfree(*vpp);
+               *vpp = 0;
+       }
        if (vp) {
                tmsize_t bytes = (tmsize_t)(nmemb * elem_size);
                if (elem_size && bytes / elem_size == nmemb)
@@ -57,13 +59,13 @@ void _TIFFsetByteArray(void** vpp, void* vp, uint32 n)
     { setByteArray(vpp, vp, n, 1); }
 void _TIFFsetString(char** cpp, char* cp)
     { setByteArray((void**) cpp, (void*) cp, strlen(cp)+1, 1); }
-void _TIFFsetNString(char** cpp, char* cp, uint32 n)
+static void _TIFFsetNString(char** cpp, char* cp, uint32 n)
     { setByteArray((void**) cpp, (void*) cp, n, 1); }
 void _TIFFsetShortArray(uint16** wpp, uint16* wp, uint32 n)
     { setByteArray((void**) wpp, (void*) wp, n, sizeof (uint16)); }
 void _TIFFsetLongArray(uint32** lpp, uint32* lp, uint32 n)
     { setByteArray((void**) lpp, (void*) lp, n, sizeof (uint32)); }
-void _TIFFsetLong8Array(uint64** lpp, uint64* lp, uint32 n)
+static void _TIFFsetLong8Array(uint64** lpp, uint64* lp, uint32 n)
     { setByteArray((void**) lpp, (void*) lp, n, sizeof (uint64)); }
 void _TIFFsetFloatArray(float** fpp, float* fp, uint32 n)
     { setByteArray((void**) fpp, (void*) fp, n, sizeof (float)); }
@@ -170,7 +172,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
         * We want to force the custom code to be used for custom
         * fields even if the tag happens to match a well known 
         * one - important for reinterpreted handling of standard
-        * tag values in custom directories (ie. EXIF) 
+        * tag values in custom directories (i.e. EXIF) 
         */
        if (fip->field_bit == FIELD_CUSTOM) {
                standard_tag = 0;
@@ -254,6 +256,28 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
                v = (uint16) va_arg(ap, uint16_vap);
                if (v == 0)
                        goto badvalue;
+        if( v != td->td_samplesperpixel )
+        {
+            /* See http://bugzilla.maptools.org/show_bug.cgi?id=2500 */
+            if( td->td_sminsamplevalue != NULL )
+            {
+                TIFFWarningExt(tif->tif_clientdata,module,
+                    "SamplesPerPixel tag value is changing, "
+                    "but SMinSampleValue tag was read with a different value. Cancelling it");
+                TIFFClrFieldBit(tif,FIELD_SMINSAMPLEVALUE);
+                _TIFFfree(td->td_sminsamplevalue);
+                td->td_sminsamplevalue = NULL;
+            }
+            if( td->td_smaxsamplevalue != NULL )
+            {
+                TIFFWarningExt(tif->tif_clientdata,module,
+                    "SamplesPerPixel tag value is changing, "
+                    "but SMaxSampleValue tag was read with a different value. Cancelling it");
+                TIFFClrFieldBit(tif,FIELD_SMAXSAMPLEVALUE);
+                _TIFFfree(td->td_smaxsamplevalue);
+                td->td_smaxsamplevalue = NULL;
+            }
+        }
                td->td_samplesperpixel = (uint16) v;
                break;
        case TIFFTAG_ROWSPERSTRIP:
@@ -402,7 +426,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
                if ((tif->tif_flags & TIFF_INSUBIFD) == 0) {
                        td->td_nsubifd = (uint16) va_arg(ap, uint16_vap);
                        _TIFFsetLong8Array(&td->td_subifd, (uint64*) va_arg(ap, uint64*),
-                           (long) td->td_nsubifd);
+                           (uint32) td->td_nsubifd);
                } else {
                        TIFFErrorExt(tif->tif_clientdata, module,
                                     "%s: Sorry, cannot nest SubIFDs",
@@ -421,7 +445,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
                v = (td->td_samplesperpixel - td->td_extrasamples) > 1 ? 3 : 1;
                for (i = 0; i < v; i++)
                        _TIFFsetShortArray(&td->td_transferfunction[i],
-                           va_arg(ap, uint16*), 1L<<td->td_bitspersample);
+                           va_arg(ap, uint16*), 1U<<td->td_bitspersample);
                break;
        case TIFFTAG_REFERENCEBLACKWHITE:
                /* XXX should check for null range */
@@ -579,10 +603,10 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
                                   handled this way ... likely best if we move it into
                                   the directory structure with an explicit field in 
                                   libtiff 4.1 and assign it a FIELD_ value */
-                               uint16 v[2];
-                               v[0] = (uint16)va_arg(ap, int);
-                               v[1] = (uint16)va_arg(ap, int);
-                               _TIFFmemcpy(tv->value, &v, 4);
+                               uint16 v2[2];
+                               v2[0] = (uint16)va_arg(ap, int);
+                               v2[1] = (uint16)va_arg(ap, int);
+                               _TIFFmemcpy(tv->value, &v2, 4);
                        }
 
                        else if (fip->field_passcount
@@ -600,66 +624,66 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
                                case TIFF_BYTE:
                                case TIFF_UNDEFINED:
                                        {
-                                               uint8 v = (uint8)va_arg(ap, int);
-                                               _TIFFmemcpy(val, &v, tv_size);
+                                               uint8 v2 = (uint8)va_arg(ap, int);
+                                               _TIFFmemcpy(val, &v2, tv_size);
                                        }
                                        break;
                                case TIFF_SBYTE:
                                        {
-                                               int8 v = (int8)va_arg(ap, int);
-                                               _TIFFmemcpy(val, &v, tv_size);
+                                               int8 v2 = (int8)va_arg(ap, int);
+                                               _TIFFmemcpy(val, &v2, tv_size);
                                        }
                                        break;
                                case TIFF_SHORT:
                                        {
-                                               uint16 v = (uint16)va_arg(ap, int);
-                                               _TIFFmemcpy(val, &v, tv_size);
+                                               uint16 v2 = (uint16)va_arg(ap, int);
+                                               _TIFFmemcpy(val, &v2, tv_size);
                                        }
                                        break;
                                case TIFF_SSHORT:
                                        {
-                                               int16 v = (int16)va_arg(ap, int);
-                                               _TIFFmemcpy(val, &v, tv_size);
+                                               int16 v2 = (int16)va_arg(ap, int);
+                                               _TIFFmemcpy(val, &v2, tv_size);
                                        }
                                        break;
                                case TIFF_LONG:
                                case TIFF_IFD:
                                        {
-                                               uint32 v = va_arg(ap, uint32);
-                                               _TIFFmemcpy(val, &v, tv_size);
+                                               uint32 v2 = va_arg(ap, uint32);
+                                               _TIFFmemcpy(val, &v2, tv_size);
                                        }
                                        break;
                                case TIFF_SLONG:
                                        {
-                                               int32 v = va_arg(ap, int32);
-                                               _TIFFmemcpy(val, &v, tv_size);
+                                               int32 v2 = va_arg(ap, int32);
+                                               _TIFFmemcpy(val, &v2, tv_size);
                                        }
                                        break;
                                case TIFF_LONG8:
                                case TIFF_IFD8:
                                        {
-                                               uint64 v = va_arg(ap, uint64);
-                                               _TIFFmemcpy(val, &v, tv_size);
+                                               uint64 v2 = va_arg(ap, uint64);
+                                               _TIFFmemcpy(val, &v2, tv_size);
                                        }
                                        break;
                                case TIFF_SLONG8:
                                        {
-                                               int64 v = va_arg(ap, int64);
-                                               _TIFFmemcpy(val, &v, tv_size);
+                                               int64 v2 = va_arg(ap, int64);
+                                               _TIFFmemcpy(val, &v2, tv_size);
                                        }
                                        break;
                                case TIFF_RATIONAL:
                                case TIFF_SRATIONAL:
                                case TIFF_FLOAT:
                                        {
-                                               float v = (float)va_arg(ap, double);
-                                               _TIFFmemcpy(val, &v, tv_size);
+                                               float v2 = (float)va_arg(ap, double);
+                                               _TIFFmemcpy(val, &v2, tv_size);
                                        }
                                        break;
                                case TIFF_DOUBLE:
                                        {
-                                               double v = va_arg(ap, double);
-                                               _TIFFmemcpy(val, &v, tv_size);
+                                               double v2 = va_arg(ap, double);
+                                               _TIFFmemcpy(val, &v2, tv_size);
                                        }
                                        break;
                                default:
@@ -672,9 +696,9 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
        }
        }
        if (status) {
-               const TIFFField* fip=TIFFFieldWithTag(tif,tag);
-               if (fip)                
-                       TIFFSetFieldBit(tif, fip->field_bit);
+               const TIFFField* fip2=TIFFFieldWithTag(tif,tag);
+               if (fip2)                
+                       TIFFSetFieldBit(tif, fip2->field_bit);
                tif->tif_flags |= TIFF_DIRTYDIRECT;
        }
 
@@ -683,31 +707,31 @@ end:
        return (status);
 badvalue:
         {
-               const TIFFField* fip=TIFFFieldWithTag(tif,tag);
+               const TIFFField* fip2=TIFFFieldWithTag(tif,tag);
                TIFFErrorExt(tif->tif_clientdata, module,
                     "%s: Bad value %u for \"%s\" tag",
                     tif->tif_name, v,
-                    fip ? fip->field_name : "Unknown");
+                    fip2 ? fip2->field_name : "Unknown");
                va_end(ap);
         }
        return (0);
 badvalue32:
         {
-               const TIFFField* fip=TIFFFieldWithTag(tif,tag);
+               const TIFFField* fip2=TIFFFieldWithTag(tif,tag);
                TIFFErrorExt(tif->tif_clientdata, module,
                     "%s: Bad value %u for \"%s\" tag",
                     tif->tif_name, v32,
-                    fip ? fip->field_name : "Unknown");
+                    fip2 ? fip2->field_name : "Unknown");
                va_end(ap);
         }
        return (0);
 badvaluedouble:
         {
-        const TIFFField* fip=TIFFFieldWithTag(tif,tag);
+        const TIFFField* fip2=TIFFFieldWithTag(tif,tag);
         TIFFErrorExt(tif->tif_clientdata, module,
              "%s: Bad value %f for \"%s\" tag",
              tif->tif_name, dblval,
-             fip ? fip->field_name : "Unknown");
+             fip2 ? fip2->field_name : "Unknown");
         va_end(ap);
         }
     return (0);
@@ -834,7 +858,7 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
         * We want to force the custom code to be used for custom
         * fields even if the tag happens to match a well known 
         * one - important for reinterpreted handling of standard
-        * tag values in custom directories (ie. EXIF) 
+        * tag values in custom directories (i.e. EXIF) 
         */
        if (fip->field_bit == FIELD_CUSTOM) {
                standard_tag = 0;
@@ -885,7 +909,7 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
                                *va_arg(ap, double**) = td->td_sminsamplevalue;
                        else
                        {
-                               /* libtiff historially treats this as a single value. */
+                               /* libtiff historically treats this as a single value. */
                                uint16 i;
                                double v = td->td_sminsamplevalue[0];
                                for (i=1; i < td->td_samplesperpixel; ++i)
@@ -899,7 +923,7 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
                                *va_arg(ap, double**) = td->td_smaxsamplevalue;
                        else
                        {
-                               /* libtiff historially treats this as a single value. */
+                               /* libtiff historically treats this as a single value. */
                                uint16 i;
                                double v = td->td_smaxsamplevalue[0];
                                for (i=1; i < td->td_samplesperpixel; ++i)
index 7db4bdb..23ad002 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_dirinfo.c,v 1.121 2014-05-07 01:58:46 bfriesen Exp $ */
+/* $Id: tif_dirinfo.c,v 1.126 2016-11-18 02:52:13 bfriesen Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * NOTE: The second field (field_readcount) and third field (field_writecount)
  *       sometimes use the values TIFF_VARIABLE (-1), TIFF_VARIABLE2 (-3)
  *       and TIFF_SPP (-2). The macros should be used but would throw off
- *       the formatting of the code, so please interprete the -1, -2 and -3
+ *       the formatting of the code, so please interpret the -1, -2 and -3
  *       values accordingly.
  */
 
-static TIFFFieldArray tiffFieldArray;
-static TIFFFieldArray exifFieldArray;
-
-static TIFFField
+/* const object should be initialized */
+#ifdef _MSC_VER
+#pragma warning( push )
+#pragma warning( disable : 4132 )
+#endif
+static const TIFFFieldArray tiffFieldArray;
+static const TIFFFieldArray exifFieldArray;
+#ifdef _MSC_VER
+#pragma warning( pop )
+#endif
+
+static const TIFFField
 tiffFields[] = {
        { TIFFTAG_SUBFILETYPE, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_SUBFILETYPE, 1, 0, "SubfileType", NULL },
        { TIFFTAG_OSUBFILETYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_SUBFILETYPE, 1, 0, "OldSubfileType", NULL },
@@ -95,7 +103,7 @@ tiffFields[] = {
        { TIFFTAG_TILELENGTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_TILEDIMENSIONS, 0, 0, "TileLength", NULL },
        { TIFFTAG_TILEOFFSETS, -1, 1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_STRIPOFFSETS, 0, 0, "TileOffsets", NULL },
        { TIFFTAG_TILEBYTECOUNTS, -1, 1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_STRIPBYTECOUNTS, 0, 0, "TileByteCounts", NULL },
-       { TIFFTAG_SUBIFD, -1, -1, TIFF_IFD8, 0, TIFF_SETGET_C16_IFD8, TIFF_SETGET_UNDEFINED, FIELD_SUBIFD, 1, 1, "SubIFD", &tiffFieldArray },
+       { TIFFTAG_SUBIFD, -1, -1, TIFF_IFD8, 0, TIFF_SETGET_C16_IFD8, TIFF_SETGET_UNDEFINED, FIELD_SUBIFD, 1, 1, "SubIFD", (TIFFFieldArray*) &tiffFieldArray },
        { TIFFTAG_INKSET, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "InkSet", NULL },
        { TIFFTAG_INKNAMES, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_C16_ASCII, TIFF_SETGET_UNDEFINED, FIELD_INKNAMES, 1, 1, "InkNames", NULL },
        { TIFFTAG_NUMBEROFINKS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "NumberOfInks", NULL },
@@ -134,7 +142,7 @@ tiffFields[] = {
        /* end Pixar tags */
        { TIFFTAG_RICHTIFFIPTC, -3, -3, TIFF_LONG, 0, TIFF_SETGET_C32_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "RichTIFFIPTC", NULL },
        { TIFFTAG_PHOTOSHOP, -3, -3, TIFF_BYTE, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "Photoshop", NULL },
-       { TIFFTAG_EXIFIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "EXIFIFDOffset", &exifFieldArray },
+       { TIFFTAG_EXIFIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "EXIFIFDOffset", (TIFFFieldArray*) &exifFieldArray },
        { TIFFTAG_ICCPROFILE, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "ICC Profile", NULL },
        { TIFFTAG_GPSIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "GPSIFDOffset", NULL },
        { TIFFTAG_FAXRECVPARAMS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UINT32, FIELD_CUSTOM, TRUE, FALSE, "FaxRecvParams", NULL },
@@ -211,7 +219,7 @@ tiffFields[] = {
        /* begin pseudo tags */
 };
 
-static TIFFField
+static const TIFFField
 exifFields[] = {
        { EXIFTAG_EXPOSURETIME, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ExposureTime", NULL },
        { EXIFTAG_FNUMBER, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FNumber", NULL },
@@ -271,13 +279,13 @@ exifFields[] = {
        { EXIFTAG_IMAGEUNIQUEID, 33, 33, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImageUniqueID", NULL }
 };
 
-static TIFFFieldArray
-tiffFieldArray = { tfiatImage, 0, TIFFArrayCount(tiffFields), tiffFields };
-static TIFFFieldArray
-exifFieldArray = { tfiatExif, 0, TIFFArrayCount(exifFields), exifFields };
+static const TIFFFieldArray
+tiffFieldArray = { tfiatImage, 0, TIFFArrayCount(tiffFields), (TIFFField*) tiffFields };
+static const TIFFFieldArray
+exifFieldArray = { tfiatExif, 0, TIFFArrayCount(exifFields), (TIFFField*) exifFields };
 
 /*
- *  We have our own local lfind() equivelent to avoid subtle differences
+ *  We have our own local lfind() equivalent to avoid subtle differences
  *  in types passed to lfind() on different systems. 
  */
 
@@ -521,7 +529,7 @@ TIFFFindField(TIFF* tif, uint32 tag, TIFFDataType dt)
        return tif->tif_foundfield = (ret ? *ret : NULL);
 }
 
-const TIFFField*
+static const TIFFField*
 _TIFFFindFieldByName(TIFF* tif, const char *field_name, TIFFDataType dt)
 {
        TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, 0, NULL, NULL};
@@ -713,7 +721,7 @@ _TIFFCreateAnonField(TIFF *tif, uint32 tag, TIFFDataType field_type)
         * note that this name is a special sign to TIFFClose() and
         * _TIFFSetupFields() to free the field
         */
-       snprintf(fld->field_name, 32, "Tag %d", (int) tag);
+       (void) snprintf(fld->field_name, 32, "Tag %d", (int) tag);
 
        return fld;    
 }
index a0dc68b..01070f2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_dirread.c,v 1.191 2015-09-05 20:31:41 bfriesen Exp $ */
+/* $Id: tif_dirread.c,v 1.204 2016-11-16 15:14:15 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -166,6 +166,8 @@ static int TIFFFetchSubjectDistance(TIFF*, TIFFDirEntry*);
 static void ChopUpSingleUncompressedStrip(TIFF*);
 static uint64 TIFFReadUInt64(const uint8 *value);
 
+static int _TIFFFillStrilesInternal( TIFF *tif, int loadStripByteCount );
+
 typedef union _UInt64Aligned_t
 {
         double d;
@@ -3457,12 +3459,12 @@ TIFFReadDirectory(TIFF* tif)
         * the fields to check type and tag information,
         * and to extract info required to size data
         * structures.  A second pass is made afterwards
-        * to read in everthing not taken in the first pass.
+        * to read in everything not taken in the first pass.
         * But we must process the Compression tag first
         * in order to merge in codec-private tag definitions (otherwise
         * we may get complaints about unknown tags).  However, the
         * Compression tag may be dependent on the SamplesPerPixel
-        * tag value because older TIFF specs permited Compression
+        * tag value because older TIFF specs permitted Compression
         * to be written as a SamplesPerPixel-count tag entry.
         * Thus if we don't first figure out the correct SamplesPerPixel
         * tag value then we may end up ignoring the Compression tag
@@ -3626,6 +3628,7 @@ TIFFReadDirectory(TIFF* tif)
        if (tif->tif_dir.td_planarconfig == PLANARCONFIG_SEPARATE)
                tif->tif_dir.td_stripsperimage /= tif->tif_dir.td_samplesperpixel;
        if (!TIFFFieldSet(tif, FIELD_STRIPOFFSETS)) {
+#ifdef OJPEG_SUPPORT
                if ((tif->tif_dir.td_compression==COMPRESSION_OJPEG) &&
                    (isTiled(tif)==0) &&
                    (tif->tif_dir.td_nstrips==1)) {
@@ -3638,7 +3641,9 @@ TIFFReadDirectory(TIFF* tif)
                         * JpegInterchangeFormat stream.
                         */
                        TIFFSetFieldBit(tif, FIELD_STRIPOFFSETS);
-               } else {
+               } else
+#endif
+        {
                        MissingRequired(tif,
                                isTiled(tif) ? "TileOffsets" : "StripOffsets");
                        goto bad;
@@ -3663,7 +3668,7 @@ TIFFReadDirectory(TIFF* tif)
                                 * DataType and SampleFormat tags are supposed to be
                                 * written as one value/sample, but some vendors
                                 * incorrectly write one value only -- so we accept
-                                * that as well (yech). Other vendors write correct
+                                * that as well (yuck). Other vendors write correct
                                 * value for NumberOfSamples, but incorrect one for
                                 * BitsPerSample and friends, and we will read this
                                 * too.
@@ -3690,7 +3695,7 @@ TIFFReadDirectory(TIFF* tif)
                        case TIFFTAG_SMAXSAMPLEVALUE:
                                {
 
-                                       double *data;
+                                       double *data = NULL;
                                        enum TIFFReadDirEntryErr err;
                                        uint32 saved_flags;
                                        int m;
@@ -3741,7 +3746,7 @@ TIFFReadDirectory(TIFF* tif)
                                        uint32 countrequired;
                                        uint32 incrementpersample;
                                        uint16* value=NULL;
-                    /* It would be dangerous to instanciate those tag values */
+                    /* It would be dangerous to instantiate those tag values */
                     /* since if td_bitspersample has not yet been read (due to */
                     /* unordered tags), it could be read afterwards with a */
                     /* values greater than the default one (1), which may cause */
@@ -3754,7 +3759,19 @@ TIFFReadDirectory(TIFF* tif)
                                        fip ? fip->field_name : "unknown tagname");
                         continue;
                     }
-                                       countpersample=(1L<<tif->tif_dir.td_bitspersample);
+                                       /* ColorMap or TransferFunction for high bit */
+                                       /* depths do not make much sense and could be */
+                                       /* used as a denial of service vector */
+                                       if (tif->tif_dir.td_bitspersample > 24)
+                                       {
+                                           fip = TIFFFieldWithTag(tif,dp->tdir_tag);
+                                           TIFFWarningExt(tif->tif_clientdata,module,
+                                               "Ignoring %s because BitsPerSample=%d>24",
+                                               fip ? fip->field_name : "unknown tagname",
+                                               tif->tif_dir.td_bitspersample);
+                                           continue;
+                                       }
+                                       countpersample=(1U<<tif->tif_dir.td_bitspersample);
                                        if ((dp->tdir_tag==TIFFTAG_TRANSFERFUNCTION)&&(dp->tdir_count==(uint64)countpersample))
                                        {
                                                countrequired=countpersample;
@@ -4142,7 +4159,7 @@ TIFFReadDirectoryFindFieldInfo(TIFF* tif, uint16 tagid, uint32* fii)
 }
 
 /*
- * Read custom directory from the arbitarry offset.
+ * Read custom directory from the arbitrary offset.
  * The code is very similar to TIFFReadDirectory().
  */
 int
@@ -4269,8 +4286,9 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
        TIFFDirectory *td = &tif->tif_dir;
        uint32 strip;
 
-    if( !_TIFFFillStriles( tif ) )
-        return -1;
+    /* Do not try to load stripbytecount as we will compute it */
+        if( !_TIFFFillStrilesInternal( tif, 0 ) )
+            return -1;
 
        if (td->td_stripbytecount)
                _TIFFfree(td->td_stripbytecount);
@@ -4292,7 +4310,7 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
                /* calculate amount of space used by indirect values */
                for (dp = dir, n = dircount; n > 0; n--, dp++)
                {
-                       uint32 typewidth = TIFFDataWidth((TIFFDataType) dp->tdir_type);
+                       uint32 typewidth;
                        uint64 datasize;
                        typewidth = TIFFDataWidth((TIFFDataType) dp->tdir_type);
                        if (typewidth == 0) {
@@ -4382,7 +4400,7 @@ TIFFCheckDirOffset(TIFF* tif, uint64 diroff)
 
        tif->tif_dirnumber++;
 
-       if (tif->tif_dirnumber > tif->tif_dirlistsize) {
+       if (tif->tif_dirlist == NULL || tif->tif_dirnumber > tif->tif_dirlistsize) {
                uint64* new_dirlist;
 
                /*
@@ -4572,7 +4590,6 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
                }
                else
                {
-                       tmsize_t m;
                        uint64 dircount64;
                        m=off+sizeof(uint64);
                        if ((m<off)||(m<(tmsize_t)sizeof(uint64))||(m>tif->tif_size)) {
@@ -4983,6 +5000,11 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
                                        if (err==TIFFReadDirEntryErrOk)
                                        {
                                                int m;
+                        if( dp->tdir_count > 0 && data[dp->tdir_count-1] != '\0' )
+                        {
+                            TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte. Forcing it to be null",fip->field_name);
+                            data[dp->tdir_count-1] = '\0';
+                        }
                                                m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data);
                                                if (data!=0)
                                                        _TIFFfree(data);
@@ -5155,6 +5177,11 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
                                if (err==TIFFReadDirEntryErrOk)
                                {
                                        int m;
+                    if( dp->tdir_count > 0 && data[dp->tdir_count-1] != '\0' )
+                    {
+                        TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte. Forcing it to be null",fip->field_name);
+                        data[dp->tdir_count-1] = '\0';
+                    }
                                        m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
                                        if (data!=0)
                                                _TIFFfree(data);
@@ -5558,6 +5585,11 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
 
 int _TIFFFillStriles( TIFF *tif )
 {
+    return _TIFFFillStrilesInternal( tif, 1 );
+}
+
+static int _TIFFFillStrilesInternal( TIFF *tif, int loadStripByteCount )
+{
 #if defined(DEFER_STRILE_LOAD)
         register TIFFDirectory *td = &tif->tif_dir;
         int return_value = 1;
@@ -5574,7 +5606,8 @@ int _TIFFFillStriles( TIFF *tif )
                 return_value = 0;
         }
 
-        if (!TIFFFetchStripThing(tif,&(td->td_stripbytecount_entry),
+        if (loadStripByteCount &&
+            !TIFFFetchStripThing(tif,&(td->td_stripbytecount_entry),
                                  td->td_nstrips,&td->td_stripbytecount))
         {
                 return_value = 0;
@@ -5599,6 +5632,7 @@ int _TIFFFillStriles( TIFF *tif )
         return return_value;
 #else /* !defined(DEFER_STRILE_LOAD) */
         (void) tif;
+        (void) loadStripByteCount;
         return 1;
 #endif 
 }
index a0fd8dc..d34f6f6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_dirwrite.c,v 1.78 2015-05-31 00:38:46 bfriesen Exp $ */
+/* $Id: tif_dirwrite.c,v 1.83 2016-10-25 21:35:15 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -542,8 +542,20 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
                        {
                                if (!isTiled(tif))
                                {
-                                       if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_STRIPOFFSETS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripoffset))
-                                               goto bad;
+                    /* td_stripoffset might be NULL in an odd OJPEG case. See
+                     *  tif_dirread.c around line 3634.
+                     * XXX: OJPEG hack.
+                     * If a) compression is OJPEG, b) it's not a tiled TIFF,
+                     * and c) the number of strips is 1,
+                     * then we tolerate the absence of stripoffsets tag,
+                     * because, presumably, all required data is in the
+                     * JpegInterchangeFormat stream.
+                     * We can get here when using tiffset on such a file.
+                     * See http://bugzilla.maptools.org/show_bug.cgi?id=2500
+                    */
+                    if (tif->tif_dir.td_stripoffset != NULL &&
+                        !TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_STRIPOFFSETS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripoffset))
+                        goto bad;
                                }
                                else
                                {
@@ -645,7 +657,7 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
                                                                        assert(o->field_passcount==0);
                                                                        TIFFGetField(tif,o->field_tag,&pb);
                                                                        pa=(uint32)(strlen(pb));
-                                                                       if (!TIFFWriteDirectoryTagAscii(tif,&ndir,dir,o->field_tag,pa,pb))
+                                                                       if (!TIFFWriteDirectoryTagAscii(tif,&ndir,dir,(uint16)o->field_tag,pa,pb))
                                                                                goto bad;
                                                                }
                                                                break;
@@ -656,7 +668,7 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
                                                                        assert(o->field_readcount==1);
                                                                        assert(o->field_passcount==0);
                                                                        TIFFGetField(tif,o->field_tag,&p);
-                                                                       if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,o->field_tag,p))
+                                                                       if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,(uint16)o->field_tag,p))
                                                                                goto bad;
                                                                }
                                                                break;
@@ -667,7 +679,7 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
                                                                        assert(o->field_readcount==1);
                                                                        assert(o->field_passcount==0);
                                                                        TIFFGetField(tif,o->field_tag,&p);
-                                                                       if (!TIFFWriteDirectoryTagLong(tif,&ndir,dir,o->field_tag,p))
+                                                                       if (!TIFFWriteDirectoryTagLong(tif,&ndir,dir,(uint16)o->field_tag,p))
                                                                                goto bad;
                                                                }
                                                                break;
@@ -679,7 +691,7 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
                                                                        assert(o->field_readcount==TIFF_VARIABLE2);
                                                                        assert(o->field_passcount==1);
                                                                        TIFFGetField(tif,o->field_tag,&pa,&pb);
-                                                                       if (!TIFFWriteDirectoryTagUndefinedArray(tif,&ndir,dir,o->field_tag,pa,pb))
+                                                                       if (!TIFFWriteDirectoryTagUndefinedArray(tif,&ndir,dir,(uint16)o->field_tag,pa,pb))
                                                                                goto bad;
                                                                }
                                                                break;
@@ -693,70 +705,72 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
                }
                for (m=0; m<(uint32)(tif->tif_dir.td_customValueCount); m++)
                {
+                        uint16 tag = (uint16)tif->tif_dir.td_customValues[m].info->field_tag;
+                        uint32 count = tif->tif_dir.td_customValues[m].count;
                        switch (tif->tif_dir.td_customValues[m].info->field_type)
                        {
                                case TIFF_ASCII:
-                                       if (!TIFFWriteDirectoryTagAscii(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagAscii(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_UNDEFINED:
-                                       if (!TIFFWriteDirectoryTagUndefinedArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagUndefinedArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_BYTE:
-                                       if (!TIFFWriteDirectoryTagByteArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagByteArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_SBYTE:
-                                       if (!TIFFWriteDirectoryTagSbyteArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagSbyteArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_SHORT:
-                                       if (!TIFFWriteDirectoryTagShortArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagShortArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_SSHORT:
-                                       if (!TIFFWriteDirectoryTagSshortArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagSshortArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_LONG:
-                                       if (!TIFFWriteDirectoryTagLongArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagLongArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_SLONG:
-                                       if (!TIFFWriteDirectoryTagSlongArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagSlongArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_LONG8:
-                                       if (!TIFFWriteDirectoryTagLong8Array(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagLong8Array(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_SLONG8:
-                                       if (!TIFFWriteDirectoryTagSlong8Array(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagSlong8Array(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_RATIONAL:
-                                       if (!TIFFWriteDirectoryTagRationalArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagRationalArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_SRATIONAL:
-                                       if (!TIFFWriteDirectoryTagSrationalArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagSrationalArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_FLOAT:
-                                       if (!TIFFWriteDirectoryTagFloatArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagFloatArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_DOUBLE:
-                                       if (!TIFFWriteDirectoryTagDoubleArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagDoubleArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_IFD:
-                                       if (!TIFFWriteDirectoryTagIfdArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagIfdArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                case TIFF_IFD8:
-                                       if (!TIFFWriteDirectoryTagIfdIfd8Array(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value))
+                                       if (!TIFFWriteDirectoryTagIfdIfd8Array(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value))
                                                goto bad;
                                        break;
                                default:
@@ -778,7 +792,7 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
                                goto bad;
                }
                else
-                       tif->tif_diroff=(TIFFSeekFile(tif,0,SEEK_END)+1)&(~1);
+                       tif->tif_diroff=(TIFFSeekFile(tif,0,SEEK_END)+1)&(~((toff_t)1));
                if (pdiroff!=NULL)
                        *pdiroff=tif->tif_diroff;
                if (!(tif->tif_flags&TIFF_BIGTIFF))
@@ -828,7 +842,7 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
                uint32 nTmp;
                TIFFDirEntry* o;
                n=dirmem;
-               *(uint16*)n=ndir;
+               *(uint16*)n=(uint16)ndir;
                if (tif->tif_flags&TIFF_SWAB)
                        TIFFSwabShort((uint16*)n);
                n+=2;
@@ -2141,13 +2155,13 @@ TIFFWriteDirectoryTagCheckedRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry*
                }
                else if (*na<1.0)
                {
-                       nb[0]=(uint32)((*na)*0xFFFFFFFF);
+                       nb[0]=(uint32)((double)(*na)*0xFFFFFFFF);
                        nb[1]=0xFFFFFFFF;
                }
                else
                {
                        nb[0]=0xFFFFFFFF;
-                       nb[1]=(uint32)(0xFFFFFFFF/(*na));
+                       nb[1]=(uint32)((double)0xFFFFFFFF/(*na));
                }
        }
        if (tif->tif_flags&TIFF_SWAB)
@@ -2184,13 +2198,13 @@ TIFFWriteDirectoryTagCheckedSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry
                        }
                        else if (*na>-1.0)
                        {
-                               nb[0]=-(int32)((-*na)*0x7FFFFFFF);
+                               nb[0]=-(int32)((double)(-*na)*0x7FFFFFFF);
                                nb[1]=0x7FFFFFFF;
                        }
                        else
                        {
                                nb[0]=-0x7FFFFFFF;
-                               nb[1]=(int32)(0x7FFFFFFF/(-*na));
+                               nb[1]=(int32)((double)0x7FFFFFFF/(-*na));
                        }
                }
                else
@@ -2202,13 +2216,13 @@ TIFFWriteDirectoryTagCheckedSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry
                        }
                        else if (*na<1.0)
                        {
-                               nb[0]=(int32)((*na)*0x7FFFFFFF);
+                               nb[0]=(int32)((double)(*na)*0x7FFFFFFF);
                                nb[1]=0x7FFFFFFF;
                        }
                        else
                        {
                                nb[0]=0x7FFFFFFF;
-                               nb[1]=(int32)(0x7FFFFFFF/(*na));
+                               nb[1]=(int32)((double)0x7FFFFFFF/(*na));
                        }
                }
        }
@@ -2368,7 +2382,7 @@ TIFFLinkDirectory(TIFF* tif)
 {
        static const char module[] = "TIFFLinkDirectory";
 
-       tif->tif_diroff = (TIFFSeekFile(tif,0,SEEK_END)+1) &~ 1;
+       tif->tif_diroff = (TIFFSeekFile(tif,0,SEEK_END)+1) & (~((toff_t)1));
 
        /*
         * Handle SubIFDs
index a94cf0b..a6a94c0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dumpmode.c,v 1.14 2011-04-02 20:54:09 bfriesen Exp $ */
+/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dumpmode.c,v 1.15 2015-12-12 18:04:26 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -66,7 +66,7 @@ DumpModeEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s)
                cc -= n;
                if (tif->tif_rawcc >= tif->tif_rawdatasize &&
                    !TIFFFlushData1(tif))
-                       return (-1);
+                       return (0);
        }
        return (1);
 }
index 10afd41..39fab4c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_extension.c,v 1.7 2010-03-10 18:56:48 bfriesen Exp $ */
+/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_extension.c,v 1.8 2015-12-06 11:13:43 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -66,13 +66,13 @@ TIFFTagMethods *TIFFAccessTagMethods( TIFF *tif )
 void *TIFFGetClientInfo( TIFF *tif, const char *name )
 
 {
-    TIFFClientInfoLink *link = tif->tif_clientinfo;
+    TIFFClientInfoLink *psLink = tif->tif_clientinfo;
 
-    while( link != NULL && strcmp(link->name,name) != 0 )
-        link = link->next;
+    while( psLink != NULL && strcmp(psLink->name,name) != 0 )
+        psLink = psLink->next;
 
-    if( link != NULL )
-        return link->data;
+    if( psLink != NULL )
+        return psLink->data;
     else
         return NULL;
 }
@@ -80,18 +80,18 @@ void *TIFFGetClientInfo( TIFF *tif, const char *name )
 void TIFFSetClientInfo( TIFF *tif, void *data, const char *name )
 
 {
-    TIFFClientInfoLink *link = tif->tif_clientinfo;
+    TIFFClientInfoLink *psLink = tif->tif_clientinfo;
 
     /*
     ** Do we have an existing link with this name?  If so, just
     ** set it.
     */
-    while( link != NULL && strcmp(link->name,name) != 0 )
-        link = link->next;
+    while( psLink != NULL && strcmp(psLink->name,name) != 0 )
+        psLink = psLink->next;
 
-    if( link != NULL )
+    if( psLink != NULL )
     {
-        link->data = data;
+        psLink->data = data;
         return;
     }
 
@@ -99,15 +99,15 @@ void TIFFSetClientInfo( TIFF *tif, void *data, const char *name )
     ** Create a new link.
     */
 
-    link = (TIFFClientInfoLink *) _TIFFmalloc(sizeof(TIFFClientInfoLink));
-    assert (link != NULL);
-    link->next = tif->tif_clientinfo;
-    link->name = (char *) _TIFFmalloc((tmsize_t)(strlen(name)+1));
-    assert (link->name != NULL);
-    strcpy(link->name, name);
-    link->data = data;
+    psLink = (TIFFClientInfoLink *) _TIFFmalloc(sizeof(TIFFClientInfoLink));
+    assert (psLink != NULL);
+    psLink->next = tif->tif_clientinfo;
+    psLink->name = (char *) _TIFFmalloc((tmsize_t)(strlen(name)+1));
+    assert (psLink->name != NULL);
+    strcpy(psLink->name, name);
+    psLink->data = data;
 
-    tif->tif_clientinfo = link;
+    tif->tif_clientinfo = psLink;
 }
 /*
  * Local Variables:
index bbe7255..16bb4d3 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_fax3.c,v 1.75 2015-08-30 20:49:55 erouault Exp $ */
+/* $Id: tif_fax3.c,v 1.78 2016-09-04 21:32:56 erouault Exp $ */
 
 /*
  * Copyright (c) 1990-1997 Sam Leffler
@@ -644,7 +644,8 @@ putspan(TIFF* tif, int32 span, const tableentry* tab)
 
        while (span >= 2624) {
                const tableentry* te = &tab[63 + (2560>>6)];
-               code = te->code, length = te->length;
+               code = te->code;
+               length = te->length;
 #ifdef FAX3_DEBUG
                DEBUG_PRINT("MakeUp", te->runlen);
 #endif
@@ -654,14 +655,16 @@ putspan(TIFF* tif, int32 span, const tableentry* tab)
        if (span >= 64) {
                const tableentry* te = &tab[63 + (span>>6)];
                assert(te->runlen == 64*(span>>6));
-               code = te->code, length = te->length;
+               code = te->code;
+               length = te->length;
 #ifdef FAX3_DEBUG
                DEBUG_PRINT("MakeUp", te->runlen);
 #endif
                _PutBits(tif, code, length);
                span -= te->runlen;
        }
-       code = tab[span].code, length = tab[span].length;
+       code = tab[span].code;
+       length = tab[span].length;
 #ifdef FAX3_DEBUG
        DEBUG_PRINT("  Term", tab[span].runlen);
 #endif
@@ -697,14 +700,16 @@ Fax3PutEOL(TIFF* tif)
                                align = sp->bit + (8 - align);
                        else
                                align = sp->bit - align;
-                       code = 0;
                        tparm=align; 
                        _PutBits(tif, 0, tparm);
                }
        }
-       code = EOL, length = 12;
-       if (is2DEncoding(sp))
-               code = (code<<1) | (sp->tag == G3_1D), length++;
+       code = EOL;
+       length = 12;
+       if (is2DEncoding(sp)) {
+               code = (code<<1) | (sp->tag == G3_1D);
+               length++;
+       }
        _PutBits(tif, code, length);
 
        sp->data = data;
@@ -815,7 +820,7 @@ find0span(unsigned char* bp, int32 bs, int32 be)
        /*
         * Check partial byte on lhs.
         */
-       if (bits > 0 && (n = (bs & 7))) {
+       if (bits > 0 && (n = (bs & 7)) != 0) {
                span = zeroruns[(*bp << n) & 0xff];
                if (span > 8-n)         /* table value too generous */
                        span = 8-n;
@@ -835,12 +840,14 @@ find0span(unsigned char* bp, int32 bs, int32 be)
                while (!isAligned(bp, long)) {
                        if (*bp != 0x00)
                                return (span + zeroruns[*bp]);
-                       span += 8, bits -= 8;
+                       span += 8;
+                       bits -= 8;
                        bp++;
                }
                lp = (long*) bp;
                while ((bits >= (int32)(8 * sizeof(long))) && (0 == *lp)) {
-                       span += 8*sizeof (long), bits -= 8*sizeof (long);
+                       span += 8*sizeof (long);
+                       bits -= 8*sizeof (long);
                        lp++;
                }
                bp = (unsigned char*) lp;
@@ -851,7 +858,8 @@ find0span(unsigned char* bp, int32 bs, int32 be)
        while (bits >= 8) {
                if (*bp != 0x00)        /* end of run */
                        return (span + zeroruns[*bp]);
-               span += 8, bits -= 8;
+               span += 8;
+               bits -= 8;
                bp++;
        }
        /*
@@ -874,7 +882,7 @@ find1span(unsigned char* bp, int32 bs, int32 be)
        /*
         * Check partial byte on lhs.
         */
-       if (bits > 0 && (n = (bs & 7))) {
+       if (bits > 0 && (n = (bs & 7)) != 0) {
                span = oneruns[(*bp << n) & 0xff];
                if (span > 8-n)         /* table value too generous */
                        span = 8-n;
@@ -894,12 +902,14 @@ find1span(unsigned char* bp, int32 bs, int32 be)
                while (!isAligned(bp, long)) {
                        if (*bp != 0xff)
                                return (span + oneruns[*bp]);
-                       span += 8, bits -= 8;
+                       span += 8;
+                       bits -= 8;
                        bp++;
                }
                lp = (long*) bp;
                while ((bits >= (int32)(8 * sizeof(long))) && (~0 == *lp)) {
-                       span += 8*sizeof (long), bits -= 8*sizeof (long);
+                       span += 8*sizeof (long);
+                       bits -= 8*sizeof (long);
                        lp++;
                }
                bp = (unsigned char*) lp;
@@ -910,7 +920,8 @@ find1span(unsigned char* bp, int32 bs, int32 be)
        while (bits >= 8) {
                if (*bp != 0xff)        /* end of run */
                        return (span + oneruns[*bp]);
-               span += 8, bits -= 8;
+               span += 8;
+               bits -= 8;
                bp++;
        }
        /*
@@ -1094,8 +1105,10 @@ Fax3Close(TIFF* tif)
                unsigned int length = 12;
                int i;
 
-               if (is2DEncoding(sp))
-                       code = (code<<1) | (sp->tag == G3_1D), length++;
+               if (is2DEncoding(sp)) {
+                       code = (code<<1) | (sp->tag == G3_1D);
+                       length++;
+               }
                for (i = 0; i < 6; i++)
                        Fax3PutBits(tif, code, length);
                Fax3FlushBits(tif, sp);
@@ -1182,7 +1195,7 @@ Fax3VSetField(TIFF* tif, uint32 tag, va_list ap)
                return (*sp->vsetparent)(tif, tag, ap);
        }
        
-       if ((fip = TIFFFieldWithTag(tif, tag)))
+       if ((fip = TIFFFieldWithTag(tif, tag)) != NULL)
                TIFFSetFieldBit(tif, fip->field_bit);
        else
                return 0;
@@ -1241,10 +1254,14 @@ Fax3PrintDir(TIFF* tif, FILE* fd, long flags)
                } else {
 
                        fprintf(fd, "  Group 3 Options:");
-                       if (sp->groupoptions & GROUP3OPT_2DENCODING)
-                               fprintf(fd, "%s2-d encoding", sep), sep = "+";
-                       if (sp->groupoptions & GROUP3OPT_FILLBITS)
-                               fprintf(fd, "%sEOL padding", sep), sep = "+";
+                       if (sp->groupoptions & GROUP3OPT_2DENCODING) {
+                               fprintf(fd, "%s2-d encoding", sep);
+                               sep = "+";
+                       }
+                       if (sp->groupoptions & GROUP3OPT_FILLBITS) {
+                               fprintf(fd, "%sEOL padding", sep);
+                               sep = "+";
+                       }
                        if (sp->groupoptions & GROUP3OPT_UNCOMPRESSED)
                                fprintf(fd, "%suncompressed data", sep);
                }
index b0f46c9..e0b2ca6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_fax3.h,v 1.9 2011-03-10 20:23:07 fwarmerdam Exp $ */
+/* $Id: tif_fax3.h,v 1.11 2016-01-23 21:20:34 erouault Exp $ */
 
 /*
  * Copyright (c) 1990-1997 Sam Leffler
@@ -39,7 +39,7 @@
 
 /*
  * To override the default routine used to image decoded
- * spans one can use the pseduo tag TIFFTAG_FAXFILLFUNC.
+ * spans one can use the pseudo tag TIFFTAG_FAXFILLFUNC.
  * The routine must have the type signature given below;
  * for example:
  *
@@ -84,7 +84,7 @@ extern void _TIFFFax3fillruns(unsigned char*, uint32*, uint32*, uint32);
 typedef struct {                /* state table entry */
        unsigned char State;    /* see above */
        unsigned char Width;    /* width of code in bits */
-       uint32 Param;           /* unsigned 32-bit run length in bits */
+       uint16 Param;           /* unsigned 16-bit run length in bits */
 } TIFFFaxTabEnt;
 
 extern const TIFFFaxTabEnt TIFFFaxMainTable[];
index f49b73f..0f5e932 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_getimage.c,v 1.90 2015-06-17 01:34:08 bfriesen Exp $ */
+/* $Id: tif_getimage.c,v 1.98 2016-11-18 02:47:45 bfriesen Exp $ */
 
 /*
  * Copyright (c) 1991-1997 Sam Leffler
@@ -95,6 +95,10 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
                            td->td_bitspersample);
                        return (0);
        }
+        if (td->td_sampleformat == SAMPLEFORMAT_IEEEFP) {
+                sprintf(emsg, "Sorry, can not handle images with IEEE floating-point samples");
+                return (0);
+        }
        colorchannels = td->td_samplesperpixel - td->td_extrasamples;
        if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &photometric)) {
                switch (colorchannels) {
@@ -182,25 +186,25 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
                                    "Planarconfiguration", td->td_planarconfig);
                                return (0);
                        }
-                       if( td->td_samplesperpixel != 3 )
-            {
-                sprintf(emsg,
-                        "Sorry, can not handle image with %s=%d",
-                        "Samples/pixel", td->td_samplesperpixel);
-                return 0;
-            }
+                       if ( td->td_samplesperpixel != 3 || colorchannels != 3 ) {
+                                sprintf(emsg,
+                                        "Sorry, can not handle image with %s=%d, %s=%d",
+                                        "Samples/pixel", td->td_samplesperpixel,
+                                        "colorchannels", colorchannels);
+                                return 0;
+                        }
                        break;
                case PHOTOMETRIC_CIELAB:
-            if( td->td_samplesperpixel != 3 || td->td_bitspersample != 8 )
-            {
-                sprintf(emsg,
-                        "Sorry, can not handle image with %s=%d and %s=%d",
-                        "Samples/pixel", td->td_samplesperpixel,
-                        "Bits/sample", td->td_bitspersample);
-                return 0;
-            }
+                        if ( td->td_samplesperpixel != 3 || colorchannels != 3 || td->td_bitspersample != 8 ) {
+                                sprintf(emsg,
+                                        "Sorry, can not handle image with %s=%d, %s=%d and %s=%d",
+                                        "Samples/pixel", td->td_samplesperpixel,
+                                        "colorchannels", colorchannels,
+                                        "Bits/sample", td->td_bitspersample);
+                                return 0;
+                        }
                        break;
-               default:
+                default:
                        sprintf(emsg, "Sorry, can not handle image with %s=%d",
                            photoTag, photometric);
                        return (0);
@@ -211,20 +215,34 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
 void
 TIFFRGBAImageEnd(TIFFRGBAImage* img)
 {
-       if (img->Map)
-               _TIFFfree(img->Map), img->Map = NULL;
-       if (img->BWmap)
-               _TIFFfree(img->BWmap), img->BWmap = NULL;
-       if (img->PALmap)
-               _TIFFfree(img->PALmap), img->PALmap = NULL;
-       if (img->ycbcr)
-               _TIFFfree(img->ycbcr), img->ycbcr = NULL;
-       if (img->cielab)
-               _TIFFfree(img->cielab), img->cielab = NULL;
-       if (img->UaToAa)
-               _TIFFfree(img->UaToAa), img->UaToAa = NULL;
-       if (img->Bitdepth16To8)
-               _TIFFfree(img->Bitdepth16To8), img->Bitdepth16To8 = NULL;
+       if (img->Map) {
+               _TIFFfree(img->Map);
+               img->Map = NULL;
+       }
+       if (img->BWmap) {
+               _TIFFfree(img->BWmap);
+               img->BWmap = NULL;
+       }
+       if (img->PALmap) {
+               _TIFFfree(img->PALmap);
+               img->PALmap = NULL;
+       }
+       if (img->ycbcr) {
+               _TIFFfree(img->ycbcr);
+               img->ycbcr = NULL;
+       }
+       if (img->cielab) {
+               _TIFFfree(img->cielab);
+               img->cielab = NULL;
+       }
+       if (img->UaToAa) {
+               _TIFFfree(img->UaToAa);
+               img->UaToAa = NULL;
+       }
+       if (img->Bitdepth16To8) {
+               _TIFFfree(img->Bitdepth16To8);
+               img->Bitdepth16To8 = NULL;
+       }
 
        if( img->redcmap ) {
                _TIFFfree( img->redcmap );
@@ -255,6 +273,9 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
        int colorchannels;
        uint16 *red_orig, *green_orig, *blue_orig;
        int n_color;
+       
+       if( !TIFFRGBAImageOK(tif, emsg) )
+               return 0;
 
        /* Initialize to normal values */
        img->row_offset = 0;
@@ -338,7 +359,7 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
                        }
 
                        /* copy the colormaps so we can modify them */
-                       n_color = (1L << img->bitspersample);
+                       n_color = (1U << 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);
@@ -351,7 +372,7 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
                        _TIFFmemcpy( img->greencmap, green_orig, n_color * 2 );
                        _TIFFmemcpy( img->bluecmap, blue_orig, n_color * 2 );
 
-                       /* fall thru... */
+                       /* fall through... */
                case PHOTOMETRIC_MINISWHITE:
                case PHOTOMETRIC_MINISBLACK:
                        if (planarconfig == PLANARCONFIG_CONTIG
@@ -509,7 +530,7 @@ TIFFReadRGBAImageOriented(TIFF* tif,
     int ok;
 
        if (TIFFRGBAImageOK(tif, emsg) && TIFFRGBAImageBegin(&img, tif, stop, emsg)) {
-               img.req_orientation = orientation;
+               img.req_orientation = (uint16)orientation;
                /* XXX verify rwidth and rheight against width and height */
                ok = TIFFRGBAImageGet(&img, raster+(rheight-img.height)*rwidth,
                        rwidth, img.height);
@@ -696,7 +717,8 @@ gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
                            uint32 temp = *left;
                            *left = *right;
                            *right = temp;
-                           left++, right--;
+                           left++;
+                               right--;
                    }
            }
     }
@@ -729,7 +751,7 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
        int alpha = img->alpha;
        uint32 nrow;
        int ret = 1, flip;
-        int colorchannels;
+        uint16 colorchannels;
        uint32 this_tw, tocol;
        int32 this_toskew, leftmost_toskew;
        int32 leftmost_fromskew;
@@ -863,7 +885,8 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
                                uint32 temp = *left;
                                *left = *right;
                                *right = temp;
-                               left++, right--;
+                               left++;
+                               right--;
                        }
                }
        }
@@ -953,7 +976,8 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
                                uint32 temp = *left;
                                *left = *right;
                                *right = temp;
-                               left++, right--;
+                               left++;
+                               right--;
                        }
                }
        }
@@ -984,7 +1008,8 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
        tmsize_t bufsize;
        int32 fromskew, toskew;
        int alpha = img->alpha;
-       int ret = 1, flip, colorchannels;
+       int ret = 1, flip;
+        uint16 colorchannels;
 
        stripsize = TIFFStripSize(tif);  
        bufsize = TIFFSafeMultiply(tmsize_t,alpha?4:3,stripsize);
@@ -1086,7 +1111,8 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
                                uint32 temp = *left;
                                *left = *right;
                                *right = temp;
-                               left++, right--;
+                               left++;
+                               right--;
                        }
                }
        }
@@ -1414,7 +1440,7 @@ DECLAREContigPutFunc(putRGBUAcontig8bittile)
                uint8* m;
                for (x = w; x-- > 0;) {
                        a = pp[3];
-                       m = img->UaToAa+(a<<8);
+                       m = img->UaToAa+((size_t) a<<8);
                        r = m[pp[0]];
                        g = m[pp[1]];
                        b = m[pp[2]];
@@ -1485,7 +1511,7 @@ DECLAREContigPutFunc(putRGBUAcontig16bittile)
                uint8* m;
                for (x = w; x-- > 0;) {
                        a = img->Bitdepth16To8[wp[3]];
-                       m = img->UaToAa+(a<<8);
+                       m = img->UaToAa+((size_t) a<<8);
                        r = m[img->Bitdepth16To8[wp[0]]];
                        g = m[img->Bitdepth16To8[wp[1]]];
                        b = m[img->Bitdepth16To8[wp[2]]];
@@ -1616,7 +1642,7 @@ DECLARESepPutFunc(putRGBUAseparate8bittile)
                uint8* m;
                for (x = w; x-- > 0;) {
                        av = *a++;
-                       m = img->UaToAa+(av<<8);
+                       m = img->UaToAa+((size_t) av<<8);
                        rv = m[*r++];
                        gv = m[*g++];
                        bv = m[*b++];
@@ -1678,15 +1704,15 @@ DECLARESepPutFunc(putRGBUAseparate16bittile)
        uint16 *wa = (uint16*) a;
        (void) img; (void) y;
        while (h-- > 0) {
-               uint32 r,g,b,a;
+               uint32 r2,g2,b2,a2;
                uint8* m;
                for (x = w; x-- > 0;) {
-                       a = img->Bitdepth16To8[*wa++];
-                       m = img->UaToAa+(a<<8);
-                       r = m[img->Bitdepth16To8[*wr++]];
-                       g = m[img->Bitdepth16To8[*wg++]];
-                       b = m[img->Bitdepth16To8[*wb++]];
-                       *cp++ = PACK4(r,g,b,a);
+                       a2 = img->Bitdepth16To8[*wa++];
+                       m = img->UaToAa+((size_t) a2<<8);
+                       r2 = m[img->Bitdepth16To8[*wr++]];
+                       g2 = m[img->Bitdepth16To8[*wg++]];
+                       b2 = m[img->Bitdepth16To8[*wb++]];
+                       *cp++ = PACK4(r2,g2,b2,a2);
                }
                SKEW4(wr, wg, wb, wa, fromskew);
                cp += toskew;
@@ -1841,10 +1867,16 @@ DECLAREContigPutFunc(putcontig8bitYCbCr44tile)
                 YCbCrtoRGB(cp3[2], pp[14]);
                 YCbCrtoRGB(cp3[3], pp[15]);
 
-                cp += 4, cp1 += 4, cp2 += 4, cp3 += 4;
+                cp += 4;
+                cp1 += 4;
+                cp2 += 4;
+                cp3 += 4;
                 pp += 18;
             } while (--x);
-            cp += incr, cp1 += incr, cp2 += incr, cp3 += incr;
+            cp += incr;
+            cp1 += incr;
+            cp2 += incr;
+            cp3 += incr;
             pp += fromskew;
         }
     } else {
@@ -1895,7 +1927,10 @@ DECLAREContigPutFunc(putcontig8bitYCbCr44tile)
             if (h <= 4)
                 break;
             h -= 4;
-            cp += incr, cp1 += incr, cp2 += incr, cp3 += incr;
+            cp += incr;
+            cp1 += incr;
+            cp2 += incr;
+            cp3 += incr;
             pp += fromskew;
         }
     }
@@ -1927,10 +1962,12 @@ DECLAREContigPutFunc(putcontig8bitYCbCr42tile)
                 YCbCrtoRGB(cp1[2], pp[6]);
                 YCbCrtoRGB(cp1[3], pp[7]);
                 
-                cp += 4, cp1 += 4;
+                cp += 4;
+                cp1 += 4;
                 pp += 10;
             } while (--x);
-            cp += incr, cp1 += incr;
+            cp += incr;
+            cp1 += incr;
             pp += fromskew;
         }
     } else {
@@ -1973,7 +2010,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr42tile)
             if (h <= 2)
                 break;
             h -= 2;
-            cp += incr, cp1 += incr;
+            cp += incr;
+            cp1 += incr;
             pp += fromskew;
         }
     }
@@ -2362,7 +2400,8 @@ setupMap(TIFFRGBAImage* img)
        if (!makebwmap(img))
            return (0);
        /* no longer need Map, free it */
-       _TIFFfree(img->Map), img->Map = NULL;
+       _TIFFfree(img->Map);
+       img->Map = NULL;
     }
     return (1);
 }
@@ -2470,7 +2509,7 @@ buildMap(TIFFRGBAImage* img)
     case PHOTOMETRIC_SEPARATED:
        if (img->bitspersample == 8)
            break;
-       /* fall thru... */
+       /* fall through... */
     case PHOTOMETRIC_MINISBLACK:
     case PHOTOMETRIC_MINISWHITE:
        if (!setupMap(img))
@@ -2508,29 +2547,33 @@ PickContigCase(TIFFRGBAImage* img)
                case PHOTOMETRIC_RGB:
                        switch (img->bitspersample) {
                                case 8:
-                                       if (img->alpha == EXTRASAMPLE_ASSOCALPHA)
+                                       if (img->alpha == EXTRASAMPLE_ASSOCALPHA &&
+                                               img->samplesperpixel >= 4)
                                                img->put.contig = putRGBAAcontig8bittile;
-                                       else if (img->alpha == EXTRASAMPLE_UNASSALPHA)
+                                       else if (img->alpha == EXTRASAMPLE_UNASSALPHA &&
+                                                        img->samplesperpixel >= 4)
                                        {
                                                if (BuildMapUaToAa(img))
                                                        img->put.contig = putRGBUAcontig8bittile;
                                        }
-                                       else
+                                       else if( img->samplesperpixel >= 3 )
                                                img->put.contig = putRGBcontig8bittile;
                                        break;
                                case 16:
-                                       if (img->alpha == EXTRASAMPLE_ASSOCALPHA)
+                                       if (img->alpha == EXTRASAMPLE_ASSOCALPHA &&
+                                               img->samplesperpixel >=4 )
                                        {
                                                if (BuildMapBitdepth16To8(img))
                                                        img->put.contig = putRGBAAcontig16bittile;
                                        }
-                                       else if (img->alpha == EXTRASAMPLE_UNASSALPHA)
+                                       else if (img->alpha == EXTRASAMPLE_UNASSALPHA &&
+                                                        img->samplesperpixel >=4 )
                                        {
                                                if (BuildMapBitdepth16To8(img) &&
                                                    BuildMapUaToAa(img))
                                                        img->put.contig = putRGBUAcontig16bittile;
                                        }
-                                       else
+                                       else if( img->samplesperpixel >=3 )
                                        {
                                                if (BuildMapBitdepth16To8(img))
                                                        img->put.contig = putRGBcontig16bittile;
@@ -2539,7 +2582,7 @@ PickContigCase(TIFFRGBAImage* img)
                        }
                        break;
                case PHOTOMETRIC_SEPARATED:
-                       if (buildMap(img)) {
+                       if (img->samplesperpixel >=4 && buildMap(img)) {
                                if (img->bitspersample == 8) {
                                        if (!img->Map)
                                                img->put.contig = putRGBcontig8bitCMYKtile;
@@ -2635,7 +2678,7 @@ PickContigCase(TIFFRGBAImage* img)
                        }
                        break;
                case PHOTOMETRIC_CIELAB:
-                       if (buildMap(img)) {
+                       if (img->samplesperpixel == 3 && buildMap(img)) {
                                if (img->bitspersample == 8)
                                        img->put.contig = initCIELabConversion(img);
                                break;
@@ -2736,7 +2779,7 @@ BuildMapUaToAa(TIFFRGBAImage* img)
        for (na=0; na<256; na++)
        {
                for (nv=0; nv<256; nv++)
-                       *m++=(nv*na+127)/255;
+                       *m++=(uint8)((nv*na+127)/255);
        }
        return(1);
 }
@@ -2756,7 +2799,7 @@ BuildMapBitdepth16To8(TIFFRGBAImage* img)
        }
        m=img->Bitdepth16To8;
        for (n=0; n<65536; n++)
-               *m++=(n+128)/257;
+               *m++=(uint8)((n+128)/257);
        return(1);
 }
 
index a970eb1..70b72d8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_jpeg.c,v 1.119 2015-08-15 20:13:07 bfriesen Exp $ */
+/* $Id: tif_jpeg.c,v 1.123 2016-01-23 21:20:34 erouault Exp $ */
 
 /*
  * Copyright (c) 1994-1997 Sam Leffler
@@ -58,7 +58,7 @@ int TIFFReInitJPEG_12( TIFF *tif, int scheme, int is_encode );
   Libjpeg's jmorecfg.h defines INT16 and INT32, but only if XMD_H is
   not defined.  Unfortunately, the MinGW and Borland compilers include
   a typedef for INT32, which causes a conflict.  MSVC does not include
-  a conficting typedef given the headers which are included.
+  a conflicting typedef given the headers which are included.
 */
 #if defined(__BORLANDC__) || defined(__MINGW32__)
 # define XMD_H 1
@@ -937,7 +937,7 @@ JPEGFixupTagsSubsamplingSkip(struct JPEGFixupTagsSubsamplingData* data, uint16 s
        else
        {
                uint16 m;
-               m=skiplength-data->bufferbytesleft;
+               m=(uint16)(skiplength-data->bufferbytesleft);
                if (m<=data->filebytesleft)
                {
                        data->bufferbytesleft=0;
@@ -1283,7 +1283,7 @@ JPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
                        if( line_work_buf != NULL )
                        {
                                /*
-                                * In the MK1 case, we aways read into a 16bit
+                                * In the MK1 case, we always read into a 16bit
                                 * buffer, and then pack down to 12bit or 8bit.
                                 * In 6B case we only read into 16 bit buffer
                                 * for 12bit data, which we need to repack.
@@ -1303,10 +1303,10 @@ JPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
                                                        ((unsigned char *) buf) + iPair * 3;
                                                JSAMPLE *in_ptr = line_work_buf + iPair * 2;
 
-                                               out_ptr[0] = (in_ptr[0] & 0xff0) >> 4;
-                                               out_ptr[1] = ((in_ptr[0] & 0xf) << 4)
-                                                       | ((in_ptr[1] & 0xf00) >> 8);
-                                               out_ptr[2] = ((in_ptr[1] & 0xff) >> 0);
+                                               out_ptr[0] = (unsigned char)((in_ptr[0] & 0xff0) >> 4);
+                                               out_ptr[1] = (unsigned char)(((in_ptr[0] & 0xf) << 4)
+                                                       | ((in_ptr[1] & 0xf00) >> 8));
+                                               out_ptr[2] = (unsigned char)(((in_ptr[1] & 0xff) >> 0));
                                        }
                                }
                                else if( sp->cinfo.d.data_precision == 8 )
@@ -1367,7 +1367,7 @@ JPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
        (void) s;
 
        /* data is expected to be read in multiples of a scanline */
-       if ( (nrows = sp->cinfo.d.image_height) ) {
+       if ( (nrows = sp->cinfo.d.image_height) != 0 ) {
 
                /* Cb,Cr both have sampling factors 1, so this is correct */
                JDIMENSION clumps_per_line = sp->cinfo.d.comp_info[1].downsampled_width;            
@@ -1467,10 +1467,10 @@ JPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
                                        {
                                                unsigned char *out_ptr = ((unsigned char *) buf) + iPair * 3;
                                                JSAMPLE *in_ptr = (JSAMPLE *) (tmpbuf + iPair * 2);
-                                               out_ptr[0] = (in_ptr[0] & 0xff0) >> 4;
-                                               out_ptr[1] = ((in_ptr[0] & 0xf) << 4)
-                                                       | ((in_ptr[1] & 0xf00) >> 8);
-                                               out_ptr[2] = ((in_ptr[1] & 0xff) >> 0);
+                                               out_ptr[0] = (unsigned char)((in_ptr[0] & 0xff0) >> 4);
+                                               out_ptr[1] = (unsigned char)(((in_ptr[0] & 0xf) << 4)
+                                                       | ((in_ptr[1] & 0xf00) >> 8));
+                                               out_ptr[2] = (unsigned char)(((in_ptr[1] & 0xff) >> 0));
                                        }
                                }
                        }
@@ -1893,7 +1893,7 @@ JPEGEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
 
         if( sp->cinfo.c.data_precision == 12 )
         {
-            line16_count = (sp->bytesperline * 2) / 3;
+            line16_count = (int)((sp->bytesperline * 2) / 3);
             line16 = (short *) _TIFFmalloc(sizeof(short) * line16_count);
             if (!line16)
             {
@@ -2138,8 +2138,7 @@ JPEGVSetField(TIFF* tif, uint32 tag, va_list ap)
                        /* XXX */
                        return (0);
                }
-               _TIFFsetByteArray(&sp->jpegtables, va_arg(ap, void*),
-                   (long) v32);
+               _TIFFsetByteArray(&sp->jpegtables, va_arg(ap, void*), v32);
                sp->jpegtables_length = v32;
                TIFFSetFieldBit(tif, FIELD_JPEGTABLES);
                break;
@@ -2168,7 +2167,7 @@ JPEGVSetField(TIFF* tif, uint32 tag, va_list ap)
                return (*sp->vsetparent)(tif, tag, ap);
        }
 
-       if ((fip = TIFFFieldWithTag(tif, tag))) {
+       if ((fip = TIFFFieldWithTag(tif, tag)) != NULL) {
                TIFFSetFieldBit(tif, fip->field_bit);
        } else {
                return (0);
index 87aaa19..8499e64 100644 (file)
@@ -5,6 +5,9 @@
 
 #  define TIFFInitJPEG TIFFInitJPEG_12
 
+int
+TIFFInitJPEG_12(TIFF* tif, int scheme);
+
 #  include LIBJPEG_12_PATH
 
 #  include "tif_jpeg.c"
index 4e328ba..ca08f30 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_luv.c,v 1.40 2015-06-21 01:09:09 bfriesen Exp $ */
+/* $Id: tif_luv.c,v 1.43 2016-09-04 21:32:56 erouault Exp $ */
 
 /*
  * Copyright (c) 1997 Greg Ward Larson
@@ -202,7 +202,11 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
        if (sp->user_datafmt == SGILOGDATAFMT_16BIT)
                tp = (int16*) op;
        else {
-               assert(sp->tbuflen >= npixels);
+               if(sp->tbuflen < npixels) {
+                       TIFFErrorExt(tif->tif_clientdata, module,
+                                                "Translation buffer too short");
+                       return (0);
+               }
                tp = (int16*) sp->tbuf;
        }
        _TIFFmemset((void*) tp, 0, npixels*sizeof (tp[0]));
@@ -211,9 +215,11 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
        cc = tif->tif_rawcc;
        /* get each byte string */
        for (shft = 2*8; (shft -= 8) >= 0; ) {
-               for (i = 0; i < npixels && cc > 0; )
+               for (i = 0; i < npixels && cc > 0; ) {
                        if (*bp >= 128) {               /* run */
-                               rc = *bp++ + (2-128);   /* TODO: potential input buffer overrun when decoding corrupt or truncated data */
+                               if( cc < 2 )
+                                       break;
+                               rc = *bp++ + (2-128);
                                b = (int16)(*bp++ << shft);
                                cc -= 2;
                                while (rc-- && i < npixels)
@@ -223,6 +229,7 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
                                while (--cc && rc-- && i < npixels)
                                        tp[i++] |= (int16)*bp++ << shft;
                        }
+               }
                if (i != npixels) {
 #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
                        TIFFErrorExt(tif->tif_clientdata, module,
@@ -268,13 +275,17 @@ LogLuvDecode24(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
        if (sp->user_datafmt == SGILOGDATAFMT_RAW)
                tp = (uint32 *)op;
        else {
-               assert(sp->tbuflen >= npixels);
+               if(sp->tbuflen < npixels) {
+                       TIFFErrorExt(tif->tif_clientdata, module,
+                                                "Translation buffer too short");
+                       return (0);
+               }
                tp = (uint32 *) sp->tbuf;
        }
        /* copy to array of uint32 */
        bp = (unsigned char*) tif->tif_rawcp;
        cc = tif->tif_rawcc;
-       for (i = 0; i < npixels && cc > 0; i++) {
+       for (i = 0; i < npixels && cc >= 3; i++) {
                tp[i] = bp[0] << 16 | bp[1] << 8 | bp[2];
                bp += 3;
                cc -= 3;
@@ -325,7 +336,11 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
        if (sp->user_datafmt == SGILOGDATAFMT_RAW)
                tp = (uint32*) op;
        else {
-               assert(sp->tbuflen >= npixels);
+               if(sp->tbuflen < npixels) {
+                       TIFFErrorExt(tif->tif_clientdata, module,
+                                                "Translation buffer too short");
+                       return (0);
+               }
                tp = (uint32*) sp->tbuf;
        }
        _TIFFmemset((void*) tp, 0, npixels*sizeof (tp[0]));
@@ -334,11 +349,13 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
        cc = tif->tif_rawcc;
        /* get each byte string */
        for (shft = 4*8; (shft -= 8) >= 0; ) {
-               for (i = 0; i < npixels && cc > 0; )
+               for (i = 0; i < npixels && cc > 0; ) {
                        if (*bp >= 128) {               /* run */
+                               if( cc < 2 )
+                                       break;
                                rc = *bp++ + (2-128);
                                b = (uint32)*bp++ << shft;
-                               cc -= 2;                /* TODO: potential input buffer overrun when decoding corrupt or truncated data */
+                               cc -= 2;
                                while (rc-- && i < npixels)
                                        tp[i++] |= b;
                        } else {                        /* non-run */
@@ -346,6 +363,7 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
                                while (--cc && rc-- && i < npixels)
                                        tp[i++] |= (uint32)*bp++ << shft;
                        }
+               }
                if (i != npixels) {
 #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
                        TIFFErrorExt(tif->tif_clientdata, module,
@@ -383,8 +401,10 @@ LogLuvDecodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
                 return 0;
 
        assert(cc%rowlen == 0);
-       while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s))
-               bp += rowlen, cc -= rowlen;
+       while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s)) {
+               bp += rowlen;
+               cc -= rowlen;
+       }
        return (cc == 0);
 }
 
@@ -402,8 +422,10 @@ LogLuvDecodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
                 return 0;
 
        assert(cc%rowlen == 0);
-       while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s))
-               bp += rowlen, cc -= rowlen;
+       while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s)) {
+               bp += rowlen;
+               cc -= rowlen;
+       }
        return (cc == 0);
 }
 
@@ -413,6 +435,7 @@ LogLuvDecodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
 static int
 LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
 {
+       static const char module[] = "LogL16Encode";
        LogLuvState* sp = EncoderState(tif);
        int shft;
        tmsize_t i;
@@ -433,7 +456,11 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
                tp = (int16*) bp;
        else {
                tp = (int16*) sp->tbuf;
-               assert(sp->tbuflen >= npixels);
+               if(sp->tbuflen < npixels) {
+                       TIFFErrorExt(tif->tif_clientdata, module,
+                                                "Translation buffer too short");
+                       return (0);
+               }
                (*sp->tfunc)(sp, bp, npixels);
        }
        /* compress each byte string */
@@ -506,6 +533,7 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
 static int
 LogLuvEncode24(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
 {
+       static const char module[] = "LogLuvEncode24";
        LogLuvState* sp = EncoderState(tif);
        tmsize_t i;
        tmsize_t npixels;
@@ -521,7 +549,11 @@ LogLuvEncode24(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
                tp = (uint32*) bp;
        else {
                tp = (uint32*) sp->tbuf;
-               assert(sp->tbuflen >= npixels);
+               if(sp->tbuflen < npixels) {
+                       TIFFErrorExt(tif->tif_clientdata, module,
+                                                "Translation buffer too short");
+                       return (0);
+               }
                (*sp->tfunc)(sp, bp, npixels);
        }
        /* write out encoded pixels */
@@ -553,6 +585,7 @@ LogLuvEncode24(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
 static int
 LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
 {
+       static const char module[] = "LogLuvEncode32";
        LogLuvState* sp = EncoderState(tif);
        int shft;
        tmsize_t i;
@@ -574,7 +607,11 @@ LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
                tp = (uint32*) bp;
        else {
                tp = (uint32*) sp->tbuf;
-               assert(sp->tbuflen >= npixels);
+               if(sp->tbuflen < npixels) {
+                       TIFFErrorExt(tif->tif_clientdata, module,
+                                                "Translation buffer too short");
+                       return (0);
+               }
                (*sp->tfunc)(sp, bp, npixels);
        }
        /* compress each byte string */
@@ -654,8 +691,10 @@ LogLuvEncodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
                 return 0;
 
        assert(cc%rowlen == 0);
-       while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 1)
-               bp += rowlen, cc -= rowlen;
+       while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 1) {
+               bp += rowlen;
+               cc -= rowlen;
+       }
        return (cc == 0);
 }
 
@@ -672,8 +711,10 @@ LogLuvEncodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
                 return 0;
 
        assert(cc%rowlen == 0);
-       while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 1)
-               bp += rowlen, cc -= rowlen;
+       while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 1) {
+               bp += rowlen;
+               cc -= rowlen;
+       }
        return (cc == 0);
 }
 
@@ -1243,6 +1284,14 @@ LogL16InitState(TIFF* tif)
        assert(sp != NULL);
        assert(td->td_photometric == PHOTOMETRIC_LOGL);
 
+       if( td->td_samplesperpixel != 1 )
+       {
+               TIFFErrorExt(tif->tif_clientdata, module,
+                            "Sorry, can not handle LogL image with %s=%d",
+                            "Samples/pixel", td->td_samplesperpixel);
+               return 0;
+       }
+
        /* for some reason, we can't do this in TIFFInitLogL16 */
        if (sp->user_datafmt == SGILOGDATAFMT_UNKNOWN)
                sp->user_datafmt = LogL16GuessDataFmt(td);
@@ -1565,17 +1614,21 @@ LogLuvVSetField(TIFF* tif, uint32 tag, va_list ap)
                 */
                switch (sp->user_datafmt) {
                case SGILOGDATAFMT_FLOAT:
-                       bps = 32, fmt = SAMPLEFORMAT_IEEEFP;
+                       bps = 32;
+                       fmt = SAMPLEFORMAT_IEEEFP;
                        break;
                case SGILOGDATAFMT_16BIT:
-                       bps = 16, fmt = SAMPLEFORMAT_INT;
+                       bps = 16;
+                       fmt = SAMPLEFORMAT_INT;
                        break;
                case SGILOGDATAFMT_RAW:
-                       bps = 32, fmt = SAMPLEFORMAT_UINT;
+                       bps = 32;
+                       fmt = SAMPLEFORMAT_UINT;
                        TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1);
                        break;
                case SGILOGDATAFMT_8BIT:
-                       bps = 8, fmt = SAMPLEFORMAT_UINT;
+                       bps = 8;
+                       fmt = SAMPLEFORMAT_UINT;
                        break;
                default:
                        TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
index dedf1d9..80fc394 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_lzma.c,v 1.4 2011-12-22 00:29:29 bfriesen Exp $ */
+/* $Id: tif_lzma.c,v 1.6 2016-09-17 09:18:59 erouault Exp $ */
 
 /*
  * Copyright (c) 2010, Andrey Kiselev <dron@ak4719.spb.edu>
@@ -95,7 +95,7 @@ LZMAStrerror(lzma_ret ret)
                case LZMA_PROG_ERROR:
                    return "programming error";
                default:
-                   return "unindentified liblzma error";
+                   return "unidentified liblzma error";
        }
 }
 
@@ -490,6 +490,6 @@ bad:
                     "No space for LZMA2 state block");
        return 0;
 }
-#endif /* LZMA_SUPORT */
+#endif /* LZMA_SUPPORT */
 
 /* vim: set ts=8 sts=8 sw=8 noet: */
index 9b76dd0..240e19c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_lzw.c,v 1.49 2015-08-30 21:07:44 erouault Exp $ */
+/* $Id: tif_lzw.c,v 1.52 2016-09-04 21:32:56 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -240,8 +240,8 @@ LZWSetupDecode(TIFF* tif)
                 */
                code = 255;
                do {
-                       sp->dec_codetab[code].value = code;
-                       sp->dec_codetab[code].firstchar = code;
+                       sp->dec_codetab[code].value = (unsigned char)code;
+                       sp->dec_codetab[code].firstchar = (unsigned char)code;
                        sp->dec_codetab[code].length = 1;
                        sp->dec_codetab[code].next = NULL;
                } while (code--);
@@ -411,14 +411,15 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
                /*
                 * Residue satisfies only part of the decode request.
                 */
-               op += residue, occ -= residue;
+               op += residue;
+               occ -= residue;
                tp = op;
                do {
                        int t;
                        --tp;
                        t = codep->value;
                        codep = codep->next;
-                       *tp = t;
+                       *tp = (char)t;
                } while (--residue && codep);
                sp->dec_restart = 0;
        }
@@ -454,7 +455,8 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
                                             tif->tif_row);
                                return (0);
                        }
-                       *op++ = (char)code, occ--;
+                       *op++ = (char)code;
+                       occ--;
                        oldcodep = sp->dec_codetab + code;
                        continue;
                }
@@ -532,16 +534,19 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
                                --tp;
                                t = codep->value;
                                codep = codep->next;
-                               *tp = t;
+                               *tp = (char)t;
                        } while (codep && tp > op);
                        if (codep) {
                            codeLoop(tif, module);
                            break;
                        }
                        assert(occ >= len);
-                       op += len, occ -= len;
-               } else
-                       *op++ = (char)code, occ--;
+                       op += len;
+                       occ -= len;
+               } else {
+                       *op++ = (char)code;
+                       occ--;
+               }
        }
 
        tif->tif_rawcp = (uint8*) bp;
@@ -635,7 +640,8 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
                /*
                 * Residue satisfies only part of the decode request.
                 */
-               op += residue, occ -= residue;
+               op += residue;
+               occ -= residue;
                tp = op;
                do {
                        *--tp = codep->value;
@@ -675,7 +681,8 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
                                             tif->tif_row);
                                return (0);
                        }
-                       *op++ = code, occ--;
+                       *op++ = (char)code;
+                       occ--;
                        oldcodep = sp->dec_codetab + code;
                        continue;
                }
@@ -741,17 +748,20 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
                                break;
                        }
                        assert(occ >= codep->length);
-                       op += codep->length, occ -= codep->length;
+                       op += codep->length;
+                       occ -= codep->length;
                        tp = op;
                        do {
                                *--tp = codep->value;
                        } while( (codep = codep->next) != NULL );
-               } else
-                       *op++ = code, occ--;
+               } else {
+                       *op++ = (char)code;
+                       occ--;
+               }
        }
 
        tif->tif_rawcp = (uint8*) bp;
-       sp->lzw_nbits = nbits;
+       sp->lzw_nbits = (unsigned short)nbits;
        sp->lzw_nextdata = nextdata;
        sp->lzw_nextbits = nextbits;
        sp->dec_nbitsmask = nbitsmask;
@@ -900,7 +910,7 @@ LZWEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
        nbits = sp->lzw_nbits;
        op = tif->tif_rawcp;
        limit = sp->enc_rawlimit;
-       ent = sp->enc_oldcode;
+       ent = (hcode_t)sp->enc_oldcode;
 
        if (ent == (hcode_t) -1 && cc > 0) {
                /*
@@ -936,7 +946,7 @@ LZWEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
                                disp = 1;
                        do {
                                /*
-                                * Avoid pointer arithmetic 'cuz of
+                                * Avoid pointer arithmetic because of
                                 * wraparound problems with segments.
                                 */
                                if ((h -= disp) < 0)
@@ -963,8 +973,8 @@ LZWEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
                        op = tif->tif_rawdata;
                }
                PutNextCode(op, ent);
-               ent = c;
-               hp->code = free_ent++;
+               ent = (hcode_t)c;
+               hp->code = (hcode_t)(free_ent++);
                hp->hash = fcode;
                if (free_ent == CODE_MAX-1) {
                        /* table is full, emit clear code and reset */
@@ -1021,9 +1031,9 @@ LZWEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
        sp->enc_oldcode = ent;
        sp->lzw_nextdata = nextdata;
        sp->lzw_nextbits = nextbits;
-       sp->lzw_free_ent = free_ent;
-       sp->lzw_maxcode = maxcode;
-       sp->lzw_nbits = nbits;
+       sp->lzw_free_ent = (unsigned short)free_ent;
+       sp->lzw_maxcode = (unsigned short)maxcode;
+       sp->lzw_nbits = (unsigned short)nbits;
        tif->tif_rawcp = op;
        return (1);
 }
index 17e0311..0821178 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_next.c,v 1.16 2014-12-29 12:09:11 erouault Exp $ */
+/* $Id: tif_next.c,v 1.19 2016-09-04 21:32:56 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -37,7 +37,7 @@
        case 0: op[0]  = (unsigned char) ((v) << 6); break;     \
        case 1: op[0] |= (v) << 4; break;       \
        case 2: op[0] |= (v) << 2; break;       \
-       case 3: *op++ |= (v);      break;       \
+       case 3: *op++ |= (v);      op_offset++; break;  \
        }                                       \
 }
 
@@ -72,7 +72,8 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
                return (0);
        }
        for (row = buf; cc > 0 && occ > 0; occ -= scanline, row += scanline) {
-               n = *bp++, cc--;
+               n = *bp++;
+               cc--;
                switch (n) {
                case LITERALROW:
                        /*
@@ -103,6 +104,7 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
                }
                default: {
                        uint32 npixels = 0, grey;
+                       tmsize_t op_offset = 0;
                        uint32 imagewidth = tif->tif_dir.td_imagewidth;
             if( isTiled(tif) )
                 imagewidth = tif->tif_dir.td_tilewidth;
@@ -122,13 +124,19 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
                                 * bounds, potentially resulting in a security
                                 * issue.
                                 */
-                               while (n-- > 0 && npixels < imagewidth)
+                               while (n-- > 0 && npixels < imagewidth && op_offset < scanline)
                                        SETPIXEL(op, grey);
                                if (npixels >= imagewidth)
                                        break;
+                if (op_offset >= scanline ) {
+                    TIFFErrorExt(tif->tif_clientdata, module, "Invalid data for scanline %ld",
+                        (long) tif->tif_row);
+                    return (0);
+                }
                                if (cc == 0)
                                        goto bad;
-                               n = *bp++, cc--;
+                               n = *bp++;
+                               cc--;
                        }
                        break;
                }
index 23d4062..30a1812 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_ojpeg.c,v 1.60 2015-05-31 00:38:46 bfriesen Exp $ */
+/* $Id: tif_ojpeg.c,v 1.65 2016-09-04 21:32:56 erouault Exp $ */
 
 /* WARNING: The type of JPEG encapsulation defined by the TIFF Version 6.0
    specification is now totally obsolete and deprecated for new applications and
@@ -75,7 +75,7 @@
    OJPEGSubsamplingCorrect, making no note of any other data, reporting no warnings
    or errors, up to the point where either these values are read, or it's clear they
    aren't there. This means that some of the data is read twice, but we feel speed
-   in correcting these values is important enough to warrant this sacrifice. Allthough
+   in correcting these values is important enough to warrant this sacrifice. Although
    there is currently no define or other configuration mechanism to disable this behaviour,
    the actual header scanning is build to robustly respond with error report if it
    should encounter an uncorrected mismatch of subsampling values. See
@@ -84,7 +84,7 @@
    The restart interval and restart markers are the most tricky part... The restart
    interval can be specified in a tag. It can also be set inside the input JPEG stream.
    It can be used inside the input JPEG stream. If reading from strile data, we've
-   consistenly discovered the need to insert restart markers in between the different
+   consistently discovered the need to insert restart markers in between the different
    striles, as is also probably the most likely interpretation of the original TIFF 6.0
    specification. With all this setting of interval, and actual use of markers that is not
    predictable at the time of valid JPEG header assembly, the restart thing may turn
    planarconfig is not separate (vast majority). We may one day use that to build
    converters to JPEG, and/or to new-style JPEG compression inside TIFF.
 
-   A dissadvantage is the lack of random access to the individual striles. This is the
+   A disadvantage is the lack of random access to the individual striles. This is the
    reason for much of the complicated restart-and-position stuff inside OJPEGPreDecode.
    Applications would do well accessing all striles in order, as this will result in
    a single sequential scan of the input stream, and no restarting of LibJpeg decoding
  *     The default mode, without JPEG_ENCAP_EXTERNAL, implements the call encapsulators
  *     here, internally, with normal longjump.
  * SETJMP, LONGJMP, JMP_BUF: On some machines/environments a longjump equivalent is
- *     conviniently available, but still it may be worthwhile to use _setjmp or sigsetjmp
+ *     conveniently available, but still it may be worthwhile to use _setjmp or sigsetjmp
  *     in place of plain setjmp. These macros will make it easier. It is useless
  *     to fiddle with these if you define JPEG_ENCAP_EXTERNAL.
  * OJPEG_BUFFER: Define the size of the desired buffer here. Should be small enough so as to guarantee
@@ -200,7 +200,7 @@ static const TIFFField ojpegFields[] = {
   Libjpeg's jmorecfg.h defines INT16 and INT32, but only if XMD_H is
   not defined.  Unfortunately, the MinGW and Borland compilers include
   a typedef for INT32, which causes a conflict.  MSVC does not include
-  a conficting typedef given the headers which are included.
+  a conflicting typedef given the headers which are included.
 */
 #if defined(__BORLANDC__) || defined(__MINGW32__)
 # define XMD_H 1
@@ -1081,7 +1081,7 @@ OJPEGReadHeaderInfo(TIFF* tif)
                        TIFFErrorExt(tif->tif_clientdata,module,"Incompatible vertical subsampling and image strip/tile length");
                        return(0);
                }
-               sp->restart_interval=((sp->strile_width+sp->subsampling_hor*8-1)/(sp->subsampling_hor*8))*(sp->strile_length/(sp->subsampling_ver*8));
+               sp->restart_interval=(uint16)(((sp->strile_width+sp->subsampling_hor*8-1)/(sp->subsampling_hor*8))*(sp->strile_length/(sp->subsampling_ver*8)));
        }
        if (OJPEGReadHeaderInfoSec(tif)==0)
                return(0);
@@ -1103,7 +1103,7 @@ OJPEGReadSecondarySos(TIFF* tif, uint16 s)
        assert(s<3);
        assert(sp->sos_end[0].log!=0);
        assert(sp->sos_end[s].log==0);
-       sp->plane_sample_offset=s-1;
+       sp->plane_sample_offset=(uint8)(s-1);
        while(sp->sos_end[sp->plane_sample_offset].log==0)
                sp->plane_sample_offset--;
        sp->in_buffer_source=sp->sos_end[sp->plane_sample_offset].in_buffer_source;
@@ -1381,7 +1381,8 @@ OJPEGReadHeaderInfoSec(TIFF* tif)
 static int
 OJPEGReadHeaderInfoSecStreamDri(TIFF* tif)
 {
-       /* this could easilly cause trouble in some cases... but no such cases have occured sofar */
+       /* This could easily cause trouble in some cases... but no such cases have
+           occurred so far */
        static const char module[]="OJPEGReadHeaderInfoSecStreamDri";
        OJPEGState* sp=(OJPEGState*)tif->tif_data;
        uint16 m;
@@ -1779,7 +1780,7 @@ OJPEGReadHeaderInfoSecTablesQTable(TIFF* tif)
                        ob[sizeof(uint32)+3]=67;
                        ob[sizeof(uint32)+4]=m;
                        TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET); 
-                       p=TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
+                       p=(uint32)TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
                        if (p!=64)
                                return(0);
                        sp->qtable[m]=ob;
@@ -1822,7 +1823,7 @@ OJPEGReadHeaderInfoSecTablesDcTable(TIFF* tif)
                                }
                        }
                        TIFFSeekFile(tif,sp->dctable_offset[m],SEEK_SET);
-                       p=TIFFReadFile(tif,o,16);
+                       p=(uint32)TIFFReadFile(tif,o,16);
                        if (p!=16)
                                return(0);
                        q=0;
@@ -1838,12 +1839,12 @@ OJPEGReadHeaderInfoSecTablesDcTable(TIFF* tif)
                        *(uint32*)rb=ra;
                        rb[sizeof(uint32)]=255;
                        rb[sizeof(uint32)+1]=JPEG_MARKER_DHT;
-                       rb[sizeof(uint32)+2]=((19+q)>>8);
+                       rb[sizeof(uint32)+2]=(uint8)((19+q)>>8);
                        rb[sizeof(uint32)+3]=((19+q)&255);
                        rb[sizeof(uint32)+4]=m;
                        for (n=0; n<16; n++)
                                rb[sizeof(uint32)+5+n]=o[n];
-                       p=TIFFReadFile(tif,&(rb[sizeof(uint32)+21]),q);
+                       p=(uint32)TIFFReadFile(tif,&(rb[sizeof(uint32)+21]),q);
                        if (p!=q)
                                return(0);
                        sp->dctable[m]=rb;
@@ -1886,7 +1887,7 @@ OJPEGReadHeaderInfoSecTablesAcTable(TIFF* tif)
                                }
                        }
                        TIFFSeekFile(tif,sp->actable_offset[m],SEEK_SET);  
-                       p=TIFFReadFile(tif,o,16);
+                       p=(uint32)TIFFReadFile(tif,o,16);
                        if (p!=16)
                                return(0);
                        q=0;
@@ -1902,12 +1903,12 @@ OJPEGReadHeaderInfoSecTablesAcTable(TIFF* tif)
                        *(uint32*)rb=ra;
                        rb[sizeof(uint32)]=255;
                        rb[sizeof(uint32)+1]=JPEG_MARKER_DHT;
-                       rb[sizeof(uint32)+2]=((19+q)>>8);
+                       rb[sizeof(uint32)+2]=(uint8)((19+q)>>8);
                        rb[sizeof(uint32)+3]=((19+q)&255);
                        rb[sizeof(uint32)+4]=(16|m);
                        for (n=0; n<16; n++)
                                rb[sizeof(uint32)+5+n]=o[n];
-                       p=TIFFReadFile(tif,&(rb[sizeof(uint32)+21]),q);
+                       p=(uint32)TIFFReadFile(tif,&(rb[sizeof(uint32)+21]),q);
                        if (p!=q)
                                return(0);
                        sp->actable[m]=rb;
@@ -2269,10 +2270,10 @@ OJPEGWriteStreamSof(TIFF* tif, void** mem, uint32* len)
        /* P */
        sp->out_buffer[4]=8;
        /* Y */
-       sp->out_buffer[5]=(sp->sof_y>>8);
+       sp->out_buffer[5]=(uint8)(sp->sof_y>>8);
        sp->out_buffer[6]=(sp->sof_y&255);
        /* X */
-       sp->out_buffer[7]=(sp->sof_x>>8);
+       sp->out_buffer[7]=(uint8)(sp->sof_x>>8);
        sp->out_buffer[8]=(sp->sof_x&255);
        /* Nf */
        sp->out_buffer[9]=sp->samples_per_pixel_per_plane;
@@ -2385,7 +2386,12 @@ OJPEGWriteStreamEoi(TIFF* tif, void** mem, uint32* len)
 static int
 jpeg_create_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo)
 {
-       return(SETJMP(sp->exit_jmpbuf)?0:(jpeg_create_decompress(cinfo),1));
+       if( SETJMP(sp->exit_jmpbuf) )
+               return 0;
+       else {
+               jpeg_create_decompress(cinfo);
+               return 1;
+       }
 }
 #endif
 
@@ -2393,7 +2399,12 @@ jpeg_create_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo)
 static int
 jpeg_read_header_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, uint8 require_image)
 {
-       return(SETJMP(sp->exit_jmpbuf)?0:(jpeg_read_header(cinfo,require_image),1));
+       if( SETJMP(sp->exit_jmpbuf) )
+               return 0;
+       else {
+               jpeg_read_header(cinfo,require_image);
+               return 1;
+       }
 }
 #endif
 
@@ -2401,7 +2412,12 @@ jpeg_read_header_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, uint8 requ
 static int
 jpeg_start_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo)
 {
-       return(SETJMP(sp->exit_jmpbuf)?0:(jpeg_start_decompress(cinfo),1));
+       if( SETJMP(sp->exit_jmpbuf) )
+               return 0;
+       else {
+               jpeg_start_decompress(cinfo);
+               return 1;
+       }
 }
 #endif
 
@@ -2409,7 +2425,12 @@ jpeg_start_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo)
 static int
 jpeg_read_scanlines_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* scanlines, uint32 max_lines)
 {
-       return(SETJMP(sp->exit_jmpbuf)?0:(jpeg_read_scanlines(cinfo,scanlines,max_lines),1));
+       if( SETJMP(sp->exit_jmpbuf) )
+               return 0;
+       else {
+               jpeg_read_scanlines(cinfo,scanlines,max_lines);
+               return 1;
+       }
 }
 #endif
 
@@ -2417,7 +2438,12 @@ jpeg_read_scanlines_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* s
 static int
 jpeg_read_raw_data_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* data, uint32 max_lines)
 {
-       return(SETJMP(sp->exit_jmpbuf)?0:(jpeg_read_raw_data(cinfo,data,max_lines),1));
+       if( SETJMP(sp->exit_jmpbuf) )
+               return 0;
+       else {
+               jpeg_read_raw_data(cinfo,data,max_lines);
+               return 1;
+       }
 }
 #endif
 
@@ -2479,6 +2505,10 @@ OJPEGLibjpegJpegSourceMgrSkipInputData(jpeg_decompress_struct* cinfo, long num_b
        jpeg_encap_unwind(tif);
 }
 
+#ifdef _MSC_VER
+#pragma warning( push )
+#pragma warning( disable : 4702 ) /* unreachable code */
+#endif
 static boolean
 OJPEGLibjpegJpegSourceMgrResyncToRestart(jpeg_decompress_struct* cinfo, int desired)
 {
@@ -2488,6 +2518,9 @@ OJPEGLibjpegJpegSourceMgrResyncToRestart(jpeg_decompress_struct* cinfo, int desi
        jpeg_encap_unwind(tif);
        return(0);
 }
+#ifdef _MSC_VER
+#pragma warning( pop ) 
+#endif
 
 static void
 OJPEGLibjpegJpegSourceMgrTermSource(jpeg_decompress_struct* cinfo)
index 8c88328..5c9036e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_open.c,v 1.46 2010-12-06 16:54:54 faxguy Exp $ */
+/* $Id: tif_open.c,v 1.47 2016-01-23 21:20:34 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -168,7 +168,7 @@ TIFFClientOpen(
         * The following flags may be used to control intrinsic library
         * behaviour that may or may not be desirable (usually for
         * compatibility with some application that claims to support
-        * TIFF but only supports some braindead idea of what the
+        * TIFF but only supports some brain dead idea of what the
         * vendor thinks TIFF is):
         *
         * 'l' use little-endian byte order for creating a file
@@ -198,8 +198,8 @@ TIFFClientOpen(
         * The 'L', 'B', and 'H' flags are intended for applications
         * that can optimize operations on data by using a particular
         * bit order.  By default the library returns data in MSB2LSB
-        * bit order for compatibiltiy with older versions of this
-        * library.  Returning data in the bit order of the native cpu
+        * bit order for compatibility with older versions of this
+        * library.  Returning data in the bit order of the native CPU
         * makes the most sense but also requires applications to check
         * the value of the FillOrder tag; something they probably do
         * not do right now.
index 9e77190..d2a0165 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_packbits.c,v 1.22 2012-06-20 05:25:33 fwarmerdam Exp $ */
+/* $Id: tif_packbits.c,v 1.24 2016-09-04 21:32:56 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -38,7 +38,8 @@ PackBitsPreEncode(TIFF* tif, uint16 s)
 {
        (void) s;
 
-       if (!(tif->tif_data = (uint8*)_TIFFmalloc(sizeof(tmsize_t))))
+        tif->tif_data = (uint8*)_TIFFmalloc(sizeof(tmsize_t));
+       if (tif->tif_data == NULL)
                return (0);
        /*
         * Calculate the scanline/tile-width size in bytes.
@@ -81,7 +82,9 @@ PackBitsEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
                /*
                 * Find the longest string of identical bytes.
                 */
-               b = *bp++, cc--, n = 1;
+               b = *bp++;
+               cc--;
+               n = 1;
                for (; cc > 0 && b == *bp; cc--, bp++)
                        n++;
        again:
@@ -222,7 +225,8 @@ PackBitsDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
        bp = (char*) tif->tif_rawcp;
        cc = tif->tif_rawcc;
        while (cc > 0 && occ > 0) {
-               n = (long) *bp++, cc--;
+               n = (long) *bp++;
+               cc--;
                /*
                 * Watch out for compilers that
                 * don't sign extend chars...
@@ -241,7 +245,8 @@ PackBitsDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
                                n = (long)occ;
                        }
                        occ -= n;
-                       b = *bp++, cc--;
+                       b = *bp++;
+                       cc--;
                        while (n-- > 0)
                                *op++ = (uint8) b;
                } else {                /* copy next n+1 bytes literally */
index 044c411..f4af2ba 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_pixarlog.c,v 1.39 2012-12-10 17:27:13 tgl Exp $ */
+/* $Id: tif_pixarlog.c,v 1.48 2016-09-23 22:12:18 erouault Exp $ */
 
 /*
  * Copyright (c) 1996-1997 Sam Leffler
  * input is assumed to be unsigned linear color values that represent
  * the range 0-1.  In the case of IEEE values, the 0-1 range is assumed to
  * be the normal linear color range, in addition over 1 values are
- * accepted up to a value of about 25.0 to encode "hot" hightlights and such.
+ * accepted up to a value of about 25.0 to encode "hot" highlights and such.
  * The encoding is lossless for 8-bit values, slightly lossy for the
  * other bit depths.  The actual color precision should be better
  * than the human eye can perceive with extra room to allow for
  * error introduced by further image computation.  As with any quantized
  * color format, it is possible to perform image calculations which
  * expose the quantization error. This format should certainly be less 
- * susceptable to such errors than standard 8-bit encodings, but more
- * susceptable than straight 16-bit or 32-bit encodings.
+ * susceptible to such errors than standard 8-bit encodings, but more
+ * susceptible than straight 16-bit or 32-bit encodings.
  *
  * On reading the internal format is converted to the desired output format.
  * The program can request which format it desires by setting the internal
@@ -296,33 +296,35 @@ horizontalAccumulate16(uint16 *wp, int n, int stride, uint16 *op,
 static void
 horizontalAccumulate11(uint16 *wp, int n, int stride, uint16 *op)
 {
-    register unsigned int  cr, cg, cb, ca, mask;
+    register unsigned int cr, cg, cb, ca, mask;
 
     if (n >= stride) {
        mask = CODE_MASK;
        if (stride == 3) {
-           op[0] = cr = wp[0];  op[1] = cg = wp[1];  op[2] = cb = wp[2];
+           op[0] = wp[0];  op[1] = wp[1];  op[2] = wp[2];
+            cr = wp[0];  cg = wp[1];  cb = wp[2];
            n -= 3;
            while (n > 0) {
                wp += 3;
                op += 3;
                n -= 3;
-               op[0] = (cr += wp[0]) & mask;
-               op[1] = (cg += wp[1]) & mask;
-               op[2] = (cb += wp[2]) & mask;
+               op[0] = (uint16)((cr += wp[0]) & mask);
+               op[1] = (uint16)((cg += wp[1]) & mask);
+               op[2] = (uint16)((cb += wp[2]) & mask);
            }
        } else if (stride == 4) {
-           op[0] = cr = wp[0];  op[1] = cg = wp[1];
-           op[2] = cb = wp[2];  op[3] = ca = wp[3];
+           op[0] = wp[0];  op[1] = wp[1];
+           op[2] = wp[2];  op[3] = wp[3];
+            cr = wp[0]; cg = wp[1]; cb = wp[2]; ca = wp[3];
            n -= 4;
            while (n > 0) {
                wp += 4;
                op += 4;
                n -= 4;
-               op[0] = (cr += wp[0]) & mask;
-               op[1] = (cg += wp[1]) & mask;
-               op[2] = (cb += wp[2]) & mask;
-               op[3] = (ca += wp[3]) & mask;
+               op[0] = (uint16)((cr += wp[0]) & mask);
+               op[1] = (uint16)((cg += wp[1]) & mask);
+               op[2] = (uint16)((cb += wp[2]) & mask);
+               op[3] = (uint16)((ca += wp[3]) & mask);
            } 
        } else {
            REPEAT(stride, *op = *wp&mask; wp++; op++)
@@ -457,6 +459,7 @@ horizontalAccumulate8abgr(uint16 *wp, int n, int stride, unsigned char *op,
 typedef        struct {
        TIFFPredictorState      predict;
        z_stream                stream;
+       tmsize_t                tbuf_size; /* only set/used on reading for now */
        uint16                  *tbuf; 
        uint16                  stride;
        int                     state;
@@ -556,7 +559,7 @@ PixarLogMakeTables(PixarLogState *sp)
     for (i = 0; i < lt2size; i++)  {
        if ((i*linstep)*(i*linstep) > ToLinearF[j]*ToLinearF[j+1])
            j++;
-       FromLT2[i] = j;
+       FromLT2[i] = (uint16)j;
     }
 
     /*
@@ -568,14 +571,14 @@ PixarLogMakeTables(PixarLogState *sp)
     for (i = 0; i < 16384; i++)  {
        while ((i/16383.)*(i/16383.) > ToLinearF[j]*ToLinearF[j+1])
            j++;
-       From14[i] = j;
+       From14[i] = (uint16)j;
     }
 
     j = 0;
     for (i = 0; i < 256; i++)  {
        while ((i/255.)*(i/255.) > ToLinearF[j]*ToLinearF[j+1])
            j++;
-       From8[i] = j;
+       From8[i] = (uint16)j;
     }
 
     Fltsize = (float)(lt2size/2);
@@ -692,6 +695,7 @@ PixarLogSetupDecode(TIFF* tif)
        sp->tbuf = (uint16 *) _TIFFmalloc(tbuf_size);
        if (sp->tbuf == NULL)
                return (0);
+       sp->tbuf_size = tbuf_size;
        if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN)
                sp->user_datafmt = PixarLogGuessDataFmt(td);
        if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) {
@@ -702,7 +706,7 @@ PixarLogSetupDecode(TIFF* tif)
        }
 
        if (inflateInit(&sp->stream) != Z_OK) {
-               TIFFErrorExt(tif->tif_clientdata, module, "%s", sp->stream.msg);
+               TIFFErrorExt(tif->tif_clientdata, module, "%s", sp->stream.msg ? sp->stream.msg : "(null)");
                return (0);
        } else {
                sp->state |= PLSTATE_INIT;
@@ -725,7 +729,7 @@ PixarLogPreDecode(TIFF* tif, uint16 s)
        assert(sizeof(sp->stream.avail_in)==4);  /* if this assert gets raised,
            we need to simplify this code to reflect a ZLib that is likely updated
            to deal with 8byte memory sizes, though this code will respond
-           apropriately even before we simplify it */
+           appropriately even before we simplify it */
        sp->stream.avail_in = (uInt) tif->tif_rawcc;
        if ((tmsize_t)sp->stream.avail_in != tif->tif_rawcc)
        {
@@ -774,13 +778,19 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
        assert(sizeof(sp->stream.avail_out)==4);  /* if this assert gets raised,
            we need to simplify this code to reflect a ZLib that is likely updated
            to deal with 8byte memory sizes, though this code will respond
-           apropriately even before we simplify it */
+           appropriately even before we simplify it */
        sp->stream.avail_out = (uInt) (nsamples * sizeof(uint16));
        if (sp->stream.avail_out != nsamples * sizeof(uint16))
        {
                TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
                return (0);
        }
+       /* Check that we will not fill more than what was allocated */
+       if ((tmsize_t)sp->stream.avail_out > sp->tbuf_size)
+       {
+               TIFFErrorExt(tif->tif_clientdata, module, "sp->stream.avail_out > sp->tbuf_size");
+               return (0);
+       }
        do {
                int state = inflate(&sp->stream, Z_PARTIAL_FLUSH);
                if (state == Z_STREAM_END) {
@@ -789,14 +799,14 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
                if (state == Z_DATA_ERROR) {
                        TIFFErrorExt(tif->tif_clientdata, module,
                            "Decoding error at scanline %lu, %s",
-                           (unsigned long) tif->tif_row, sp->stream.msg);
+                           (unsigned long) tif->tif_row, sp->stream.msg ? sp->stream.msg : "(null)");
                        if (inflateSync(&sp->stream) != Z_OK)
                                return (0);
                        continue;
                }
                if (state != Z_OK) {
                        TIFFErrorExt(tif->tif_clientdata, module, "ZLib error: %s",
-                           sp->stream.msg);
+                           sp->stream.msg ? sp->stream.msg : "(null)");
                        return (0);
                }
        } while (sp->stream.avail_out > 0);
@@ -898,7 +908,7 @@ PixarLogSetupEncode(TIFF* tif)
        }
 
        if (deflateInit(&sp->stream, sp->quality) != Z_OK) {
-               TIFFErrorExt(tif->tif_clientdata, module, "%s", sp->stream.msg);
+               TIFFErrorExt(tif->tif_clientdata, module, "%s", sp->stream.msg ? sp->stream.msg : "(null)");
                return (0);
        } else {
                sp->state |= PLSTATE_INIT;
@@ -921,8 +931,8 @@ PixarLogPreEncode(TIFF* tif, uint16 s)
        assert(sizeof(sp->stream.avail_out)==4);  /* if this assert gets raised,
            we need to simplify this code to reflect a ZLib that is likely updated
            to deal with 8byte memory sizes, though this code will respond
-           apropriately even before we simplify it */
-       sp->stream.avail_out = tif->tif_rawdatasize;
+           appropriately even before we simplify it */
+       sp->stream.avail_out = (uInt)tif->tif_rawdatasize;
        if ((tmsize_t)sp->stream.avail_out != tif->tif_rawdatasize)
        {
                TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
@@ -953,9 +963,9 @@ horizontalDifferenceF(float *ip, int n, int stride, uint16 *wp, uint16 *FromLT2)
                n -= 3;
                wp += 3;
                ip += 3;
-               r1 = (int32) CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1;
-               g1 = (int32) CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1;
-               b1 = (int32) CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1;
+               r1 = (int32) CLAMP(ip[0]); wp[0] = (uint16)((r1-r2) & mask); r2 = r1;
+               g1 = (int32) CLAMP(ip[1]); wp[1] = (uint16)((g1-g2) & mask); g2 = g1;
+               b1 = (int32) CLAMP(ip[2]); wp[2] = (uint16)((b1-b2) & mask); b2 = b1;
            }
        } else if (stride == 4) {
            r2 = wp[0] = (uint16) CLAMP(ip[0]);
@@ -967,23 +977,20 @@ horizontalDifferenceF(float *ip, int n, int stride, uint16 *wp, uint16 *FromLT2)
                n -= 4;
                wp += 4;
                ip += 4;
-               r1 = (int32) CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1;
-               g1 = (int32) CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1;
-               b1 = (int32) CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1;
-               a1 = (int32) CLAMP(ip[3]); wp[3] = (a1-a2) & mask; a2 = a1;
+               r1 = (int32) CLAMP(ip[0]); wp[0] = (uint16)((r1-r2) & mask); r2 = r1;
+               g1 = (int32) CLAMP(ip[1]); wp[1] = (uint16)((g1-g2) & mask); g2 = g1;
+               b1 = (int32) CLAMP(ip[2]); wp[2] = (uint16)((b1-b2) & mask); b2 = b1;
+               a1 = (int32) CLAMP(ip[3]); wp[3] = (uint16)((a1-a2) & mask); a2 = a1;
            }
        } else {
-           ip += n - 1;        /* point to last one */
-           wp += n - 1;        /* point to last one */
-           n -= stride;
-           while (n > 0) {
-               REPEAT(stride, wp[0] = (uint16) CLAMP(ip[0]);
-                               wp[stride] -= wp[0];
-                               wp[stride] &= mask;
-                               wp--; ip--)
-               n -= stride;
-           }
-           REPEAT(stride, wp[0] = (uint16) CLAMP(ip[0]); wp--; ip--)
+        REPEAT(stride, wp[0] = (uint16) CLAMP(ip[0]); wp++; ip++)
+        n -= stride;
+        while (n > 0) {
+            REPEAT(stride,
+                wp[0] = (uint16)(((int32)CLAMP(ip[0])-(int32)CLAMP(ip[-stride])) & mask);
+                wp++; ip++)
+            n -= stride;
+        }
        }
     }
 }
@@ -1008,9 +1015,9 @@ horizontalDifference16(unsigned short *ip, int n, int stride,
                n -= 3;
                wp += 3;
                ip += 3;
-               r1 = CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1;
-               g1 = CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1;
-               b1 = CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1;
+               r1 = CLAMP(ip[0]); wp[0] = (uint16)((r1-r2) & mask); r2 = r1;
+               g1 = CLAMP(ip[1]); wp[1] = (uint16)((g1-g2) & mask); g2 = g1;
+               b1 = CLAMP(ip[2]); wp[2] = (uint16)((b1-b2) & mask); b2 = b1;
            }
        } else if (stride == 4) {
            r2 = wp[0] = CLAMP(ip[0]);  g2 = wp[1] = CLAMP(ip[1]);
@@ -1020,23 +1027,20 @@ horizontalDifference16(unsigned short *ip, int n, int stride,
                n -= 4;
                wp += 4;
                ip += 4;
-               r1 = CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1;
-               g1 = CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1;
-               b1 = CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1;
-               a1 = CLAMP(ip[3]); wp[3] = (a1-a2) & mask; a2 = a1;
+               r1 = CLAMP(ip[0]); wp[0] = (uint16)((r1-r2) & mask); r2 = r1;
+               g1 = CLAMP(ip[1]); wp[1] = (uint16)((g1-g2) & mask); g2 = g1;
+               b1 = CLAMP(ip[2]); wp[2] = (uint16)((b1-b2) & mask); b2 = b1;
+               a1 = CLAMP(ip[3]); wp[3] = (uint16)((a1-a2) & mask); a2 = a1;
            }
        } else {
-           ip += n - 1;        /* point to last one */
-           wp += n - 1;        /* point to last one */
+        REPEAT(stride, wp[0] = CLAMP(ip[0]); wp++; ip++)
            n -= stride;
            while (n > 0) {
-               REPEAT(stride, wp[0] = CLAMP(ip[0]);
-                               wp[stride] -= wp[0];
-                               wp[stride] &= mask;
-                               wp--; ip--)
-               n -= stride;
-           }
-           REPEAT(stride, wp[0] = CLAMP(ip[0]); wp--; ip--)
+            REPEAT(stride,
+                wp[0] = (uint16)((CLAMP(ip[0])-CLAMP(ip[-stride])) & mask);
+                wp++; ip++)
+            n -= stride;
+        }
        }
     }
 }
@@ -1059,9 +1063,9 @@ horizontalDifference8(unsigned char *ip, int n, int stride,
            n -= 3;
            while (n > 0) {
                n -= 3;
-               r1 = CLAMP(ip[3]); wp[3] = (r1-r2) & mask; r2 = r1;
-               g1 = CLAMP(ip[4]); wp[4] = (g1-g2) & mask; g2 = g1;
-               b1 = CLAMP(ip[5]); wp[5] = (b1-b2) & mask; b2 = b1;
+               r1 = CLAMP(ip[3]); wp[3] = (uint16)((r1-r2) & mask); r2 = r1;
+               g1 = CLAMP(ip[4]); wp[4] = (uint16)((g1-g2) & mask); g2 = g1;
+               b1 = CLAMP(ip[5]); wp[5] = (uint16)((b1-b2) & mask); b2 = b1;
                wp += 3;
                ip += 3;
            }
@@ -1071,26 +1075,23 @@ horizontalDifference8(unsigned char *ip, int n, int stride,
            n -= 4;
            while (n > 0) {
                n -= 4;
-               r1 = CLAMP(ip[4]); wp[4] = (r1-r2) & mask; r2 = r1;
-               g1 = CLAMP(ip[5]); wp[5] = (g1-g2) & mask; g2 = g1;
-               b1 = CLAMP(ip[6]); wp[6] = (b1-b2) & mask; b2 = b1;
-               a1 = CLAMP(ip[7]); wp[7] = (a1-a2) & mask; a2 = a1;
+               r1 = CLAMP(ip[4]); wp[4] = (uint16)((r1-r2) & mask); r2 = r1;
+               g1 = CLAMP(ip[5]); wp[5] = (uint16)((g1-g2) & mask); g2 = g1;
+               b1 = CLAMP(ip[6]); wp[6] = (uint16)((b1-b2) & mask); b2 = b1;
+               a1 = CLAMP(ip[7]); wp[7] = (uint16)((a1-a2) & mask); a2 = a1;
                wp += 4;
                ip += 4;
            }
        } else {
-           wp += n + stride - 1;       /* point to last one */
-           ip += n + stride - 1;       /* point to last one */
-           n -= stride;
-           while (n > 0) {
-               REPEAT(stride, wp[0] = CLAMP(ip[0]);
-                               wp[stride] -= wp[0];
-                               wp[stride] &= mask;
-                               wp--; ip--)
-               n -= stride;
-           }
-           REPEAT(stride, wp[0] = CLAMP(ip[0]); wp--; ip--)
-       }
+        REPEAT(stride, wp[0] = CLAMP(ip[0]); wp++; ip++)
+        n -= stride;
+        while (n > 0) {
+            REPEAT(stride,
+                wp[0] = (uint16)((CLAMP(ip[0])-CLAMP(ip[-stride])) & mask);
+                wp++; ip++)
+            n -= stride;
+        }
+    }
     }
 }
 
@@ -1131,6 +1132,13 @@ PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
        }
 
        llen = sp->stride * td->td_imagewidth;
+    /* Check against the number of elements (of size uint16) of sp->tbuf */
+    if( n > (tmsize_t)(td->td_rowsperstrip * llen) )
+    {
+        TIFFErrorExt(tif->tif_clientdata, module,
+                     "Too many input bytes provided");
+        return 0;
+    }
 
        for (i = 0, up = sp->tbuf; i < n; i += llen, up += llen) {
                switch (sp->user_datafmt)  {
@@ -1161,7 +1169,7 @@ PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
        assert(sizeof(sp->stream.avail_in)==4);  /* if this assert gets raised,
            we need to simplify this code to reflect a ZLib that is likely updated
            to deal with 8byte memory sizes, though this code will respond
-           apropriately even before we simplify it */
+           appropriately even before we simplify it */
        sp->stream.avail_in = (uInt) (n * sizeof(uint16));
        if ((sp->stream.avail_in / sizeof(uint16)) != (uInt) n)
        {
@@ -1173,7 +1181,7 @@ PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
        do {
                if (deflate(&sp->stream, Z_NO_FLUSH) != Z_OK) {
                        TIFFErrorExt(tif->tif_clientdata, module, "Encoder error: %s",
-                           sp->stream.msg);
+                           sp->stream.msg ? sp->stream.msg : "(null)");
                        return (0);
                }
                if (sp->stream.avail_out == 0) {
@@ -1215,7 +1223,7 @@ PixarLogPostEncode(TIFF* tif)
                    break;
                default:
                        TIFFErrorExt(tif->tif_clientdata, module, "ZLib error: %s",
-                       sp->stream.msg);
+                       sp->stream.msg ? sp->stream.msg : "(null)");
                    return (0);
                }
        } while (state != Z_STREAM_END);
@@ -1227,7 +1235,7 @@ PixarLogClose(TIFF* tif)
 {
        TIFFDirectory *td = &tif->tif_dir;
 
-       /* In a really sneaky (and really incorrect, and untruthfull, and
+       /* In a really sneaky (and really incorrect, and untruthful, and
         * troublesome, and error-prone) maneuver that completely goes against
         * the spirit of TIFF, and breaks TIFF, on close, we covertly
         * modify both bitspersample and sampleformat in the directory to
@@ -1285,7 +1293,7 @@ PixarLogVSetField(TIFF* tif, uint32 tag, va_list ap)
                        if (deflateParams(&sp->stream,
                            sp->quality, Z_DEFAULT_STRATEGY) != Z_OK) {
                                TIFFErrorExt(tif->tif_clientdata, module, "ZLib error: %s",
-                                       sp->stream.msg);
+                                       sp->stream.msg ? sp->stream.msg : "(null)");
                                return (0);
                        }
                }
index 1388dde..0b185d2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_predict.c,v 1.35 2015-08-31 15:05:57 erouault Exp $ */
+/* $Id: tif_predict.c,v 1.40 2016-11-04 09:19:13 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
 
 #define        PredictorState(tif)     ((TIFFPredictorState*) (tif)->tif_data)
 
-static void horAcc8(TIFF* tif, uint8* cp0, tmsize_t cc);
-static void horAcc16(TIFF* tif, uint8* cp0, tmsize_t cc);
-static void horAcc32(TIFF* tif, uint8* cp0, tmsize_t cc);
-static void swabHorAcc16(TIFF* tif, uint8* cp0, tmsize_t cc);
-static void swabHorAcc32(TIFF* tif, uint8* cp0, tmsize_t cc);
-static void horDiff8(TIFF* tif, uint8* cp0, tmsize_t cc);
-static void horDiff16(TIFF* tif, uint8* cp0, tmsize_t cc);
-static void horDiff32(TIFF* tif, uint8* cp0, tmsize_t cc);
-static void swabHorDiff16(TIFF* tif, uint8* cp0, tmsize_t cc);
-static void swabHorDiff32(TIFF* tif, uint8* cp0, tmsize_t cc);
-static void fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc);
-static void fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc);
+static int horAcc8(TIFF* tif, uint8* cp0, tmsize_t cc);
+static int horAcc16(TIFF* tif, uint8* cp0, tmsize_t cc);
+static int horAcc32(TIFF* tif, uint8* cp0, tmsize_t cc);
+static int swabHorAcc16(TIFF* tif, uint8* cp0, tmsize_t cc);
+static int swabHorAcc32(TIFF* tif, uint8* cp0, tmsize_t cc);
+static int horDiff8(TIFF* tif, uint8* cp0, tmsize_t cc);
+static int horDiff16(TIFF* tif, uint8* cp0, tmsize_t cc);
+static int horDiff32(TIFF* tif, uint8* cp0, tmsize_t cc);
+static int swabHorDiff16(TIFF* tif, uint8* cp0, tmsize_t cc);
+static int swabHorDiff32(TIFF* tif, uint8* cp0, tmsize_t cc);
+static int fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc);
+static int fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc);
 static int PredictorDecodeRow(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s);
 static int PredictorDecodeTile(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s);
 static int PredictorEncodeRow(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s);
@@ -80,6 +80,15 @@ PredictorSetup(TIFF* tif)
                                    td->td_sampleformat);
                                return 0;
                        }
+                        if (td->td_bitspersample != 16
+                            && td->td_bitspersample != 24
+                            && td->td_bitspersample != 32
+                            && td->td_bitspersample != 64) { /* Should 64 be allowed? */
+                                TIFFErrorExt(tif->tif_clientdata, module,
+                                             "Floating point \"Predictor\" not supported with %d-bit samples",
+                                             td->td_bitspersample);
+                               return 0;
+                            }
                        break;
                default:
                        TIFFErrorExt(tif->tif_clientdata, module,
@@ -174,7 +183,7 @@ PredictorSetupDecode(TIFF* tif)
                }
                /*
                 * Allocate buffer to keep the decoded bytes before
-                * rearranging in the ight order
+                * rearranging in the right order
                 */
        }
 
@@ -213,7 +222,7 @@ PredictorSetupEncode(TIFF* tif)
                 /*
                  * If the data is horizontally differenced 16-bit data that
                  * requires byte-swapping, then it must be byte swapped after
-                 * the differenciation step.  We do this with a special-purpose
+                 * the differentiation step.  We do this with a special-purpose
                  * routine and override the normal post decoding logic that
                  * the library setup when the directory was read.
                  */
@@ -264,13 +273,19 @@ PredictorSetupEncode(TIFF* tif)
 /* - when storing into the byte stream, we explicitly mask with 0xff so */
 /*   as to make icc -check=conversions happy (not necessary by the standard) */
 
-static void
+static int
 horAcc8(TIFF* tif, uint8* cp0, tmsize_t cc)
 {
        tmsize_t stride = PredictorState(tif)->stride;
 
        unsigned char* cp = (unsigned char*) cp0;
-       assert((cc%stride)==0);
+    if((cc%stride)!=0)
+    {
+        TIFFErrorExt(tif->tif_clientdata, "horAcc8",
+                     "%s", "(cc%stride)!=0");
+        return 0;
+    }
+
        if (cc > stride) {
                /*
                 * Pipeline the most common cases.
@@ -312,26 +327,32 @@ horAcc8(TIFF* tif, uint8* cp0, tmsize_t cc)
                        } while (cc>0);
                }
        }
+       return 1;
 }
 
-static void
+static int
 swabHorAcc16(TIFF* tif, uint8* cp0, tmsize_t cc)
 {
        uint16* wp = (uint16*) cp0;
        tmsize_t wc = cc / 2;
 
         TIFFSwabArrayOfShort(wp, wc);
-        horAcc16(tif, cp0, cc);
+        return horAcc16(tif, cp0, cc);
 }
 
-static void
+static int
 horAcc16(TIFF* tif, uint8* cp0, tmsize_t cc)
 {
        tmsize_t stride = PredictorState(tif)->stride;
        uint16* wp = (uint16*) cp0;
        tmsize_t wc = cc / 2;
 
-       assert((cc%(2*stride))==0);
+    if((cc%(2*stride))!=0)
+    {
+        TIFFErrorExt(tif->tif_clientdata, "horAcc16",
+                     "%s", "cc%(2*stride))!=0");
+        return 0;
+    }
 
        if (wc > stride) {
                wc -= stride;
@@ -340,26 +361,32 @@ horAcc16(TIFF* tif, uint8* cp0, tmsize_t cc)
                        wc -= stride;
                } while (wc > 0);
        }
+       return 1;
 }
 
-static void
+static int
 swabHorAcc32(TIFF* tif, uint8* cp0, tmsize_t cc)
 {
        uint32* wp = (uint32*) cp0;
        tmsize_t wc = cc / 4;
 
         TIFFSwabArrayOfLong(wp, wc);
-       horAcc32(tif, cp0, cc);
+       return horAcc32(tif, cp0, cc);
 }
 
-static void
+static int
 horAcc32(TIFF* tif, uint8* cp0, tmsize_t cc)
 {
        tmsize_t stride = PredictorState(tif)->stride;
        uint32* wp = (uint32*) cp0;
        tmsize_t wc = cc / 4;
 
-       assert((cc%(4*stride))==0);
+    if((cc%(4*stride))!=0)
+    {
+        TIFFErrorExt(tif->tif_clientdata, "horAcc32",
+                     "%s", "cc%(4*stride))!=0");
+        return 0;
+    }
 
        if (wc > stride) {
                wc -= stride;
@@ -368,12 +395,13 @@ horAcc32(TIFF* tif, uint8* cp0, tmsize_t cc)
                        wc -= stride;
                } while (wc > 0);
        }
+       return 1;
 }
 
 /*
  * Floating point predictor accumulation routine.
  */
-static void
+static int
 fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc)
 {
        tmsize_t stride = PredictorState(tif)->stride;
@@ -381,12 +409,18 @@ fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc)
        tmsize_t wc = cc / bps;
        tmsize_t count = cc;
        uint8 *cp = (uint8 *) cp0;
-       uint8 *tmp = (uint8 *)_TIFFmalloc(cc);
+       uint8 *tmp;
 
-       assert((cc%(bps*stride))==0);
+    if(cc%(bps*stride)!=0)
+    {
+        TIFFErrorExt(tif->tif_clientdata, "fpAcc",
+                     "%s", "cc%(bps*stride))!=0");
+        return 0;
+    }
 
+    tmp = (uint8 *)_TIFFmalloc(cc);
        if (!tmp)
-               return;
+               return 0;
 
        while (count > stride) {
                REPEAT4(stride, cp[stride] =
@@ -408,6 +442,7 @@ fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc)
                }
        }
        _TIFFfree(tmp);
+    return 1;
 }
 
 /*
@@ -423,8 +458,7 @@ PredictorDecodeRow(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
        assert(sp->decodepfunc != NULL);  
 
        if ((*sp->decoderow)(tif, op0, occ0, s)) {
-               (*sp->decodepfunc)(tif, op0, occ0);
-               return 1;
+               return (*sp->decodepfunc)(tif, op0, occ0);
        } else
                return 0;
 }
@@ -447,10 +481,16 @@ PredictorDecodeTile(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
        if ((*sp->decodetile)(tif, op0, occ0, s)) {
                tmsize_t rowsize = sp->rowsize;
                assert(rowsize > 0);
-               assert((occ0%rowsize)==0);
+               if((occ0%rowsize) !=0)
+        {
+            TIFFErrorExt(tif->tif_clientdata, "PredictorDecodeTile",
+                         "%s", "occ0%rowsize != 0");
+            return 0;
+        }
                assert(sp->decodepfunc != NULL);
                while (occ0 > 0) {
-                       (*sp->decodepfunc)(tif, op0, rowsize);
+                       if( !(*sp->decodepfunc)(tif, op0, rowsize) )
+                return 0;
                        occ0 -= rowsize;
                        op0 += rowsize;
                }
@@ -459,14 +499,19 @@ PredictorDecodeTile(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
                return 0;
 }
 
-static void
+static int
 horDiff8(TIFF* tif, uint8* cp0, tmsize_t cc)
 {
        TIFFPredictorState* sp = PredictorState(tif);
        tmsize_t stride = sp->stride;
        unsigned char* cp = (unsigned char*) cp0;
 
-       assert((cc%stride)==0);
+    if((cc%stride)!=0)
+    {
+        TIFFErrorExt(tif->tif_clientdata, "horDiff8",
+                     "%s", "(cc%stride)!=0");
+        return 0;
+    }
 
        if (cc > stride) {
                cc -= stride;
@@ -504,9 +549,10 @@ horDiff8(TIFF* tif, uint8* cp0, tmsize_t cc)
                        } while ((cc -= stride) > 0);
                }
        }
+       return 1;
 }
 
-static void
+static int
 horDiff16(TIFF* tif, uint8* cp0, tmsize_t cc)
 {
        TIFFPredictorState* sp = PredictorState(tif);
@@ -514,7 +560,12 @@ horDiff16(TIFF* tif, uint8* cp0, tmsize_t cc)
        uint16 *wp = (uint16*) cp0;
        tmsize_t wc = cc/2;
 
-       assert((cc%(2*stride))==0);
+    if((cc%(2*stride))!=0)
+    {
+        TIFFErrorExt(tif->tif_clientdata, "horDiff8",
+                     "%s", "(cc%(2*stride))!=0");
+        return 0;
+    }
 
        if (wc > stride) {
                wc -= stride;
@@ -524,20 +575,23 @@ horDiff16(TIFF* tif, uint8* cp0, tmsize_t cc)
                        wc -= stride;
                } while (wc > 0);
        }
+       return 1;
 }
 
-static void
+static int
 swabHorDiff16(TIFF* tif, uint8* cp0, tmsize_t cc)
 {
     uint16* wp = (uint16*) cp0;
     tmsize_t wc = cc / 2;
 
-    horDiff16(tif, cp0, cc);
+    if( !horDiff16(tif, cp0, cc) )
+        return 0;
 
     TIFFSwabArrayOfShort(wp, wc);
+    return 1;
 }
 
-static void
+static int
 horDiff32(TIFF* tif, uint8* cp0, tmsize_t cc)
 {
        TIFFPredictorState* sp = PredictorState(tif);
@@ -545,7 +599,12 @@ horDiff32(TIFF* tif, uint8* cp0, tmsize_t cc)
        uint32 *wp = (uint32*) cp0;
        tmsize_t wc = cc/4;
 
-       assert((cc%(4*stride))==0);
+    if((cc%(4*stride))!=0)
+    {
+        TIFFErrorExt(tif->tif_clientdata, "horDiff32",
+                     "%s", "(cc%(4*stride))!=0");
+        return 0;
+    }
 
        if (wc > stride) {
                wc -= stride;
@@ -555,23 +614,26 @@ horDiff32(TIFF* tif, uint8* cp0, tmsize_t cc)
                        wc -= stride;
                } while (wc > 0);
        }
+       return 1;
 }
 
-static void
+static int
 swabHorDiff32(TIFF* tif, uint8* cp0, tmsize_t cc)
 {
     uint32* wp = (uint32*) cp0;
     tmsize_t wc = cc / 4;
 
-    horDiff32(tif, cp0, cc);
+    if( !horDiff32(tif, cp0, cc) )
+        return 0;
 
     TIFFSwabArrayOfLong(wp, wc);
+    return 1;
 }
 
 /*
  * Floating point predictor differencing routine.
  */
-static void
+static int
 fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc)
 {
        tmsize_t stride = PredictorState(tif)->stride;
@@ -579,12 +641,18 @@ fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc)
        tmsize_t wc = cc / bps;
        tmsize_t count;
        uint8 *cp = (uint8 *) cp0;
-       uint8 *tmp = (uint8 *)_TIFFmalloc(cc);
+       uint8 *tmp;
 
-       assert((cc%(bps*stride))==0);
+    if((cc%(bps*stride))!=0)
+    {
+        TIFFErrorExt(tif->tif_clientdata, "fpDiff",
+                     "%s", "(cc%(bps*stride))!=0");
+        return 0;
+    }
 
+    tmp = (uint8 *)_TIFFmalloc(cc);
        if (!tmp)
-               return;
+               return 0;
 
        _TIFFmemcpy(tmp, cp0, cc);
        for (count = 0; count < wc; count++) {
@@ -604,6 +672,7 @@ fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc)
        cp += cc - stride - 1;
        for (count = cc; count > stride; count -= stride)
                REPEAT4(stride, cp[stride] = (unsigned char)((cp[stride] - cp[0])&0xff); cp--)
+    return 1;
 }
 
 static int
@@ -616,7 +685,8 @@ PredictorEncodeRow(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
        assert(sp->encoderow != NULL);
 
        /* XXX horizontal differencing alters user's data XXX */
-       (*sp->encodepfunc)(tif, bp, cc);
+       if( !(*sp->encodepfunc)(tif, bp, cc) )
+        return 0;
        return (*sp->encoderow)(tif, bp, cc, s);
 }
 
@@ -651,7 +721,13 @@ PredictorEncodeTile(TIFF* tif, uint8* bp0, tmsize_t cc0, uint16 s)
 
        rowsize = sp->rowsize;
        assert(rowsize > 0);
-       assert((cc0%rowsize)==0);
+       if((cc0%rowsize)!=0)
+    {
+        TIFFErrorExt(tif->tif_clientdata, "PredictorEncodeTile",
+                     "%s", "(cc0%rowsize)!=0");
+        _TIFFfree( working_copy );
+        return 0;
+    }
        while (cc > 0) {
                (*sp->encodepfunc)(tif, bp, rowsize);
                cc -= rowsize;
@@ -700,7 +776,7 @@ PredictorVGetField(TIFF* tif, uint32 tag, va_list ap)
 
        switch (tag) {
        case TIFFTAG_PREDICTOR:
-               *va_arg(ap, uint16*) = sp->predictor;
+               *va_arg(ap, uint16*) = (uint16)sp->predictor;
                break;
        default:
                return (*sp->vgetparent)(tif, tag, ap);
index dc7144c..6c68e21 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_predict.h,v 1.8 2010-03-10 18:56:49 bfriesen Exp $ */
+/* $Id: tif_predict.h,v 1.9 2016-10-31 17:24:26 erouault Exp $ */
 
 /*
  * Copyright (c) 1995-1997 Sam Leffler
@@ -30,6 +30,8 @@
  * ``Library-private'' Support for the Predictor Tag
  */
 
+typedef int (*TIFFEncodeDecodeMethod)(TIFF* tif, uint8* buf, tmsize_t size);
+
 /*
  * Codecs that want to support the Predictor tag must place
  * this structure first in their private state block so that
@@ -43,12 +45,12 @@ typedef struct {
        TIFFCodeMethod  encoderow;      /* parent codec encode/decode row */
        TIFFCodeMethod  encodestrip;    /* parent codec encode/decode strip */
        TIFFCodeMethod  encodetile;     /* parent codec encode/decode tile */ 
-       TIFFPostMethod  encodepfunc;    /* horizontal differencer */
+       TIFFEncodeDecodeMethod  encodepfunc;    /* horizontal differencer */
 
        TIFFCodeMethod  decoderow;      /* parent codec encode/decode row */
        TIFFCodeMethod  decodestrip;    /* parent codec encode/decode strip */
        TIFFCodeMethod  decodetile;     /* parent codec encode/decode tile */ 
-       TIFFPostMethod  decodepfunc;    /* horizontal accumulator */
+       TIFFEncodeDecodeMethod  decodepfunc;    /* horizontal accumulator */
 
        TIFFVGetMethod  vgetparent;     /* super-class method */
        TIFFVSetMethod  vsetparent;     /* super-class method */
index 7b1a422..186f2ee 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_print.c,v 1.62 2015-08-19 02:31:04 bfriesen Exp $ */
+/* $Id: tif_print.c,v 1.64 2015-12-06 22:19:56 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -37,7 +37,7 @@
 static void
 _TIFFprintAsciiBounded(FILE* fd, const char* cp, size_t max_chars);
 
-static const char *photoNames[] = {
+static const char * const photoNames[] = {
     "min-is-white",                            /* PHOTOMETRIC_MINISWHITE */
     "min-is-black",                            /* PHOTOMETRIC_MINISBLACK */
     "RGB color",                               /* PHOTOMETRIC_RGB */
@@ -52,7 +52,7 @@ static const char *photoNames[] = {
 };
 #define        NPHOTONAMES     (sizeof (photoNames) / sizeof (photoNames[0]))
 
-static const char *orientNames[] = {
+static const char * const orientNames[] = {
     "0 (0x0)",
     "row 0 top, col 0 lhs",                    /* ORIENTATION_TOPLEFT */
     "row 0 top, col 0 rhs",                    /* ORIENTATION_TOPRIGHT */
@@ -237,7 +237,6 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
 {
        TIFFDirectory *td = &tif->tif_dir;
        char *sep;
-       uint16 i;
        long l, n;
 
 #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
@@ -365,6 +364,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
                }
        }
        if (TIFFFieldSet(tif,FIELD_EXTRASAMPLES) && td->td_extrasamples) {
+               uint16 i;
                fprintf(fd, "  Extra Samples: %u<", td->td_extrasamples);
                sep = "";
                for (i = 0; i < td->td_extrasamples; i++) {
@@ -389,6 +389,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
        }
        if (TIFFFieldSet(tif,FIELD_INKNAMES)) {
                char* cp;
+               uint16 i;
                fprintf(fd, "  Ink Names: ");
                i = td->td_samplesperpixel;
                sep = "";
@@ -481,6 +482,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
        if (TIFFFieldSet(tif,FIELD_MAXSAMPLEVALUE))
                fprintf(fd, "  Max Sample Value: %u\n", td->td_maxsamplevalue);
        if (TIFFFieldSet(tif,FIELD_SMINSAMPLEVALUE)) {
+               int i;
                int count = (tif->tif_flags & TIFF_PERSAMPLE) ? td->td_samplesperpixel : 1;
                fprintf(fd, "  SMin Sample Value:");
                for (i = 0; i < count; ++i)
@@ -488,6 +490,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
                fprintf(fd, "\n");
        }
        if (TIFFFieldSet(tif,FIELD_SMAXSAMPLEVALUE)) {
+               int i;
                int count = (tif->tif_flags & TIFF_PERSAMPLE) ? td->td_samplesperpixel : 1;
                fprintf(fd, "  SMax Sample Value:");
                for (i = 0; i < count; ++i)
@@ -527,6 +530,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
                        fprintf(fd, "(present)\n");
        }
        if (TIFFFieldSet(tif,FIELD_REFBLACKWHITE)) {
+               int i;
                fprintf(fd, "  Reference Black/White:\n");
                for (i = 0; i < 3; i++)
                fprintf(fd, "    %2d: %5g %5g\n", i,
@@ -539,6 +543,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
                        fprintf(fd, "\n");
                        n = 1L<<td->td_bitspersample;
                        for (l = 0; l < n; l++) {
+                               uint16 i;
                                fprintf(fd, "    %2lu: %5u",
                                    l, td->td_transferfunction[0][l]);
                                for (i = 1; i < td->td_samplesperpixel; i++)
@@ -550,6 +555,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
                        fprintf(fd, "(present)\n");
        }
        if (TIFFFieldSet(tif, FIELD_SUBIFD) && (td->td_subifd)) {
+               uint16 i;
                fprintf(fd, "  SubIFD Offsets:");
                for (i = 0; i < td->td_nsubifd; i++)
 #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
index 5cb419b..8003592 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_read.c,v 1.45 2015-06-07 22:35:40 bfriesen Exp $ */
+/* $Id: tif_read.c,v 1.49 2016-07-10 18:00:21 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -31,6 +31,9 @@
 #include "tiffiop.h"
 #include <stdio.h>
 
+#define TIFF_SIZE_T_MAX ((size_t) ~ ((size_t)0))
+#define TIFF_TMSIZE_T_MAX (tmsize_t)(TIFF_SIZE_T_MAX >> 1)
+
 int TIFFFillStrip(TIFF* tif, uint32 strip);
 int TIFFFillTile(TIFF* tif, uint32 tile);
 static int TIFFStartStrip(TIFF* tif, uint32 strip);
@@ -38,6 +41,8 @@ static int TIFFStartTile(TIFF* tif, uint32 tile);
 static int TIFFCheckRead(TIFF*, int);
 static tmsize_t
 TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,const char* module);
+static tmsize_t
+TIFFReadRawTile1(TIFF* tif, uint32 tile, void* buf, tmsize_t size, const char* module);
 
 #define NOSTRIP ((uint32)(-1))       /* undefined state */
 #define NOTILE ((uint32)(-1))         /* undefined state */
@@ -343,13 +348,31 @@ TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
                rowsperstrip=td->td_imagelength;
        stripsperplane=((td->td_imagelength+rowsperstrip-1)/rowsperstrip);
        stripinplane=(strip%stripsperplane);
-       plane=(strip/stripsperplane);
+       plane=(uint16)(strip/stripsperplane);
        rows=td->td_imagelength-stripinplane*rowsperstrip;
        if (rows>rowsperstrip)
                rows=rowsperstrip;
        stripsize=TIFFVStripSize(tif,rows);
        if (stripsize==0)
                return((tmsize_t)(-1));
+
+    /* shortcut to avoid an extra memcpy() */
+    if( td->td_compression == COMPRESSION_NONE &&
+        size!=(tmsize_t)(-1) && size >= stripsize &&
+        !isMapped(tif) &&
+        ((tif->tif_flags&TIFF_NOREADRAW)==0) )
+    {
+        if (TIFFReadRawStrip1(tif, strip, buf, stripsize, module) != stripsize)
+            return ((tmsize_t)(-1));
+
+        if (!isFillOrder(tif, td->td_fillorder) &&
+            (tif->tif_flags & TIFF_NOBITREV) == 0)
+            TIFFReverseBits(buf,stripsize);
+
+        (*tif->tif_postdecode)(tif,buf,stripsize);
+        return (stripsize);
+    }
+
        if ((size!=(tmsize_t)(-1))&&(size<stripsize))
                stripsize=size;
        if (!TIFFFillStrip(tif,strip))
@@ -401,7 +424,7 @@ TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,
                tmsize_t n;
                ma=(tmsize_t)td->td_stripoffset[strip];
                mb=ma+size;
-               if (((uint64)ma!=td->td_stripoffset[strip])||(ma>tif->tif_size))
+               if ((td->td_stripoffset[strip] > (uint64)TIFF_TMSIZE_T_MAX)||(ma>tif->tif_size))
                        n=0;
                else if ((mb<ma)||(mb<size)||(mb>tif->tif_size))
                        n=tif->tif_size-ma;
@@ -492,9 +515,9 @@ TIFFFillStrip(TIFF* tif, uint32 strip)
        static const char module[] = "TIFFFillStrip";
        TIFFDirectory *td = &tif->tif_dir;
 
-    if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount)
-        return 0;
-        
+        if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount)
+            return 0;
+
        if ((tif->tif_flags&TIFF_NOREADRAW)==0)
        {
                uint64 bytecount = td->td_stripbytecount[strip];
@@ -661,6 +684,24 @@ TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size)
                    (unsigned long) tile, (unsigned long) td->td_nstrips);
                return ((tmsize_t)(-1));
        }
+
+    /* shortcut to avoid an extra memcpy() */
+    if( td->td_compression == COMPRESSION_NONE &&
+        size!=(tmsize_t)(-1) && size >= tilesize &&
+        !isMapped(tif) &&
+        ((tif->tif_flags&TIFF_NOREADRAW)==0) )
+    {
+        if (TIFFReadRawTile1(tif, tile, buf, tilesize, module) != tilesize)
+            return ((tmsize_t)(-1));
+
+        if (!isFillOrder(tif, td->td_fillorder) &&
+            (tif->tif_flags & TIFF_NOBITREV) == 0)
+            TIFFReverseBits(buf,tilesize);
+
+        (*tif->tif_postdecode)(tif,buf,tilesize);
+        return (tilesize);
+    }
+
        if (size == (tmsize_t)(-1))
                size = tilesize;
        else if (size > tilesize)
@@ -717,7 +758,7 @@ TIFFReadRawTile1(TIFF* tif, uint32 tile, void* buf, tmsize_t size, const char* m
                tmsize_t n;
                ma=(tmsize_t)td->td_stripoffset[tile];
                mb=ma+size;
-               if (((uint64)ma!=td->td_stripoffset[tile])||(ma>tif->tif_size))
+               if ((td->td_stripoffset[tile] > (uint64)TIFF_TMSIZE_T_MAX)||(ma>tif->tif_size))
                        n=0;
                else if ((mb<ma)||(mb<size)||(mb>tif->tif_size))
                        n=tif->tif_size-ma;
@@ -795,9 +836,9 @@ TIFFFillTile(TIFF* tif, uint32 tile)
        static const char module[] = "TIFFFillTile";
        TIFFDirectory *td = &tif->tif_dir;
 
-    if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount)
-        return 0;
-        
+        if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount)
+            return 0;
+
        if ((tif->tif_flags&TIFF_NOREADRAW)==0)
        {
                uint64 bytecount = td->td_stripbytecount[tile];
@@ -957,8 +998,8 @@ TIFFStartStrip(TIFF* tif, uint32 strip)
 {
        TIFFDirectory *td = &tif->tif_dir;
 
-    if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount)
-        return 0;
+        if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount)
+            return 0;
 
        if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
                if (!(*tif->tif_setupdecode)(tif))
index 6cac71d..b6098dd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_strip.c,v 1.36 2015-06-07 22:35:40 bfriesen Exp $ */
+/* $Id: tif_strip.c,v 1.37 2016-11-09 23:00:49 erouault Exp $ */
 
 /*
  * Copyright (c) 1991-1997 Sam Leffler
@@ -63,6 +63,15 @@ TIFFNumberOfStrips(TIFF* tif)
        TIFFDirectory *td = &tif->tif_dir;
        uint32 nstrips;
 
+    /* If the value was already computed and store in td_nstrips, then return it,
+       since ChopUpSingleUncompressedStrip might have altered and resized the
+       since the td_stripbytecount and td_stripoffset arrays to the new value
+       after the initial affectation of td_nstrips = TIFFNumberOfStrips() in
+       tif_dirread.c ~line 3612.
+       See http://bugzilla.maptools.org/show_bug.cgi?id=2587 */
+    if( td->td_nstrips )
+        return td->td_nstrips;
+
        nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
             TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
        if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
index f37e33f..211dc57 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_swab.c,v 1.13 2010-03-10 18:56:49 bfriesen Exp $ */
+/* $Id: tif_swab.c,v 1.14 2016-09-04 21:32:56 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -296,8 +296,10 @@ TIFFReverseBits(uint8* cp, tmsize_t n)
                cp[7] = TIFFBitRevTable[cp[7]];
                cp += 8;
        }
-       while (n-- > 0)
-               *cp = TIFFBitRevTable[*cp], cp++;
+       while (n-- > 0) {
+               *cp = TIFFBitRevTable[*cp];
+               cp++;
+       }
 }
 
 /* vim: set ts=8 sts=8 sw=8 noet: */
index 390891c..183199d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_thunder.c,v 1.12 2011-04-02 20:54:09 bfriesen Exp $ */
+/* $Id: tif_thunder.c,v 1.13 2016-09-04 21:32:56 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -100,7 +100,8 @@ ThunderDecode(TIFF* tif, uint8* op, tmsize_t maxpixels)
        while (cc > 0 && npixels < maxpixels) {
                int n, delta;
 
-               n = *bp++, cc--;
+               n = *bp++;
+               cc--;
                switch (n & THUNDER_CODE) {
                case THUNDER_RUN:               /* pixel run */
                        /*
index 7996c31..34c4d81 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_write.c,v 1.42 2015-06-07 23:00:23 bfriesen Exp $ */
+/* $Id: tif_write.c,v 1.45 2016-09-23 22:12:18 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -258,6 +258,23 @@ TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc)
     tif->tif_rawcp = tif->tif_rawdata;
 
        tif->tif_flags &= ~TIFF_POSTENCODE;
+
+    /* shortcut to avoid an extra memcpy() */
+    if( td->td_compression == COMPRESSION_NONE )
+    {
+        /* swab if needed - note that source buffer will be altered */
+        tif->tif_postdecode( tif, (uint8*) data, cc );
+
+        if (!isFillOrder(tif, td->td_fillorder) &&
+            (tif->tif_flags & TIFF_NOBITREV) == 0)
+            TIFFReverseBits((uint8*) data, cc);
+
+        if (cc > 0 &&
+            !TIFFAppendToStrip(tif, strip, (uint8*) data, cc))
+            return ((tmsize_t) -1);
+        return (cc);
+    }
+
        sample = (uint16)(strip / td->td_stripsperimage);
        if (!(*tif->tif_preencode)(tif, sample))
                return ((tmsize_t) -1);
@@ -266,7 +283,7 @@ TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc)
        tif->tif_postdecode( tif, (uint8*) data, cc );
 
        if (!(*tif->tif_encodestrip)(tif, (uint8*) data, cc, sample))
-               return (0);
+               return ((tmsize_t) -1);
        if (!(*tif->tif_postencode)(tif))
                return ((tmsize_t) -1);
        if (!isFillOrder(tif, td->td_fillorder) &&
@@ -431,9 +448,7 @@ TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc)
                tif->tif_flags |= TIFF_CODERSETUP;
        }
        tif->tif_flags &= ~TIFF_POSTENCODE;
-       sample = (uint16)(tile/td->td_stripsperimage);
-       if (!(*tif->tif_preencode)(tif, sample))
-               return ((tmsize_t)(-1));
+
        /*
         * Clamp write amount to the tile size.  This is mostly
         * done so that callers can pass in some large number
@@ -442,11 +457,30 @@ TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc)
        if ( cc < 1 || cc > tif->tif_tilesize)
                cc = tif->tif_tilesize;
 
+    /* shortcut to avoid an extra memcpy() */
+    if( td->td_compression == COMPRESSION_NONE )
+    {
+        /* swab if needed - note that source buffer will be altered */
+        tif->tif_postdecode( tif, (uint8*) data, cc );
+
+        if (!isFillOrder(tif, td->td_fillorder) &&
+            (tif->tif_flags & TIFF_NOBITREV) == 0)
+            TIFFReverseBits((uint8*) data, cc);
+
+        if (cc > 0 &&
+            !TIFFAppendToStrip(tif, tile, (uint8*) data, cc))
+            return ((tmsize_t) -1);
+        return (cc);
+    }
+
+    sample = (uint16)(tile/td->td_stripsperimage);
+    if (!(*tif->tif_preencode)(tif, sample))
+        return ((tmsize_t)(-1));
         /* swab if needed - note that source buffer will be altered */
        tif->tif_postdecode( tif, (uint8*) data, cc );
 
        if (!(*tif->tif_encodetile)(tif, (uint8*) data, cc, sample))
-               return (0);
+               return ((tmsize_t) -1);
        if (!(*tif->tif_postencode)(tif))
                return ((tmsize_t)(-1));
        if (!isFillOrder(tif, td->td_fillorder) &&
@@ -764,7 +798,14 @@ TIFFFlushData1(TIFF* tif)
                if (!TIFFAppendToStrip(tif,
                    isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip,
                    tif->tif_rawdata, tif->tif_rawcc))
+        {
+            /* We update those variables even in case of error since there's */
+            /* code that doesn't really check the return code of this */
+            /* function */
+            tif->tif_rawcc = 0;
+            tif->tif_rawcp = tif->tif_rawdata;
                        return (0);
+        }
                tif->tif_rawcc = 0;
                tif->tif_rawcp = tif->tif_rawdata;
        }
index 22e9f35..8c35aea 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tif_zip.c,v 1.33 2014-12-25 18:29:11 erouault Exp $ */
+/* $Id: tif_zip.c,v 1.36 2016-11-12 16:48:28 erouault Exp $ */
 
 /*
  * Copyright (c) 1995-1997 Sam Leffler
@@ -135,7 +135,7 @@ ZIPPreDecode(TIFF* tif, uint16 s)
        assert(sizeof(sp->stream.avail_in)==4);  /* if this assert gets raised,
            we need to simplify this code to reflect a ZLib that is likely updated
            to deal with 8byte memory sizes, though this code will respond
-           apropriately even before we simplify it */
+           appropriately even before we simplify it */
        sp->stream.avail_in = (uInt) tif->tif_rawcc;
        if ((tmsize_t)sp->stream.avail_in != tif->tif_rawcc)
        {
@@ -162,7 +162,7 @@ ZIPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
        assert(sizeof(sp->stream.avail_out)==4);  /* if this assert gets raised,
            we need to simplify this code to reflect a ZLib that is likely updated
            to deal with 8byte memory sizes, though this code will respond
-           apropriately even before we simplify it */
+           appropriately even before we simplify it */
        sp->stream.avail_out = (uInt) occ;
        if ((tmsize_t)sp->stream.avail_out != occ)
        {
@@ -239,8 +239,8 @@ ZIPPreEncode(TIFF* tif, uint16 s)
        assert(sizeof(sp->stream.avail_out)==4);  /* if this assert gets raised,
            we need to simplify this code to reflect a ZLib that is likely updated
            to deal with 8byte memory sizes, though this code will respond
-           apropriately even before we simplify it */
-       sp->stream.avail_out = tif->tif_rawdatasize;
+           appropriately even before we simplify it */
+       sp->stream.avail_out = (uInt)tif->tif_rawdatasize;
        if ((tmsize_t)sp->stream.avail_out != tif->tif_rawdatasize)
        {
                TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
@@ -266,7 +266,7 @@ ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
        assert(sizeof(sp->stream.avail_in)==4);  /* if this assert gets raised,
            we need to simplify this code to reflect a ZLib that is likely updated
            to deal with 8byte memory sizes, though this code will respond
-           apropriately even before we simplify it */
+           appropriately even before we simplify it */
        sp->stream.avail_in = (uInt) cc;
        if ((tmsize_t)sp->stream.avail_in != cc)
        {
@@ -460,7 +460,7 @@ bad:
                     "No space for ZIP state block");
        return (0);
 }
-#endif /* ZIP_SUPORT */
+#endif /* ZIP_SUPPORT */
 
 /* vim: set ts=8 sts=8 sw=8 noet: */
 /*
index bc46acd..fb39634 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tiff.h,v 1.69 2014-04-02 17:23:06 fwarmerdam Exp $ */
+/* $Id: tiff.h,v 1.70 2016-01-23 21:20:34 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -279,7 +279,7 @@ typedef enum {
 #define     PREDICTOR_FLOATINGPOINT    3       /* floating point predictor */
 #define        TIFFTAG_WHITEPOINT              318     /* image white point */
 #define        TIFFTAG_PRIMARYCHROMATICITIES   319     /* !primary chromaticities */
-#define        TIFFTAG_COLORMAP                320     /* RGB map for pallette image */
+#define        TIFFTAG_COLORMAP                320     /* RGB map for palette image */
 #define        TIFFTAG_HALFTONEHINTS           321     /* !highlight+shadow info */
 #define        TIFFTAG_TILEWIDTH               322     /* !tile width in pixels */
 #define        TIFFTAG_TILELENGTH              323     /* !tile height in pixels */
@@ -358,7 +358,7 @@ typedef enum {
 #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_JPEGQTABLES             519     /* !Q matrix offsets */
 #define        TIFFTAG_JPEGDCTABLES            520     /* !DCT table offsets */
 #define        TIFFTAG_JPEGACTABLES            521     /* !AC coefficient offsets */
 #define        TIFFTAG_YCBCRCOEFFICIENTS       529     /* !RGB -> YCbCr transform */
index 038b670..6a84d80 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tiffio.h,v 1.91 2012-07-29 15:45:29 tgl Exp $ */
+/* $Id: tiffio.h,v 1.92 2016-01-23 21:20:34 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -208,7 +208,7 @@ struct _TIFFRGBAImage {
        uint16 orientation;                     /* image orientation */
        uint16 req_orientation;                 /* requested orientation */
        uint16 photometric;                     /* image photometric interp */
-       uint16* redcmap;                        /* colormap pallete */
+       uint16* redcmap;                        /* colormap palette */
        uint16* greencmap;
        uint16* bluecmap;
        /* get image data routine */
@@ -225,7 +225,7 @@ struct _TIFFRGBAImage {
        TIFFYCbCrToRGB* ycbcr;                  /* YCbCr conversion state */
        TIFFCIELabToRGB* cielab;                /* CIE L*a*b conversion state */
 
-       uint8* UaToAa;                          /* Unassociated alpha to associated alpha convertion LUT */
+       uint8* UaToAa;                          /* Unassociated alpha to associated alpha conversion LUT */
        uint8* Bitdepth16To8;                   /* LUT for conversion from 16bit to 8bit values */
 
        int row_offset;
index ca95d75..8bcd0c1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tiffiop.h,v 1.87 2015-08-23 17:49:01 bfriesen Exp $ */
+/* $Id: tiffiop.h,v 1.89 2016-01-23 21:20:34 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -86,7 +86,7 @@ typedef struct client_info {
 
 /*
  * Typedefs for ``method pointers'' used internally.
- * these are depriciated and provided only for backwards compatibility
+ * these are deprecated and provided only for backwards compatibility.
  */
 typedef unsigned char tidataval_t;    /* internal image data value type */
 typedef tidataval_t* tidata_t;        /* reference to internal image data */
@@ -105,33 +105,33 @@ struct tiff {
        int                  tif_fd;           /* open file descriptor */
        int                  tif_mode;         /* open mode (O_*) */
        uint32               tif_flags;
-       #define TIFF_FILLORDER   0x00003 /* natural bit fill order for machine */
-       #define TIFF_DIRTYHEADER 0x00004 /* header must be written on close */
-       #define TIFF_DIRTYDIRECT 0x00008 /* current directory must be written */
-       #define TIFF_BUFFERSETUP 0x00010 /* data buffers setup */
-       #define TIFF_CODERSETUP  0x00020 /* encoder/decoder setup done */
-       #define TIFF_BEENWRITING 0x00040 /* written 1+ scanlines to file */
-       #define TIFF_SWAB        0x00080 /* byte swap file information */
-       #define TIFF_NOBITREV    0x00100 /* inhibit bit reversal logic */
-       #define TIFF_MYBUFFER    0x00200 /* my raw data buffer; free on close */
-       #define TIFF_ISTILED     0x00400 /* file is tile, not strip- based */
-       #define TIFF_MAPPED      0x00800 /* file is mapped into memory */
-       #define TIFF_POSTENCODE  0x01000 /* need call to postencode routine */
-       #define TIFF_INSUBIFD    0x02000 /* currently writing a subifd */
-       #define TIFF_UPSAMPLED   0x04000 /* library is doing data up-sampling */
-       #define TIFF_STRIPCHOP   0x08000 /* enable strip chopping support */
-       #define TIFF_HEADERONLY  0x10000 /* read header only, do not process the first directory */
-       #define TIFF_NOREADRAW   0x20000 /* skip reading of raw uncompressed image data */
-       #define TIFF_INCUSTOMIFD 0x40000 /* currently writing a custom IFD */
-       #define TIFF_BIGTIFF     0x80000 /* read/write bigtiff */
-        #define TIFF_BUF4WRITE  0x100000 /* rawcc bytes are for writing */
-        #define TIFF_DIRTYSTRIP 0x200000 /* stripoffsets/stripbytecount dirty*/
-        #define TIFF_PERSAMPLE  0x400000 /* get/set per sample tags as arrays */
-        #define TIFF_BUFFERMMAP 0x800000 /* read buffer (tif_rawdata) points into mmap() memory */
+       #define TIFF_FILLORDER   0x00003U /* natural bit fill order for machine */
+       #define TIFF_DIRTYHEADER 0x00004U /* header must be written on close */
+       #define TIFF_DIRTYDIRECT 0x00008U /* current directory must be written */
+       #define TIFF_BUFFERSETUP 0x00010U /* data buffers setup */
+       #define TIFF_CODERSETUP  0x00020U /* encoder/decoder setup done */
+       #define TIFF_BEENWRITING 0x00040U /* written 1+ scanlines to file */
+       #define TIFF_SWAB        0x00080U /* byte swap file information */
+       #define TIFF_NOBITREV    0x00100U /* inhibit bit reversal logic */
+       #define TIFF_MYBUFFER    0x00200U /* my raw data buffer; free on close */
+       #define TIFF_ISTILED     0x00400U /* file is tile, not strip- based */
+       #define TIFF_MAPPED      0x00800U /* file is mapped into memory */
+       #define TIFF_POSTENCODE  0x01000U /* need call to postencode routine */
+       #define TIFF_INSUBIFD    0x02000U /* currently writing a subifd */
+       #define TIFF_UPSAMPLED   0x04000U /* library is doing data up-sampling */
+       #define TIFF_STRIPCHOP   0x08000U /* enable strip chopping support */
+       #define TIFF_HEADERONLY  0x10000U /* read header only, do not process the first directory */
+       #define TIFF_NOREADRAW   0x20000U /* skip reading of raw uncompressed image data */
+       #define TIFF_INCUSTOMIFD 0x40000U /* currently writing a custom IFD */
+       #define TIFF_BIGTIFF     0x80000U /* read/write bigtiff */
+        #define TIFF_BUF4WRITE  0x100000U /* rawcc bytes are for writing */
+        #define TIFF_DIRTYSTRIP 0x200000U /* stripoffsets/stripbytecount dirty*/
+        #define TIFF_PERSAMPLE  0x400000U /* get/set per sample tags as arrays */
+        #define TIFF_BUFFERMMAP 0x800000U /* read buffer (tif_rawdata) points into mmap() memory */
        uint64               tif_diroff;       /* file offset of current directory */
        uint64               tif_nextdiroff;   /* file offset of following directory */
        uint64*              tif_dirlist;      /* list of offsets to already seen directories to prevent IFD looping */
-       uint16               tif_dirlistsize;  /* number of entires in offset list */
+       uint16               tif_dirlistsize;  /* number of entries in offset list */
        uint16               tif_dirnumber;    /* number of already seen directories */
        TIFFDirectory        tif_dir;          /* internal rep of current directory */
        TIFFDirectory        tif_customdir;    /* custom IFDs are separated from the main ones */
index e965814..fe55c72 100644 (file)
@@ -1,4 +1,4 @@
-#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.6\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
+#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.7\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
 /*
  * This define can be used in code that requires
  * compilation-related definitions specific to a
@@ -6,4 +6,4 @@
  * version checking should be done based on the
  * string returned by TIFFGetVersion.
  */
-#define TIFFLIB_VERSION 20150912
+#define TIFFLIB_VERSION 20161119
index 50f11d7..6286cfb 100644 (file)
@@ -3,7 +3,7 @@
 #define UV_NDIVS       16289
 #define UV_VSTART      (float)0.016940
 #define UV_NVS         163
-static struct {
+static const struct {
        float   ustart;
        short   nus, ncum;
 }      uv_row[UV_NVS] = {
index 9c089e0..a3bc337 100644 (file)
@@ -1,6 +1,6 @@
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
-#   Copyright (C) 1996-2001, 2003-2014 Free Software Foundation, Inc.
+#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 # This file is free software; the Free Software Foundation gives
@@ -103,19 +103,36 @@ dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
 
 
+# _LT_PREPARE_CC_BASENAME
+# -----------------------
+m4_defun([_LT_PREPARE_CC_BASENAME], [
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in @S|@*""; do
+      case $cc_temp in
+        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+])# _LT_PREPARE_CC_BASENAME
+
+
 # _LT_CC_BASENAME(CC)
 # -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
+# but that macro is also expanded into generated libtool script, which
+# arranges for $SED and $ECHO to be set by different means.
 m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
-  case $cc_temp in
-    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+[m4_require([_LT_PREPARE_CC_BASENAME])dnl
+AC_REQUIRE([_LT_DECL_SED])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+func_cc_basename $1
+cc_basename=$func_cc_basename_result
 ])
 
 
@@ -720,6 +737,9 @@ _LT_CONFIG_SAVE_COMMANDS([
 _LT_COPYING
 _LT_LIBTOOL_TAGS
 
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
 # ### BEGIN LIBTOOL CONFIG
 _LT_LIBTOOL_CONFIG_VARS
 _LT_LIBTOOL_TAG_VARS
@@ -727,6 +747,17 @@ _LT_LIBTOOL_TAG_VARS
 
 _LT_EOF
 
+    cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_PREPARE_MUNGE_PATH_LIST
+_LT_PREPARE_CC_BASENAME
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
   case $host_os in
   aix3*)
     cat <<\_LT_EOF >> "$cfgfile"
@@ -2202,6 +2233,47 @@ _LT_DECL([], [striplib], [1])
 ])# _LT_CMD_STRIPLIB
 
 
+# _LT_PREPARE_MUNGE_PATH_LIST
+# ---------------------------
+# Make sure func_munge_path_list() is defined correctly.
+m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
+[[# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x@S|@2 in
+    x)
+        ;;
+    *:)
+        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
+        ;;
+    x:*)
+        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
+        ;;
+    *)
+        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+]])# _LT_PREPARE_PATH_LIST
+
+
 # _LT_SYS_DYNAMIC_LINKER([TAG])
 # -----------------------------
 # PORTME Fill in your ld.so characteristics
@@ -2212,6 +2284,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_OBJDUMP])dnl
 m4_require([_LT_DECL_SED])dnl
 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
 AC_MSG_CHECKING([dynamic linker characteristics])
 m4_if([$1],
        [], [
@@ -2306,6 +2379,9 @@ hardcode_into_libs=no
 # flags to be left without arguments
 need_version=unknown
 
+AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
+[User-defined run-time library search path.])
+
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
@@ -2594,6 +2670,7 @@ freebsd* | dragonfly*)
   case $version_type in
     freebsd-elf*)
       library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;
@@ -2653,10 +2730,11 @@ hpux9* | hpux10* | hpux11*)
     soname_spec='$libname$release$shared_ext$major'
     if test 32 = "$HPUX_IA64_MODE"; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
     fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
   hppa*64*)
     shrext_cmds='.sl'
@@ -2789,7 +2867,12 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[  ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
@@ -3013,10 +3096,20 @@ fi
 if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
   sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
 fi
+
 if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
   sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
 fi
 
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
 _LT_DECL([], [variables_saved_for_relink], [1],
     [Variables whose values should be saved in libtool wrapper scripts and
     restored at link time])
@@ -3049,8 +3142,10 @@ _LT_DECL([], [hardcode_into_libs], [0],
     [Whether we should hardcode library paths into libraries])
 _LT_DECL([], [sys_lib_search_path_spec], [2],
     [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
-    [Run-time system search path for libraries])
+_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
+    [Detected run-time system search path for libraries])
+_LT_DECL([], [configure_time_lt_sys_library_path], [2],
+    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
 ])# _LT_SYS_DYNAMIC_LINKER
 
 
@@ -7350,6 +7445,7 @@ func_stripname_cnf ()
 } # func_stripname_cnf
 ])# _LT_FUNC_STRIPNAME_CNF
 
+
 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
 # ---------------------------------
 # Figure out "hidden" library dependencies from verbose
@@ -7528,51 +7624,6 @@ interix[[3-9]]*)
   _LT_TAGVAR(postdep_objects,$1)=
   _LT_TAGVAR(postdeps,$1)=
   ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test yes != "$solaris_use_stlport4"; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC* | sunCC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test yes != "$solaris_use_stlport4"; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
 esac
 ])
 
index f51ec8c..94b0829 100644 (file)
@@ -1,6 +1,6 @@
 # Helper functions for option handling.                    -*- Autoconf -*-
 #
-#   Copyright (C) 2004-2005, 2007-2009, 2011-2014 Free Software
+#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
 #   Foundation, Inc.
 #   Written by Gary V. Vaughan, 2004
 #
index da4ac6b..48bc934 100644 (file)
@@ -1,6 +1,6 @@
 # ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
 #
-# Copyright (C) 2004-2005, 2007-2008, 2011-2014 Free Software
+# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
 # Foundation, Inc.
 # Written by Gary V. Vaughan, 2004
 #
index cb6da68..fa04b52 100644 (file)
@@ -1,6 +1,6 @@
 # ltversion.m4 -- version numbers                      -*- Autoconf -*-
 #
-#   Copyright (C) 2004, 2011-2014 Free Software Foundation, Inc.
+#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
 #   Written by Scott James Remnant, 2004
 #
 # This file is free software; the Free Software Foundation gives
@@ -9,15 +9,15 @@
 
 # @configure_input@
 
-# serial 4151 ltversion.m4
+# serial 4179 ltversion.m4
 # This file is part of GNU Libtool
 
-m4_define([LT_PACKAGE_VERSION], [2.4.4])
-m4_define([LT_PACKAGE_REVISION], [2.4.4])
+m4_define([LT_PACKAGE_VERSION], [2.4.6])
+m4_define([LT_PACKAGE_REVISION], [2.4.6])
 
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.4'
-macro_revision='2.4.4'
+[macro_version='2.4.6'
+macro_revision='2.4.6'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 ])
index 6975098..c6b26f8 100644 (file)
@@ -1,6 +1,6 @@
 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
 #
-#   Copyright (C) 2004-2005, 2007, 2009, 2011-2014 Free Software
+#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
 #   Foundation, Inc.
 #   Written by Scott James Remnant, 2004.
 #
index f7f8462..1db7556 100644 (file)
 # OF THIS SOFTWARE.
 
 set(man1_MANS
-  bmp2tiff.1
   fax2ps.1
   fax2tiff.1
-  gif2tiff.1
   pal2rgb.1
   ppm2tiff.1
-  ras2tiff.1
   raw2tiff.1
   rgb2ycbcr.1
-  sgi2tiff.1
   thumbnail.1
   tiff2bw.1
   tiff2pdf.1
@@ -47,8 +43,7 @@ set(man1_MANS
   tiffinfo.1
   tiffmedian.1
   tiffset.1
-  tiffsplit.1
-  tiffsv.1)
+  tiffsplit.1)
 
 set(man3_MANS
   libtiff.3tiff
index 931f71d..08b8749 100644 (file)
 # Process this file with automake to produce Makefile.in.
 
 dist_man1_MANS = \
-       bmp2tiff.1 \
        fax2ps.1 \
        fax2tiff.1 \
-       gif2tiff.1 \
        pal2rgb.1 \
        ppm2tiff.1 \
-       ras2tiff.1 \
        raw2tiff.1 \
        rgb2ycbcr.1 \
-       sgi2tiff.1 \
        thumbnail.1 \
        tiff2bw.1 \
        tiff2pdf.1 \
@@ -48,8 +44,7 @@ dist_man1_MANS = \
        tiffinfo.1 \
        tiffmedian.1 \
        tiffset.1 \
-       tiffsplit.1 \
-       tiffsv.1
+       tiffsplit.1
 
 dist_man3_MANS = \
        libtiff.3tiff \
index 9125537..3f19b8c 100644 (file)
@@ -241,6 +241,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -329,16 +330,12 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 dist_man1_MANS = \
-       bmp2tiff.1 \
        fax2ps.1 \
        fax2tiff.1 \
-       gif2tiff.1 \
        pal2rgb.1 \
        ppm2tiff.1 \
-       ras2tiff.1 \
        raw2tiff.1 \
        rgb2ycbcr.1 \
-       sgi2tiff.1 \
        thumbnail.1 \
        tiff2bw.1 \
        tiff2pdf.1 \
@@ -353,8 +350,7 @@ dist_man1_MANS = \
        tiffinfo.1 \
        tiffmedian.1 \
        tiffset.1 \
-       tiffsplit.1 \
-       tiffsv.1
+       tiffsplit.1
 
 dist_man3_MANS = \
        libtiff.3tiff \
index bcb7604..a6a7d82 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFClose.3tiff,v 1.3 2009-08-24 19:13:40 bfriesen Exp $
+.\" $Id: TIFFClose.3tiff,v 1.4 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -50,4 +50,4 @@ routine.
 .BR TIFFOpen (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index cb274d8..af67777 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFDataWidth.3tiff,v 1.3 2006-03-23 14:54:02 dron Exp $
+.\" $Id: TIFFDataWidth.3tiff,v 1.4 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 2002, Andrey Kiselev <dron@ak4719.spb.edu>
 .\"
@@ -71,4 +71,4 @@ uknown data type supplied.
 .BR libtiff (3TIFF),
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 761ff08..6924c7f 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFError.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFError.3tiff,v 1.3 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -66,4 +66,4 @@ returns a reference to the previous error handling function.
 .BR printf (3)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 3efe697..4fb1e2c 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFFieldDataType.3tiff,v 1.1 2012-07-29 15:45:29 tgl Exp $
+.\" $Id: TIFFFieldDataType.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
 .\"
@@ -50,4 +50,4 @@ returns a member of the enum type
 .BR libtiff (3TIFF),
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 2755d18..0f49c33 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFFieldName.3tiff,v 1.1 2012-07-29 15:45:29 tgl Exp $
+.\" $Id: TIFFFieldName.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
 .\"
@@ -49,4 +49,4 @@ returns a constant C string.
 .BR libtiff (3TIFF),
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 8f3c5d0..07324f8 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFFieldPassCount.3tiff,v 1.1 2012-07-29 15:45:29 tgl Exp $
+.\" $Id: TIFFFieldPassCount.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
 .\"
@@ -70,4 +70,4 @@ returns an integer that is always 1 (true) or 0 (false).
 .BR libtiff (3TIFF),
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index cdb5858..88d67fd 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFFieldReadCount.3tiff,v 1.1 2012-07-29 15:45:30 tgl Exp $
+.\" $Id: TIFFFieldReadCount.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
 .\"
@@ -74,4 +74,4 @@ returns an integer.
 .BR libtiff (3TIFF),
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index bf8174e..f94f1be 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFFieldTag.3tiff,v 1.1 2012-07-29 15:45:30 tgl Exp $
+.\" $Id: TIFFFieldTag.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
 .\"
@@ -53,4 +53,4 @@ returns an integer tag value.
 .BR libtiff (3TIFF),
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 6330532..68a3b04 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFFieldWriteCount.3tiff,v 1.1 2012-07-29 15:45:30 tgl Exp $
+.\" $Id: TIFFFieldWriteCount.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
 .\"
@@ -85,4 +85,4 @@ returns an integer.
 .BR libtiff (3TIFF),
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index af32350..27520da 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFFlush.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFFlush.3tiff,v 1.3 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -61,4 +61,4 @@ routine.
 .BR libtiff (3TIFF),
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 0624ee9..bdf41a2 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFGetField.3tiff,v 1.6 2012-05-19 23:15:22 bfriesen Exp $
+.\" $Id: TIFFGetField.3tiff,v 1.7 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -226,4 +226,4 @@ An unknown tag was supplied.
 .BR libtiff (3TIFF),
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index ef1a85c..86c9368 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFRGBAImage.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFRGBAImage.3tiff,v 1.3 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 1991-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -283,4 +283,4 @@ data to 8-bit
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 000bf0a..e13586f 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFReadDirectory.3tiff,v 1.3 2010-12-12 01:45:35 faxguy Exp $
+.\" $Id: TIFFReadDirectory.3tiff,v 1.4 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -161,4 +161,4 @@ the missing value based on the file size.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index d2d7b67..afde8e7 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFReadEncodedStrip.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFReadEncodedStrip.3tiff,v 1.3 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -75,4 +75,4 @@ routine.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 5f6d900..99d3e45 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFReadEncodedTile.3tiff,v 1.3 2006-10-13 07:22:01 dron Exp $
+.\" $Id: TIFFReadEncodedTile.3tiff,v 1.4 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -73,4 +73,4 @@ routine.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 5d43ce3..7373e2a 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFReadRGBAImage.3tiff,v 1.4 2006-10-13 07:22:01 dron Exp $
+.\" $Id: TIFFReadRGBAImage.3tiff,v 1.5 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1991-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -215,4 +215,4 @@ data to 8-bit
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index a8bb189..db889a0 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFReadRGBAStrip.3tiff,v 1.3 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFReadRGBAStrip.3tiff,v 1.4 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1991-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -166,5 +166,5 @@ There was insufficient memory to allocate a table used to map data to 8-bit
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
 
index dfae1a9..5cb7655 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFReadRGBATile.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFReadRGBATile.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1991-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -168,4 +168,4 @@ There was insufficient memory to allocate a table used to map data to 8-bit
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 1f2d1d1..6fe326b 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFReadRawStrip.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFReadRawStrip.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -61,4 +61,4 @@ routine.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 3945dd9..2844573 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFReadRawTile.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFReadRawTile.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -62,4 +62,4 @@ routine.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 7baf651..2d9c85a 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFReadScanline.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFReadScanline.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -91,4 +91,4 @@ tile-based interfaces to read these formats.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 4a9b20d..f1107dc 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFReadTile.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFReadTile.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -81,4 +81,4 @@ routine.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 162d310..93faf19 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFSetDirectory.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFSetDirectory.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -76,4 +76,4 @@ next directory in a file.
 .IR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 33e9471..1754827 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFSetField.3tiff,v 1.5 2010-05-06 02:54:46 olivier Exp $
+.\" $Id: TIFFSetField.3tiff,v 1.6 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -214,4 +214,4 @@ An invalid value was supplied for the named tag.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 32339aa..0d302ed 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFWarning.3tiff,v 1.3 2012-06-01 22:02:44 fwarmerdam Exp $
+.\" $Id: TIFFWarning.3tiff,v 1.4 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -67,4 +67,4 @@ returns a reference to the previous error handling function.
 .BR printf (3)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index b8de6bf..9f0d249 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFWriteDirectory.3tiff,v 1.3 2010-12-12 01:45:35 faxguy Exp $
+.\" $Id: TIFFWriteDirectory.3tiff,v 1.4 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -135,4 +135,4 @@ written.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 4130634..a31f6e0 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFWriteEncodedStrip.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFWriteEncodedStrip.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -99,4 +99,4 @@ counts.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 4bb471f..476cbbb 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFWriteEncodedTile.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFWriteEncodedTile.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -93,4 +93,4 @@ counts.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 0fed3aa..8d145a0 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFWriteRawStrip.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFWriteRawStrip.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -93,4 +93,4 @@ currently specified image dimensions.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index d422e58..78b23ed 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFWriteRawTile.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFWriteRawTile.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -81,4 +81,4 @@ dimensions.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 0dd35f5..a2691b5 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFWriteScanline.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFWriteScanline.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -151,4 +151,4 @@ the library does not pack the block-interleaved samples.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 08250f7..3755fc7 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFWriteTile.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFWriteTile.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -74,4 +74,4 @@ routine.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index a4446cd..edda2db 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFbuffer.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFbuffer.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1995 Sam Leffler
 .\" Copyright (c) 1995 Silicon Graphics, Inc.
@@ -74,4 +74,4 @@ was unable to dynamically allocate space for a data buffer.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 78a0f02..6c480c4 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFcodec.3tiff,v 1.3 2011-08-02 14:09:43 bfriesen Exp $
+.\" $Id: TIFFcodec.3tiff,v 1.4 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1995 Sam Leffler
 .\" Copyright (c) 1995 Silicon Graphics, Inc.
@@ -79,4 +79,4 @@ compression schemes.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index e5d2727..987ac9d 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFcolor.3tiff,v 1.4 2009-11-30 12:22:26 fwarmerdam Exp $
+.\" $Id: TIFFcolor.3tiff,v 1.5 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 2003, Andrey Kiselev <dron@ak4719.spb.edu>
 .\"
@@ -265,4 +265,4 @@ _TIFFfree(cielab);
 .BR libtiff (3TIFF),
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 55f446b..6c4412d 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFmemory.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFmemory.3tiff,v 1.3 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1995 Sam Leffler
 .\" Copyright (c) 1995 Silicon Graphics, Inc.
@@ -87,4 +87,4 @@ None.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 6de9084..4b90a59 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFsize.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFsize.3tiff,v 1.3 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -56,4 +56,4 @@ None.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index bb9658e..da59b0e 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFstrip.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFstrip.3tiff,v 1.3 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1992-1997 Sam Leffler
 .\" Copyright (c) 1992-1997 Silicon Graphics, Inc.
@@ -96,4 +96,4 @@ None.
 .BR libtiff (3TIFF),
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index d6432fa..2294156 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFswab.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
+.\" $Id: TIFFswab.3tiff,v 1.3 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -77,4 +77,4 @@ None.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 5431f31..5bdbe55 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: TIFFtile.3tiff,v 1.2 2005-11-02 11:07:19 dron Exp $
+.\" $Id: TIFFtile.3tiff,v 1.3 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -128,4 +128,4 @@ None.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
diff --git a/man/bmp2tiff.1 b/man/bmp2tiff.1
deleted file mode 100644 (file)
index f5d68ce..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-.\" $Id: bmp2tiff.1,v 1.7 2006-04-20 12:17:19 dron Exp $
-.\"
-.\" Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu> 
-.\"
-.\" 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 BMP2TIFF 1 "15 October, 2004" "libtiff"
-.SH NAME
-bmp2tiff \- create a
-.SM TIFF
-file from a Microsoft Windows Device Independent Bitmap image file
-.SH SYNOPSIS
-.B bmp2tiff
-[
-.I options
-]
-.I input.bmp
-[
-.I input2.bmp ...\&
-]
-.I output.tiff
-.SH DESCRIPTION
-.I bmp2tiff
-converts a Microsoft Windows Device Independent Bitmap image file to
-.SM TIFF.
-If several input BMP files are being specified the multipage
-.SM TIFF
-output file will be created. By default, the
-.SM TIFF
-image is created with data samples packed (\c
-.IR PlanarConfiguration =1),
-compressed with the PackBits algorithm (\c
-.IR Compression =32773),
-and with each strip no more than 8 kilobytes.
-These characteristics can overridden, or explicitly specified
-with the options described below.
-.SH OPTIONS
-.TP
-.B \-c
-Specify a compression scheme to use when writing image data:
-.B "\-c none"
-for no compression,
-.B "\-c packbits"
-for the PackBits compression algorithm (the default),
-.B "\-c jpeg"
-for the baseline JPEG compression algorithm,
-.B "\-c zip"
-for the Deflate compression algorithm,
-and
-.B "\-c lzw"
-for Lempel-Ziv & Welch.
-.TP
-.BI \-r " number"
-Write data with a specified number of rows per strip;
-by default the number of rows/strip is selected so that each strip
-is approximately 8 kilobytes.
-.SH "SEE ALSO"
-.BR gif2tiff (1),
-.BR pal2rgb (1),
-.BR ppm2tiff (1),
-.BR raw2tiff (1),
-.BR ras2tiff (1),
-.BR sgi2tiff (1),
-.BR libtiff (3TIFF)
-.PP
-Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
index 9525f20..f82e252 100644 (file)
@@ -1,4 +1,4 @@
-.\"    $Id: fax2ps.1,v 1.4 2006-04-20 12:17:19 dron Exp $
+.\"    $Id: fax2ps.1,v 1.5 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1991-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -156,4 +156,4 @@ job of compressing the output and just generate
 .BR libtiff (3)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 873cab1..7ce4ffe 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: fax2tiff.1,v 1.7 2006-04-20 12:17:19 dron Exp $
+.\" $Id: fax2tiff.1,v 1.8 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1990-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -283,4 +283,4 @@ an appendix to the TIFF 5.0 specification prepared by Cygnet Technologies.
 .BR libtiff (3)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
diff --git a/man/gif2tiff.1 b/man/gif2tiff.1
deleted file mode 100644 (file)
index 5f01d8d..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-.\" $Id: gif2tiff.1,v 1.4 2006-04-20 12:17:19 dron 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 GIF2TIFF 1 "November 2, 2005" "libtiff"
-.SH NAME
-gif2tiff \- create a
-.SM TIFF
-file from a GIF87 format image file
-.SH SYNOPSIS
-.B gif2tiff
-[
-.I options
-]
-.I input.gif
-.I output.tif
-.SH DESCRIPTION
-.I Gif2tiff
-converts a file in the GIF87 format to
-.SM TIFF.
-The
-.SM TIFF
-image is created as a palette image, with samples
-compressed with the Lempel-Ziv & Welch algorithm (\c
-.IR Compression =5).
-These characteristics can overridden, or explicitly specified
-with the options described below.
-.SH OPTIONS
-.TP
-.B \-c
-Specify a compression scheme to use when writing image data:
-.B "\-c none"
-for no compression,
-.B "\-c packbits"
-for the PackBits compression algorithm,
-.B "\-c zip"
-for the Deflate compression algorithm,
-and
-.B "\-c lzw"
-for Lempel-Ziv & Welch (the default).
-.TP
-.B \-r
-Write data with a specified number of rows per strip;
-by default the number of rows/strip is selected so that each strip
-is approximately 8 kilobytes.
-.SH NOTES
-The program is based on Paul Haeberli's
-.I fromgif
-program which, in turn, is based on Marcel J.E. Mol's GIF reader.
-.SH BUGS
-Should have more options to control output format.
-.SH "SEE ALSO"
-.BR pal2rgb (1),
-.BR tiffinfo (1),
-.BR tiffcp (1),
-.BR tiffmedian (1),
-.BR libtiff (3)
-.PP
-Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
index 59895d6..924d17a 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: libtiff.3tiff,v 1.4 2012-07-29 15:45:30 tgl Exp $
+.\" $Id: libtiff.3tiff,v 1.5 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -536,7 +536,7 @@ an Aldus Technical Memorandum.
 an appendix to the TIFF 5.0 specification prepared by Cygnet Technologies.
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
 .SH BUGS
 The library does not support multi-sample images
 where some samples have different bits/sample.
index 0ac2e5a..428f93a 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: pal2rgb.1,v 1.3 2005-11-02 11:07:19 dron Exp $
+.\" $Id: pal2rgb.1,v 1.4 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1990-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -108,4 +108,4 @@ Only 8-bit images are handled.
 .BR libtiff (3)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 882fd04..2c940fb 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: ppm2tiff.1,v 1.5 2006-03-01 11:20:33 dron Exp $
+.\" $Id: ppm2tiff.1,v 1.6 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1991-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -102,4 +102,4 @@ dots/inch).
 .BR libtiff (3)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
diff --git a/man/ras2tiff.1 b/man/ras2tiff.1
deleted file mode 100644 (file)
index 0c78ddb..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-.\" $Id: ras2tiff.1,v 1.4 2006-04-20 12:17:19 dron Exp $
-.\"
-.\" Copyright (c) 1990-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 RAS2TIFF 1 "November 2, 2005" "libtiff"
-.SH NAME
-ras2tiff \- create a
-.SM TIFF
-file from a Sun rasterfile
-.SH SYNOPSIS
-.B ras2tiff
-[
-.I options
-]
-.I input.ras
-.I output.tif
-.SH DESCRIPTION
-.I ras2tiff
-converts a file in the Sun rasterfile format to
-.SM TIFF.
-By default, the
-.SM TIFF
-image is created with data samples packed (\c
-.IR PlanarConfiguration =1),
-compressed with the Lempel-Ziv & Welch algorithm (\c
-.IR Compression =5),
-and with each strip no more than 8 kilobytes.
-These characteristics can overridden, or explicitly specified
-with the options described below.
-.PP
-Any colormap information in the rasterfile is carried over to the
-.SM TIFF
-file by including a
-.I Colormap
-tag in the output file.
-If the rasterfile has a colormap, the
-.I PhotometricInterpretation
-tag is set to 3 (palette);
-otherwise it is set to 2 (RGB) if the depth
-is 24 or 1 (min-is-black) if the depth is not 24.
-.SH OPTIONS
-.TP
-.B \-c
-Specify a compression scheme to use when writing image data:
-.B "\-c none"
-for no compression,
-.B "\-c packbits"
-for the PackBits compression algorithm,
-.B "\-c jpeg"
-for the baseline JPEG compression algorithm,
-.B "\-c zip
-for the Deflate compression algorithm,
-and
-.B "\-c lzw"
-for Lempel-Ziv & Welch (the default).
-.TP
-.B \-r
-Write data with a specified number of rows per strip;
-by default the number of rows/strip is selected so that each strip
-is approximately 8 kilobytes.
-.SH BUGS
-Does not handle all possible rasterfiles.
-In particular, 
-.I ras2tiff
-does not handle run-length encoded images.
-.SH "SEE ALSO"
-.BR pal2rgb (1),
-.BR tiffinfo (1),
-.BR tiffcp (1),
-.BR tiffmedian (1),
-.BR libtiff (3)
-.PP
-Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
-
index 3e832df..184a5d1 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: raw2tiff.1,v 1.7 2009-08-24 19:13:40 bfriesen Exp $
+.\" $Id: raw2tiff.1,v 1.8 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1990-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -193,4 +193,4 @@ in some cases. But for most ordinary images guessing method will work fine.
 .BR libtiff (3)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 01a332c..e3be491 100644 (file)
@@ -1,4 +1,4 @@
-.\"    $Header: /cvs/maptools/cvsroot/libtiff/man/rgb2ycbcr.1,v 1.4 2006-04-20 12:17:19 dron Exp $
+.\"    $Header: /cvs/maptools/cvsroot/libtiff/man/rgb2ycbcr.1,v 1.5 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1991-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -96,4 +96,4 @@ Set the vertical sampling dimension to one of: 1, 2 (default), or 4.
 .BR libtiff (3)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff
+.BR http://www.simplesystems.org/libtiff
diff --git a/man/sgi2tiff.1 b/man/sgi2tiff.1
deleted file mode 100644 (file)
index 650adb3..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-.\" $Id: sgi2tiff.1,v 1.4 2006-04-20 12:17:19 dron 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 SGI2TIFF 1 "November 2, 2005" "libtiff"
-.SH NAME
-sgi2tiff \- create a
-.SM TIFF
-file from an
-.SM SGI
-image file
-.SH SYNOPSIS
-.B sgi2tiff
-[
-.I options
-]
-.I input.rgb
-.I output.tif
-.SH DESCRIPTION
-.I sgi2tiff
-converts a file in the 
-.SM SGI
-image format to
-.SM TIFF.
-By default, the
-.SM TIFF
-image is created with data samples packed (\c
-.IR PlanarConfiguration =1),
-compressed with the Lempel-Ziv & Welch algorithm (\c
-.IR Compression =5),
-and with each strip no more than 8 kilobytes.
-These characteristics can overridden, or explicitly specified
-with the options described below.
-.SH OPTIONS
-.TP
-.B \-c
-Specify a compression scheme to use when writing image data:
-.B "\-c none"
-for no compression,
-.B "\-c packbits"
-for the PackBits compression algorithm),
-.B "\-c jpeg"
-for the baseline JPEG compression algorithm,
-.B "\-c zip
-for the Deflate compression algorithm,
-and
-.B "\-c lzw"
-for Lempel-Ziv & Welch (the default).
-.TP
-.B \-p
-Explicitly select the planar configuration used in organizing
-data samples in the output image:
-.B "\-p contig"
-for samples packed contiguously, and
-.B "\-p separate"
-for samples stored separately.
-By default samples are packed.
-.TP
-.B \-r
-Write data with a specified number of rows per strip;
-by default the number of rows/strip is selected so that each strip
-is approximately 8 kilobytes.
-.SH BUGS
-Does not record colormap information.
-.SH "SEE ALSO"
-.BR tiffinfo (1),
-.BR tiffcp (1),
-.BR tiffmedian (1),
-.BR libtiff (3)
-.PP
-Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
index f4172bb..5ae87ed 100644 (file)
@@ -1,4 +1,4 @@
-.\"    $Id: thumbnail.1,v 1.2 2005-11-02 11:07:19 dron Exp $
+.\"    $Id: thumbnail.1,v 1.3 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1994-1997 Sam Leffler
 .\" Copyright (c) 1994-1997 Silicon Graphics, Inc.
@@ -87,4 +87,4 @@ There are no options to control the format of the saved thumbnail images.
 .BR libtiff (3)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index ccbe7e8..182ebbe 100644 (file)
@@ -1,4 +1,4 @@
-.\"    $Id: tiff2bw.1,v 1.3 2006-04-20 12:17:19 dron Exp $
+.\"    $Id: tiff2bw.1,v 1.4 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -91,4 +91,4 @@ Specify the percentage of the blue channel to use (default 11).
 .BR libtiff (3)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index ba670cf..de80599 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: tiff2pdf.1,v 1.7 2010-12-11 22:47:49 faxguy Exp $
+.\" $Id: tiff2pdf.1,v 1.8 2016-09-25 20:05:51 bfriesen Exp $
 .\" 
 .\"  Copyright (c) 2003 Ross Finlayson
 .\" 
@@ -251,4 +251,4 @@ Please report bugs via the web interface at
 .BR tiff2ps (1)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 565e3ac..e3b57ec 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: tiff2ps.1,v 1.11 2013-03-06 03:35:09 tgl Exp $
+.\" $Id: tiff2ps.1,v 1.12 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -291,4 +291,4 @@ Does not handle tiled images when generating \*(Ps Level I output.
 .BR libtiff (3)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index c551656..f0af0a1 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: tiff2rgba.1,v 1.4 2006-04-20 12:17:19 dron Exp $
+.\" $Id: tiff2rgba.1,v 1.5 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -94,4 +94,4 @@ flag is also in effect.
 .BR libtiff (3)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 961d812..3d111a4 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: tiffcmp.1,v 1.6 2009-08-24 19:13:40 bfriesen Exp $
+.\" $Id: tiffcmp.1,v 1.7 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -84,4 +84,4 @@ in some exotic cases.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 0ed12dc..fee4639 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: tiffcp.1,v 1.13 2013-03-06 03:35:09 tgl Exp $
+.\" $Id: tiffcp.1,v 1.14 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -314,4 +314,4 @@ tiffcp \-c none \-,=% \-b CCD,X.tif CCD,X%1%.tif result.tif
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 0423fb2..3fa6bb6 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: tiffcrop.1,v 1.7 2010-12-12 01:45:35 faxguy Exp $
+.\" $Id: tiffcrop.1,v 1.8 2016-09-25 20:05:52 bfriesen Exp $
 .\" tiffcrop -- a port of tiffcp.c extended to include extended processing of images
 .\" 
 .\" Original code:
@@ -567,5 +567,5 @@ in research or remote sensing scenarios.
 .BR libtiff (3TIFF)
 .PP 
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
 
index c313fd6..d5214ce 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: tiffdither.1,v 1.5 2013-03-06 03:35:09 tgl Exp $
+.\" $Id: tiffdither.1,v 1.6 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1990-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -132,4 +132,4 @@ program (written by Paul Heckbert).
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 076f9ff..a5eeccd 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: tiffdump.1,v 1.5 2006-04-20 12:17:19 dron Exp $
+.\" $Id: tiffdump.1,v 1.6 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -78,4 +78,4 @@ i.e. a leading ``0x'' for hexadecimal and a leading ``0'' for octal.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 680a49a..5303101 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: tiffgt.1,v 1.4 2006-04-20 12:17:19 dron Exp $
+.\" $Id: tiffgt.1,v 1.5 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -242,4 +242,4 @@ crashing old versions of the window manager.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 2d57375..89637bb 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: tiffinfo.1,v 1.2 2005-11-02 11:07:19 dron Exp $
+.\" $Id: tiffinfo.1,v 1.3 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -85,4 +85,4 @@ directory to
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index c584b97..428ca9a 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: tiffmedian.1,v 1.3 2005-11-02 11:07:19 dron Exp $
+.\" $Id: tiffmedian.1,v 1.4 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1990-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -109,4 +109,4 @@ program.
 Paul Heckbert, SIGGRAPH proceedings, 1982, pp. 297-307.
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 516934d..d7c48fa 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: tiffset.1,v 1.6 2012-12-04 03:02:37 bfriesen Exp $
+.\" $Id: tiffset.1,v 1.7 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -96,4 +96,4 @@ tiffset -d 2 -s 262 1 a.tif
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
index 411ebf4..f01b3f4 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: tiffsplit.1,v 1.6 2009-08-24 19:13:40 bfriesen Exp $
+.\" $Id: tiffsplit.1,v 1.7 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1992-1997 Sam Leffler
 .\" Copyright (c) 1992-1997 Silicon Graphics, Inc.
@@ -66,4 +66,4 @@ Only a select set of ``known tags'' is copied when splitting.
 .BR libtiff (3TIFF)
 .PP
 Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
diff --git a/man/tiffsv.1 b/man/tiffsv.1
deleted file mode 100644 (file)
index 206df56..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-.\" $Id: tiffsv.1,v 1.3 2005-11-02 11:07:19 dron 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.
-.\"
-.if n .po 0
-.TH TIFFSV 1 "September 20, 2005" "libtiff"
-.SH NAME
-tiffsv \- save an image from the framebuffer in a
-.SM TIFF
-file (Silicon Graphics version)
-.SH SYNOPSIS
-.B tiffsv
-[
-.I options
-]
-.I output.tif
-[
-.I "x1 x2 y1 y2"
-]
-.SH DESCRIPTION
-.I tiffsv
-saves all or part of the framebuffer in a file using the
-Tag Image File Format, Revision 6.0.
-By default, the image is saved with data samples packed (\c
-.IR PlanarConfiguration =1),
-compressed with the Lempel-Ziv & Welch algorithm (\c
-.IR Compression =5),
-and with each strip no more than 8 kilobytes.
-These characteristics can be overridden, or explicitly specified
-with the options described below.
-.SH OPTIONS
-.TP
-.B \-b
-Save the image as a greyscale image
-as if it were processed by 
-.IR tiff2bw (1).
-This option is included for compatibility with the standard
-.IR scrsave (6D)
-program.
-.TP
-.B \-c
-Specify the compression to use for data written to the output file:
-.B none 
-for no compression,
-.B packbits
-for PackBits compression,
-.B jpeg
-for baseline JPEG compression,
-.B zip
-for Deflate compression,
-and
-.B lzw
-for Lempel-Ziv & Welch compression (default).
-.IP
-.SM LZW
-compression can be specified together with a 
-.I predictor
-value.
-A predictor value of 2 causes
-each scanline of the output image to undergo horizontal
-differencing before it is encoded; a value
-of 1 forces each scanline to be encoded without differencing.
-LZW-specific options are specified by appending a ``:''-separated
-list to the ``lzw'' option; e.g.
-.B "\-c lzw:2"
-for
-.SM LZW
-compression with horizontal differencing.
-.TP
-.B \-p
-Specify the planar configuration to use in writing image data.
-By default,
-.I tiffsv
-will create a new file with the data samples packed contiguously.
-Specifying
-.B "\-p contig"
-will force data to be written with multi-sample data packed
-together, while
-.B "\-p separate"
-will force samples to be written in separate planes.
-.TP
-.B \-r
-Specify the number of rows (scanlines) in each strip of data
-written to the output file.
-By default,
-.I tiffsv
-attempts to set the rows/strip
-that no more than 8 kilobytes of data appear in a strip.
-.SH NOTE
-Except for the use of
-.SM TIFF,
-this program is equivalent to the standard
-.I scrsave
-program.
-This means, for example, that you can use it in conjunction with
-the standard
-.IR icut
-program simply by creating a link called
-.IR scrsave ,
-or by creating a shell script called
-.I scrsave
-that invokes
-.I tiffgt
-with the appropriate options.
-.SH BUGS
-If data are saved compressed and in separate planes, then the
-rows in each strip is silently set to one to avoid limitations
-in the
-.BR libtiff (3TIFF)
-library.
-.SH "SEE ALSO"
-.BR scrsave (6D)
-.BR pal2rgb (1),
-.BR tiffdump (1),
-.BR tiffgt (1),
-.BR tiffinfo (1),
-.BR tiffcp (1),
-.BR tiffmedian (1),
-.BR libtiff (3TIFF)
-.PP
-Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
index 7c2971c..55e09e6 100644 (file)
@@ -259,6 +259,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
index 0aca56f..df5c082 100644 (file)
@@ -66,9 +66,6 @@ check_PROGRAMS = \
 
 # Test scripts to execute
 TESTSCRIPTS = \
-       bmp2tiff_palette.sh \
-       bmp2tiff_rgb.sh \
-       gif2tiff.sh \
        ppm2tiff_pbm.sh \
        ppm2tiff_pgm.sh \
        ppm2tiff_ppm.sh \
@@ -157,13 +154,6 @@ TIFFIMAGES = \
        images/rgb-3c-8b.tiff \
        images/quad-tile.jpg.tiff
 
-BMPIMAGES = \
-       images/palette-1c-8b.bmp \
-       images/rgb-3c-8b.bmp
-
-GIFIMAGES = \
-       images/palette-1c-8b.gif
-
 PNMIMAGES = \
        images/minisblack-1c-8b.pgm \
        images/miniswhite-1c-1b.pbm \
@@ -174,8 +164,6 @@ PNMIMAGES = \
 # files which are not currently used by the tests.
 IMAGES_EXTRA_DIST = \
        images/README.txt \
-       $(BMPIMAGES) \
-       $(GIFIMAGES) \
        $(PNMIMAGES) \
        $(TIFFIMAGES)
 
index 29b008a..92a4165 100644 (file)
@@ -410,13 +410,12 @@ am__set_TESTS_bases = \
 RECHECK_LOGS = $(TEST_LOGS)
 AM_RECURSIVE_TARGETS = check recheck
 @HAVE_JPEG_TRUE@am__EXEEXT_2 = tiff2rgba-quad-tile.jpg.sh
-am__EXEEXT_3 = bmp2tiff_palette.sh bmp2tiff_rgb.sh gif2tiff.sh \
-       ppm2tiff_pbm.sh ppm2tiff_pgm.sh ppm2tiff_ppm.sh tiffcp-g3.sh \
-       tiffcp-g3-1d.sh tiffcp-g3-1d-fill.sh tiffcp-g3-2d.sh \
-       tiffcp-g3-2d-fill.sh tiffcp-g4.sh tiffcp-logluv.sh \
-       tiffcp-thumbnail.sh tiffdump.sh tiffinfo.sh tiffcp-split.sh \
-       tiffcp-split-join.sh tiff2ps-PS1.sh tiff2ps-PS2.sh \
-       tiff2ps-PS3.sh tiff2ps-EPS1.sh tiff2pdf.sh \
+am__EXEEXT_3 = ppm2tiff_pbm.sh ppm2tiff_pgm.sh ppm2tiff_ppm.sh \
+       tiffcp-g3.sh tiffcp-g3-1d.sh tiffcp-g3-1d-fill.sh \
+       tiffcp-g3-2d.sh tiffcp-g3-2d-fill.sh tiffcp-g4.sh \
+       tiffcp-logluv.sh tiffcp-thumbnail.sh tiffdump.sh tiffinfo.sh \
+       tiffcp-split.sh tiffcp-split-join.sh tiff2ps-PS1.sh \
+       tiff2ps-PS2.sh tiff2ps-PS3.sh tiff2ps-EPS1.sh tiff2pdf.sh \
        tiffcrop-doubleflip-logluv-3c-16b.sh \
        tiffcrop-doubleflip-minisblack-1c-16b.sh \
        tiffcrop-doubleflip-minisblack-1c-8b.sh \
@@ -542,6 +541,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -657,9 +657,6 @@ CLEANFILES = test_packbits.tif o-*
 
 # Test scripts to execute
 TESTSCRIPTS = \
-       bmp2tiff_palette.sh \
-       bmp2tiff_rgb.sh \
-       gif2tiff.sh \
        ppm2tiff_pbm.sh \
        ppm2tiff_pgm.sh \
        ppm2tiff_ppm.sh \
@@ -749,13 +746,6 @@ TIFFIMAGES = \
        images/rgb-3c-8b.tiff \
        images/quad-tile.jpg.tiff
 
-BMPIMAGES = \
-       images/palette-1c-8b.bmp \
-       images/rgb-3c-8b.bmp
-
-GIFIMAGES = \
-       images/palette-1c-8b.gif
-
 PNMIMAGES = \
        images/minisblack-1c-8b.pgm \
        images/miniswhite-1c-1b.pbm \
@@ -767,8 +757,6 @@ PNMIMAGES = \
 # files which are not currently used by the tests.
 IMAGES_EXTRA_DIST = \
        images/README.txt \
-       $(BMPIMAGES) \
-       $(GIFIMAGES) \
        $(PNMIMAGES) \
        $(TIFFIMAGES)
 
@@ -1145,27 +1133,6 @@ raw_decode.log: raw_decode$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
-bmp2tiff_palette.sh.log: bmp2tiff_palette.sh
-       @p='bmp2tiff_palette.sh'; \
-       b='bmp2tiff_palette.sh'; \
-       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
-       --log-file $$b.log --trs-file $$b.trs \
-       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
-       "$$tst" $(AM_TESTS_FD_REDIRECT)
-bmp2tiff_rgb.sh.log: bmp2tiff_rgb.sh
-       @p='bmp2tiff_rgb.sh'; \
-       b='bmp2tiff_rgb.sh'; \
-       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
-       --log-file $$b.log --trs-file $$b.trs \
-       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
-       "$$tst" $(AM_TESTS_FD_REDIRECT)
-gif2tiff.sh.log: gif2tiff.sh
-       @p='gif2tiff.sh'; \
-       b='gif2tiff.sh'; \
-       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
-       --log-file $$b.log --trs-file $$b.trs \
-       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
-       "$$tst" $(AM_TESTS_FD_REDIRECT)
 ppm2tiff_pbm.sh.log: ppm2tiff_pbm.sh
        @p='ppm2tiff_pbm.sh'; \
        b='ppm2tiff_pbm.sh'; \
diff --git a/test/bmp2tiff_palette.sh b/test/bmp2tiff_palette.sh
deleted file mode 100755 (executable)
index 1992623..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-# Generated file, master is Makefile.am
-. ${srcdir:-.}/common.sh
-infile="$IMG_PALETTE_1C_8B_BMP"
-outfile="o-bmp2tiff_palette.tiff"
-f_test_convert "$BMP2TIFF" $infile $outfile
-f_tiffinfo_validate $outfile
diff --git a/test/bmp2tiff_rgb.sh b/test/bmp2tiff_rgb.sh
deleted file mode 100755 (executable)
index 2e940ce..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-# Generated file, master is Makefile.am
-. ${srcdir:-.}/common.sh
-infile="$IMG_RGB_3C_8B_BMP"
-outfile="o-bmp2tiff_rgb.tiff"
-f_test_convert "$BMP2TIFF" $infile $outfile
-f_tiffinfo_validate $outfile
index 643104b..6f9b282 100644 (file)
@@ -9,13 +9,10 @@ TOOLS=`cd ../tools && pwd`
 IMAGES="${SRCDIR}/images"
 
 # Aliases for built tools
-BMP2TIFF=${TOOLS}/bmp2tiff
 FAX2PS=${TOOLS}/fax2ps
 FAX2TIFF=${TOOLS}/fax2tiff
-GIF2TIFF=${TOOLS}/gif2tiff
 PAL2RGB=${TOOLS}/pal2rgb
 PPM2TIFF=${TOOLS}/ppm2tiff
-RAS2TIFF=${TOOLS}/ras2tiff
 RAW2TIFF=${TOOLS}/raw2tiff
 RGB2YCBCR=${TOOLS}/rgb2ycbcr
 THUMBNAIL=${TOOLS}/thumbnail
@@ -44,11 +41,6 @@ IMG_RGB_3C_16B=${IMAGES}/rgb-3c-16b.tiff
 IMG_RGB_3C_8B=${IMAGES}/rgb-3c-8b.tiff
 IMG_MINISBLACK_2C_8B_ALPHA=${IMAGES}/minisblack-2c-8b-alpha.tiff
 
-IMG_PALETTE_1C_8B_BMP=${IMAGES}/palette-1c-8b.bmp
-IMG_RGB_3C_8B_BMP=${IMAGES}/rgb-3c-8b.bmp
-
-IMG_PALETTE_1C_8B_GIF=${IMAGES}/palette-1c-8b.gif
-
 IMG_MINISWHITE_1C_1B_PBM=${IMAGES}/miniswhite-1c-1b.pbm
 IMG_MINISBLACK_1C_8B_PGM=${IMAGES}/minisblack-1c-8b.pgm
 IMG_RGB_3C_8B_PPM=${IMAGES}/rgb-3c-8b.ppm
diff --git a/test/gif2tiff.sh b/test/gif2tiff.sh
deleted file mode 100755 (executable)
index 6bf9a12..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-# Generated file, master is Makefile.am
-. ${srcdir:-.}/common.sh
-infile="$IMG_PALETTE_1C_8B_GIF"
-outfile="o-gif2tiff.tiff"
-f_test_convert "$GIF2TIFF" $infile $outfile
-f_tiffinfo_validate $outfile
diff --git a/test/images/palette-1c-8b.bmp b/test/images/palette-1c-8b.bmp
deleted file mode 100644 (file)
index 215f4c5..0000000
Binary files a/test/images/palette-1c-8b.bmp and /dev/null differ
diff --git a/test/images/palette-1c-8b.gif b/test/images/palette-1c-8b.gif
deleted file mode 100644 (file)
index f83dfa3..0000000
Binary files a/test/images/palette-1c-8b.gif and /dev/null differ
diff --git a/test/images/rgb-3c-8b.bmp b/test/images/rgb-3c-8b.bmp
deleted file mode 100644 (file)
index e6a86dc..0000000
Binary files a/test/images/rgb-3c-8b.bmp and /dev/null differ
index a595c4b..331f83c 100644 (file)
@@ -29,27 +29,18 @@ include_directories(${PROJECT_SOURCE_DIR}/libtiff
                     ${PROJECT_SOURCE_DIR}/port
                     ${CMAKE_CURRENT_BINARY_DIR})
 
-add_executable(bmp2tiff bmp2tiff.c)
-target_link_libraries(bmp2tiff tiff port)
-
 add_executable(fax2ps fax2ps.c)
 target_link_libraries(fax2ps tiff port)
 
 add_executable(fax2tiff fax2tiff.c)
 target_link_libraries(fax2tiff tiff port)
 
-add_executable(gif2tiff gif2tiff.c)
-target_link_libraries(gif2tiff tiff port)
-
 add_executable(pal2rgb pal2rgb.c)
 target_link_libraries(pal2rgb tiff port)
 
 add_executable(ppm2tiff ppm2tiff.c)
 target_link_libraries(ppm2tiff tiff port)
 
-add_executable(ras2tiff ras2tiff.c rasterfile.h)
-target_link_libraries(ras2tiff tiff port)
-
 add_executable(raw2tiff raw2tiff.c)
 target_link_libraries(raw2tiff tiff port)
 
@@ -98,16 +89,11 @@ target_link_libraries(tiffset tiff port)
 add_executable(tiffsplit tiffsplit.c)
 target_link_libraries(tiffsplit tiff port)
 
-install(TARGETS bmp2tiff
-                fax2ps
+install(TARGETS fax2ps
                 fax2tiff
-                gif2tiff
                 pal2rgb
                 ppm2tiff
-                ras2tiff
                 raw2tiff
-                rgb2ycbcr
-                thumbnail
                 tiff2bw
                 tiff2pdf
                 tiff2ps
index 4a55cf5..3054bee 100644 (file)
@@ -31,16 +31,11 @@ EXTRA_DIST = \
        Makefile.vc
 
 bin_PROGRAMS = \
-       bmp2tiff \
        fax2ps \
        fax2tiff \
-       gif2tiff \
        pal2rgb \
        ppm2tiff \
-       ras2tiff \
        raw2tiff \
-       rgb2ycbcr \
-       thumbnail \
        tiff2bw \
        tiff2pdf \
        tiff2ps \
@@ -58,33 +53,29 @@ if HAVE_OPENGL
 bin_PROGRAMS += tiffgt
 endif
 
-EXTRA_PROGRAMS = sgi2tiff sgisv ycbcr
+EXTRA_PROGRAMS = rgb2ycbcr thumbnail
+
+# Executable programs which need to be built in order to support tests
+check_PROGRAMS = \
+       rgb2ycbcr \
+       thumbnail
 
 if HAVE_RPATH
 AM_LDFLAGS = $(LIBDIR)
 endif
 
-bmp2tiff_SOURCES = bmp2tiff.c
-bmp2tiff_LDADD = $(LIBTIFF) $(LIBPORT)
-
 fax2ps_SOURCES = fax2ps.c
 fax2ps_LDADD = $(LIBTIFF) $(LIBPORT)
 
 fax2tiff_SOURCES = fax2tiff.c
 fax2tiff_LDADD = $(LIBTIFF) $(LIBPORT)
 
-gif2tiff_SOURCES = gif2tiff.c
-gif2tiff_LDADD = $(LIBTIFF) $(LIBPORT)
-
 pal2rgb_SOURCES = pal2rgb.c
 pal2rgb_LDADD = $(LIBTIFF) $(LIBPORT)
 
 ppm2tiff_SOURCES = ppm2tiff.c
 ppm2tiff_LDADD = $(LIBTIFF) $(LIBPORT)
 
-ras2tiff_SOURCES = ras2tiff.c rasterfile.h
-ras2tiff_LDADD = $(LIBTIFF) $(LIBPORT)
-
 raw2tiff_SOURCES = raw2tiff.c
 raw2tiff_LDADD = $(LIBTIFF) $(LIBPORT)
 
index 43e4347..d7d5604 100644 (file)
@@ -113,16 +113,16 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-bin_PROGRAMS = bmp2tiff$(EXEEXT) fax2ps$(EXEEXT) fax2tiff$(EXEEXT) \
-       gif2tiff$(EXEEXT) pal2rgb$(EXEEXT) ppm2tiff$(EXEEXT) \
-       ras2tiff$(EXEEXT) raw2tiff$(EXEEXT) rgb2ycbcr$(EXEEXT) \
-       thumbnail$(EXEEXT) tiff2bw$(EXEEXT) tiff2pdf$(EXEEXT) \
-       tiff2ps$(EXEEXT) tiff2rgba$(EXEEXT) tiffcmp$(EXEEXT) \
-       tiffcp$(EXEEXT) tiffcrop$(EXEEXT) tiffdither$(EXEEXT) \
-       tiffdump$(EXEEXT) tiffinfo$(EXEEXT) tiffmedian$(EXEEXT) \
-       tiffset$(EXEEXT) tiffsplit$(EXEEXT) $(am__EXEEXT_1)
+bin_PROGRAMS = fax2ps$(EXEEXT) fax2tiff$(EXEEXT) pal2rgb$(EXEEXT) \
+       ppm2tiff$(EXEEXT) raw2tiff$(EXEEXT) tiff2bw$(EXEEXT) \
+       tiff2pdf$(EXEEXT) tiff2ps$(EXEEXT) tiff2rgba$(EXEEXT) \
+       tiffcmp$(EXEEXT) tiffcp$(EXEEXT) tiffcrop$(EXEEXT) \
+       tiffdither$(EXEEXT) tiffdump$(EXEEXT) tiffinfo$(EXEEXT) \
+       tiffmedian$(EXEEXT) tiffset$(EXEEXT) tiffsplit$(EXEEXT) \
+       $(am__EXEEXT_1)
 @HAVE_OPENGL_TRUE@am__append_1 = tiffgt
-EXTRA_PROGRAMS = sgi2tiff$(EXEEXT) sgisv$(EXEEXT) ycbcr$(EXEEXT)
+EXTRA_PROGRAMS = rgb2ycbcr$(EXEEXT) thumbnail$(EXEEXT)
+check_PROGRAMS = rgb2ycbcr$(EXEEXT) thumbnail$(EXEEXT)
 subdir = tools
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
@@ -140,43 +140,28 @@ CONFIG_CLEAN_VPATH_FILES =
 @HAVE_OPENGL_TRUE@am__EXEEXT_1 = tiffgt$(EXEEXT)
 am__installdirs = "$(DESTDIR)$(bindir)"
 PROGRAMS = $(bin_PROGRAMS)
-am_bmp2tiff_OBJECTS = bmp2tiff.$(OBJEXT)
-bmp2tiff_OBJECTS = $(am_bmp2tiff_OBJECTS)
-bmp2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT)
+am_fax2ps_OBJECTS = fax2ps.$(OBJEXT)
+fax2ps_OBJECTS = $(am_fax2ps_OBJECTS)
+fax2ps_DEPENDENCIES = $(LIBTIFF) $(LIBPORT)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
 am__v_lt_1 = 
-am_fax2ps_OBJECTS = fax2ps.$(OBJEXT)
-fax2ps_OBJECTS = $(am_fax2ps_OBJECTS)
-fax2ps_DEPENDENCIES = $(LIBTIFF) $(LIBPORT)
 am_fax2tiff_OBJECTS = fax2tiff.$(OBJEXT)
 fax2tiff_OBJECTS = $(am_fax2tiff_OBJECTS)
 fax2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT)
-am_gif2tiff_OBJECTS = gif2tiff.$(OBJEXT)
-gif2tiff_OBJECTS = $(am_gif2tiff_OBJECTS)
-gif2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT)
 am_pal2rgb_OBJECTS = pal2rgb.$(OBJEXT)
 pal2rgb_OBJECTS = $(am_pal2rgb_OBJECTS)
 pal2rgb_DEPENDENCIES = $(LIBTIFF) $(LIBPORT)
 am_ppm2tiff_OBJECTS = ppm2tiff.$(OBJEXT)
 ppm2tiff_OBJECTS = $(am_ppm2tiff_OBJECTS)
 ppm2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT)
-am_ras2tiff_OBJECTS = ras2tiff.$(OBJEXT)
-ras2tiff_OBJECTS = $(am_ras2tiff_OBJECTS)
-ras2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT)
 am_raw2tiff_OBJECTS = raw2tiff.$(OBJEXT)
 raw2tiff_OBJECTS = $(am_raw2tiff_OBJECTS)
 raw2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT)
 am_rgb2ycbcr_OBJECTS = rgb2ycbcr.$(OBJEXT)
 rgb2ycbcr_OBJECTS = $(am_rgb2ycbcr_OBJECTS)
 rgb2ycbcr_DEPENDENCIES = $(LIBTIFF) $(LIBPORT)
-sgi2tiff_SOURCES = sgi2tiff.c
-sgi2tiff_OBJECTS = sgi2tiff.$(OBJEXT)
-sgi2tiff_LDADD = $(LDADD)
-sgisv_SOURCES = sgisv.c
-sgisv_OBJECTS = sgisv.$(OBJEXT)
-sgisv_LDADD = $(LDADD)
 am_thumbnail_OBJECTS = thumbnail.$(OBJEXT)
 thumbnail_OBJECTS = $(am_thumbnail_OBJECTS)
 thumbnail_DEPENDENCIES = $(LIBTIFF) $(LIBPORT)
@@ -227,9 +212,6 @@ tiffset_DEPENDENCIES = $(LIBTIFF) $(LIBPORT)
 am_tiffsplit_OBJECTS = tiffsplit.$(OBJEXT)
 tiffsplit_OBJECTS = $(am_tiffsplit_OBJECTS)
 tiffsplit_DEPENDENCIES = $(LIBTIFF) $(LIBPORT)
-ycbcr_SOURCES = ycbcr.c
-ycbcr_OBJECTS = ycbcr.$(OBJEXT)
-ycbcr_LDADD = $(LDADD)
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -264,24 +246,21 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = $(bmp2tiff_SOURCES) $(fax2ps_SOURCES) $(fax2tiff_SOURCES) \
-       $(gif2tiff_SOURCES) $(pal2rgb_SOURCES) $(ppm2tiff_SOURCES) \
-       $(ras2tiff_SOURCES) $(raw2tiff_SOURCES) $(rgb2ycbcr_SOURCES) \
-       sgi2tiff.c sgisv.c $(thumbnail_SOURCES) $(tiff2bw_SOURCES) \
+SOURCES = $(fax2ps_SOURCES) $(fax2tiff_SOURCES) $(pal2rgb_SOURCES) \
+       $(ppm2tiff_SOURCES) $(raw2tiff_SOURCES) $(rgb2ycbcr_SOURCES) \
+       $(thumbnail_SOURCES) $(tiff2bw_SOURCES) $(tiff2pdf_SOURCES) \
+       $(tiff2ps_SOURCES) $(tiff2rgba_SOURCES) $(tiffcmp_SOURCES) \
+       $(tiffcp_SOURCES) $(tiffcrop_SOURCES) $(tiffdither_SOURCES) \
+       $(tiffdump_SOURCES) $(tiffgt_SOURCES) $(tiffinfo_SOURCES) \
+       $(tiffmedian_SOURCES) $(tiffset_SOURCES) $(tiffsplit_SOURCES)
+DIST_SOURCES = $(fax2ps_SOURCES) $(fax2tiff_SOURCES) \
+       $(pal2rgb_SOURCES) $(ppm2tiff_SOURCES) $(raw2tiff_SOURCES) \
+       $(rgb2ycbcr_SOURCES) $(thumbnail_SOURCES) $(tiff2bw_SOURCES) \
        $(tiff2pdf_SOURCES) $(tiff2ps_SOURCES) $(tiff2rgba_SOURCES) \
        $(tiffcmp_SOURCES) $(tiffcp_SOURCES) $(tiffcrop_SOURCES) \
        $(tiffdither_SOURCES) $(tiffdump_SOURCES) $(tiffgt_SOURCES) \
        $(tiffinfo_SOURCES) $(tiffmedian_SOURCES) $(tiffset_SOURCES) \
-       $(tiffsplit_SOURCES) ycbcr.c
-DIST_SOURCES = $(bmp2tiff_SOURCES) $(fax2ps_SOURCES) \
-       $(fax2tiff_SOURCES) $(gif2tiff_SOURCES) $(pal2rgb_SOURCES) \
-       $(ppm2tiff_SOURCES) $(ras2tiff_SOURCES) $(raw2tiff_SOURCES) \
-       $(rgb2ycbcr_SOURCES) sgi2tiff.c sgisv.c $(thumbnail_SOURCES) \
-       $(tiff2bw_SOURCES) $(tiff2pdf_SOURCES) $(tiff2ps_SOURCES) \
-       $(tiff2rgba_SOURCES) $(tiffcmp_SOURCES) $(tiffcp_SOURCES) \
-       $(tiffcrop_SOURCES) $(tiffdither_SOURCES) $(tiffdump_SOURCES) \
-       $(tiffgt_SOURCES) $(tiffinfo_SOURCES) $(tiffmedian_SOURCES) \
-       $(tiffset_SOURCES) $(tiffsplit_SOURCES) ycbcr.c
+       $(tiffsplit_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -369,6 +348,7 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -463,20 +443,14 @@ EXTRA_DIST = \
        Makefile.vc
 
 @HAVE_RPATH_TRUE@AM_LDFLAGS = $(LIBDIR)
-bmp2tiff_SOURCES = bmp2tiff.c
-bmp2tiff_LDADD = $(LIBTIFF) $(LIBPORT)
 fax2ps_SOURCES = fax2ps.c
 fax2ps_LDADD = $(LIBTIFF) $(LIBPORT)
 fax2tiff_SOURCES = fax2tiff.c
 fax2tiff_LDADD = $(LIBTIFF) $(LIBPORT)
-gif2tiff_SOURCES = gif2tiff.c
-gif2tiff_LDADD = $(LIBTIFF) $(LIBPORT)
 pal2rgb_SOURCES = pal2rgb.c
 pal2rgb_LDADD = $(LIBTIFF) $(LIBPORT)
 ppm2tiff_SOURCES = ppm2tiff.c
 ppm2tiff_LDADD = $(LIBTIFF) $(LIBPORT)
-ras2tiff_SOURCES = ras2tiff.c rasterfile.h
-ras2tiff_LDADD = $(LIBTIFF) $(LIBPORT)
 raw2tiff_SOURCES = raw2tiff.c
 raw2tiff_LDADD = $(LIBTIFF) $(LIBPORT)
 rgb2ycbcr_SOURCES = rgb2ycbcr.c
@@ -596,9 +570,14 @@ clean-binPROGRAMS:
        echo " rm -f" $$list; \
        rm -f $$list
 
-bmp2tiff$(EXEEXT): $(bmp2tiff_OBJECTS) $(bmp2tiff_DEPENDENCIES) $(EXTRA_bmp2tiff_DEPENDENCIES) 
-       @rm -f bmp2tiff$(EXEEXT)
-       $(AM_V_CCLD)$(LINK) $(bmp2tiff_OBJECTS) $(bmp2tiff_LDADD) $(LIBS)
+clean-checkPROGRAMS:
+       @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
 
 fax2ps$(EXEEXT): $(fax2ps_OBJECTS) $(fax2ps_DEPENDENCIES) $(EXTRA_fax2ps_DEPENDENCIES) 
        @rm -f fax2ps$(EXEEXT)
@@ -608,10 +587,6 @@ fax2tiff$(EXEEXT): $(fax2tiff_OBJECTS) $(fax2tiff_DEPENDENCIES) $(EXTRA_fax2tiff
        @rm -f fax2tiff$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(fax2tiff_OBJECTS) $(fax2tiff_LDADD) $(LIBS)
 
-gif2tiff$(EXEEXT): $(gif2tiff_OBJECTS) $(gif2tiff_DEPENDENCIES) $(EXTRA_gif2tiff_DEPENDENCIES) 
-       @rm -f gif2tiff$(EXEEXT)
-       $(AM_V_CCLD)$(LINK) $(gif2tiff_OBJECTS) $(gif2tiff_LDADD) $(LIBS)
-
 pal2rgb$(EXEEXT): $(pal2rgb_OBJECTS) $(pal2rgb_DEPENDENCIES) $(EXTRA_pal2rgb_DEPENDENCIES) 
        @rm -f pal2rgb$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(pal2rgb_OBJECTS) $(pal2rgb_LDADD) $(LIBS)
@@ -620,10 +595,6 @@ ppm2tiff$(EXEEXT): $(ppm2tiff_OBJECTS) $(ppm2tiff_DEPENDENCIES) $(EXTRA_ppm2tiff
        @rm -f ppm2tiff$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(ppm2tiff_OBJECTS) $(ppm2tiff_LDADD) $(LIBS)
 
-ras2tiff$(EXEEXT): $(ras2tiff_OBJECTS) $(ras2tiff_DEPENDENCIES) $(EXTRA_ras2tiff_DEPENDENCIES) 
-       @rm -f ras2tiff$(EXEEXT)
-       $(AM_V_CCLD)$(LINK) $(ras2tiff_OBJECTS) $(ras2tiff_LDADD) $(LIBS)
-
 raw2tiff$(EXEEXT): $(raw2tiff_OBJECTS) $(raw2tiff_DEPENDENCIES) $(EXTRA_raw2tiff_DEPENDENCIES) 
        @rm -f raw2tiff$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(raw2tiff_OBJECTS) $(raw2tiff_LDADD) $(LIBS)
@@ -632,14 +603,6 @@ rgb2ycbcr$(EXEEXT): $(rgb2ycbcr_OBJECTS) $(rgb2ycbcr_DEPENDENCIES) $(EXTRA_rgb2y
        @rm -f rgb2ycbcr$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(rgb2ycbcr_OBJECTS) $(rgb2ycbcr_LDADD) $(LIBS)
 
-sgi2tiff$(EXEEXT): $(sgi2tiff_OBJECTS) $(sgi2tiff_DEPENDENCIES) $(EXTRA_sgi2tiff_DEPENDENCIES) 
-       @rm -f sgi2tiff$(EXEEXT)
-       $(AM_V_CCLD)$(LINK) $(sgi2tiff_OBJECTS) $(sgi2tiff_LDADD) $(LIBS)
-
-sgisv$(EXEEXT): $(sgisv_OBJECTS) $(sgisv_DEPENDENCIES) $(EXTRA_sgisv_DEPENDENCIES) 
-       @rm -f sgisv$(EXEEXT)
-       $(AM_V_CCLD)$(LINK) $(sgisv_OBJECTS) $(sgisv_LDADD) $(LIBS)
-
 thumbnail$(EXEEXT): $(thumbnail_OBJECTS) $(thumbnail_DEPENDENCIES) $(EXTRA_thumbnail_DEPENDENCIES) 
        @rm -f thumbnail$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(thumbnail_OBJECTS) $(thumbnail_LDADD) $(LIBS)
@@ -700,27 +663,18 @@ tiffsplit$(EXEEXT): $(tiffsplit_OBJECTS) $(tiffsplit_DEPENDENCIES) $(EXTRA_tiffs
        @rm -f tiffsplit$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(tiffsplit_OBJECTS) $(tiffsplit_LDADD) $(LIBS)
 
-ycbcr$(EXEEXT): $(ycbcr_OBJECTS) $(ycbcr_DEPENDENCIES) $(EXTRA_ycbcr_DEPENDENCIES) 
-       @rm -f ycbcr$(EXEEXT)
-       $(AM_V_CCLD)$(LINK) $(ycbcr_OBJECTS) $(ycbcr_LDADD) $(LIBS)
-
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
 
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bmp2tiff.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax2ps.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax2tiff.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif2tiff.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pal2rgb.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppm2tiff.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ras2tiff.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw2tiff.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rgb2ycbcr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgi2tiff.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgisv.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thumbnail.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2bw.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2pdf.Po@am__quote@
@@ -736,7 +690,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffmedian.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffset.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffsplit.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ycbcr.Po@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -862,6 +815,7 @@ distdir: $(DISTFILES)
          fi; \
        done
 check-am: all-am
+       $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
 check: check-am
 all-am: Makefile $(PROGRAMS)
 installdirs:
@@ -900,7 +854,8 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
+       clean-libtool mostlyclean-am
 
 distclean: distclean-am
        -rm -rf ./$(DEPDIR)
@@ -968,18 +923,19 @@ ps-am:
 
 uninstall-am: uninstall-binPROGRAMS
 
-.MAKE: install-am install-strip
+.MAKE: check-am install-am install-strip
 
 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
-       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
-       ctags ctags-am distclean distclean-compile distclean-generic \
-       distclean-libtool distclean-tags distdir dvi dvi-am html \
-       html-am info info-am install install-am install-binPROGRAMS \
-       install-data install-data-am install-dvi install-dvi-am \
-       install-exec install-exec-am install-html install-html-am \
-       install-info install-info-am install-man install-pdf \
-       install-pdf-am install-ps install-ps-am install-strip \
-       installcheck installcheck-am installdirs maintainer-clean \
+       clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
+       clean-libtool cscopelist-am ctags ctags-am distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-binPROGRAMS install-data \
+       install-data-am install-dvi install-dvi-am install-exec \
+       install-exec-am install-html install-html-am install-info \
+       install-info-am install-man install-pdf install-pdf-am \
+       install-ps install-ps-am install-strip installcheck \
+       installcheck-am installdirs maintainer-clean \
        maintainer-clean-generic mostlyclean mostlyclean-compile \
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
index c8d69cd..646c767 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile.vc,v 1.15 2009-01-22 20:53:07 fwarmerdam Exp $
+# $Id: Makefile.vc,v 1.16 2016-06-05 19:54:03 bfriesen Exp $
 #
 # Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
 #
@@ -28,9 +28,9 @@
 
 !INCLUDE ..\nmake.opt
 
-TARGETS        =       bmp2tiff.exe tiffinfo.exe tiffdump.exe fax2tiff.exe \
-               fax2ps.exe gif2tiff.exe pal2rgb.exe ppm2tiff.exe \
-               rgb2ycbcr.exe thumbnail.exe ras2tiff.exe raw2tiff.exe \
+TARGETS        =       tiffinfo.exe tiffdump.exe fax2tiff.exe \
+               fax2ps.exe pal2rgb.exe ppm2tiff.exe \
+               rgb2ycbcr.exe thumbnail.exe raw2tiff.exe \
                tiff2bw.exe tiff2rgba.exe tiff2pdf.exe tiff2ps.exe \
                tiffcmp.exe tiffcp.exe tiffcrop.exe tiffdither.exe \
                tiffmedian.exe tiffset.exe tiffsplit.exe 
diff --git a/tools/bmp2tiff.c b/tools/bmp2tiff.c
deleted file mode 100644 (file)
index 797dabd..0000000
+++ /dev/null
@@ -1,937 +0,0 @@
-/* $Id: bmp2tiff.c,v 1.27 2015-08-19 02:31:04 bfriesen Exp $
- *
- * Project:  libtiff tools
- * Purpose:  Convert Windows BMP files in TIFF.
- * Author:   Andrey Kiselev, dron@ak4719.spb.edu
- *
- ******************************************************************************
- * Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
- *
- * 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 "tif_config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
-
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_IO_H
-# include <io.h>
-#endif
-
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
-#include "tiffiop.h"
-#include "tiffio.h"
-
-#ifndef O_BINARY
-# define O_BINARY 0
-#endif
-
-enum BMPType
-{
-    BMPT_WIN4,      /* BMP used in Windows 3.0/NT 3.51/95 */
-    BMPT_WIN5,      /* BMP used in Windows NT 4.0/98/Me/2000/XP */
-    BMPT_OS21,      /* BMP used in OS/2 PM 1.x */
-    BMPT_OS22       /* BMP used in OS/2 PM 2.x */
-};
-
-/*
- * Bitmap file consists of a BMPFileHeader structure followed by a
- * BMPInfoHeader structure. An array of BMPColorEntry structures (also called
- * a colour table) follows the bitmap information header structure. The colour
- * table is followed by a second array of indexes into the colour table (the
- * actual bitmap data). Data may be comressed, for 4-bpp and 8-bpp used RLE
- * compression.
- *
- * +---------------------+
- * | BMPFileHeader       |
- * +---------------------+
- * | BMPInfoHeader       |
- * +---------------------+
- * | BMPColorEntry array |
- * +---------------------+
- * | Colour-index array  |
- * +---------------------+
- *
- * All numbers stored in Intel order with least significant byte first.
- */
-
-enum BMPComprMethod
-{
-    BMPC_RGB = 0L,          /* Uncompressed */
-    BMPC_RLE8 = 1L,         /* RLE for 8 bpp images */
-    BMPC_RLE4 = 2L,         /* RLE for 4 bpp images */
-    BMPC_BITFIELDS = 3L,    /* Bitmap is not compressed and the colour table
-                            * consists of three DWORD color masks that specify
-                            * the red, green, and blue components of each
-                            * pixel. This is valid when used with
-                            * 16- and 32-bpp bitmaps. */
-    BMPC_JPEG = 4L,         /* Indicates that the image is a JPEG image. */
-    BMPC_PNG = 5L           /* Indicates that the image is a PNG image. */
-};
-
-enum BMPLCSType                 /* Type of logical color space. */
-{
-    BMPLT_CALIBRATED_RGB = 0,  /* This value indicates that endpoints and
-                                * gamma values are given in the appropriate
-                                * fields. */
-    BMPLT_DEVICE_RGB = 1,
-    BMPLT_DEVICE_CMYK = 2
-};
-
-typedef struct
-{
-    int32   iCIEX;
-    int32   iCIEY;
-    int32   iCIEZ;
-} BMPCIEXYZ;
-
-typedef struct                  /* This structure contains the x, y, and z */
-{                              /* coordinates of the three colors that */
-                               /* correspond */
-    BMPCIEXYZ   iCIERed;        /* to the red, green, and blue endpoints for */
-    BMPCIEXYZ   iCIEGreen;      /* a specified logical color space. */
-    BMPCIEXYZ  iCIEBlue;
-} BMPCIEXYZTriple;
-
-typedef struct
-{
-    char       bType[2];       /* Signature "BM" */
-    uint32     iSize;          /* Size in bytes of the bitmap file. Should
-                                * always be ignored while reading because
-                                * of error in Windows 3.0 SDK's description
-                                * of this field */
-    uint16     iReserved1;     /* Reserved, set as 0 */
-    uint16     iReserved2;     /* Reserved, set as 0 */
-    uint32     iOffBits;       /* Offset of the image from file start in bytes */
-} BMPFileHeader;
-
-/* File header size in bytes: */
-const int       BFH_SIZE = 14;
-
-typedef struct
-{
-    uint32     iSize;          /* Size of BMPInfoHeader structure in bytes.
-                                * Should be used to determine start of the
-                                * colour table */
-    int32      iWidth;         /* Image width */
-    int32      iHeight;        /* Image height. If positive, image has bottom
-                                * left origin, if negative --- top left. */
-    int16      iPlanes;        /* Number of image planes (must be set to 1) */
-    int16      iBitCount;      /* Number of bits per pixel (1, 4, 8, 16, 24
-                                * or 32). If 0 then the number of bits per
-                                * pixel is specified or is implied by the
-                                * JPEG or PNG format. */
-    uint32     iCompression;   /* Compression method */
-    uint32     iSizeImage;     /* Size of uncomressed image in bytes. May
-                                * be 0 for BMPC_RGB bitmaps. If iCompression
-                                * is BI_JPEG or BI_PNG, iSizeImage indicates
-                                * the size of the JPEG or PNG image buffer. */
-    int32      iXPelsPerMeter; /* X resolution, pixels per meter (0 if not used) */
-    int32      iYPelsPerMeter; /* Y resolution, pixels per meter (0 if not used) */
-    uint32     iClrUsed;       /* Size of colour table. If 0, iBitCount should
-                                * be used to calculate this value
-                                * (1<<iBitCount). This value should be
-                                * unsigned for proper shifting. */
-    int32      iClrImportant;  /* Number of important colours. If 0, all
-                                * colours are required */
-
-    /*
-     * Fields above should be used for bitmaps, compatible with Windows NT 3.51
-     * and earlier. Windows 98/Me, Windows 2000/XP introduces additional fields:
-     */
-
-    int32      iRedMask;       /* Colour mask that specifies the red component
-                                * of each pixel, valid only if iCompression
-                                * is set to BI_BITFIELDS. */
-    int32      iGreenMask;     /* The same for green component */
-    int32      iBlueMask;      /* The same for blue component */
-    int32      iAlphaMask;     /* Colour mask that specifies the alpha
-                                * component of each pixel. */
-    uint32     iCSType;        /* Colour space of the DIB. */
-    BMPCIEXYZTriple sEndpoints; /* This member is ignored unless the iCSType
-                                * member specifies BMPLT_CALIBRATED_RGB. */
-    int32      iGammaRed;      /* Toned response curve for red. This member
-                                * is ignored unless color values are
-                                * calibrated RGB values and iCSType is set to
-                                * BMPLT_CALIBRATED_RGB. Specified
-                                * in 16^16 format. */
-    int32      iGammaGreen;    /* Toned response curve for green. */
-    int32      iGammaBlue;     /* Toned response curve for blue. */
-} BMPInfoHeader;
-
-/*
- * Info header size in bytes:
- */
-const unsigned int  BIH_WIN4SIZE = 40; /* for BMPT_WIN4 */
-const unsigned int  BIH_WIN5SIZE = 57; /* for BMPT_WIN5 */
-const unsigned int  BIH_OS21SIZE = 12; /* for BMPT_OS21 */
-const unsigned int  BIH_OS22SIZE = 64; /* for BMPT_OS22 */
-
-/*
- * We will use plain byte array instead of this structure, but declaration
- * provided for reference
- */
-typedef struct
-{
-    char       bBlue;
-    char       bGreen;
-    char       bRed;
-    char       bReserved;      /* Must be 0 */
-} BMPColorEntry;
-
-static uint16 compression = (uint16) -1;
-static int jpegcolormode = JPEGCOLORMODE_RGB;
-static int quality = 75;               /* JPEG quality */
-static uint16 predictor = 0;
-
-static void usage(void);
-static int processCompressOptions(char*);
-static void rearrangePixels(char *, uint32, uint32);
-
-int
-main(int argc, char* argv[])
-{
-       uint32  width, length;
-       uint16  nbands = 1;             /* number of bands in input image */
-        uint16 depth = 8;              /* bits per pixel in input image */
-       uint32  rowsperstrip = (uint32) -1;
-        uint16 photometric = PHOTOMETRIC_MINISBLACK;
-       int     fd = 0;
-       _TIFF_stat_s instat;
-       char    *outfilename = NULL, *infilename = NULL;
-       TIFF    *out = NULL;
-
-       BMPFileHeader file_hdr;
-        BMPInfoHeader info_hdr;
-        int     bmp_type;
-        uint32  clr_tbl_size, n_clr_elems = 3;
-        unsigned char *clr_tbl;
-       unsigned short *red_tbl = NULL, *green_tbl = NULL, *blue_tbl = NULL;
-       uint32  row, clr;
-
-       int     c;
-#if !HAVE_DECL_OPTARG
-       extern int optind;
-       extern char* optarg;
-#endif
-
-       while ((c = getopt(argc, argv, "c:r:o:h")) != -1) {
-               switch (c) {
-               case 'c':               /* compression scheme */
-                       if (!processCompressOptions(optarg))
-                               usage();
-                       break;
-               case 'r':               /* rows/strip */
-                       rowsperstrip = atoi(optarg);
-                       break;
-               case 'o':
-                       outfilename = optarg;
-                       break;
-               case 'h':
-                       usage();
-               default:
-                       break;
-               }
-       }
-
-       if (argc - optind < 2)
-               usage();
-
-       if (outfilename == NULL)
-               outfilename = argv[argc-1];
-       out = TIFFOpen(outfilename, "w");
-       if (out == NULL) {
-               TIFFError(infilename, "Cannot open file %s for output",
-                         outfilename);
-               goto bad3;
-       }
-       
-
-       while (optind < argc-1) {
-               infilename = argv[optind];
-               optind++;
-           
-               fd = open(infilename, O_RDONLY|O_BINARY, 0);
-               if (fd < 0) {
-                       TIFFError(infilename, "Cannot open input file");
-                       return -1;
-               }
-
-               if (read(fd, file_hdr.bType, 2) != 2) {
-                        TIFFError(infilename, "Failed to read from file (%s)",
-                                  strerror(errno));
-                       goto bad;
-                }
-               if(file_hdr.bType[0] != 'B' || file_hdr.bType[1] != 'M') {
-                       TIFFError(infilename, "File is not BMP");
-                       goto bad;
-               }
-
-                /* -------------------------------------------------------------------- */
-                /*      Read the BMPFileHeader. We need iOffBits value only             */
-                /* -------------------------------------------------------------------- */
-                if (_TIFF_lseek_f(fd, 10, SEEK_SET) == (_TIFF_off_t)-1) {
-                        TIFFError(infilename, "Failed to seek to offset");
-                        goto bad;
-                }
-                if (read(fd, &file_hdr.iOffBits, 4) != 4) {
-                        TIFFError(infilename, "Failed to read from file (%s)",
-                                  strerror(errno));
-                       goto bad;
-                }
-#ifdef WORDS_BIGENDIAN
-               TIFFSwabLong(&file_hdr.iOffBits);
-#endif
-               if (_TIFF_fstat_f(fd, &instat) == -1) {
-                        TIFFError(infilename, "Failed obtain file information");
-                        goto bad;
-                }
-               file_hdr.iSize = instat.st_size;
-
-                /* -------------------------------------------------------------------- */
-                /*      Read the BMPInfoHeader.                                         */
-                /* -------------------------------------------------------------------- */
-
-               if (_TIFF_lseek_f(fd, BFH_SIZE, SEEK_SET) == (_TIFF_off_t)-1) {
-                        TIFFError(infilename, "Failed to seek to offset");
-                        goto bad;
-                }
-                if (read(fd, &info_hdr.iSize, 4) != 4) {
-                        TIFFError(infilename, "Failed to read from file (%s)",
-                                  strerror(errno));
-                       goto bad;
-                }
-#ifdef WORDS_BIGENDIAN
-               TIFFSwabLong(&info_hdr.iSize);
-#endif
-
-               if (info_hdr.iSize == BIH_WIN4SIZE)
-                       bmp_type = BMPT_WIN4;
-               else if (info_hdr.iSize == BIH_OS21SIZE)
-                       bmp_type = BMPT_OS21;
-               else if (info_hdr.iSize == BIH_OS22SIZE
-                        || info_hdr.iSize == 16)
-                       bmp_type = BMPT_OS22;
-               else
-                       bmp_type = BMPT_WIN5;
-
-               if (bmp_type == BMPT_WIN4
-                   || bmp_type == BMPT_WIN5
-                   || bmp_type == BMPT_OS22) {
-                       if ((read(fd, &info_hdr.iWidth, 4) != 4) ||
-                            (read(fd, &info_hdr.iHeight, 4) != 4) ||
-                            (read(fd, &info_hdr.iPlanes, 2) != 2) ||
-                            (read(fd, &info_hdr.iBitCount, 2) != 2) ||
-                            (read(fd, &info_hdr.iCompression, 4) != 4) ||
-                            (read(fd, &info_hdr.iSizeImage, 4) != 4) ||
-                            (read(fd, &info_hdr.iXPelsPerMeter, 4) != 4) ||
-                            (read(fd, &info_hdr.iYPelsPerMeter, 4) != 4) ||
-                            (read(fd, &info_hdr.iClrUsed, 4) != 4) ||
-                            (read(fd, &info_hdr.iClrImportant, 4) != 4)) {
-                                TIFFError(infilename, "Failed to read from file (%s)",
-                                          strerror(errno));
-                                goto bad;
-                        }
-#ifdef WORDS_BIGENDIAN
-                       TIFFSwabLong((uint32*) &info_hdr.iWidth);
-                       TIFFSwabLong((uint32*) &info_hdr.iHeight);
-                       TIFFSwabShort((uint16*) &info_hdr.iPlanes);
-                       TIFFSwabShort((uint16*) &info_hdr.iBitCount);
-                       TIFFSwabLong((uint32*) &info_hdr.iCompression);
-                       TIFFSwabLong((uint32*) &info_hdr.iSizeImage);
-                       TIFFSwabLong((uint32*) &info_hdr.iXPelsPerMeter);
-                       TIFFSwabLong((uint32*) &info_hdr.iYPelsPerMeter);
-                       TIFFSwabLong((uint32*) &info_hdr.iClrUsed);
-                       TIFFSwabLong((uint32*) &info_hdr.iClrImportant);
-#endif
-                       n_clr_elems = 4;
-               }
-
-               if (bmp_type == BMPT_OS22) {
-                       /* 
-                        * FIXME: different info in different documents
-                        * regarding this!
-                        */
-                        n_clr_elems = 3;
-               }
-
-               if (bmp_type == BMPT_OS21) {
-                       int16  iShort;
-
-                       if ( read(fd, &iShort, 2) != 2 ) {
-                                TIFFError(infilename, "Failed to read from file (%s)",
-                                          strerror(errno));
-                                goto bad;
-                        }
-#ifdef WORDS_BIGENDIAN
-                       TIFFSwabShort((uint16*) &iShort);
-#endif
-                       info_hdr.iWidth = iShort;
-                       if ( read(fd, &iShort, 2) != 2 ) {
-                                TIFFError(infilename, "Failed to read from file (%s)",
-                                          strerror(errno));
-                                goto bad;
-                        }
-#ifdef WORDS_BIGENDIAN
-                       TIFFSwabShort((uint16*) &iShort);
-#endif
-                       info_hdr.iHeight = iShort;
-                       if (read(fd, &iShort, 2) != 2 ) {
-                                TIFFError(infilename, "Failed to read from file (%s)",
-                                          strerror(errno));
-                                goto bad;
-                        }
-#ifdef WORDS_BIGENDIAN
-                       TIFFSwabShort((uint16*) &iShort);
-#endif
-                       info_hdr.iPlanes = iShort;
-                       if ( read(fd, &iShort, 2) != 2 ) {
-                                TIFFError(infilename, "Failed to read from file (%s)",
-                                          strerror(errno));
-                                goto bad;
-                        }
-#ifdef WORDS_BIGENDIAN
-                       TIFFSwabShort((uint16*) &iShort);
-#endif
-                       info_hdr.iBitCount = iShort;
-                       info_hdr.iCompression = BMPC_RGB;
-                       n_clr_elems = 3;
-               }
-
-               if (info_hdr.iBitCount != 1  && info_hdr.iBitCount != 4  &&
-                   info_hdr.iBitCount != 8  && info_hdr.iBitCount != 16 &&
-                   info_hdr.iBitCount != 24 && info_hdr.iBitCount != 32) {
-                        TIFFError(infilename,
-                                  "Cannot process BMP file with bit count %d",
-                                  info_hdr.iBitCount);
-                        close(fd);
-                        return 0;
-               }
-
-               width = info_hdr.iWidth;
-               length = (info_hdr.iHeight > 0) ? info_hdr.iHeight : -info_hdr.iHeight;
-                if( width <= 0 || length <= 0 )
-                        {
-                                TIFFError(infilename,
-                                          "Invalid dimensions of BMP file" );
-                                close(fd);
-                                return -1;
-                        }
-
-               switch (info_hdr.iBitCount)
-                        {
-                       case 1:
-                       case 4:
-                       case 8:
-                               nbands = 1;
-                               depth = info_hdr.iBitCount;
-                               photometric = PHOTOMETRIC_PALETTE;
-                               /* Allocate memory for colour table and read it. */
-                               if (info_hdr.iClrUsed)
-                                        clr_tbl_size =
-                                                ((uint32)(1<<depth)<info_hdr.iClrUsed)
-                                                ? (uint32) (1 << depth)
-                                                : info_hdr.iClrUsed;
-                               else
-                                        clr_tbl_size = 1 << depth;
-                               clr_tbl = (unsigned char *)
-                                       _TIFFmalloc(n_clr_elems * clr_tbl_size);
-                               if (!clr_tbl) {
-                                       TIFFError(infilename,
-                                                  "Can't allocate space for color table");
-                                       goto bad;
-                               }
-
-                               if (_TIFF_lseek_f(fd, BFH_SIZE + info_hdr.iSize, SEEK_SET) == (_TIFF_off_t)-1) {
-                                        TIFFError(infilename, "Failed to seek to offset");
-                                        goto bad;
-                                }
-                               if ( read(fd, clr_tbl, n_clr_elems * clr_tbl_size)
-                                     != (long) (n_clr_elems * clr_tbl_size) ) {
-                                        TIFFError(infilename, "Failed to read from file (%s)",
-                                                  strerror(errno));
-                                        goto bad;
-                                }
-
-                               red_tbl = (unsigned short*)
-                                       _TIFFmalloc(((tmsize_t)1)<<depth * sizeof(unsigned short));
-                               if (!red_tbl) {
-                                       TIFFError(infilename,
-                                                  "Can't allocate space for red component table");
-                                       _TIFFfree(clr_tbl);
-                                       goto bad1;
-                               }
-                               green_tbl = (unsigned short*)
-                                       _TIFFmalloc(((tmsize_t)1)<<depth * sizeof(unsigned short));
-                               if (!green_tbl) {
-                                       TIFFError(infilename,
-                                                  "Can't allocate space for green component table");
-                                       _TIFFfree(clr_tbl);
-                                       goto bad2;
-                               }
-                               blue_tbl = (unsigned short*)
-                                       _TIFFmalloc(((tmsize_t)1)<<depth * sizeof(unsigned short));
-                               if (!blue_tbl) {
-                                       TIFFError(infilename,
-                                                  "Can't allocate space for blue component table");
-                                       _TIFFfree(clr_tbl);
-                                       goto bad3;
-                               }
-
-                               for(clr = 0; clr < clr_tbl_size; clr++) {
-                                        red_tbl[clr] = 257*clr_tbl[clr*n_clr_elems+2];
-                                        green_tbl[clr] = 257*clr_tbl[clr*n_clr_elems+1];
-                                        blue_tbl[clr] = 257*clr_tbl[clr*n_clr_elems];
-                               }
-
-                               _TIFFfree(clr_tbl);
-                               break;
-                       case 16:
-                       case 24:
-                               nbands = 3;
-                               depth = info_hdr.iBitCount / nbands;
-                               photometric = PHOTOMETRIC_RGB;
-                               break;
-                       case 32:
-                               nbands = 3;
-                               depth = 8;
-                               photometric = PHOTOMETRIC_RGB;
-                               break;
-                       default:
-                               break;
-                        }
-
-                /* -------------------------------------------------------------------- */
-                /*  Create output file.                                                 */
-                /* -------------------------------------------------------------------- */
-
-               TIFFSetField(out, TIFFTAG_IMAGEWIDTH, width);
-               TIFFSetField(out, TIFFTAG_IMAGELENGTH, length);
-               TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
-               TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, nbands);
-               TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, depth);
-               TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
-               TIFFSetField(out, TIFFTAG_PHOTOMETRIC, photometric);
-               TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,
-                            TIFFDefaultStripSize(out, rowsperstrip));
-               
-               if (red_tbl && green_tbl && blue_tbl) {
-                       TIFFSetField(out, TIFFTAG_COLORMAP,
-                                    red_tbl, green_tbl, blue_tbl);
-               }
-               
-               if (compression == (uint16) -1)
-                       compression = COMPRESSION_PACKBITS;
-               TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
-               switch (compression) {
-               case COMPRESSION_JPEG:
-                       if (photometric == PHOTOMETRIC_RGB
-                           && jpegcolormode == JPEGCOLORMODE_RGB)
-                               photometric = PHOTOMETRIC_YCBCR;
-                       TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality);
-                       TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode);
-                       break;
-               case COMPRESSION_LZW:
-               case COMPRESSION_DEFLATE:
-                       if (predictor != 0)
-                               TIFFSetField(out, TIFFTAG_PREDICTOR, predictor);
-                       break;
-               }
-
-                /* -------------------------------------------------------------------- */
-                /*  Read uncompressed image data.                                       */
-                /* -------------------------------------------------------------------- */
-
-               if (info_hdr.iCompression == BMPC_RGB) {
-                       uint32 offset, size;
-                       char *scanbuf;
-
-                       /* XXX: Avoid integer overflow. We can calculate size
-                        * in one step using
-                        *
-                        *  size = ((width * info_hdr.iBitCount + 31) & ~31) / 8
-                        *
-                        * formulae, but we should check for overflow
-                        * conditions during calculation.
-                        */
-                       size = width * info_hdr.iBitCount + 31;
-                       if (!width || !info_hdr.iBitCount
-                           || (size - 31) / info_hdr.iBitCount != width ) {
-                               TIFFError(infilename,
-                                         "Wrong image parameters; can't "
-                                         "allocate space for scanline buffer");
-                               goto bad3;
-                       }
-                       size = (size & ~31) / 8;
-
-                       scanbuf = (char *) _TIFFmalloc(size);
-                       if (!scanbuf) {
-                               TIFFError(infilename,
-                                          "Can't allocate space for scanline buffer");
-                               goto bad3;
-                       }
-
-                       for (row = 0; row < length; row++) {
-                               if (info_hdr.iHeight > 0)
-                                       offset = file_hdr.iOffBits+(length-row-1)*size;
-                               else
-                                       offset = file_hdr.iOffBits + row * size;
-                               if (_TIFF_lseek_f(fd, offset, SEEK_SET) == (_TIFF_off_t)-1) {
-                                       TIFFError(infilename,
-                                                 "scanline %lu: Seek error",
-                                                 (unsigned long) row);
-                                       break;
-                               }
-
-                               if (read(fd, scanbuf, size) != (long) size) {
-                                       TIFFError(infilename,
-                                                 "scanline %lu: Read error",
-                                                 (unsigned long) row);
-                                       break;
-                               }
-
-                               rearrangePixels(scanbuf, width, info_hdr.iBitCount);
-
-                               if (TIFFWriteScanline(out, scanbuf, row, 0)<0) {
-                                       TIFFError(infilename,
-                                                 "scanline %lu: Write error",
-                                                 (unsigned long) row);
-                                       break;
-                               }
-                       }
-
-                       _TIFFfree(scanbuf);
-
-                        /* -------------------------------------------------------------------- */
-                        /*  Read compressed image data.                                         */
-                        /* -------------------------------------------------------------------- */
-
-               } else if ( info_hdr.iCompression == BMPC_RLE8
-                           || info_hdr.iCompression == BMPC_RLE4 ) {
-                       uint32          i, j, k, runlength;
-                       uint32          compr_size, uncompr_size;
-                       unsigned char   *comprbuf;
-                       unsigned char   *uncomprbuf;
-
-                       compr_size = file_hdr.iSize - file_hdr.iOffBits;
-                       uncompr_size = width * length;
-                        /* Detect int overflow */
-                        if( uncompr_size / width != length ) {
-                                TIFFError(infilename,
-                                          "Invalid dimensions of BMP file" );
-                                close(fd);
-                                return -1;
-                        }
-                        if ( (compr_size == 0) ||
-                             (compr_size > ((uint32) ~0) >> 1) ||
-                             (uncompr_size == 0) ||
-                             (uncompr_size > ((uint32) ~0) >> 1) ) {
-                                TIFFError(infilename,
-                                          "Invalid dimensions of BMP file" );
-                                close(fd);
-                                return -1;  
-                        }
-                       comprbuf = (unsigned char *) _TIFFmalloc( compr_size );
-                       if (!comprbuf) {
-                               TIFFError(infilename,
-                                          "Can't allocate space for compressed scanline buffer");
-                               goto bad3;
-                       }
-                       uncomprbuf = (unsigned char *)_TIFFmalloc(uncompr_size);
-                       if (!uncomprbuf) {
-                               TIFFError(infilename,
-                                          "Can't allocate space for uncompressed scanline buffer");
-                               goto bad3;
-                       }
-
-                       if (_TIFF_lseek_f(fd, file_hdr.iOffBits, SEEK_SET) == (_TIFF_off_t)-1) {
-                                TIFFError(infilename, "Failed to seek to offset");
-                                goto bad3;
-                        }
-                       if ( read(fd, comprbuf, compr_size) != (long) compr_size ) {
-                                TIFFError(infilename, "Failed to read from file (%s)",
-                                          strerror(errno));
-                                goto bad;
-                        }
-                       i = 0;
-                       j = 0;
-                       if (info_hdr.iBitCount == 8) {          /* RLE8 */
-                                while(j < uncompr_size && i < compr_size) {
-                                        if ( comprbuf[i] ) {
-                                                runlength = comprbuf[i++];
-                                                while( runlength > 0
-                                                       && j < uncompr_size
-                                                       && i < compr_size ) {
-                                                        uncomprbuf[j++] = comprbuf[i];
-                                                        runlength--;
-                                                }
-                                                i++;
-                                        } else {
-                                                i++;
-                                                if (comprbuf[i] == 0) /* Next scanline */
-                                                        i++;
-                                                else if (comprbuf[i] == 1) /* End of image */
-                                                        break;
-                                                else if (comprbuf[i] == 2) { /* Move to... */
-                                                        i++;
-                                                        if (i < compr_size - 1) {
-                                                                j+=comprbuf[i]+comprbuf[i+1]*width;
-                                                                i += 2;
-                                                        }
-                                                        else
-                                                                break;
-                                                } else {            /* Absolute mode */
-                                                        runlength = comprbuf[i++];
-                                                        for (k = 0; k < runlength && j < uncompr_size && i < compr_size; k++)
-                                                                uncomprbuf[j++] = comprbuf[i++];
-                                                        if ( k & 0x01 )
-                                                                i++;
-                                                }
-                                        }
-                                }
-                       }
-                       else {                              /* RLE4 */
-                                while( j < uncompr_size && i < compr_size ) {
-                                        if ( comprbuf[i] ) {
-                                                runlength = comprbuf[i++];
-                                                while( runlength > 0 && j < uncompr_size && i < compr_size ) {
-                                                        if ( runlength & 0x01 )
-                                                                uncomprbuf[j++] = (comprbuf[i] & 0xF0) >> 4;
-                                                        else
-                                                                uncomprbuf[j++] = comprbuf[i] & 0x0F;
-                                                        runlength--;
-                                                }
-                                                i++;
-                                        } else {
-                                                i++;
-                                                if (comprbuf[i] == 0) /* Next scanline */
-                                                        i++;
-                                                else if (comprbuf[i] == 1) /* End of image */
-                                                        break;
-                                                else if (comprbuf[i] == 2) { /* Move to... */
-                                                        i++;
-                                                        if (i < compr_size - 1) {
-                                                                j+=comprbuf[i]+comprbuf[i+1]*width;
-                                                                i += 2;
-                                                        }
-                                                        else
-                                                                break;
-                                                } else {            /* Absolute mode */
-                                                        runlength = comprbuf[i++];
-                                                        for (k = 0; k < runlength && j < uncompr_size && i < compr_size; k++) {
-                                                                if (k & 0x01)
-                                                                        uncomprbuf[j++] = comprbuf[i++] & 0x0F;
-                                                                else
-                                                                        uncomprbuf[j++] = (comprbuf[i] & 0xF0) >> 4;
-                                                        }
-                                                        if (k & 0x01)
-                                                                i++;
-                                                }
-                                        }
-                                }
-                       }
-
-                       _TIFFfree(comprbuf);
-
-                       for (row = 0; row < length; row++) {
-                               if (TIFFWriteScanline(out,
-                                                      uncomprbuf + (length - row - 1) * width,
-                                                      row, 0) < 0) {
-                                       TIFFError(infilename,
-                                                  "scanline %lu: Write error.\n",
-                                                 (unsigned long) row);
-                               }
-                       }
-
-                       _TIFFfree(uncomprbuf);
-               }
-               TIFFWriteDirectory(out);
-               if (blue_tbl) {
-                        _TIFFfree(blue_tbl);
-                        blue_tbl=NULL;
-               }
-               if (green_tbl) {
-                        _TIFFfree(green_tbl);
-                        green_tbl=NULL;
-               }
-               if (red_tbl) {
-                        _TIFFfree(red_tbl);
-                        red_tbl=NULL;
-               }
-       }
-
- bad3:
-       if (blue_tbl)
-               _TIFFfree(blue_tbl);
- bad2:
-       if (green_tbl)
-               _TIFFfree(green_tbl);
- bad1:
-       if (red_tbl)
-               _TIFFfree(red_tbl);
- bad:
-        close(fd);
-
-       if (out)
-               TIFFClose(out);
-        return 0;
-}
-
-/*
- * Image data in BMP file stored in BGR (or ABGR) format. We should rearrange
- * pixels to RGB (RGBA) format.
- */
-static void
-rearrangePixels(char *buf, uint32 width, uint32 bit_count)
-{
-       char tmp;
-       uint32 i;
-
-        switch(bit_count) {
-               case 16:    /* FIXME: need a sample file */
-                        break;
-                case 24:
-                       for (i = 0; i < width; i++, buf += 3) {
-                               tmp = *buf;
-                               *buf = *(buf + 2);
-                               *(buf + 2) = tmp;
-                       }
-                        break;
-                case 32:
-                       {
-                               char    *buf1 = buf;
-
-                               for (i = 0; i < width; i++, buf += 4) {
-                                       tmp = *buf;
-                                       *buf1++ = *(buf + 2);
-                                       *buf1++ = *(buf + 1);
-                                       *buf1++ = tmp;
-                               }
-                       }
-                        break;
-                default:
-                        break;
-        }
-}
-
-static int
-processCompressOptions(char* opt)
-{
-       if (strcmp(opt, "none") == 0)
-               compression = COMPRESSION_NONE;
-       else if (strcmp(opt, "packbits") == 0)
-               compression = COMPRESSION_PACKBITS;
-       else if (strncmp(opt, "jpeg", 4) == 0) {
-               char* cp = strchr(opt, ':');
-
-                compression = COMPRESSION_JPEG;
-                while( cp )
-                {
-                    if (isdigit((int)cp[1]))
-                       quality = atoi(cp+1);
-                    else if (cp[1] == 'r' )
-                       jpegcolormode = JPEGCOLORMODE_RAW;
-                    else
-                        usage();
-
-                    cp = strchr(cp+1,':');
-                }
-       } else if (strncmp(opt, "lzw", 3) == 0) {
-               char* cp = strchr(opt, ':');
-               if (cp)
-                       predictor = atoi(cp+1);
-               compression = COMPRESSION_LZW;
-       } else if (strncmp(opt, "zip", 3) == 0) {
-               char* cp = strchr(opt, ':');
-               if (cp)
-                       predictor = atoi(cp+1);
-               compression = COMPRESSION_DEFLATE;
-       } else
-               return (0);
-       return (1);
-}
-
-static char* stuff[] = {
-"bmp2tiff --- convert Windows BMP files to TIFF",
-"usage: bmp2tiff [options] input.bmp [input2.bmp ...] output.tif",
-"where options are:",
-" -r #         make each strip have no more than # rows",
-"",
-" -c lzw[:opts]        compress output with Lempel-Ziv & Welch encoding",
-" -c zip[:opts]        compress output with deflate encoding",
-" -c jpeg[:opts]compress output with JPEG encoding",
-" -c packbits  compress output with packbits encoding",
-" -c none      use no compression algorithm on output",
-"",
-"JPEG options:",
-" #            set compression quality level (0-100, default 75)",
-" r            output color image as RGB rather than YCbCr",
-"For example, -c jpeg:r:50 to get JPEG-encoded RGB data with 50% comp. quality",
-"",
-"LZW and deflate options:",
-" #            set predictor value",
-"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
-" -o out.tif   write output to out.tif",
-" -h           this help message",
-NULL
-};
-
-static void
-usage(void)
-{
-       char buf[BUFSIZ];
-       int i;
-
-       setbuf(stderr, buf);
-        fprintf(stderr, "%s\n\n", TIFFGetVersion());
-       for (i = 0; stuff[i] != NULL; i++)
-               fprintf(stderr, "%s\n", stuff[i]);
-       exit(-1);
-}
-
-/* vim: set ts=8 sts=8 sw=8 noet: */
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 8
- * fill-column: 78
- * End:
- */
index 9bbcb63..e00de52 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: fax2tiff.c,v 1.24 2015-08-23 15:40:45 bfriesen Exp $ */
+/* $Id: fax2tiff.c,v 1.25 2016-10-25 22:22:45 erouault Exp $ */
 
 /*
  * Copyright (c) 1990-1997 Sam Leffler
@@ -116,7 +116,7 @@ main(int argc, char* argv[])
        extern char* optarg;
 #endif
 
-       while ((c = getopt(argc, argv, "R:X:o:1234ABLMPUW5678abcflmprsuvwz?")) != -1)
+       while ((c = getopt(argc, argv, "R:X:o:r:1234ABLMPUW5678abcflmprsuvwz?")) != -1)
                switch (c) {
                        /* input-related options */
                case '3':               /* input is g3-encoded */
diff --git a/tools/gif2tiff.c b/tools/gif2tiff.c
deleted file mode 100644 (file)
index 4c4f7bb..0000000
+++ /dev/null
@@ -1,591 +0,0 @@
-/* $Id: gif2tiff.c,v 1.18 2015-06-21 01:09:10 bfriesen Exp $ */
-
-/*
- * Copyright (c) 1990-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.
- */
-
-/*
- *     convert a GIF file into a TIFF file.
- *     based on Paul Haeberli's fromgif program which in turn is
- *     based on a GIF file reader by Marcel J.E. Mol March 23 1989 
- *
- *     if input is 320 by 200 pixel aspect is probably 1.2
- *     if input is 640 350 pixel aspect is probably 1.37
- *
- */
-#include "tif_config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <math.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
-#include "tiffio.h"
-
-#define        GIFGAMMA        (1.5)           /* smaller makes output img brighter */
-#define        IMAX            0xffff          /* max intensity value */
-#define EXTRAFUDGE     128             /* some people write BAD .gif files */
-
-#define        streq(a,b)      (strcmp(a,b) == 0)
-#define        strneq(a,b,n)   (strncmp(a,b,n) == 0)
-
-unsigned short gamtab[256];
-
-void
-makegamtab(float gam)
-{
-    int i;
-
-    for(i=0; i<256; i++) 
-       gamtab[i] = (unsigned short) (IMAX*pow(i/255.0,gam)+0.5);
-}
-
-char* stuff[] = {
-"usage: gif2tiff [options] input.gif output.tif",
-"where options are:",
-" -r #         make each strip have no more than # rows",
-"",
-" -c lzw[:opts]        compress output with Lempel-Ziv & Welch encoding",
-" -c zip[:opts]        compress output with deflate encoding",
-" -c packbits  compress output with packbits encoding",
-" -c none      use no compression algorithm on output",
-"",
-"LZW and deflate options:",
-" #            set predictor value",
-"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
-NULL
-};
-
-static void
-usage(void)
-{
-       char buf[BUFSIZ];
-       int i;
-
-       setbuf(stderr, buf);
-        fprintf(stderr, "%s\n\n", TIFFGetVersion());
-       for (i = 0; stuff[i] != NULL; i++)
-               fprintf(stderr, "%s\n", stuff[i]);
-       exit(-1);
-}
-
-#define COLSIZE 256
-
-unsigned char *stackp;
-unsigned int prefix[4096];
-unsigned char suffix[4096];
-unsigned char stack[4096];
-int datasize,codesize,codemask;     /* Decoder working variables */
-int clear,eoi;                      /* Special code values */
-int avail, oldcode;
-
-FILE *infile;
-int global;                        /* Is there a global color map? */
-int globalbits;                     /* Number of bits of global colors */
-unsigned char globalmap[COLSIZE][3];/* RGB values for global color map */
-unsigned char *raster;              /* Decoded image data */
-unsigned long width, height;
-unsigned short red[COLSIZE];
-unsigned short green[COLSIZE];
-unsigned short blue[COLSIZE];
-char *filename, *imagename;
-
-static uint16 compression = COMPRESSION_PACKBITS;
-static uint16 predictor = 0;
-static uint32 rowsperstrip = (uint32) -1;
-static int processCompressOptions(char*);
-
-int    convert(void);
-int    checksignature(void);
-int    readscreen(void);
-int    readgifimage(char*);
-int    readextension(void);
-int    readraster(void);
-int    process(int, unsigned char**);
-void   initcolors(unsigned char [COLSIZE][3], int);
-void   rasterize(int, char*);
-
-int
-main(int argc, char* argv[])
-{
-#if !HAVE_DECL_OPTARG
-    extern int optind;
-    extern char *optarg;
-#endif
-
-    int c, status;
-
-    while ((c = getopt(argc, argv, "c:r:")) != -1)
-           switch (c) {
-           case 'c':           /* compression scheme */
-                   if (!processCompressOptions(optarg))
-                           usage();
-                   break;
-           case 'r':           /* rows/strip */
-                   rowsperstrip = atoi(optarg);
-                   break;
-           case '?':
-                   usage();
-                   /*NOTREACHED*/
-           }
-    if (argc - optind != 2)
-           usage();
-
-    makegamtab(GIFGAMMA);
-    filename = argv[optind];
-    imagename = argv[optind+1];
-    if ((infile = fopen(imagename, "rb")) != NULL) {
-       int c;
-       fclose(infile);
-       printf("overwrite %s? ", imagename); fflush(stdout);
-       c = getc(stdin);
-       if (c != 'y' && c != 'Y')
-           return (1);
-    }
-    if ((infile = fopen(filename, "rb")) == NULL) {
-       perror(filename);
-       return (1);
-    }
-    status = convert();
-    fclose(infile);
-    return (status);
-}
-
-static int
-processCompressOptions(char* opt)
-{
-       if (streq(opt, "none"))
-               compression = COMPRESSION_NONE;
-       else if (streq(opt, "packbits"))
-               compression = COMPRESSION_PACKBITS;
-       else if (strneq(opt, "lzw", 3)) {
-               char* cp = strchr(opt, ':');
-               if (cp)
-                       predictor = atoi(cp+1);
-               compression = COMPRESSION_LZW;
-       } else if (strneq(opt, "zip", 3)) {
-               char* cp = strchr(opt, ':');
-               if (cp)
-                       predictor = atoi(cp+1);
-               compression = COMPRESSION_DEFLATE;
-       } else
-               return (0);
-       return (1);
-}
-
-int
-convert(void)
-{
-    int ch;
-    char* mode = "w";
-
-    if (!checksignature())
-        return (-1);
-    if (!readscreen())
-        return (-1);
-    while ((ch = getc(infile)) != ';' && ch != EOF) {
-        switch (ch) {
-            case '\0':  break;  /* this kludge for non-standard files */
-            case ',':   if (!readgifimage(mode))
-                           return (-1);
-                       mode = "a";             /* subsequent images append */
-                        break;
-        case '!':   if (!readextension())
-                            return (-1);
-                        break;
-            default:    fprintf(stderr, "illegal GIF block type\n");
-                        return (-1);
-        }
-    }
-    return (0);
-}
-
-int
-checksignature(void)
-{
-    char buf[6];
-
-    if (fread(buf,1,6,infile) != 6) {
-        fprintf(stderr, "short read from file %s (%s)\n",
-                filename, strerror(errno));
-        return 0;
-    }
-    if (strncmp(buf,"GIF",3)) {
-        fprintf(stderr, "file is not a GIF file\n");
-        return 0;
-    }
-    if (strncmp(&buf[3],"87a",3)) {
-        fprintf(stderr, "unknown GIF version number\n");
-        return 0;
-    }
-    return 1;
-}
-
-/*
- *     readscreen - 
- *             Get information which is global to all the images stored 
- *     in the file
- */
-int
-readscreen(void)
-{
-    unsigned char buf[7];
-
-    if (fread(buf,1,7,infile) != 7) {
-        fprintf(stderr, "short read from file %s (%s)\n",
-                filename, strerror(errno));
-        return 0;
-    }
-    global = buf[4] & 0x80;
-    if (global) {
-        globalbits = (buf[4] & 0x07) + 1;
-        if (fread(globalmap,3,((size_t)1)<<globalbits,infile) !=
-            ((size_t)1)<<globalbits) {
-            fprintf(stderr, "short read from file %s (%s)\n",
-                    filename, strerror(errno));
-            return 0;
-        }
-    }
-    return 1;
-}
-
-int
-readgifimage(char* mode)
-{
-    unsigned char buf[9];
-    int local, interleaved;
-    unsigned char localmap[256][3];
-    int localbits;
-    int status;
-    size_t raster_size;
-
-    if (fread(buf, 1, 9, infile) != 9) {
-        fprintf(stderr, "short read from file %s (%s)\n",
-                filename, strerror(errno));
-       return (0);
-    }
-    width = (buf[4] + (buf[5] << 8)) & 0xffff; /* 16 bit */
-    height = (buf[6] + (buf[7] << 8)) & 0xffff;  /* 16 bit */
-    local = buf[8] & 0x80;
-    interleaved = buf[8] & 0x40;
-    if (width == 0UL || height == 0UL || (width > 2000000000UL / height)) {
-        fprintf(stderr, "Invalid value of width or height\n");
-        return(0);
-    }
-    if (local == 0 && global == 0) {
-        fprintf(stderr, "no colormap present for image\n");
-        return (0);
-    }
-    raster_size=width*height;
-    if ((raster_size/width) == height) {
-        raster_size += EXTRAFUDGE;  /* Add elbow room */
-    } else {
-        raster_size=0;
-    }
-    if ((raster = (unsigned char*) _TIFFmalloc(raster_size)) == NULL) {
-        fprintf(stderr, "not enough memory for image\n");
-        return (0);
-    }
-    if (local) {
-        localbits = (buf[8] & 0x7) + 1;
-
-        fprintf(stderr, "   local colors: %d\n", 1<<localbits);
-
-        if (fread(localmap, 3, ((size_t)1)<<localbits, infile) !=
-            ((size_t)1)<<localbits) {
-            fprintf(stderr, "short read from file %s (%s)\n",
-                    filename, strerror(errno));
-            return (0);
-        }
-        initcolors(localmap, 1<<localbits);
-    } else if (global) {
-        initcolors(globalmap, 1<<globalbits);
-    }
-    if ((status = readraster()))
-       rasterize(interleaved, mode);
-    _TIFFfree(raster);
-    return status;
-}
-
-/*
- *     readextension -
- *             Read a GIF extension block (and do nothing with it).
- *
- */
-int
-readextension(void)
-{
-    int count;
-    char buf[255];
-    int status = 1;
-
-    (void) getc(infile);
-    while ((count = getc(infile)) && count <= 255)
-        if (fread(buf, 1, count, infile) != (size_t) count) {
-            fprintf(stderr, "short read from file %s (%s)\n",
-                    filename, strerror(errno));
-            status = 0;
-            break;
-        }
-    return status;
-}
-
-/*
- *     readraster -
- *             Decode a raster image
- *
- */
-int
-readraster(void)
-{
-    unsigned char *fill = raster;
-    unsigned char buf[255];
-    register int bits=0;
-    register unsigned long datum=0;
-    register unsigned char *ch;
-    register int count, code;
-    int status = 1;
-
-    datasize = getc(infile);
-    if (datasize > 12)
-       return 0;
-    clear = 1 << datasize;
-    eoi = clear + 1;
-    avail = clear + 2;
-    oldcode = -1;
-    codesize = datasize + 1;
-    codemask = (1 << codesize) - 1;
-    for (code = 0; code < clear; code++) {
-       prefix[code] = 0;
-       suffix[code] = code;
-    }
-    stackp = stack;
-    for (count = getc(infile); count > 0 && count <= 255; count = getc(infile)) {
-       if (fread(buf,1,count,infile) != (size_t)count) {
-            fprintf(stderr, "short read from file %s (%s)\n",
-                    filename, strerror(errno));
-            return 0;
-        }
-       for (ch=buf; count-- > 0; ch++) {
-           datum += (unsigned long) *ch << bits;
-           bits += 8;
-           while (bits >= codesize) {
-               code = datum & codemask;
-               datum >>= codesize;
-               bits -= codesize;
-               if (code == eoi) {               /* This kludge put in */
-                   goto exitloop;               /* because some GIF files*/
-               }                                /* aren't standard */
-               if (!process(code, &fill)) {
-                   status = 0;
-                   goto exitloop;
-               }
-           }
-       }
-       if (fill >= raster + width*height) {
-           fprintf(stderr, "raster full before eoi code\n");
-           break;
-       }
-    }
-exitloop:
-    if (fill != raster + width*height)  {
-       fprintf(stderr, "warning: wrong rastersize: %ld bytes\n",
-                                                     (long) (fill-raster));
-       fprintf(stderr, "         instead of %ld bytes\n",
-                                                     (long) width*height);
-    }
-    return status;
-}
-
-/*
- *     process - 
- *             Process a compression code.  "clear" resets the code table.  
- *     Otherwise make a new code table entry, and output the bytes 
- *     associated with the code.
- */
-int
-process(register int code, unsigned char** fill)
-{
-    int incode;
-    static unsigned char firstchar;
-
-    if (code == clear) {
-       codesize = datasize + 1;
-       codemask = (1 << codesize) - 1;
-       avail = clear + 2;
-       oldcode = -1;
-       return 1;
-    }
-
-    if (oldcode == -1) {
-        if (code >= clear) {
-            fprintf(stderr, "bad input: code=%d is larger than clear=%d\n",code, clear);
-            return 0;
-        }
-        if (*fill >= raster + width*height) {
-            fprintf(stderr, "raster full before eoi code\n");
-            return 0;
-        }
-       *(*fill)++ = suffix[code];
-       firstchar = oldcode = code;
-       return 1;
-    }
-    if (code > avail) {
-       fprintf(stderr, "code %d too large for %d\n", code, avail);
-       return 0; 
-    }
-
-    incode = code;
-    if (code == avail) {      /* the first code is always < avail */
-       *stackp++ = firstchar;
-       code = oldcode;
-    }
-    while (code > clear) {
-       *stackp++ = suffix[code];
-       code = prefix[code];
-    }
-
-    *stackp++ = firstchar = suffix[code];
-    prefix[avail] = oldcode;
-    suffix[avail] = firstchar;
-    avail++;
-
-    if (((avail & codemask) == 0) && (avail < 4096)) {
-       codesize++;
-       codemask += avail;
-    }
-    oldcode = incode;
-    do {
-        if (*fill >= raster + width*height) {
-            fprintf(stderr, "raster full before eoi code\n");
-            return 0;
-        }
-       *(*fill)++ = *--stackp;
-    } while (stackp > stack);
-    return 1;
-}
-
-/*
- *     initcolors -
- *             Convert a color map (local or global) to arrays with R, G and B
- *     values. 
- *
- */
-void
-initcolors(unsigned char colormap[COLSIZE][3], int ncolors)
-{
-    register int i;
-
-    for (i = 0; i < ncolors; i++) {
-        red[i]   = gamtab[colormap[i][0]];
-        green[i] = gamtab[colormap[i][1]];
-        blue[i]  = gamtab[colormap[i][2]];
-    }
-}
-
-void
-rasterize(int interleaved, char* mode)
-{
-    register unsigned long row;
-    unsigned char *newras;
-    unsigned char *ras;
-    TIFF *tif;
-    tstrip_t strip;
-    tsize_t stripsize;
-
-    if ((newras = (unsigned char*) _TIFFmalloc(width*height+EXTRAFUDGE)) == NULL) {
-        fprintf(stderr, "not enough memory for image\n");
-        return;
-    }
-#define DRAWSEGMENT(offset, step) {                    \
-        for (row = offset; row < height; row += step) {        \
-            _TIFFmemcpy(newras + row*width, ras, width);\
-            ras += width;                              \
-        }                                              \
-    }
-    ras = raster;
-    if (interleaved) {
-        DRAWSEGMENT(0, 8);
-        DRAWSEGMENT(4, 8);
-        DRAWSEGMENT(2, 4);
-        DRAWSEGMENT(1, 2);
-    } else 
-        DRAWSEGMENT(0, 1);
-#undef DRAWSEGMENT
-
-    tif = TIFFOpen(imagename, mode);
-    if (!tif) {
-       TIFFError(imagename,"Can not open output image");
-       exit(-1);
-    }
-    TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, (uint32) width);
-    TIFFSetField(tif, TIFFTAG_IMAGELENGTH, (uint32) height);
-    TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_PALETTE);
-    TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
-    TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1);
-    TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
-    TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, 
-       rowsperstrip = TIFFDefaultStripSize(tif, rowsperstrip));
-    TIFFSetField(tif, TIFFTAG_COMPRESSION, compression);
-    switch (compression) {
-    case COMPRESSION_LZW:
-    case COMPRESSION_DEFLATE:
-           if (predictor != 0)
-                   TIFFSetField(tif, TIFFTAG_PREDICTOR, predictor);
-           break;
-    }
-    TIFFSetField(tif, TIFFTAG_COLORMAP, red, green, blue);
-    TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
-    strip = 0;
-    stripsize = TIFFStripSize(tif);
-    for (row=0; row<height; row += rowsperstrip) {
-       if (rowsperstrip > height-row) {
-           rowsperstrip = height-row;
-           stripsize = TIFFVStripSize(tif, rowsperstrip);
-       }
-       if (TIFFWriteEncodedStrip(tif, strip, newras+row*width, stripsize) < 0)
-           break;
-       strip++;
-    }
-    TIFFClose(tif);
-
-    _TIFFfree(newras);
-}
-
-/* vim: set ts=8 sts=8 sw=8 noet: */
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 4
- * fill-column: 78
- * End:
- */
diff --git a/tools/ras2tiff.c b/tools/ras2tiff.c
deleted file mode 100644 (file)
index a8fa0df..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-/* $Id: ras2tiff.c,v 1.22 2015-06-21 01:09:10 bfriesen 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.
- */
-
-#include "tif_config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <limits.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
-#include "rasterfile.h"
-#include "tiffio.h"
-
-#ifndef howmany
-#define        howmany(x, y)   (((x)+((y)-1))/(y))
-#endif
-#define        streq(a,b)      (strcmp(a,b) == 0)
-#define        strneq(a,b,n)   (strncmp(a,b,n) == 0)
-
-static uint16 compression = (uint16) -1;
-static int jpegcolormode = JPEGCOLORMODE_RGB;
-static int quality = 75;               /* JPEG quality */
-static uint16 predictor = 0;
-
-static void usage(void);
-static int processCompressOptions(char*);
-
-int
-main(int argc, char* argv[])
-{
-       unsigned char* buf;
-       long row;
-       tsize_t linebytes, scanline;
-       TIFF *out;
-       FILE *in;
-       struct rasterfile h;
-       uint16 photometric;
-       uint16 config = PLANARCONFIG_CONTIG;
-       uint32 rowsperstrip = (uint32) -1;
-       int c;
-#if !HAVE_DECL_OPTARG
-       extern int optind;
-       extern char* optarg;
-#endif
-
-       while ((c = getopt(argc, argv, "c:r:h")) != -1)
-               switch (c) {
-               case 'c':               /* compression scheme */
-                       if (!processCompressOptions(optarg))
-                               usage();
-                       break;
-               case 'r':               /* rows/strip */
-                       rowsperstrip = atoi(optarg);
-                       break;
-               case 'h':
-                       usage();
-                       /*NOTREACHED*/
-               }
-       if (argc - optind != 2)
-               usage();
-       in = fopen(argv[optind], "rb");
-       if (in == NULL) {
-               fprintf(stderr, "%s: Can not open.\n", argv[optind]);
-               return (-1);
-       }
-       if (fread(&h, sizeof (h), 1, in) != 1) {
-               fprintf(stderr, "%s: Can not read header.\n", argv[optind]);
-               fclose(in);
-               return (-2);
-       }
-       if (strcmp(h.ras_magic, RAS_MAGIC) == 0) {
-#ifndef WORDS_BIGENDIAN
-                       TIFFSwabLong((uint32 *)&h.ras_width);
-                       TIFFSwabLong((uint32 *)&h.ras_height);
-                       TIFFSwabLong((uint32 *)&h.ras_depth);
-                       TIFFSwabLong((uint32 *)&h.ras_length);
-                       TIFFSwabLong((uint32 *)&h.ras_type);
-                       TIFFSwabLong((uint32 *)&h.ras_maptype);
-                       TIFFSwabLong((uint32 *)&h.ras_maplength);
-#endif
-       } else if (strcmp(h.ras_magic, RAS_MAGIC_INV) == 0) {
-#ifdef WORDS_BIGENDIAN
-                       TIFFSwabLong((uint32 *)&h.ras_width);
-                       TIFFSwabLong((uint32 *)&h.ras_height);
-                       TIFFSwabLong((uint32 *)&h.ras_depth);
-                       TIFFSwabLong((uint32 *)&h.ras_length);
-                       TIFFSwabLong((uint32 *)&h.ras_type);
-                       TIFFSwabLong((uint32 *)&h.ras_maptype);
-                       TIFFSwabLong((uint32 *)&h.ras_maplength);
-#endif
-       } else {
-               fprintf(stderr, "%s: Not a rasterfile.\n", argv[optind]);
-               fclose(in);
-               return (-3);
-       }
-        if ((h.ras_width <= 0) || (h.ras_width >= INT_MAX) ||
-            (h.ras_height <= 0) || (h.ras_height >= INT_MAX) ||
-            (h.ras_depth <= 0) || (h.ras_depth >= INT_MAX) ||
-            (h.ras_length <= 0) || (h.ras_length >= INT_MAX) ||
-            (h.ras_type <= 0) ||
-            (h.ras_maptype <= 0) ||
-            (h.ras_maplength <= 0) || (h.ras_maplength >= INT_MAX)) {
-                fprintf(stderr, "%s: Improper image header.\n", argv[optind]);
-                fclose(in);
-               return (-2);
-        }
-        if ((h.ras_depth != 1) &&
-            (h.ras_depth != 8) &&
-            (h.ras_depth != 24)) {
-                fprintf(stderr, "%s: Improper image depth (%d).\n",
-                        argv[optind], h.ras_depth);
-                fclose(in);
-               return (-2);
-        }
-       out = TIFFOpen(argv[optind+1], "w");
-       if (out == NULL)
-       {
-               fclose(in);
-               return (-4);
-       }
-       TIFFSetField(out, TIFFTAG_IMAGEWIDTH, (uint32) h.ras_width);
-       TIFFSetField(out, TIFFTAG_IMAGELENGTH, (uint32) h.ras_height);
-       TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
-       TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, h.ras_depth > 8 ? 3 : 1);
-       TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, h.ras_depth > 1 ? 8 : 1);
-       TIFFSetField(out, TIFFTAG_PLANARCONFIG, config);
-       if (h.ras_maptype != RMT_NONE) {
-               uint16* red;
-               register uint16* map;
-               register int i, j;
-               int mapsize;
-
-               buf = (unsigned char *)_TIFFmalloc(h.ras_maplength);
-               if (buf == NULL) {
-                       fprintf(stderr, "No space to read in colormap.\n");
-                       return (-5);
-               }
-               if (fread(buf, h.ras_maplength, 1, in) != 1) {
-                       fprintf(stderr, "%s: Read error on colormap.\n",
-                           argv[optind]);
-                       return (-6);
-               }
-               mapsize = 1<<h.ras_depth; 
-               if (h.ras_maplength > mapsize*3) {
-                       fprintf(stderr,
-                           "%s: Huh, %d colormap entries, should be %d?\n",
-                           argv[optind], h.ras_maplength, mapsize*3);
-                       return (-7);
-               }
-               red = (uint16*)_TIFFmalloc(mapsize * 3 * sizeof (uint16));
-               if (red == NULL) {
-                       fprintf(stderr, "No space for colormap.\n");
-                       return (-8);
-               }
-               map = red;
-               for (j = 0; j < 3; j++) {
-#define        SCALE(x)        (((x)*((1L<<16)-1))/255)
-                       for (i = h.ras_maplength/3; i-- > 0;)
-                               *map++ = SCALE(*buf++);
-                       if ((i = h.ras_maplength/3) < mapsize) {
-                               i = mapsize - i;
-                               _TIFFmemset(map, 0, i*sizeof (uint16));
-                               map += i;
-                       }
-               }
-               TIFFSetField(out, TIFFTAG_COLORMAP,
-                    red, red + mapsize, red + 2*mapsize);
-               photometric = PHOTOMETRIC_PALETTE;
-               if (compression == (uint16) -1)
-                       compression = COMPRESSION_PACKBITS;
-               TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
-       } else {
-               /* XXX this is bogus... */
-               photometric = h.ras_depth == 24 ?
-                   PHOTOMETRIC_RGB : PHOTOMETRIC_MINISBLACK;
-               if (compression == (uint16) -1)
-                       compression = COMPRESSION_LZW;
-               TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
-       }
-       switch (compression) {
-       case COMPRESSION_JPEG:
-               if (photometric == PHOTOMETRIC_RGB && jpegcolormode == JPEGCOLORMODE_RGB)
-                       photometric = PHOTOMETRIC_YCBCR;
-               TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality);
-               TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode);
-               break;
-       case COMPRESSION_LZW:
-       case COMPRESSION_DEFLATE:
-               if (predictor != 0)
-                       TIFFSetField(out, TIFFTAG_PREDICTOR, predictor);
-               break;
-       }
-       TIFFSetField(out, TIFFTAG_PHOTOMETRIC, photometric);
-       linebytes = ((h.ras_depth*h.ras_width+15) >> 3) &~ 1;
-       scanline = TIFFScanlineSize(out);
-       if (scanline > linebytes) {
-               buf = (unsigned char *)_TIFFmalloc(scanline);
-               _TIFFmemset(buf+linebytes, 0, scanline-linebytes);
-       } else
-               buf = (unsigned char *)_TIFFmalloc(linebytes);
-       TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,
-           TIFFDefaultStripSize(out, rowsperstrip));
-       for (row = 0; row < h.ras_height; row++) {
-               if (fread(buf, linebytes, 1, in) != 1) {
-                       fprintf(stderr, "%s: scanline %ld: Read error.\n",
-                           argv[optind], row);
-                       break;
-               }
-               if (h.ras_type == RT_STANDARD && h.ras_depth == 24) {
-                       tsize_t cc = h.ras_width;
-                       unsigned char* cp = buf;
-#define        SWAP(a,b)       { unsigned char t = (a); (a) = (b); (b) = t; }
-                       do {
-                               SWAP(cp[0], cp[2]);
-                               cp += 3;
-                       } while (--cc);
-               }
-               if (TIFFWriteScanline(out, buf, row, 0) < 0)
-                       break;
-       }
-       (void) TIFFClose(out);
-       fclose(in);
-       return (0);
-}
-
-static int
-processCompressOptions(char* opt)
-{
-       if (streq(opt, "none"))
-               compression = COMPRESSION_NONE;
-       else if (streq(opt, "packbits"))
-               compression = COMPRESSION_PACKBITS;
-       else if (strneq(opt, "jpeg", 4)) {
-               char* cp = strchr(opt, ':');
-
-                compression = COMPRESSION_JPEG;
-                while( cp )
-                {
-                    if (isdigit((int)cp[1]))
-                       quality = atoi(cp+1);
-                    else if (cp[1] == 'r' )
-                       jpegcolormode = JPEGCOLORMODE_RAW;
-                    else
-                        usage();
-
-                    cp = strchr(cp+1,':');
-                }
-       } else if (strneq(opt, "lzw", 3)) {
-               char* cp = strchr(opt, ':');
-               if (cp)
-                       predictor = atoi(cp+1);
-               compression = COMPRESSION_LZW;
-       } else if (strneq(opt, "zip", 3)) {
-               char* cp = strchr(opt, ':');
-               if (cp)
-                       predictor = atoi(cp+1);
-               compression = COMPRESSION_DEFLATE;
-       } else
-               return (0);
-       return (1);
-}
-
-char* stuff[] = {
-"usage: ras2tiff [options] input.ras output.tif",
-"where options are:",
-" -r #         make each strip have no more than # rows",
-"",
-" -c lzw[:opts]        compress output with Lempel-Ziv & Welch encoding",
-" -c zip[:opts]        compress output with deflate encoding",
-" -c jpeg[:opts]       compress output with JPEG encoding",
-" -c packbits  compress output with packbits encoding",
-" -c none      use no compression algorithm on output",
-"",
-"JPEG options:",
-" #            set compression quality level (0-100, default 75)",
-" r            output color image as RGB rather than YCbCr",
-"For example, -c jpeg:r:50 to get JPEG-encoded RGB data with 50% comp. quality",
-"",
-"LZW and deflate options:",
-" #            set predictor value",
-"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
-" -h           this help message",
-NULL
-};
-
-static void
-usage(void)
-{
-       char buf[BUFSIZ];
-       int i;
-
-       setbuf(stderr, buf);
-        fprintf(stderr, "%s\n\n", TIFFGetVersion());
-       for (i = 0; stuff[i] != NULL; i++)
-               fprintf(stderr, "%s\n", stuff[i]);
-       exit(-1);
-}
-
-/* vim: set ts=8 sts=8 sw=8 noet: */
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 8
- * fill-column: 78
- * End:
- */
diff --git a/tools/rasterfile.h b/tools/rasterfile.h
deleted file mode 100644 (file)
index 6b5218b..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/tools/rasterfile.h,v 1.4 2015-05-28 03:30:42 bfriesen Exp $ */
-
-#include "tiff.h"
-
-/*
- * Description of header for files containing raster images
- */
-struct rasterfile {
-       char    ras_magic[4];           /* magic number */
-       int32   ras_width;              /* width (pixels) of image */
-       int32   ras_height;             /* height (pixels) of image */
-       int32   ras_depth;              /* depth (1, 8, or 24 bits) of pixel */
-       int32   ras_length;             /* length (bytes) of image */
-       int32   ras_type;               /* type of file; see RT_* below */
-       int32   ras_maptype;            /* type of colormap; see RMT_* below */
-       int32   ras_maplength;          /* length (bytes) of following map */
-       /* color map follows for ras_maplength bytes, followed by image */
-};
-#define        RAS_MAGIC       "\x59\xa6\x6a\x95"
-#define        RAS_MAGIC_INV   "\x95\x6a\xa6\x59"
-
-       /* Sun supported ras_type's */
-#define RT_OLD         0       /* Raw pixrect image in 68000 byte order */
-#define RT_STANDARD    1       /* Raw pixrect image in 68000 byte order */
-#define RT_BYTE_ENCODED        2       /* Run-length compression of bytes */
-#define RT_EXPERIMENTAL 0xffff /* Reserved for testing */
-
-       /* Sun registered ras_maptype's */
-#define RMT_RAW                2
-       /* Sun supported ras_maptype's */
-#define RMT_NONE       0       /* ras_maplength is expected to be 0 */
-#define RMT_EQUAL_RGB  1       /* red[ras_maplength/3],green[],blue[] */
-
-/*
- * NOTES:
- *     Each line of the image is rounded out to a multiple of 16 bits.
- *   This corresponds to the rounding convention used by the memory pixrect
- *   package (/usr/include/pixrect/memvar.h) of the SunWindows system.
- *     The ras_encoding field (always set to 0 by Sun's supported software)
- *   was renamed to ras_length in release 2.0.  As a result, rasterfiles
- *   of type 0 generated by the old software claim to have 0 length; for
- *   compatibility, code reading rasterfiles must be prepared to compute the
- *   true length from the width, height, and depth fields.
- */
index 4a969c2..7a9d705 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: rgb2ycbcr.c,v 1.16 2015-06-21 01:09:10 bfriesen Exp $ */
+/* $Id: rgb2ycbcr.c,v 1.17 2016-08-15 21:26:56 erouault Exp $ */
 
 /*
  * Copyright (c) 1991-1997 Sam Leffler
@@ -95,9 +95,13 @@ main(int argc, char* argv[])
                        break;
                case 'h':
                        horizSubSampling = atoi(optarg);
+            if( horizSubSampling != 1 && horizSubSampling != 2 && horizSubSampling != 4 )
+                usage(-1);
                        break;
                case 'v':
                        vertSubSampling = atoi(optarg);
+            if( vertSubSampling != 1 && vertSubSampling != 2 && vertSubSampling != 4 )
+                usage(-1);
                        break;
                case 'r':
                        rowsperstrip = atoi(optarg);
diff --git a/tools/sgi2tiff.c b/tools/sgi2tiff.c
deleted file mode 100644 (file)
index b7fef0c..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-/* $Id: sgi2tiff.c,v 1.7 2015-06-21 01:09:10 bfriesen 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 <stdlib.h>
-#include <string.h>
-#include <gl/image.h>
-#include <ctype.h>
-
-#include "tiffio.h"
-
-#define        streq(a,b)      (strcmp(a,b) == 0)
-#define        strneq(a,b,n)   (strncmp(a,b,n) == 0)
-
-static short config = PLANARCONFIG_CONTIG;
-static uint16 compression = COMPRESSION_PACKBITS;
-static uint16 predictor = 0;
-static uint16 fillorder = 0;
-static uint32 rowsperstrip = (uint32) -1;
-static int jpegcolormode = JPEGCOLORMODE_RGB;
-static int quality = 75;               /* JPEG quality */
-static uint16 photometric;
-
-static void usage(void);
-static int cpContig(IMAGE*, TIFF*);
-static int cpSeparate(IMAGE*, TIFF*);
-static int processCompressOptions(char*);
-
-/* XXX image library has no prototypes */
-extern IMAGE* iopen(const char*, const char*);
-extern void iclose(IMAGE*);
-extern void getrow(IMAGE*, short*, int, int);
-
-int
-main(int argc, char* argv[])
-{
-       IMAGE *in;
-       TIFF *out;
-       int c;
-#if !HAVE_DECL_OPTARG
-       extern int optind;
-       extern char* optarg;
-#endif
-
-       while ((c = getopt(argc, argv, "c:p:r:")) != -1)
-               switch (c) {
-               case 'c':               /* compression scheme */
-                       if (!processCompressOptions(optarg))
-                               usage();
-                       break;
-               case 'f':               /* fill order */
-                       if (streq(optarg, "lsb2msb"))
-                               fillorder = FILLORDER_LSB2MSB;
-                       else if (streq(optarg, "msb2lsb"))
-                               fillorder = FILLORDER_MSB2LSB;
-                       else
-                               usage();
-                       break;
-               case 'p':               /* planar configuration */
-                       if (streq(optarg, "separate"))
-                               config = PLANARCONFIG_SEPARATE;
-                       else if (streq(optarg, "contig"))
-                               config = PLANARCONFIG_CONTIG;
-                       else
-                               usage();
-                       break;
-               case 'r':               /* rows/strip */
-                       rowsperstrip = atoi(optarg);
-                       break;
-               case '?':
-                       usage();
-                       /*NOTREACHED*/
-               }
-       if (argc - optind != 2)
-               usage();
-       in = iopen(argv[optind], "r");
-       if (in == NULL)
-               return (-1);
-       out = TIFFOpen(argv[optind+1], "w");
-       if (out == NULL)
-               return (-2);
-       TIFFSetField(out, TIFFTAG_IMAGEWIDTH, (uint32) in->xsize);
-       TIFFSetField(out, TIFFTAG_IMAGELENGTH, (uint32) in->ysize);
-       TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 8);
-       TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
-       if (in->zsize == 1)
-               photometric = PHOTOMETRIC_MINISBLACK;
-       else
-               photometric = PHOTOMETRIC_RGB;
-       switch (compression) {
-       case COMPRESSION_JPEG:
-               if (photometric == PHOTOMETRIC_RGB && jpegcolormode == JPEGCOLORMODE_RGB)
-                       photometric = PHOTOMETRIC_YCBCR;
-               TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality);
-               TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode);
-               break;
-       case COMPRESSION_LZW:
-       case COMPRESSION_DEFLATE:
-               if (predictor != 0)
-                       TIFFSetField(out, TIFFTAG_PREDICTOR, predictor);
-               break;
-       }
-       TIFFSetField(out, TIFFTAG_PHOTOMETRIC, photometric);
-       if (fillorder != 0)
-               TIFFSetField(out, TIFFTAG_FILLORDER, fillorder);
-       TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
-       TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, in->zsize);
-       if (in->zsize > 3) {
-           uint16 v[1];
-           v[0] = EXTRASAMPLE_UNASSALPHA;
-           TIFFSetField(out, TIFFTAG_EXTRASAMPLES, 1, v);
-       }
-       TIFFSetField(out, TIFFTAG_MINSAMPLEVALUE, (uint16) in->min);
-       TIFFSetField(out, TIFFTAG_MAXSAMPLEVALUE, (uint16) in->max);
-       TIFFSetField(out, TIFFTAG_PLANARCONFIG, config);
-       if (config != PLANARCONFIG_SEPARATE)
-               TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,
-                   TIFFDefaultStripSize(out, rowsperstrip));
-       else                    /* force 1 row/strip for library limitation */
-               TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, 1L);
-       if (in->name[0] != '\0')
-               TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, in->name);
-       if (config == PLANARCONFIG_CONTIG)
-               cpContig(in, out);
-       else
-               cpSeparate(in, out);
-       (void) iclose(in);
-       (void) TIFFClose(out);
-       return (0);
-}
-
-static int
-processCompressOptions(char* opt)
-{
-       if (streq(opt, "none"))
-               compression = COMPRESSION_NONE;
-       else if (streq(opt, "packbits"))
-               compression = COMPRESSION_PACKBITS;
-       else if (strneq(opt, "jpeg", 4)) {
-               char* cp = strchr(opt, ':');
-
-                defcompression = COMPRESSION_JPEG;
-                while( cp )
-                {
-                    if (isdigit((int)cp[1]))
-                       quality = atoi(cp+1);
-                    else if (cp[1] == 'r' )
-                       jpegcolormode = JPEGCOLORMODE_RAW;
-                    else
-                        usage();
-
-                    cp = strchr(cp+1,':');
-                }
-       } else if (strneq(opt, "lzw", 3)) {
-               char* cp = strchr(opt, ':');
-               if (cp)
-                       predictor = atoi(cp+1);
-               compression = COMPRESSION_LZW;
-       } else if (strneq(opt, "zip", 3)) {
-               char* cp = strchr(opt, ':');
-               if (cp)
-                       predictor = atoi(cp+1);
-               compression = COMPRESSION_DEFLATE;
-       } else
-               return (0);
-       return (1);
-}
-
-static int
-cpContig(IMAGE* in, TIFF* out)
-{
-       tdata_t buf = _TIFFmalloc(TIFFScanlineSize(out));
-       short *r = NULL;
-       int x, y;
-
-       if (in->zsize == 3) {
-               short *g, *b;
-
-               r = (short *)_TIFFmalloc(3 * in->xsize * sizeof (short));
-               g = r + in->xsize;
-               b = g + in->xsize;
-               for (y = in->ysize-1; y >= 0; y--) {
-                       uint8* pp = (uint8*) buf;
-
-                       getrow(in, r, y, 0);
-                       getrow(in, g, y, 1);
-                       getrow(in, b, y, 2);
-                       for (x = 0; x < in->xsize; x++) {
-                               pp[0] = r[x];
-                               pp[1] = g[x];
-                               pp[2] = b[x];
-                               pp += 3;
-                       }
-                       if (TIFFWriteScanline(out, buf, in->ysize-y-1, 0) < 0)
-                               goto bad;
-               }
-       } else if (in->zsize == 4) {
-               short *g, *b, *a;
-
-               r = (short *)_TIFFmalloc(4 * in->xsize * sizeof (short));
-               g = r + in->xsize;
-               b = g + in->xsize;
-               a = b + in->xsize;
-               for (y = in->ysize-1; y >= 0; y--) {
-                       uint8* pp = (uint8*) buf;
-
-                       getrow(in, r, y, 0);
-                       getrow(in, g, y, 1);
-                       getrow(in, b, y, 2);
-                       getrow(in, a, y, 3);
-                       for (x = 0; x < in->xsize; x++) {
-                               pp[0] = r[x];
-                               pp[1] = g[x];
-                               pp[2] = b[x];
-                               pp[3] = a[x];
-                               pp += 4;
-                       }
-                       if (TIFFWriteScanline(out, buf, in->ysize-y-1, 0) < 0)
-                               goto bad;
-               }
-       } else {
-               uint8* pp = (uint8*) buf;
-
-               r = (short *)_TIFFmalloc(in->xsize * sizeof (short));
-               for (y = in->ysize-1; y >= 0; y--) {
-                       getrow(in, r, y, 0);
-                       for (x = in->xsize-1; x >= 0; x--)
-                               pp[x] = r[x];
-                       if (TIFFWriteScanline(out, buf, in->ysize-y-1, 0) < 0)
-                               goto bad;
-               }
-       }
-       if (r)
-               _TIFFfree(r);
-       _TIFFfree(buf);
-       return (1);
-bad:
-       if (r)
-               _TIFFfree(r);
-       _TIFFfree(buf);
-       return (0);
-}
-
-static int
-cpSeparate(IMAGE* in, TIFF* out)
-{
-       tdata_t buf = _TIFFmalloc(TIFFScanlineSize(out));
-       short *r = (short *)_TIFFmalloc(in->xsize * sizeof (short));
-       uint8* pp = (uint8*) buf;
-       int x, y, z;
-
-       for (z = 0; z < in->zsize; z++) {
-               for (y = in->ysize-1; y >= 0; y--) {
-                       getrow(in, r, y, z);
-                       for (x = 0; x < in->xsize; x++)
-                               pp[x] = r[x];
-                       if (TIFFWriteScanline(out, buf, in->ysize-y-1, z) < 0)
-                               goto bad;
-               }
-       }
-       _TIFFfree(r);
-       _TIFFfree(buf);
-       return (1);
-bad:
-       _TIFFfree(r);
-       _TIFFfree(buf);
-       return (0);
-}
-
-char* stuff[] = {
-"usage: sgi2tiff [options] input.rgb output.tif",
-"where options are:",
-" -r #         make each strip have no more than # rows",
-"",
-" -p contig    pack samples contiguously (e.g. RGBRGB...)",
-" -p separate  store samples separately (e.g. RRR...GGG...BBB...)",
-"",
-" -f lsb2msb   force lsb-to-msb FillOrder for output",
-" -f msb2lsb   force msb-to-lsb FillOrder for output",
-"",
-" -c lzw[:opts]        compress output with Lempel-Ziv & Welch encoding",
-" -c zip[:opts]        compress output with deflate encoding",
-" -c jpeg[:opts]compress output with JPEG encoding",
-" -c packbits  compress output with packbits encoding",
-" -c none      use no compression algorithm on output",
-"",
-"JPEG options:",
-" #            set compression quality level (0-100, default 75)",
-" r            output color image as RGB rather than YCbCr",
-"",
-"LZW and deflate options:",
-" #            set predictor value",
-"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
-NULL
-};
-
-static void
-usage(void)
-{
-       char buf[BUFSIZ];
-       int i;
-
-       setbuf(stderr, buf);
-       for (i = 0; stuff[i] != NULL; i++)
-               fprintf(stderr, "%s\n", stuff[i]);
-       exit(-1);
-}
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 8
- * fill-column: 78
- * End:
- */
diff --git a/tools/sgisv.c b/tools/sgisv.c
deleted file mode 100644 (file)
index 3bc5760..0000000
+++ /dev/null
@@ -1,318 +0,0 @@
-/* $Id: sgisv.c,v 1.7 2015-06-21 01:09:10 bfriesen Exp $ */
-
-/*
- * Copyright (c) 1990-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 <stdlib.h>
-#include <string.h>
-
-#include <gl.h>
-#include <ctype.h>
-
-#include "tiffio.h"
-
-typedef unsigned char unsigned char;
-typedef unsigned long uint32;
-
-#define        streq(a,b)      (strcmp(a,b) == 0)
-#define        strneq(a,b,n)   (strncmp(a,b,n) == 0)
-
-uint32 rowsperstrip = (uint32) -1;
-uint16 compression = COMPRESSION_PACKBITS;
-uint16 config = PLANARCONFIG_CONTIG;
-uint16 predictor = 0;
-int    xmaxscreen;
-int    ymaxscreen;
-uint16 photometric = PHOTOMETRIC_RGB;
-int    jpegcolormode = JPEGCOLORMODE_RGB;
-int    quality = 75;           /* JPEG quality */
-
-static void usage(void);
-static void tiffsv(char*, int, int, int, int);
-
-int
-main(int argc, char* argv[])
-{
-       int c;
-#if !HAVE_DECL_OPTARG
-       extern int optind;
-       extern char* optarg;
-#endif
-
-       while ((c = getopt(argc, argv, "c:p:r:")) != -1)
-               switch (c) {
-               case 'b':               /* save as b&w */
-                       photometric = PHOTOMETRIC_MINISBLACK;
-                       break;
-               case 'c':               /* compression scheme */
-                       if (streq(optarg, "none"))
-                               compression = COMPRESSION_NONE;
-                       else if (streq(optarg, "packbits"))
-                               compression = COMPRESSION_PACKBITS;
-                       else if (strneq(optarg, "jpeg", 4)) {
-                               char* cp = strchr(optarg, ':');
-                               if (cp && isdigit(cp[1]))
-                                       quality = atoi(cp+1);
-                               if (cp && strchr(cp, 'r'))
-                                       jpegcolormode = JPEGCOLORMODE_RAW;
-                               compression = COMPRESSION_JPEG;
-                       } else if (strneq(optarg, "lzw", 3)) {
-                               char* cp = strchr(optarg, ':');
-                               if (cp)
-                                       predictor = atoi(cp+1);
-                               compression = COMPRESSION_LZW;
-                       } else
-                               usage();
-                       break;
-               case 'p':               /* planar configuration */
-                       if (streq(optarg, "separate"))
-                               config = PLANARCONFIG_SEPARATE;
-                       else if (streq(optarg, "contig"))
-                               config = PLANARCONFIG_CONTIG;
-                       else
-                               usage();
-                       break;
-               case 'r':               /* rows/strip */
-                       rowsperstrip = atoi(optarg);
-                       break;
-               case '?':
-                       usage();
-                       /*NOTREACHED*/
-               }
-       if (argc - optind != 1 && argc - optind != 5)
-               usage();
-       xmaxscreen = getgdesc(GD_XPMAX)-1;
-       ymaxscreen = getgdesc(GD_YPMAX)-1;
-       foreground();
-       noport();
-       winopen("tiffsv");
-       if (argc - optind == 5)
-               tiffsv(argv[optind],
-                   atoi(argv[optind+1]), atoi(argv[optind+2]),
-                   atoi(argv[optind+3]), atoi(argv[optind+4]));
-       else
-               tiffsv(argv[optind], 0, xmaxscreen, 0, ymaxscreen);
-       return (0);
-}
-
-char* stuff[] = {
-"usage: tiffsv [options] outimage.tif [x1 x2 y1 y2] [-b]",
-"where options are:",
-" -p contig    pack samples contiguously (e.g. RGBRGB...)",
-" -p separate  store samples separately (e.g. RRR...GGG...BBB...)",
-"",
-" -r #         make each strip have no more than # rows",
-"",
-" -c lzw[:opts]        compress output with Lempel-Ziv & Welch encoding",
-" -c jpeg[:opts]compress output with JPEG encoding",
-" -c packbits  compress output with packbits encoding",
-" -c none      use no compression algorithm on output",
-"",
-"JPEG options:",
-" #            set compression quality level (0-100, default 75)",
-" r            output color image as RGB rather than YCbCr",
-"",
-"LZW options:",
-" #            set predictor value for Lempel-Ziv & Welch encoding",
-"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
-NULL
-};
-
-static void
-usage(void)
-{
-       char buf[BUFSIZ];
-       int i;
-
-       setbuf(stderr, buf);
-       for (i = 0; stuff[i] != NULL; i++)
-               fprintf(stderr, "%s\n", stuff[i]);
-       exit(-1);
-}
-
-static void
-svRGBSeparate(TIFF* tif, uint32* ss, int xsize, int ysize)
-{
-       tsize_t stripsize = TIFFStripSize(tif);
-       unsigned char *rbuf = (unsigned char *)_TIFFmalloc(3*stripsize);
-       unsigned char *gbuf = rbuf + stripsize;
-       unsigned char *bbuf = gbuf + stripsize;
-       register int y;
-
-       for (y = 0; y <= ysize; y += rowsperstrip) {
-               unsigned char *rp, *gp, *bp;
-               register int x;
-               register uint32 n;
-
-               n = rowsperstrip;
-               if (n > ysize-y+1)
-                       n = ysize-y+1;
-               rp = rbuf; gp = gbuf; bp = bbuf;
-               do {
-                       for (x = 0; x <= xsize; x++) {
-                               uint32 v = ss[x];
-                               rp[x] = v;
-                               gp[x] = v >> 8;
-                               bp[x] = v >> 16;
-                       }
-                       rp += xsize+1, gp += xsize+1, bp += xsize+1;
-                       ss += xsize+1;
-               } while (--n);
-               if (TIFFWriteEncodedStrip(tif, TIFFComputeStrip(tif,y,0),
-                   rbuf, stripsize) < 0)
-                       break;
-               if (TIFFWriteEncodedStrip(tif, TIFFComputeStrip(tif,y,1),
-                   gbuf, stripsize) < 0)
-                       break;
-               if (TIFFWriteEncodedStrip(tif, TIFFComputeStrip(tif,y,2),
-                   bbuf, stripsize) < 0)
-                       break;
-       }
-       _TIFFfree(rbuf);
-}
-
-static void
-svRGBContig(TIFF* tif, uint32* ss, int xsize, int ysize)
-{
-       register int x, y;
-       tsize_t stripsize = TIFFStripSize(tif);
-       unsigned char *strip = (unsigned char *)_TIFFmalloc(stripsize);
-
-       for (y = 0; y <= ysize; y += rowsperstrip) {
-               register unsigned char *pp = strip;
-               register uint32 n;
-
-               n = rowsperstrip;
-               if (n > ysize-y+1)
-                       n = ysize-y+1;
-               do {
-                       for (x = 0; x <= xsize; x++) {
-                               uint32 v = ss[x];
-                               pp[0] = v;
-                               pp[1] = v >> 8;
-                               pp[2] = v >> 16;
-                               pp += 3;
-                       }
-                       ss += xsize+1;
-               } while (--n);
-               if (TIFFWriteEncodedStrip(tif, TIFFComputeStrip(tif,y,0),
-                   strip, stripsize) < 0)
-                       break;
-       }
-       _TIFFfree(strip);
-}
-
-#undef RED
-#undef GREEN
-#undef BLUE
-#define        CVT(x)  (((x)*255)/100)
-#define        RED     CVT(28)         /* 28% */
-#define        GREEN   CVT(59)         /* 59% */
-#define        BLUE    CVT(11)         /* 11% */
-
-static void
-svGrey(TIFF* tif, uint32* ss, int xsize, int ysize)
-{
-       register int x, y;
-       unsigned char *buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(tif));
-
-       for (y = 0; y <= ysize; y++) {
-               for (x = 0; x <= xsize; x++) {
-                       unsigned char *cp = (unsigned char *)&ss[x];
-                       buf[x] = (RED*cp[3] + GREEN*cp[2] + BLUE*cp[1]) >> 8;
-               }
-               if (TIFFWriteScanline(tif, buf, (uint32) y, 0) < 0)
-                       break;
-               ss += xsize+1;
-       }
-       _TIFFfree(buf);
-}
-
-#define        MIN(a,b)        ((a)<(b)?(a):(b))
-#define        ABS(x)          ((x)<0?-(x):(x))
-
-static void
-tiffsv(char* name, int x1, int x2, int y1, int y2)
-{
-       TIFF *tif;
-       int xsize, ysize;
-       int xorg, yorg;
-       uint32 *scrbuf;
-
-       xorg = MIN(x1,x2);
-       yorg = MIN(y1,y2);
-       if (xorg<0)
-               xorg = 0;
-       if (yorg<0)
-               yorg = 0;
-       xsize = ABS(x2-x1);
-       ysize = ABS(y2-y1);
-       if (xorg+xsize > xmaxscreen)
-               xsize = xmaxscreen-xorg;
-       if (yorg+ysize > ymaxscreen)
-               ysize = ymaxscreen-yorg;
-       tif = TIFFOpen(name, "w");
-       TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, (uint32) (xsize+1));
-       TIFFSetField(tif, TIFFTAG_IMAGELENGTH, (uint32) (ysize+1));
-       TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
-       TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL,
-           photometric == PHOTOMETRIC_RGB ? 3 : 1);
-       TIFFSetField(tif, TIFFTAG_PLANARCONFIG, config);
-       TIFFSetField(tif, TIFFTAG_COMPRESSION, compression);
-       switch (compression) {
-       case COMPRESSION_JPEG:
-               if (photometric == PHOTOMETRIC_RGB && jpegcolormode == JPEGCOLORMODE_RGB)
-                       photometric = PHOTOMETRIC_YCBCR;
-               TIFFSetField(tif, TIFFTAG_JPEGQUALITY, quality);
-               TIFFSetField(tif, TIFFTAG_JPEGCOLORMODE, jpegcolormode);
-               break;
-       case COMPRESSION_LZW:
-               if (predictor != 0)
-                       TIFFSetField(tif, TIFFTAG_PREDICTOR, predictor);
-               break;
-       }
-       TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photometric);
-       TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_BOTLEFT);
-       rowsperstrip = TIFFDefaultStripSize(tif, rowsperstrip);
-       TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
-       scrbuf = (uint32 *)_TIFFmalloc((xsize+1)*(ysize+1)*sizeof (uint32));
-       readdisplay(xorg, yorg, xorg+xsize, yorg+ysize, scrbuf, RD_FREEZE);
-       if (photometric == PHOTOMETRIC_RGB) {
-               if (config == PLANARCONFIG_SEPARATE)
-                       svRGBSeparate(tif, scrbuf, xsize, ysize);
-               else
-                       svRGBContig(tif, scrbuf, xsize, ysize);
-       } else
-               svGrey(tif, scrbuf, xsize, ysize);
-       (void) TIFFClose(tif);
-       _TIFFfree((char *)scrbuf);
-}
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 8
- * fill-column: 78
- * End:
- */
index 7464cf1..743f455 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tiff2bw.c,v 1.18 2015-06-21 01:09:10 bfriesen Exp $ */
+/* $Id: tiff2bw.c,v 1.19 2016-08-15 22:01:31 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -45,7 +45,7 @@
 #define        strneq(a,b,n)   (strncmp(a,b,n) == 0)
 
 /* x% weighting -> fraction of full color */
-#define        PCT(x)  (((x)*255+127)/100)
+#define        PCT(x)  (((x)*256+50)/100)
 int    RED = PCT(30);          /* 30% */
 int    GREEN = PCT(59);        /* 59% */
 int    BLUE = PCT(11);         /* 11% */
index 00bf850..fe8a6ea 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tiff2pdf.c,v 1.91 2015-09-06 18:24:27 bfriesen Exp $
+/* $Id: tiff2pdf.c,v 1.97 2016-11-11 21:28:24 erouault Exp $
  *
  * tiff2pdf - converts a TIFF image to a PDF document
  *
@@ -286,7 +286,7 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P*, TIFF*, TIFF*, ttile_t);
 int t2p_process_ojpeg_tables(T2P*, TIFF*);
 #endif
 #ifdef JPEG_SUPPORT
-int t2p_process_jpeg_strip(unsigned char*, tsize_t*, unsigned char*, tsize_t*, tstrip_t, uint32);
+int t2p_process_jpeg_strip(unsigned char*, tsize_t*, unsigned char*, tsize_t, tsize_t*, tstrip_t, uint32);
 #endif
 void t2p_tile_collapse_left(tdata_t, tsize_t, uint32, uint32, uint32);
 void t2p_write_advance_directory(T2P*, TIFF*);
@@ -1903,6 +1903,10 @@ void t2p_read_tiff_size(T2P* t2p, TIFF* input){
 #ifdef CCITT_SUPPORT
                if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
                        TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
+            if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {
+                TIFFError(TIFF2PDF_MODULE, "Integer overflow");
+                t2p->t2p_error = T2P_ERR_ERROR;
+            }
                        t2p->tiff_datasize=(tmsize_t)sbc[0];
                        return;
                }
@@ -1910,6 +1914,10 @@ void t2p_read_tiff_size(T2P* t2p, TIFF* input){
 #ifdef ZIP_SUPPORT
                if(t2p->pdf_compression == T2P_COMPRESS_ZIP){
                        TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
+            if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {
+                TIFFError(TIFF2PDF_MODULE, "Integer overflow");
+                t2p->t2p_error = T2P_ERR_ERROR;
+            }
                        t2p->tiff_datasize=(tmsize_t)sbc[0];
                        return;
                }
@@ -2408,7 +2416,8 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
                                if(!t2p_process_jpeg_strip(
                                        stripbuffer, 
                                        &striplength, 
-                                       buffer, 
+                                       buffer,
+                    t2p->tiff_datasize,
                                        &bufferoffset, 
                                        i, 
                                        t2p->tiff_length)){
@@ -2886,21 +2895,24 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
                                return(0);
                        }
                        if(TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt) != 0) {
-                               if (count > 0) {
-                                       _TIFFmemcpy(buffer, jpt, count);
+                               if (count >= 4) {
+                    /* Ignore EOI marker of JpegTables */
+                                       _TIFFmemcpy(buffer, jpt, count - 2);
                                        bufferoffset += count - 2;
+                    /* Store last 2 bytes of the JpegTables */
                                        table_end[0] = buffer[bufferoffset-2];
                                        table_end[1] = buffer[bufferoffset-1];
-                               }
-                               if (count > 0) {
                                        xuint32 = bufferoffset;
+                    bufferoffset -= 2;
                                        bufferoffset += TIFFReadRawTile(
                                                input, 
                                                tile, 
-                                               (tdata_t) &(((unsigned char*)buffer)[bufferoffset-2]), 
+                                               (tdata_t) &(((unsigned char*)buffer)[bufferoffset]), 
                                                -1);
-                                               buffer[xuint32-2]=table_end[0];
-                                               buffer[xuint32-1]=table_end[1];
+                    /* Overwrite SOI marker of image scan with previously */
+                    /* saved end of JpegTables */
+                                       buffer[xuint32-2]=table_end[0];
+                                       buffer[xuint32-1]=table_end[1];
                                } else {
                                        bufferoffset += TIFFReadRawTile(
                                                input, 
@@ -3439,6 +3451,7 @@ int t2p_process_jpeg_strip(
        unsigned char* strip, 
        tsize_t* striplength, 
        unsigned char* buffer, 
+    tsize_t buffersize,
        tsize_t* bufferoffset, 
        tstrip_t no, 
        uint32 height){
@@ -3473,6 +3486,8 @@ int t2p_process_jpeg_strip(
                }
                switch( strip[i] ){
                        case 0xd8:      /* SOI - start of image */
+                if( *bufferoffset + 2 > buffersize )
+                    return(0);
                                _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), 2);
                                *bufferoffset+=2;
                                break;
@@ -3482,12 +3497,18 @@ int t2p_process_jpeg_strip(
                        case 0xc9:      /* SOF9 */
                        case 0xca:      /* SOF10 */
                                if(no==0){
+                    if( *bufferoffset + datalen + 2 + 6 > buffersize )
+                        return(0);
                                        _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2);
+                    if( *bufferoffset + 9 >= buffersize )
+                        return(0);
                                        ncomp = buffer[*bufferoffset+9];
                                        if (ncomp < 1 || ncomp > 4)
                                                return(0);
                                        v_samp=1;
                                        h_samp=1;
+                    if( *bufferoffset + 11 + 3*(ncomp-1) >= buffersize )
+                        return(0);
                                        for(j=0;j<ncomp;j++){
                                                uint16 samp = buffer[*bufferoffset+11+(3*j)];
                                                if( (samp>>4) > h_samp) 
@@ -3519,20 +3540,28 @@ int t2p_process_jpeg_strip(
                                break;
                        case 0xc4: /* DHT */
                        case 0xdb: /* DQT */
+                if( *bufferoffset + datalen + 2 > buffersize )
+                    return(0);
                                _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2);
                                *bufferoffset+=datalen+2;
                                break;
                        case 0xda: /* SOS */
                                if(no==0){
+                    if( *bufferoffset + datalen + 2 > buffersize )
+                        return(0);
                                        _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2);
                                        *bufferoffset+=datalen+2;
                                } else {
+                    if( *bufferoffset + 2 > buffersize )
+                        return(0);
                                        buffer[(*bufferoffset)++]=0xff;
                                        buffer[(*bufferoffset)++]=
                                             (unsigned char)(0xd0 | ((no-1)%8));
                                }
                                i += datalen + 1;
                                /* copy remainder of strip */
+                if( *bufferoffset + *striplength - i > buffersize )
+                    return(0);
                                _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i]), *striplength - i);
                                *bufferoffset+= *striplength - i;
                                return(1);
@@ -3667,7 +3696,12 @@ t2p_sample_rgbaa_to_rgb(tdata_t data, uint32 samplecount)
 {
        uint32 i;
        
-       for(i = 0; i < samplecount; i++)
+    /* For the 3 first samples, there is overlapping between souce and
+       destination, so use memmove().
+       See http://bugzilla.maptools.org/show_bug.cgi?id=2577 */
+    for(i = 0; i < 3 && i < samplecount; i++)
+        memmove((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
+       for(; i < samplecount; i++)
                memcpy((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
 
        return(i * 3);
index 7d47c94..4de96ae 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tiff2rgba.c,v 1.21 2015-06-21 01:09:10 bfriesen Exp $ */
+/* $Id: tiff2rgba.c,v 1.22 2016-08-15 20:06:41 erouault Exp $ */
 
 /*
  * Copyright (c) 1991-1997 Sam Leffler
@@ -147,6 +147,7 @@ cvt_by_tile( TIFF *in, TIFF *out )
     uint32  row, col;
     uint32  *wrk_line;
     int            ok = 1;
+    uint32  rastersize, wrk_linesize;
 
     TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
     TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
@@ -163,7 +164,13 @@ cvt_by_tile( TIFF *in, TIFF *out )
     /*
      * Allocate tile buffer
      */
-    raster = (uint32*)_TIFFmalloc(tile_width * tile_height * sizeof (uint32));
+    rastersize = tile_width * tile_height * sizeof (uint32);
+    if (tile_width != (rastersize / tile_height) / sizeof( uint32))
+    {
+       TIFFError(TIFFFileName(in), "Integer overflow when calculating raster buffer");
+       exit(-1);
+    }
+    raster = (uint32*)_TIFFmalloc(rastersize);
     if (raster == 0) {
         TIFFError(TIFFFileName(in), "No space for raster buffer");
         return (0);
@@ -173,7 +180,13 @@ cvt_by_tile( TIFF *in, TIFF *out )
      * Allocate a scanline buffer for swapping during the vertical
      * mirroring pass.
      */
-    wrk_line = (uint32*)_TIFFmalloc(tile_width * sizeof (uint32));
+    wrk_linesize = tile_width * sizeof (uint32);
+    if (tile_width != wrk_linesize / sizeof (uint32))
+    {
+        TIFFError(TIFFFileName(in), "Integer overflow when calculating wrk_line buffer");
+       exit(-1);
+    }
+    wrk_line = (uint32*)_TIFFmalloc(wrk_linesize);
     if (!wrk_line) {
         TIFFError(TIFFFileName(in), "No space for raster scanline buffer");
         ok = 0;
@@ -249,6 +262,7 @@ cvt_by_strip( TIFF *in, TIFF *out )
     uint32  row;
     uint32  *wrk_line;
     int            ok = 1;
+    uint32  rastersize, wrk_linesize;
 
     TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
     TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
@@ -263,7 +277,13 @@ cvt_by_strip( TIFF *in, TIFF *out )
     /*
      * Allocate strip buffer
      */
-    raster = (uint32*)_TIFFmalloc(width * rowsperstrip * sizeof (uint32));
+    rastersize = width * rowsperstrip * sizeof (uint32);
+    if (width != (rastersize / rowsperstrip) / sizeof( uint32))
+    {
+       TIFFError(TIFFFileName(in), "Integer overflow when calculating raster buffer");
+       exit(-1);
+    }
+    raster = (uint32*)_TIFFmalloc(rastersize);
     if (raster == 0) {
         TIFFError(TIFFFileName(in), "No space for raster buffer");
         return (0);
@@ -273,7 +293,13 @@ cvt_by_strip( TIFF *in, TIFF *out )
      * Allocate a scanline buffer for swapping during the vertical
      * mirroring pass.
      */
-    wrk_line = (uint32*)_TIFFmalloc(width * sizeof (uint32));
+    wrk_linesize = width * sizeof (uint32);
+    if (width != wrk_linesize / sizeof (uint32))
+    {
+        TIFFError(TIFFFileName(in), "Integer overflow when calculating wrk_line buffer");
+       exit(-1);
+    }
+    wrk_line = (uint32*)_TIFFmalloc(wrk_linesize);
     if (!wrk_line) {
         TIFFError(TIFFFileName(in), "No space for raster scanline buffer");
         ok = 0;
index d415af3..338a3d1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tiffcp.c,v 1.53 2015-06-21 01:09:10 bfriesen Exp $ */
+/* $Id: tiffcp.c,v 1.55 2016-10-08 15:54:57 erouault Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -592,8 +592,8 @@ static      copyFunc pickCopyFunc(TIFF*, TIFF*, uint16, uint16);
 static int
 tiffcp(TIFF* in, TIFF* out)
 {
-       uint16 bitspersample, samplesperpixel;
-       uint16 input_compression, input_photometric;
+       uint16 bitspersample, samplesperpixel = 1;
+       uint16 input_compression, input_photometric = PHOTOMETRIC_MINISBLACK;
        copyFunc cf;
        uint32 width, length;
        struct cpTag* p;
@@ -1338,7 +1338,7 @@ DECLAREreadFunc(readContigTilesIntoBuffer)
                uint32 colb = 0;
                uint32 col;
 
-               for (col = 0; col < imagewidth; col += tw) {
+               for (col = 0; col < imagewidth && colb < imagew; col += tw) {
                        if (TIFFReadTile(in, tilebuf, col, row, 0, 0) < 0
                            && !ignore) {
                                TIFFError(TIFFFileName(in),
@@ -1523,7 +1523,7 @@ DECLAREwriteFunc(writeBufferToContigTiles)
                uint32 colb = 0;
                uint32 col;
 
-               for (col = 0; col < imagewidth; col += tw) {
+               for (col = 0; col < imagewidth && colb < imagew; col += tw) {
                        /*
                         * Tile is clipped horizontally.  Calculate
                         * visible portion and skewing factors.
index b5a49cc..722b132 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tiffcrop.c,v 1.35 2015-08-19 02:31:04 bfriesen Exp $ */
+/* $Id: tiffcrop.c,v 1.46 2016-11-18 14:58:46 erouault Exp $ */
 
 /* tiffcrop.c -- a port of tiffcp.c extended to include manipulations of
  * the image data through additional options listed below
@@ -148,6 +148,8 @@ extern int getopt(int argc, char * const argv[], const char *optstring);
 #define PATH_MAX 1024
 #endif
 
+#define TIFF_UINT32_MAX     0xFFFFFFFFU
+
 #ifndef streq
 #define        streq(a,b)      (strcmp((a),(b)) == 0)
 #endif
@@ -798,6 +800,11 @@ static int readContigTilesIntoBuffer (TIFF* in, uint8* buf,
     }
 
   tile_buffsize = tilesize;
+  if (tilesize == 0 || tile_rowsize == 0)
+  {
+     TIFFError("readContigTilesIntoBuffer", "Tile size or tile rowsize is zero");
+     exit(-1);
+  }
 
   if (tilesize < (tsize_t)(tl * tile_rowsize))
     {
@@ -807,11 +814,25 @@ static int readContigTilesIntoBuffer (TIFF* in, uint8* buf,
               tilesize, tl * tile_rowsize);
 #endif
     tile_buffsize = tl * tile_rowsize;
-    } 
+    if (tl != (tile_buffsize / tile_rowsize))
+    {
+       TIFFError("readContigTilesIntoBuffer", "Integer overflow when calculating buffer size.");
+        exit(-1);
+    }
+    }
 
-  tilebuf = _TIFFmalloc(tile_buffsize);
+  /* Add 3 padding bytes for extractContigSamplesShifted32bits */
+  if( (size_t) tile_buffsize > 0xFFFFFFFFU - 3U )
+  {
+      TIFFError("readContigTilesIntoBuffer", "Integer overflow when calculating buffer size.");
+      exit(-1);
+  }
+  tilebuf = _TIFFmalloc(tile_buffsize + 3);
   if (tilebuf == 0)
     return 0;
+  tilebuf[tile_buffsize] = 0;
+  tilebuf[tile_buffsize+1] = 0;
+  tilebuf[tile_buffsize+2] = 0;
 
   dst_rowsize = ((imagewidth * bps * spp) + 7) / 8;  
   for (row = 0; row < imagelength; row += tl)
@@ -989,7 +1010,7 @@ static int  readSeparateTilesIntoBuffer (TIFF* in, uint8 *obuf,
     nrow = (row + tl > imagelength) ? imagelength - row : tl;
     for (col = 0; col < imagewidth; col += tw)
       {
-      for (s = 0; s < spp; s++)
+      for (s = 0; s < spp && s < MAX_SAMPLES; s++)
         {  /* Read each plane of a tile set into srcbuffs[s] */
        tbytes = TIFFReadTile(in, srcbuffs[s], col, row, 0, s);
         if (tbytes < 0  && !ignore)
@@ -1145,7 +1166,24 @@ writeBufferToSeparateStrips (TIFF* out, uint8* buf,
   (void) TIFFGetFieldDefaulted(out, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
   (void) TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps);
   bytes_per_sample = (bps + 7) / 8;
-  rowsize = ((bps * spp * width) + 7) / 8; /* source has interleaved samples */
+  if( width == 0 ||
+      (uint32)bps * (uint32)spp > TIFF_UINT32_MAX / width ||
+      bps * spp * width > TIFF_UINT32_MAX - 7U )
+  {
+      TIFFError(TIFFFileName(out),
+            "Error, uint32 overflow when computing (bps * spp * width) + 7");
+      return 1;
+  }
+  rowsize = ((bps * spp * width) + 7U) / 8; /* source has interleaved samples */
+  if( bytes_per_sample == 0 ||
+      rowsperstrip > TIFF_UINT32_MAX / bytes_per_sample ||
+      rowsperstrip * bytes_per_sample > TIFF_UINT32_MAX / (width + 1) )
+  {
+      TIFFError(TIFFFileName(out),
+                "Error, uint32 overflow when computing rowsperstrip * "
+                "bytes_per_sample * (width + 1)");
+      return 1;
+  }
   rowstripsize = rowsperstrip * bytes_per_sample * (width + 1); 
 
   obuf = _TIFFmalloc (rowstripsize);
@@ -1210,6 +1248,12 @@ static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength,
       !TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps) )
       return 1;
 
+  if (tilesize == 0 || tile_rowsize == 0 || tl == 0 || tw == 0)
+  {
+    TIFFError("writeBufferToContigTiles", "Tile size, tile row size, tile width, or tile length is zero");
+    exit(-1);
+  }
+  
   tile_buffsize = tilesize;
   if (tilesize < (tsize_t)(tl * tile_rowsize))
     {
@@ -1219,13 +1263,26 @@ static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength,
               tilesize, tl * tile_rowsize);
 #endif
     tile_buffsize = tl * tile_rowsize;
+    if (tl != tile_buffsize / tile_rowsize)
+    {
+       TIFFError("writeBufferToContigTiles", "Integer overflow when calculating buffer size");
+       exit(-1);
+    }
     }
 
+  if( imagewidth == 0 ||
+      (uint32)bps * (uint32)spp > TIFF_UINT32_MAX / imagewidth ||
+      bps * spp * imagewidth > TIFF_UINT32_MAX - 7U )
+  {
+      TIFFError(TIFFFileName(out),
+            "Error, uint32 overflow when computing (imagewidth * bps * spp) + 7");
+      return 1;
+  }
+  src_rowsize = ((imagewidth * spp * bps) + 7U) / 8;
+
   tilebuf = _TIFFmalloc(tile_buffsize);
   if (tilebuf == 0)
     return 1;
-
-  src_rowsize = ((imagewidth * spp * bps) + 7) / 8;
   for (row = 0; row < imagelength; row += tl)
     {
     nrow = (row + tl > imagelength) ? imagelength - row : tl;
@@ -1285,7 +1342,17 @@ static int writeBufferToSeparateTiles (TIFF* out, uint8* buf, uint32 imagelength
   TIFFGetField(out, TIFFTAG_TILELENGTH, &tl);
   TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw);
   TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps);
-  src_rowsize = ((imagewidth * spp * bps) + 7) / 8;
+
+  if( imagewidth == 0 ||
+      (uint32)bps * (uint32)spp > TIFF_UINT32_MAX / imagewidth ||
+      bps * spp * imagewidth > TIFF_UINT32_MAX - 7 )
+  {
+      TIFFError(TIFFFileName(out),
+            "Error, uint32 overflow when computing (imagewidth * bps * spp) + 7");
+      _TIFFfree(obuf);
+      return 1;
+  }
+  src_rowsize = ((imagewidth * spp * bps) + 7U) / 8;
          
   for (row = 0; row < imagelength; row += tl)
     {
@@ -3607,7 +3674,7 @@ static int readContigStripsIntoBuffer (TIFF* in, uint8* buf)
 {
         uint8* bufp = buf;
         int32  bytes_read = 0;
-        uint16 strip, nstrips   = TIFFNumberOfStrips(in);
+        uint32 strip, nstrips   = TIFFNumberOfStrips(in);
         uint32 stripsize = TIFFStripSize(in);
         uint32 rows = 0;
         uint32 rps = TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &rps);
@@ -3738,7 +3805,7 @@ combineSeparateSamples8bits (uint8 *in[], uint8 *out, uint32 cols,
 
       matchbits = maskbits << (8 - src_bit - bps); 
       /* load up next sample from each plane */
-      for (s = 0; s < spp; s++)
+      for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
         {
        src = in[s] + src_offset + src_byte;
         buff1 = ((*src) & matchbits) << (src_bit);
@@ -3837,7 +3904,7 @@ combineSeparateSamples16bits (uint8 *in[], uint8 *out, uint32 cols,
       src_bit  = bit_offset % 8;
 
       matchbits = maskbits << (16 - src_bit - bps); 
-      for (s = 0; s < spp; s++)
+      for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
         {
        src = in[s] + src_offset + src_byte;
         if (little_endian)
@@ -3947,7 +4014,7 @@ combineSeparateSamples24bits (uint8 *in[], uint8 *out, uint32 cols,
       src_bit  = bit_offset % 8;
 
       matchbits = maskbits << (32 - src_bit - bps); 
-      for (s = 0; s < spp; s++)
+      for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
         {
        src = in[s] + src_offset + src_byte;
         if (little_endian)
@@ -4073,7 +4140,7 @@ combineSeparateSamples32bits (uint8 *in[], uint8 *out, uint32 cols,
       src_bit  = bit_offset % 8;
 
       matchbits = maskbits << (64 - src_bit - bps); 
-      for (s = 0; s < spp; s++)
+      for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
        {
        src = in[s] + src_offset + src_byte;
        if (little_endian)
@@ -4263,7 +4330,7 @@ combineSeparateTileSamples8bits (uint8 *in[], uint8 *out, uint32 cols,
 
       matchbits = maskbits << (8 - src_bit - bps); 
       /* load up next sample from each plane */
-      for (s = 0; s < spp; s++)
+      for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
         {
        src = in[s] + src_offset + src_byte;
         buff1 = ((*src) & matchbits) << (src_bit);
@@ -4362,7 +4429,7 @@ combineSeparateTileSamples16bits (uint8 *in[], uint8 *out, uint32 cols,
       src_bit  = bit_offset % 8;
 
       matchbits = maskbits << (16 - src_bit - bps); 
-      for (s = 0; s < spp; s++)
+      for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
         {
        src = in[s] + src_offset + src_byte;
         if (little_endian)
@@ -4471,7 +4538,7 @@ combineSeparateTileSamples24bits (uint8 *in[], uint8 *out, uint32 cols,
       src_bit  = bit_offset % 8;
 
       matchbits = maskbits << (32 - src_bit - bps); 
-      for (s = 0; s < spp; s++)
+      for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
         {
        src = in[s] + src_offset + src_byte;
         if (little_endian)
@@ -4597,7 +4664,7 @@ combineSeparateTileSamples32bits (uint8 *in[], uint8 *out, uint32 cols,
       src_bit  = bit_offset % 8;
 
       matchbits = maskbits << (64 - src_bit - bps); 
-      for (s = 0; s < spp; s++)
+      for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
        {
        src = in[s] + src_offset + src_byte;
        if (little_endian)
@@ -4690,9 +4757,12 @@ static int readSeparateStripsIntoBuffer (TIFF *in, uint8 *obuf, uint32 length,
                                          uint32 width, uint16 spp,
                                          struct dump_opts *dump)
   {
-  int i, j, bytes_per_sample, bytes_per_pixel, shift_width, result = 1;
+  int i, bytes_per_sample, bytes_per_pixel, shift_width, result = 1;
+  uint32 j;
   int32  bytes_read = 0;
-  uint16 bps, nstrips, planar, strips_per_sample;
+  uint16 bps, planar;
+  uint32 nstrips;
+  uint32 strips_per_sample;
   uint32 src_rowsize, dst_rowsize, rows_processed, rps;
   uint32 rows_this_strip = 0;
   tsample_t s;
@@ -5737,7 +5807,8 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
   {
   uint32   i;
   float    xres = 0.0, yres = 0.0;
-  uint16   nstrips = 0, ntiles = 0, planar = 0;
+  uint32   nstrips = 0, ntiles = 0;
+  uint16   planar = 0;
   uint16   bps = 0, spp = 0, res_unit = 0;
   uint16   orientation = 0;
   uint16   input_compression = 0, input_photometric = 0;
@@ -5945,12 +6016,27 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
     TIFFGetField(in, TIFFTAG_TILELENGTH, &tl);
 
     tile_rowsize  = TIFFTileRowSize(in);      
+    if (ntiles == 0 || tlsize == 0 || tile_rowsize == 0)
+    {
+       TIFFError("loadImage", "File appears to be tiled, but the number of tiles, tile size, or tile rowsize is zero.");
+       exit(-1);
+    }
     buffsize = tlsize * ntiles;
+    if (tlsize != (buffsize / ntiles))
+    {
+       TIFFError("loadImage", "Integer overflow when calculating buffer size");
+       exit(-1);
+    }
 
-        
     if (buffsize < (uint32)(ntiles * tl * tile_rowsize))
       {
       buffsize = ntiles * tl * tile_rowsize;
+      if (ntiles != (buffsize / tl / tile_rowsize))
+      {
+       TIFFError("loadImage", "Integer overflow when calculating buffer size");
+       exit(-1);
+      }
+      
 #ifdef DEBUG2
       TIFFError("loadImage",
                "Tilesize %u is too small, using ntiles * tilelength * tilerowsize %lu",
@@ -5965,12 +6051,29 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
     }
   else
     {
+    uint32 buffsize_check;
     readunit = STRIP;
     TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
     stsize = TIFFStripSize(in);
     nstrips = TIFFNumberOfStrips(in);
+    if (nstrips == 0 || stsize == 0)
+    {
+       TIFFError("loadImage", "File appears to be striped, but the number of stipes or stripe size is zero.");
+       exit(-1);
+    }
+
     buffsize = stsize * nstrips;
-    
+    if (stsize != (buffsize / nstrips))
+    {
+       TIFFError("loadImage", "Integer overflow when calculating buffer size");
+       exit(-1);
+    }
+    buffsize_check = ((length * width * spp * bps) + 7);
+    if (length != ((buffsize_check - 7) / width / spp / bps))
+    {
+       TIFFError("loadImage", "Integer overflow detected.");
+       exit(-1);
+    }
     if (buffsize < (uint32) (((length * width * spp * bps) + 7) / 8))
       {
       buffsize =  ((length * width * spp * bps) + 7) / 8;
@@ -6013,11 +6116,23 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
   /* +3 : add a few guard bytes since reverseSamples16bits() can read a bit */
   /* outside buffer */
   if (!read_buff)
+  {
+    if( buffsize > 0xFFFFFFFFU - 3 )
+    {
+        TIFFError("loadImage", "Unable to allocate/reallocate read buffer");
+        return (-1);
+    }
     read_buff = (unsigned char *)_TIFFmalloc(buffsize+3);
+  }
   else
     {
     if (prev_readsize < buffsize)
+    {
+      if( buffsize > 0xFFFFFFFFU - 3 )
       {
+          TIFFError("loadImage", "Unable to allocate/reallocate read buffer");
+          return (-1);
+      }
       new_buff = _TIFFrealloc(read_buff, buffsize+3);
       if (!new_buff)
         {
@@ -8859,6 +8974,11 @@ reverseSamplesBytes (uint16 spp, uint16 bps, uint32 width,
     }
 
   bytes_per_pixel  = ((bps * spp) + 7) / 8;
+  if( bytes_per_pixel > sizeof(swapbuff) )
+  {
+    TIFFError("reverseSamplesBytes","bytes_per_pixel too large");
+    return (1);
+  }
   switch (bps / 8)
      {
      case 8:  /* Use memcpy for multiple bytes per sample data */
index 7aa1c17..3de0062 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tiffdump.c,v 1.32 2015-08-19 02:31:05 bfriesen Exp $ */
+/* $Id: tiffdump.c,v 1.35 2016-11-19 15:42:46 bfriesen Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -388,7 +388,7 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
                void* datamem;
                uint64 dataoffset;
                int datatruncated;
-        int datasizeoverflow;
+                int datasizeoverflow;
 
                tag = *(uint16*)dp;
                if (swabflag)
@@ -413,7 +413,7 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
                }
                else
                {
-                       count = *(uint64*)dp;
+                       memcpy(&count, dp, sizeof(uint64));
                        if (swabflag)
                                TIFFSwabLong8(&count);
                        dp += sizeof(uint64);
@@ -427,8 +427,8 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
                        typewidth = 0;
                else
                        typewidth = datawidth[type];
-               datasize = count*typewidth;
-        datasizeoverflow = (typewidth > 0 && datasize / typewidth != count);
+               datasize = TIFFSafeMultiply(tmsize_t,count,typewidth);
+                datasizeoverflow = (typewidth > 0 && datasize / typewidth != count);
                datafits = 1;
                datamem = dp;
                dataoffset = 0;
@@ -463,17 +463,17 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
                {
                        datatruncated = 1;
                        count = 0x10000/typewidth;
-                       datasize = count*typewidth;
+                       datasize = TIFFSafeMultiply(tmsize_t,count,typewidth);
                }
                if (count>maxitems)
                {
                        datatruncated = 1;
                        count = maxitems;
-                       datasize = count*typewidth;
+                        datasize = TIFFSafeMultiply(tmsize_t,count,typewidth);
                }
                if (!datafits)
                {
-                       datamem = _TIFFmalloc((uint32)datasize);
+                       datamem = _TIFFmalloc(datasize);
                        if (datamem) {
                                if (_TIFF_lseek_f(fd, (_TIFF_off_t)dataoffset, 0) !=
                                    (_TIFF_off_t)dataoffset)
@@ -761,23 +761,23 @@ PrintData(FILE* fd, uint16 type, uint32 count, unsigned char* data)
        case TIFF_LONG8: {
                uint64 *llp = (uint64*)data;
                while (count-- > 0) {
-#if defined(__WIN32__) && defined(_MSC_VER)
-                       fprintf(fd, long8fmt, sep, (unsigned __int64) *llp++);
-#else
-                       fprintf(fd, long8fmt, sep, (unsigned long long) *llp++);
-#endif
+                        uint64 val;
+                        memcpy(&val, llp, sizeof(uint64));
+                        llp ++;
+                       fprintf(fd, long8fmt, sep, val);
                        sep = " ";
                }
                break;
        }
        case TIFF_SLONG8: {
                int64 *llp = (int64*)data;
-               while (count-- > 0)
-#if defined(__WIN32__) && defined(_MSC_VER)
-                       fprintf(fd, slong8fmt, sep, (__int64) *llp++), sep = " ";
-#else
-                       fprintf(fd, slong8fmt, sep, (long long) *llp++), sep = " ";
-#endif
+               while (count-- > 0) {
+                        int64 val;
+                        memcpy(&val, llp, sizeof(int64));
+                        llp ++;
+                        fprintf(fd, slong8fmt, sep, val);
+                        sep = " ";
+                }
                break;
        }
        case TIFF_RATIONAL: {
index acac2e4..b02c7d4 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tiffinfo.c,v 1.23 2015-06-21 01:09:11 bfriesen Exp $ */
+/* $Id: tiffinfo.c,v 1.25 2016-11-12 20:06:05 bfriesen Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -294,9 +294,10 @@ void
 TIFFReadContigTileData(TIFF* tif)
 {
        unsigned char *buf;
-       tsize_t rowsize = TIFFTileRowSize(tif);
+       tmsize_t rowsize = TIFFTileRowSize(tif);
+        tmsize_t tilesize = TIFFTileSize(tif);
 
-       buf = (unsigned char *)_TIFFmalloc(TIFFTileSize(tif));
+       buf = (unsigned char *)_TIFFmalloc(tilesize);
        if (buf) {
                uint32 tw=0, th=0, w=0, h=0;
                uint32 row, col;
@@ -305,6 +306,12 @@ TIFFReadContigTileData(TIFF* tif)
                TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);
                TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw);
                TIFFGetField(tif, TIFFTAG_TILELENGTH, &th);
+                if ( rowsize == 0 || th > (size_t) (tilesize / rowsize) )
+        {
+            fprintf(stderr, "Cannot display data: th * rowsize > tilesize\n");
+            _TIFFfree(buf);
+            return;
+        }
                for (row = 0; row < h; row += th) {
                        for (col = 0; col < w; col += tw) {
                                if (TIFFReadTile(tif, buf, col, row, 0, 0) < 0) {
@@ -322,9 +329,10 @@ void
 TIFFReadSeparateTileData(TIFF* tif)
 {
        unsigned char *buf;
-       tsize_t rowsize = TIFFTileRowSize(tif);
+        tmsize_t rowsize = TIFFTileRowSize(tif);
+        tmsize_t tilesize = TIFFTileSize(tif);
 
-       buf = (unsigned char *)_TIFFmalloc(TIFFTileSize(tif));
+       buf = (unsigned char *)_TIFFmalloc(tilesize);
        if (buf) {
                uint32 tw=0, th=0, w=0, h=0;
                uint32 row, col;
@@ -335,6 +343,12 @@ TIFFReadSeparateTileData(TIFF* tif)
                TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw);
                TIFFGetField(tif, TIFFTAG_TILELENGTH, &th);
                TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel);
+                if ( rowsize == 0 || th > (size_t) (tilesize / rowsize) )
+        {
+            fprintf(stderr, "Cannot display data: th * rowsize > tilesize\n");
+            _TIFFfree(buf);
+            return;
+        }
                for (row = 0; row < h; row += th) {
                        for (col = 0; col < w; col += tw) {
                                for (s = 0; s < samplesperpixel; s++) {
diff --git a/tools/ycbcr.c b/tools/ycbcr.c
deleted file mode 100644 (file)
index 8f72447..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-float  ycbcrCoeffs[3] = { .299, .587, .114 };
-/* default coding range is CCIR Rec 601-1 with no headroom/footroom */
-unsigned long refBlackWhite[6] = { 0, 255, 128, 255, 128, 255 };
-
-#define        LumaRed         ycbcrCoeffs[0]
-#define        LumaGreen       ycbcrCoeffs[1]
-#define        LumaBlue        ycbcrCoeffs[2]
-
-long   eRtotal = 0;
-long   eGtotal = 0;
-long   eBtotal = 0;
-long   preveRtotal = 0;
-long   preveGtotal = 0;
-long   preveBtotal = 0;
-unsigned long AbseRtotal = 0;
-unsigned long AbseGtotal = 0;
-unsigned long AbseBtotal = 0;
-unsigned long eCodes = 0;
-unsigned long preveCodes = 0;
-unsigned long eBits = 0;
-unsigned long preveBits = 0;
-
-static void setupLumaTables();
-static int abs(int v) { return (v < 0 ? -v : v); }
-static double pct(int v,double range) { return (v*100. / range); }
-static void check(int R, int G, int B);
-
-float  D1, D2;
-float  D3, D4;
-float  D5, D6;
-
-int
-main(int argc, char** argv)
-{
-    int R, G, B;
-
-    if (argc > 1) {
-       refBlackWhite[0] = 16;
-       refBlackWhite[1] = 235;
-       refBlackWhite[2] = 128;
-       refBlackWhite[3] = 240;
-       refBlackWhite[4] = 128;
-       refBlackWhite[5] = 240;
-    }
-    D3 = 2 - 2*LumaRed;
-    D4 = 2 - 2*LumaBlue;
-    D1 = 1. / D3;
-    D2 = 1. / D4;
-    D5 = D3*LumaRed / LumaGreen;
-    D6 = D4*LumaBlue / LumaGreen;
-    setupLumaTables();
-    for (R = 0; R < 256; R++) {
-       for (G = 0; G < 256; G++)
-           for (B = 0; B < 256; B++)
-               check(R, G, B);
-       printf("[%3u] c %u/%u b %u/%u (R %u/%d/%u G %u/%d/%u B %u/%d/%u)\n"
-           , R
-           , eCodes - preveCodes, eCodes
-           , eBits - preveBits, eBits
-           , abs(AbseRtotal - preveRtotal), eRtotal , AbseRtotal
-           , abs(AbseGtotal - preveGtotal), eGtotal , AbseGtotal
-           , abs(AbseBtotal - preveBtotal), eBtotal , AbseBtotal
-       );
-       preveRtotal = AbseRtotal;
-       preveGtotal = AbseGtotal;
-       preveBtotal = AbseBtotal;
-       preveCodes = eCodes;
-       preveBits = eBits;
-    }
-    printf("%u total codes\n", 256*256*256);
-    printf("total error: %u codes %u bits (R %d/%u G %d/%u B %d/%u)\n"
-       , eCodes
-       , eBits
-       , eRtotal , AbseRtotal
-       , eGtotal , AbseGtotal
-       , eBtotal , AbseBtotal
-    );
-    return (0);
-}
-
-float  *lumaRed;
-float  *lumaGreen;
-float  *lumaBlue;
-
-static float*
-setupLuma(float c)
-{
-    float *v = (float *)_TIFFmalloc(256 * sizeof (float));
-    int i;
-    for (i = 0; i < 256; i++)
-       v[i] = c * i;
-    return (v);
-}
-
-static void
-setupLumaTables(void)
-{
-    lumaRed = setupLuma(LumaRed);
-    lumaGreen = setupLuma(LumaGreen);
-    lumaBlue = setupLuma(LumaBlue);
-}
-
-static unsigned
-V2Code(float f, unsigned long RB, unsigned long RW, int CR)
-{
-    unsigned int c = (unsigned int)((((f)*(RW-RB)/CR)+RB)+.5);
-    return (c > 255 ? 255 : c);
-}
-
-#define        Code2V(c, RB, RW, CR)   ((((c)-(int)RB)*(float)CR)/(float)(RW-RB))
-
-#define        CLAMP(f,min,max) \
-    (int)((f)+.5 < (min) ? (min) : (f)+.5 > (max) ? (max) : (f)+.5)
-
-static
-void
-check(int R, int G, int B)
-{
-    float Y, Cb, Cr;
-    int iY, iCb, iCr;
-    float rY, rCb, rCr;
-    float rR, rG, rB;
-    int eR, eG, eB;
-
-    Y = lumaRed[R] + lumaGreen[G] + lumaBlue[B];
-    Cb = (B - Y)*D2;
-    Cr = (R - Y)*D1;
-    iY = V2Code(Y, refBlackWhite[0], refBlackWhite[1], 255);
-    iCb = V2Code(Cb, refBlackWhite[2], refBlackWhite[3], 127);
-    iCr = V2Code(Cr, refBlackWhite[4], refBlackWhite[5], 127);
-    rCb = Code2V(iCb, refBlackWhite[2], refBlackWhite[3], 127);
-    rCr = Code2V(iCr, refBlackWhite[4], refBlackWhite[5], 127);
-    rY = Code2V(iY, refBlackWhite[0], refBlackWhite[1], 255);
-    rR = rY + rCr*D3;
-    rB = rY + rCb*D4;
-    rG = rY - rCb*D6 - rCr*D5;
-    eR = R - CLAMP(rR,0,255);
-    eG = G - CLAMP(rG,0,255);
-    eB = B - CLAMP(rB,0,255);
-    if (abs(eR) > 1 || abs(eG) > 1 || abs(eB) > 1) {
-       printf("R %u G %u B %u", R, G, B);
-       printf(" Y %g Cb %g Cr %g", Y, Cb, Cr);
-       printf(" iY %u iCb %u iCr %u", iY, iCb, iCr);
-       printf("\n -> Y %g Cb %g Cr %g", rY, rCb, rCr);
-       printf(" R %g (%u) G %g (%u) B %g (%u) E=[%d %d %d])\n"
-           , rR, CLAMP(rR,0,255)
-           , rG, CLAMP(rG,0,255)
-           , rB, CLAMP(rB,0,255)
-           , eR, eG, eB
-       );
-    }
-    eRtotal += eR;
-    eGtotal += eG;
-    eBtotal += eB;
-    AbseRtotal += abs(eR);
-    AbseGtotal += abs(eG);
-    AbseBtotal += abs(eB);
-    if (eR | eG | eB)
-       eCodes++;
-    eBits += abs(eR) + abs(eG) + abs(eB);
-}
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 8
- * fill-column: 78
- * End:
- */