+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.
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
## 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.
PROGRAM=libtool
PACKAGE=libtool
-VERSION=2.4.4
-package_revision=2.4.4
+VERSION=2.4.6
+package_revision=2.4.6
## ------ ##
# 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.
_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=.
# 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.
# End:
# Set a version string.
-scriptversion='(GNU libtool) 2.4.4'
+scriptversion='(GNU libtool) 2.4.6'
# func_echo ARG...
"
# 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:
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
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 ()
{
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/"
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=
#! /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>.
#
# 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=''
CXXFLAGS
CXX
CPP
+LT_SYS_LIBRARY_PATH
OTOOL64
OTOOL
LIPO
LDFLAGS
LIBS
CPPFLAGS
+LT_SYS_LIBRARY_PATH
CPP
CXX
CXXFLAGS
# 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]...
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
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
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.
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 $@
# Define the identity of the package.
PACKAGE='tiff'
- VERSION='4.0.6'
+ VERSION='4.0.7'
cat >>confdefs.h <<_ACEOF
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
-macro_version='2.4.4'
-macro_revision='2.4.4'
+macro_version='2.4.6'
+macro_revision='2.4.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;
;;
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'
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
# 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
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
;;
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
+
+
+
+
+
+
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
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
# 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
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
;;
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
+
+
+
# 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
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\\"
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"`'
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 \
# 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?
# 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
_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"
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)
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
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
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
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)
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
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
<HR>
-Last updated: $Date: 2004/09/10 14:43:18 $
+Last updated: $Date: 2016-09-25 20:05:44 $
</BODY>
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"><warmerdam@pobox.com></a>,
-Andrey Kiselev
-<a href="mailto:dron@ak4719.spb.edu"><dron@ak4719.spb.edu></a>.
+<a href="mailto:warmerdam@pobox.com"><warmerdam@pobox.com></a> and
+Bob Friesenhahn
+<a href="mailto:bfriesen@simple.dallas.tx.us"><bfriesen@simple.dallas.tx.us></a>.
<P>
Of course, reporting bugs is no substitute for discussion. The
<HR>
-Last updated: $Date: 2015-01-05 19:49:37 $
+Last updated: $Date: 2016-04-08 02:34:03 $
</BODY>
</HTML>
<P>
<HR>
-Last updated: $Date: 2006/01/03 01:42:30 $
+Last updated: $Date: 2016-09-25 20:05:44 $
</BODY>
</HTML>
<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
<HR>
<ADDRESS>
- Last updated: $Date: 2006/07/10 18:13:52 $
+ Last updated: $Date: 2016-09-25 20:05:44 $
</ADDRESS>
</BODY>
<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:
<P>
<HR>
-Last updated: $Date: 2006/01/02 23:50:44 $
+Last updated: $Date: 2016-09-25 20:05:44 $
</BODY>
</HTML>
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
<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>
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:
<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>
<P>
<HR>
-Last updated: $Date: 2004/09/10 14:47:31 $
+Last updated: $Date: 2016-09-25 20:05:44 $
</BODY>
<P>
<HR>
-Last updated: $Date: 1999/08/09 20:21:21 $
+Last updated: $Date: 2016-09-25 20:05:44 $
</BODY>
</HTML>
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>
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
tiffinfo.1.html
tiffmedian.1.html
tiffset.1.html
- tiffsplit.1.html
- tiffsv.1.html)
+ tiffsplit.1.html)
set(doc_DATA ${indexfile} ${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 \
tiffinfo.1.html \
tiffmedian.1.html \
tiffset.1.html \
- tiffsplit.1.html \
- tiffsv.1.html
+ tiffsplit.1.html
dist_doc_DATA = $(indexfile) $(docfiles)
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
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 \
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>'
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
+++ /dev/null
-<!-- 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 − 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>−c</b></p>
-</td>
-<td width="5%"></td>
-<td width="80%">
-
-<p>Specify a compression scheme to use when writing image
-data: <b>−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>−c lzw</b> for Lempel-Ziv &
-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>−r <number></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>
<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>
<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>
+++ /dev/null
-<!-- 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 − 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 & 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>−c</b></p>
-</td>
-<td width="5%"></td>
-<td width="80%">
-
-<p>Specify a compression scheme to use when writing image
-data: <b>−c none</b> for no compression, <b>−c
-packbits</b> for the PackBits compression algorithm,
-<b>−c zip</b> for the Deflate compression algorithm,
-and <b>−c lzw</b> for Lempel-Ziv & Welch (the
-default).</p>
-</td>
-<td width="0%">
-</td>
-<tr valign="top" align="left">
-<td width="10%"></td>
-<td width="3%">
-
-<p><b>−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’s
-<i>fromgif</i> program which, in turn, is based on Marcel
-J.E. Mol’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>
<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>
<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>
<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>
<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>
+++ /dev/null
-<!-- 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 − 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 & 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>−c</b></p>
-</td>
-<td width="6%"></td>
-<td width="80%">
-
-<p>Specify a compression scheme to use when writing image
-data: <b>−c none</b> for no compression, <b>−c
-packbits</b> for the PackBits compression algorithm,
-<b>−c jpeg</b> for the baseline JPEG compression
-algorithm, <b>−c zip</b> for the Deflate compression
-algorithm, and <b>−c lzw</b> for Lempel-Ziv &
-Welch (the default).</p>
-</td>
-<td width="0%">
-</td>
-<tr valign="top" align="left">
-<td width="10%"></td>
-<td width="2%">
-
-<p><b>−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>
<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>
<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>
+++ /dev/null
-<!-- 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 − 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 & 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>−c</b></p>
-</td>
-<td width="5%"></td>
-<td width="80%">
-
-<p>Specify a compression scheme to use when writing image
-data: <b>−c none</b> for no compression, <b>−c
-packbits</b> for the PackBits compression algorithm),
-<b>−c jpeg</b> for the baseline JPEG compression
-algorithm, <b>−c zip</b> for the Deflate compression
-algorithm, and <b>−c lzw</b> for Lempel-Ziv &
-Welch (the default).</p>
-</td>
-<td width="0%">
-</td>
-<tr valign="top" align="left">
-<td width="10%"></td>
-<td width="3%">
-
-<p><b>−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>−p
-contig</b> for samples packed contiguously, and <b>−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>−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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
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>
<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>
<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>
+++ /dev/null
-<!-- 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 − 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 & 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>−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>−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 & 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
-‘‘:’’-separated list to the
-‘‘lzw’’ option; e.g. <b>−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>−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>−p
-contig</b> will force data to be written with multi-sample
-data packed together, while <b>−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>−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>
Joris Van Damme
Tavis Ormandy
Richard Nolde
+ Even Rouault
</PRE>
(my apology to anyone that was inadvertently not listed.)
<HR>
-Last updated: $Date: 2007/02/24 15:47:04 $
+Last updated: $Date: 2016-09-25 20:05:44 $
</BODY>
</HTML>
</p>
<hr>
<p>
- Last updated: $Date: 2005/12/28 06:53:18 $
+ Last updated: $Date: 2016-09-25 20:05:45 $
</p>
</body>
</html>
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
<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>
<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>
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
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<HR>
-Last updated $Date: 2006/01/03 01:42:30 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
<HR>
-Last updated $Date: 2004/11/26 14:37:20 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
<HR>
-Last updated $Date: 2004/11/26 14:37:20 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
<HR>
-Last updated $Date: 2006/01/03 01:45:41 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
<HR>
-Last updated $Date: 2004/11/26 14:37:20 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
<HR>
-Last updated $Date: 2006/03/18 17:12:47 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
<HR>
-Last updated $Date: 2004/11/26 14:37:20 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
<HR>
-Last updated $Date: 2003/10/04 11:38:17 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
<HR>
-Last updated $Date: 2003/12/24 22:14:15 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
<HR>
-Last updated $Date: 2004/12/20 19:31:44 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
<HR>
-Last updated $Date: 2006/03/18 17:12:47 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
<HR>
-Last updated $Date: 2006/03/18 17:12:47 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
<HR>
-Last updated $Date: 2006/03/18 17:12:47 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
</UL>
-Last updated $Date: 2004/12/20 19:31:44 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
</UL>
-Last updated $Date: 2005/03/15 15:17:44 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
</UL>
-Last updated $Date: 2006/01/04 22:04:46 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
</UL>
-Last updated $Date: 2005/11/03 14:18:43 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
</UL>
-Last updated $Date: 2006/01/04 23:38:38 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
<UL>
</UL>
-Last updated $Date: 2006/03/13 14:52:12 $.
+Last updated $Date: 2016-09-25 20:05:45 $.
</BODY>
</HTML>
<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>
<UL>
</UL>
-Last updated $Date: 2006/03/23 14:54:01 $.
+Last updated $Date: 2016-09-25 20:05:46 $.
</BODY>
</HTML>
<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>
</UL>
-Last updated $Date: 2009-08-20 22:57:39 $.
+Last updated $Date: 2016-09-25 20:05:46 $.
</BODY>
</HTML>
<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>
</UL>
-Last updated $Date: 2009-08-28 18:54:11 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
</BODY>
</HTML>
<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>
</UL>
-Last updated $Date: 2009-11-04 17:38:13 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
</BODY>
</HTML>
<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>
<UL>
</UL>
-Last updated $Date: 2011-04-09 21:01:00 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
</BODY>
</HTML>
<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>
</UL>
-Last updated $Date: 2012-02-18 21:53:27 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
</BODY>
</HTML>
<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>
</UL>
-Last updated $Date: 2012-09-22 16:12:44 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
</BODY>
</HTML>
<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>
</UL>
-Last updated $Date: 2012-09-22 16:12:44 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
</BODY>
</HTML>
<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>
</UL>
-Last updated $Date: 2015-06-18 03:08:06 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
</BODY>
</HTML>
<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>
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>
<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>
</UL>
-Last updated $Date: 2015-08-28 16:04:56 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
</BODY>
</HTML>
<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>
</UL>
-Last updated $Date: 2015-09-12 19:29:47 $.
+Last updated $Date: 2016-09-25 20:05:47 $.
</BODY>
</HTML>
--- /dev/null
+<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>
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
_TIFFmemcpy
_TIFFmemset
_TIFFrealloc
+ _TIFFMultiply32
+ _TIFFMultiply64
-/* $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
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++) {
}
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);
}
{
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) {
/*
* 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
*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;
-/* $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
/**
* 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.
*
*/
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))
-/* $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
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 */
#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))
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);
-/* $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
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;
codec_t* cd;
codec_t** pcd;
- for (pcd = ®isteredCODECS; (cd = *pcd); pcd = &cd->next)
+ for (pcd = ®isteredCODECS; (cd = *pcd) != NULL; pcd = &cd->next)
if (cd->info == c) {
*pcd = cd->next;
_TIFFfree(cd);
/* 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
-/* $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)
{ 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)); }
* 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;
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:
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",
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 */
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
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:
}
}
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;
}
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);
* 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;
*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)
*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)
-/* $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 },
{ 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 },
/* 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 },
/* 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 },
{ 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.
*/
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};
* 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;
}
-/* $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
static void ChopUpSingleUncompressedStrip(TIFF*);
static uint64 TIFFReadUInt64(const uint8 *value);
+static int _TIFFFillStrilesInternal( TIFF *tif, int loadStripByteCount );
+
typedef union _UInt64Aligned_t
{
double d;
* 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
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)) {
* JpegInterchangeFormat stream.
*/
TIFFSetFieldBit(tif, FIELD_STRIPOFFSETS);
- } else {
+ } else
+#endif
+ {
MissingRequired(tif,
isTiled(tif) ? "TileOffsets" : "StripOffsets");
goto bad;
* 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.
case TIFFTAG_SMAXSAMPLEVALUE:
{
- double *data;
+ double *data = NULL;
enum TIFFReadDirEntryErr err;
uint32 saved_flags;
int m;
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 */
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;
}
/*
- * Read custom directory from the arbitarry offset.
+ * Read custom directory from the arbitrary offset.
* The code is very similar to TIFFReadDirectory().
*/
int
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);
/* 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) {
tif->tif_dirnumber++;
- if (tif->tif_dirnumber > tif->tif_dirlistsize) {
+ if (tif->tif_dirlist == NULL || tif->tif_dirnumber > tif->tif_dirlistsize) {
uint64* new_dirlist;
/*
}
else
{
- tmsize_t m;
uint64 dircount64;
m=off+sizeof(uint64);
if ((m<off)||(m<(tmsize_t)sizeof(uint64))||(m>tif->tif_size)) {
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);
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);
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;
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;
return return_value;
#else /* !defined(DEFER_STRILE_LOAD) */
(void) tif;
+ (void) loadStripByteCount;
return 1;
#endif
}
-/* $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
{
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
{
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;
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;
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;
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;
}
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:
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))
uint32 nTmp;
TIFFDirEntry* o;
n=dirmem;
- *(uint16*)n=ndir;
+ *(uint16*)n=(uint16)ndir;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort((uint16*)n);
n+=2;
}
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)
}
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
}
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));
}
}
}
{
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
-/* $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
cc -= n;
if (tif->tif_rawcc >= tif->tif_rawdatasize &&
!TIFFFlushData1(tif))
- return (-1);
+ return (0);
}
return (1);
}
-/* $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
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;
}
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;
}
** 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:
-/* $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
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
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
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;
/*
* 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;
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;
while (bits >= 8) {
if (*bp != 0x00) /* end of run */
return (span + zeroruns[*bp]);
- span += 8, bits -= 8;
+ span += 8;
+ bits -= 8;
bp++;
}
/*
/*
* 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;
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;
while (bits >= 8) {
if (*bp != 0xff) /* end of run */
return (span + oneruns[*bp]);
- span += 8, bits -= 8;
+ span += 8;
+ bits -= 8;
bp++;
}
/*
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);
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;
} 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);
}
-/* $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
/*
* 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:
*
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[];
-/* $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
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) {
"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);
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 );
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;
}
/* 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);
_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
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);
uint32 temp = *left;
*left = *right;
*right = temp;
- left++, right--;
+ left++;
+ right--;
}
}
}
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;
uint32 temp = *left;
*left = *right;
*right = temp;
- left++, right--;
+ left++;
+ right--;
}
}
}
uint32 temp = *left;
*left = *right;
*right = temp;
- left++, right--;
+ left++;
+ right--;
}
}
}
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);
uint32 temp = *left;
*left = *right;
*right = temp;
- left++, right--;
+ left++;
+ right--;
}
}
}
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]];
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]]];
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++];
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;
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 {
if (h <= 4)
break;
h -= 4;
- cp += incr, cp1 += incr, cp2 += incr, cp3 += incr;
+ cp += incr;
+ cp1 += incr;
+ cp2 += incr;
+ cp3 += incr;
pp += fromskew;
}
}
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 {
if (h <= 2)
break;
h -= 2;
- cp += incr, cp1 += incr;
+ cp += incr;
+ cp1 += incr;
pp += fromskew;
}
}
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);
}
case PHOTOMETRIC_SEPARATED:
if (img->bitspersample == 8)
break;
- /* fall thru... */
+ /* fall through... */
case PHOTOMETRIC_MINISBLACK:
case PHOTOMETRIC_MINISWHITE:
if (!setupMap(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;
}
break;
case PHOTOMETRIC_SEPARATED:
- if (buildMap(img)) {
+ if (img->samplesperpixel >=4 && buildMap(img)) {
if (img->bitspersample == 8) {
if (!img->Map)
img->put.contig = putRGBcontig8bitCMYKtile;
}
break;
case PHOTOMETRIC_CIELAB:
- if (buildMap(img)) {
+ if (img->samplesperpixel == 3 && buildMap(img)) {
if (img->bitspersample == 8)
img->put.contig = initCIELabConversion(img);
break;
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);
}
}
m=img->Bitdepth16To8;
for (n=0; n<65536; n++)
- *m++=(n+128)/257;
+ *m++=(uint8)((n+128)/257);
return(1);
}
-/* $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
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
else
{
uint16 m;
- m=skiplength-data->bufferbytesleft;
+ m=(uint16)(skiplength-data->bufferbytesleft);
if (m<=data->filebytesleft)
{
data->bufferbytesleft=0;
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.
((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 )
(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;
{
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));
}
}
}
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)
{
/* 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;
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);
# define TIFFInitJPEG TIFFInitJPEG_12
+int
+TIFFInitJPEG_12(TIFF* tif, int scheme);
+
# include LIBJPEG_12_PATH
# include "tif_jpeg.c"
-/* $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
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]));
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)
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,
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;
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]));
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 */
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,
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);
}
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);
}
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;
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 */
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;
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 */
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;
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 */
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);
}
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);
}
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);
*/
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,
-/* $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>
case LZMA_PROG_ERROR:
return "programming error";
default:
- return "unindentified liblzma error";
+ return "unidentified liblzma error";
}
}
"No space for LZMA2 state block");
return 0;
}
-#endif /* LZMA_SUPORT */
+#endif /* LZMA_SUPPORT */
/* vim: set ts=8 sts=8 sw=8 noet: */
-/* $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
*/
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--);
/*
* 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;
}
tif->tif_row);
return (0);
}
- *op++ = (char)code, occ--;
+ *op++ = (char)code;
+ occ--;
oldcodep = sp->dec_codetab + code;
continue;
}
--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;
/*
* Residue satisfies only part of the decode request.
*/
- op += residue, occ -= residue;
+ op += residue;
+ occ -= residue;
tp = op;
do {
*--tp = codep->value;
tif->tif_row);
return (0);
}
- *op++ = code, occ--;
+ *op++ = (char)code;
+ occ--;
oldcodep = sp->dec_codetab + code;
continue;
}
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;
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) {
/*
disp = 1;
do {
/*
- * Avoid pointer arithmetic 'cuz of
+ * Avoid pointer arithmetic because of
* wraparound problems with segments.
*/
if ((h -= disp) < 0)
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 */
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);
}
-/* $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
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; \
} \
}
return (0);
}
for (row = buf; cc > 0 && occ > 0; occ -= scanline, row += scanline) {
- n = *bp++, cc--;
+ n = *bp++;
+ cc--;
switch (n) {
case LITERALROW:
/*
}
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;
* 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;
}
-/* $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
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
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
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
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);
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;
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;
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;
}
}
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;
*(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;
}
}
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;
*(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;
/* 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;
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
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
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
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
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
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)
{
jpeg_encap_unwind(tif);
return(0);
}
+#ifdef _MSC_VER
+#pragma warning( pop )
+#endif
static void
OJPEGLibjpegJpegSourceMgrTermSource(jpeg_decompress_struct* cinfo)
-/* $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
* 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
* 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.
-/* $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
{
(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.
/*
* 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:
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...
n = (long)occ;
}
occ -= n;
- b = *bp++, cc--;
+ b = *bp++;
+ cc--;
while (n-- > 0)
*op++ = (uint8) b;
} else { /* copy next n+1 bytes literally */
-/* $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
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++)
typedef struct {
TIFFPredictorState predict;
z_stream stream;
+ tmsize_t tbuf_size; /* only set/used on reading for now */
uint16 *tbuf;
uint16 stride;
int state;
for (i = 0; i < lt2size; i++) {
if ((i*linstep)*(i*linstep) > ToLinearF[j]*ToLinearF[j+1])
j++;
- FromLT2[i] = j;
+ FromLT2[i] = (uint16)j;
}
/*
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);
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) {
}
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;
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)
{
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) {
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);
}
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;
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");
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]);
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;
+ }
}
}
}
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]);
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;
+ }
}
}
}
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;
}
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;
+ }
+ }
}
}
}
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) {
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)
{
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) {
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);
{
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
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);
}
}
-/* $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);
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,
}
/*
* Allocate buffer to keep the decoded bytes before
- * rearranging in the ight order
+ * rearranging in the right order
*/
}
/*
* 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.
*/
/* - 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.
} 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;
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;
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;
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] =
}
}
_TIFFfree(tmp);
+ return 1;
}
/*
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;
}
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;
}
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;
} while ((cc -= stride) > 0);
}
}
+ return 1;
}
-static void
+static int
horDiff16(TIFF* tif, uint8* cp0, tmsize_t cc)
{
TIFFPredictorState* sp = PredictorState(tif);
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;
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);
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;
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;
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++) {
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
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);
}
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;
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);
-/* $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
* ``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
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 */
-/* $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
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 */
};
#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 */
{
TIFFDirectory *td = &tif->tif_dir;
char *sep;
- uint16 i;
long l, n;
#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
}
}
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++) {
}
if (TIFFFieldSet(tif,FIELD_INKNAMES)) {
char* cp;
+ uint16 i;
fprintf(fd, " Ink Names: ");
i = td->td_samplesperpixel;
sep = "";
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)
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)
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,
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++)
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__))
-/* $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
#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);
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 */
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))
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;
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];
(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)
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;
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];
{
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))
-/* $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
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)
-/* $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
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: */
-/* $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
while (cc > 0 && npixels < maxpixels) {
int n, delta;
- n = *bp++, cc--;
+ n = *bp++;
+ cc--;
switch (n & THUNDER_CODE) {
case THUNDER_RUN: /* pixel run */
/*
-/* $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
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);
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) &&
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
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) &&
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;
}
-/* $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
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)
{
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)
{
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");
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)
{
"No space for ZIP state block");
return (0);
}
-#endif /* ZIP_SUPORT */
+#endif /* ZIP_SUPPORT */
/* vim: set ts=8 sts=8 sw=8 noet: */
/*
-/* $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
#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 */
#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 */
-/* $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
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 */
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;
-/* $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
/*
* 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 */
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 */
-#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
* version checking should be done based on the
* string returned by TIFFGetVersion.
*/
-#define TIFFLIB_VERSION 20150912
+#define TIFFLIB_VERSION 20161119
#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] = {
# 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
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
])
_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
_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"
])# _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
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],
[], [
# 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
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
;;
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
+
_LT_DECL([], [variables_saved_for_relink], [1],
[Variables whose values should be saved in libtool wrapper scripts and
restored at link time])
[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
} # func_stripname_cnf
])# _LT_FUNC_STRIPNAME_CNF
+
# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
# ---------------------------------
# Figure out "hidden" library dependencies from verbose
_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
])
# 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
#
# 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
#
# 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
# @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)
])
# 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.
#
# 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
tiffinfo.1
tiffmedian.1
tiffset.1
- tiffsplit.1
- tiffsv.1)
+ tiffsplit.1)
set(man3_MANS
libtiff.3tiff
# 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 \
tiffinfo.1 \
tiffmedian.1 \
tiffset.1 \
- tiffsplit.1 \
- tiffsv.1
+ tiffsplit.1
dist_man3_MANS = \
libtiff.3tiff \
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
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 \
tiffinfo.1 \
tiffmedian.1 \
tiffset.1 \
- tiffsplit.1 \
- tiffsv.1
+ tiffsplit.1
dist_man3_MANS = \
libtiff.3tiff \
-.\" $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.
.BR TIFFOpen (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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>
.\"
.BR libtiff (3TIFF),
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR printf (3)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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>
.\"
.BR libtiff (3TIFF),
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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>
.\"
.BR libtiff (3TIFF),
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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>
.\"
.BR libtiff (3TIFF),
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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>
.\"
.BR libtiff (3TIFF),
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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>
.\"
.BR libtiff (3TIFF),
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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>
.\"
.BR libtiff (3TIFF),
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF),
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF),
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.IR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR printf (3)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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>
.\"
.BR libtiff (3TIFF),
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF),
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
+++ /dev/null
-.\" $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/
-.\" $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.
.BR libtiff (3)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
+++ /dev/null
-.\" $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/
-.\" $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.
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.
-.\" $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.
.BR libtiff (3)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
+++ /dev/null
-.\" $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/
-
-.\" $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.
.BR libtiff (3)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff
+.BR http://www.simplesystems.org/libtiff
+++ /dev/null
-.\" $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/
-.\" $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.
.BR libtiff (3)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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
.\"
.BR tiff2ps (1)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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:
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
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/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
-.\" $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.
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
-.BR http://www.remotesensing.org/libtiff/
+.BR http://www.simplesystems.org/libtiff/
+++ /dev/null
-.\" $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/
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
# Test scripts to execute
TESTSCRIPTS = \
- bmp2tiff_palette.sh \
- bmp2tiff_rgb.sh \
- gif2tiff.sh \
ppm2tiff_pbm.sh \
ppm2tiff_pgm.sh \
ppm2tiff_ppm.sh \
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 \
# files which are not currently used by the tests.
IMAGES_EXTRA_DIST = \
images/README.txt \
- $(BMPIMAGES) \
- $(GIFIMAGES) \
$(PNMIMAGES) \
$(TIFFIMAGES)
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 \
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
# Test scripts to execute
TESTSCRIPTS = \
- bmp2tiff_palette.sh \
- bmp2tiff_rgb.sh \
- gif2tiff.sh \
ppm2tiff_pbm.sh \
ppm2tiff_pgm.sh \
ppm2tiff_ppm.sh \
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 \
# files which are not currently used by the tests.
IMAGES_EXTRA_DIST = \
images/README.txt \
- $(BMPIMAGES) \
- $(GIFIMAGES) \
$(PNMIMAGES) \
$(TIFFIMAGES)
--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'; \
+++ /dev/null
-#!/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
+++ /dev/null
-#!/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
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
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
+++ /dev/null
-#!/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
${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)
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
Makefile.vc
bin_PROGRAMS = \
- bmp2tiff \
fax2ps \
fax2tiff \
- gif2tiff \
pal2rgb \
ppm2tiff \
- ras2tiff \
raw2tiff \
- rgb2ycbcr \
- thumbnail \
tiff2bw \
tiff2pdf \
tiff2ps \
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)
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 \
@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)
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
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;; \
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
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
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)
@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)
@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)
@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)
@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@
@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 $@ $<
fi; \
done
check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
@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)
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
-# $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>
#
!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
+++ /dev/null
-/* $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:
- */
-/* $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
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 */
+++ /dev/null
-/* $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:
- */
+++ /dev/null
-/* $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:
- */
+++ /dev/null
-/* $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.
- */
-/* $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
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);
+++ /dev/null
-/* $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:
- */
+++ /dev/null
-/* $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:
- */
-/* $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
#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% */
-/* $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
*
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*);
#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;
}
#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;
}
if(!t2p_process_jpeg_strip(
stripbuffer,
&striplength,
- buffer,
+ buffer,
+ t2p->tiff_datasize,
&bufferoffset,
i,
t2p->tiff_length)){
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,
unsigned char* strip,
tsize_t* striplength,
unsigned char* buffer,
+ tsize_t buffersize,
tsize_t* bufferoffset,
tstrip_t no,
uint32 height){
}
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;
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)
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);
{
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);
-/* $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
uint32 row, col;
uint32 *wrk_line;
int ok = 1;
+ uint32 rastersize, wrk_linesize;
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
/*
* 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);
* 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;
uint32 row;
uint32 *wrk_line;
int ok = 1;
+ uint32 rastersize, wrk_linesize;
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
/*
* 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);
* 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;
-/* $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
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;
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),
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.
-/* $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
#define PATH_MAX 1024
#endif
+#define TIFF_UINT32_MAX 0xFFFFFFFFU
+
#ifndef streq
#define streq(a,b) (strcmp((a),(b)) == 0)
#endif
}
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))
{
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)
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)
(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);
!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))
{
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;
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)
{
{
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);
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);
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)
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)
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)
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);
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)
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)
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)
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;
{
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;
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",
}
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;
/* +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)
{
}
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 */
-/* $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
void* datamem;
uint64 dataoffset;
int datatruncated;
- int datasizeoverflow;
+ int datasizeoverflow;
tag = *(uint16*)dp;
if (swabflag)
}
else
{
- count = *(uint64*)dp;
+ memcpy(&count, dp, sizeof(uint64));
if (swabflag)
TIFFSwabLong8(&count);
dp += sizeof(uint64);
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;
{
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)
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: {
-/* $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
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;
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) {
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;
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++) {
+++ /dev/null
-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:
- */