summaryrefslogtreecommitdiff
path: root/tiff
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2019-11-26 12:13:13 +0000
committerChris Liddell <chris.liddell@artifex.com>2019-11-26 13:20:38 +0000
commit9282c39e6150befd80793b3221864c9f1f814b66 (patch)
treedd78dc12dfd64de329d7f7f42b24cc6c359b22a0 /tiff
parentaa13e1a3fac84ada2b676f9c5fcffb30f5df74dd (diff)
downloadghostpdl-9282c39e6150befd80793b3221864c9f1f814b66.tar.gz
Update libtiff to 4.1.0
Add in portability changes to tiffiop.h Portability tiffiop.h Remove globals from tif_pixarlog.c
Diffstat (limited to 'tiff')
-rw-r--r--tiff/CMakeLists.txt170
-rw-r--r--tiff/ChangeLog1599
-rw-r--r--tiff/HOWTO-RELEASE71
-rw-r--r--tiff/Makefile.am3
-rw-r--r--tiff/Makefile.in36
-rw-r--r--tiff/Makefile.vc1
-rw-r--r--tiff/README.md (renamed from tiff/README)20
-rw-r--r--tiff/README.vms12
-rw-r--r--tiff/RELEASE-DATE2
-rw-r--r--tiff/SConstruct2
-rw-r--r--tiff/TODO2
-rw-r--r--tiff/VERSION2
-rw-r--r--tiff/aclocal.m4191
-rw-r--r--tiff/build/Makefile.in20
-rwxr-xr-xtiff/config/compile13
-rwxr-xr-xtiff/config/config.guess742
-rwxr-xr-xtiff/config/config.sub359
-rwxr-xr-xtiff/config/depcomp10
-rwxr-xr-xtiff/config/install-sh512
-rw-r--r--[-rwxr-xr-x]tiff/config/ltmain.sh37
-rwxr-xr-xtiff/config/missing16
-rwxr-xr-xtiff/config/mkinstalldirs161
-rwxr-xr-xtiff/config/test-driver37
-rwxr-xr-xtiff/configure677
-rw-r--r--tiff/configure.ac154
-rw-r--r--tiff/configure.com1
-rw-r--r--tiff/contrib/Makefile.in20
-rw-r--r--tiff/contrib/addtiffo/Makefile.in47
-rw-r--r--tiff/contrib/addtiffo/addtiffo.c2
-rw-r--r--tiff/contrib/addtiffo/tif_overview.c14
-rw-r--r--tiff/contrib/addtiffo/tif_ovrcache.c2
-rw-r--r--tiff/contrib/dbs/Makefile.in52
-rw-r--r--tiff/contrib/dbs/tiff-bi.c2
-rw-r--r--tiff/contrib/dbs/tiff-grayscale.c2
-rw-r--r--tiff/contrib/dbs/tiff-palette.c2
-rw-r--r--tiff/contrib/dbs/tiff-rgb.c2
-rw-r--r--tiff/contrib/dbs/xtiff/Makefile.in18
-rw-r--r--tiff/contrib/dbs/xtiff/xtiff.c2
-rw-r--r--tiff/contrib/iptcutil/Makefile.in38
-rw-r--r--tiff/contrib/iptcutil/iptcutil.c5
-rw-r--r--tiff/contrib/mfs/Makefile.in18
-rw-r--r--tiff/contrib/pds/Makefile.in18
-rw-r--r--tiff/contrib/pds/README2
-rw-r--r--tiff/contrib/pds/tif_imageiter.c8
-rw-r--r--tiff/contrib/pds/tif_imageiter.h2
-rw-r--r--tiff/contrib/pds/tif_pdsdirread.c6
-rw-r--r--tiff/contrib/pds/tif_pdsdirwrite.c2
-rw-r--r--tiff/contrib/ras/Makefile.in18
-rw-r--r--tiff/contrib/ras/tif2ras.c3
-rw-r--r--tiff/contrib/stream/Makefile.in18
-rw-r--r--tiff/contrib/tags/Makefile.in18
-rw-r--r--tiff/contrib/tags/README2
-rw-r--r--tiff/contrib/tags/xtif_dir.c2
-rw-r--r--tiff/contrib/win_dib/Makefile.in18
-rw-r--r--tiff/contrib/win_dib/Makefile.w952
-rw-r--r--tiff/contrib/win_dib/README.tiff2dib2
-rw-r--r--tiff/contrib/win_dib/Tiffile.cpp4
-rw-r--r--tiff/html/Makefile.am4
-rw-r--r--tiff/html/Makefile.in24
-rw-r--r--tiff/html/addingtags.html4
-rw-r--r--tiff/html/bugs.html21
-rw-r--r--tiff/html/build.html2
-rw-r--r--tiff/html/document.html4
-rw-r--r--tiff/html/images.html4
-rw-r--r--tiff/html/images/Makefile.in18
-rw-r--r--tiff/html/index.html30
-rw-r--r--tiff/html/libtiff.html6
-rw-r--r--tiff/html/man/Makefile.in18
-rw-r--r--tiff/html/man/TIFFReadDirectory.3tiff.html8
-rw-r--r--tiff/html/man/TIFFWriteDirectory.3tiff.html2
-rw-r--r--tiff/html/man/TIFFmemory.3tiff.html2
-rw-r--r--tiff/html/v3.4beta007.html2
-rw-r--r--tiff/html/v3.4beta016.html2
-rw-r--r--tiff/html/v3.4beta018.html2
-rw-r--r--tiff/html/v3.4beta024.html2
-rw-r--r--tiff/html/v3.4beta028.html2
-rw-r--r--tiff/html/v3.4beta029.html2
-rw-r--r--tiff/html/v3.4beta031.html2
-rw-r--r--tiff/html/v3.4beta032.html2
-rw-r--r--tiff/html/v3.4beta033.html2
-rw-r--r--tiff/html/v3.4beta034.html2
-rw-r--r--tiff/html/v3.4beta035.html2
-rw-r--r--tiff/html/v3.4beta036.html2
-rw-r--r--tiff/html/v3.5.1.html2
-rw-r--r--tiff/html/v3.5.2.html2
-rw-r--r--tiff/html/v3.5.3.html4
-rw-r--r--tiff/html/v3.5.4.html2
-rw-r--r--tiff/html/v3.5.5.html2
-rw-r--r--tiff/html/v3.5.6-beta.html4
-rw-r--r--tiff/html/v3.5.7.html4
-rw-r--r--tiff/html/v3.6.0.html6
-rw-r--r--tiff/html/v3.6.1.html4
-rw-r--r--tiff/html/v3.7.0.html2
-rw-r--r--tiff/html/v3.7.0alpha.html2
-rw-r--r--tiff/html/v3.7.0beta.html2
-rw-r--r--tiff/html/v3.7.0beta2.html2
-rw-r--r--tiff/html/v3.7.1.html2
-rw-r--r--tiff/html/v3.7.2.html4
-rw-r--r--tiff/html/v3.7.3.html4
-rw-r--r--tiff/html/v3.7.4.html2
-rw-r--r--tiff/html/v3.8.0.html2
-rw-r--r--tiff/html/v3.8.1.html2
-rw-r--r--tiff/html/v3.8.2.html2
-rw-r--r--tiff/html/v3.9.0beta.html2
-rw-r--r--tiff/html/v3.9.1.html2
-rw-r--r--tiff/html/v3.9.2.html2
-rw-r--r--tiff/html/v4.0.0.html6
-rw-r--r--tiff/html/v4.0.1.html2
-rw-r--r--tiff/html/v4.0.10.html326
-rw-r--r--tiff/html/v4.0.2.html2
-rw-r--r--tiff/html/v4.0.3.html2
-rw-r--r--tiff/html/v4.0.4.html2
-rw-r--r--tiff/html/v4.0.4beta.html2
-rw-r--r--tiff/html/v4.0.5.html2
-rw-r--r--tiff/html/v4.0.6.html2
-rw-r--r--tiff/html/v4.0.7.html2
-rw-r--r--tiff/html/v4.0.8.html2
-rw-r--r--tiff/html/v4.0.9.html2
-rw-r--r--tiff/html/v4.1.0.html198
-rw-r--r--tiff/libtiff/CMakeLists.txt18
-rw-r--r--tiff/libtiff/Makefile.am4
-rw-r--r--tiff/libtiff/Makefile.in279
-rw-r--r--tiff/libtiff/Makefile.vc2
-rw-r--r--tiff/libtiff/SConstruct2
-rw-r--r--tiff/libtiff/libtiff.def7
-rw-r--r--tiff/libtiff/mkg3states.c4
-rw-r--r--tiff/libtiff/t4.h2
-rw-r--r--tiff/libtiff/tif_aux.c77
-rw-r--r--tiff/libtiff/tif_close.c2
-rw-r--r--tiff/libtiff/tif_codec.c10
-rw-r--r--tiff/libtiff/tif_color.c4
-rw-r--r--tiff/libtiff/tif_compress.c2
-rw-r--r--tiff/libtiff/tif_config.h.cmake.in48
-rw-r--r--tiff/libtiff/tif_config.h.in62
-rw-r--r--tiff/libtiff/tif_config.wince.h2
-rw-r--r--tiff/libtiff/tif_dir.c96
-rw-r--r--tiff/libtiff/tif_dir.h18
-rw-r--r--tiff/libtiff/tif_dirinfo.c17
-rw-r--r--tiff/libtiff/tif_dirread.c1356
-rw-r--r--tiff/libtiff/tif_dirwrite.c352
-rw-r--r--tiff/libtiff/tif_dumpmode.c2
-rw-r--r--tiff/libtiff/tif_error.c2
-rw-r--r--tiff/libtiff/tif_extension.c2
-rw-r--r--tiff/libtiff/tif_fax3.c2
-rw-r--r--tiff/libtiff/tif_fax3.h2
-rw-r--r--tiff/libtiff/tif_flush.c120
-rw-r--r--tiff/libtiff/tif_getimage.c36
-rw-r--r--tiff/libtiff/tif_jbig.c34
-rw-r--r--tiff/libtiff/tif_jpeg.c23
-rw-r--r--tiff/libtiff/tif_luv.c37
-rw-r--r--tiff/libtiff/tif_lzma.c11
-rw-r--r--tiff/libtiff/tif_lzw.c34
-rw-r--r--tiff/libtiff/tif_next.c2
-rw-r--r--tiff/libtiff/tif_ojpeg.c93
-rw-r--r--tiff/libtiff/tif_open.c20
-rw-r--r--tiff/libtiff/tif_packbits.c2
-rw-r--r--tiff/libtiff/tif_pixarlog.c16
-rw-r--r--tiff/libtiff/tif_predict.c2
-rw-r--r--tiff/libtiff/tif_predict.h6
-rw-r--r--tiff/libtiff/tif_print.c14
-rw-r--r--tiff/libtiff/tif_read.c269
-rw-r--r--tiff/libtiff/tif_stream.cxx8
-rw-r--r--tiff/libtiff/tif_strip.c40
-rw-r--r--tiff/libtiff/tif_swab.c2
-rw-r--r--tiff/libtiff/tif_thunder.c12
-rw-r--r--tiff/libtiff/tif_tile.c29
-rw-r--r--tiff/libtiff/tif_unix.c2
-rw-r--r--tiff/libtiff/tif_version.c1
-rw-r--r--tiff/libtiff/tif_warning.c2
-rw-r--r--tiff/libtiff/tif_webp.c695
-rw-r--r--tiff/libtiff/tif_win32.c41
-rw-r--r--tiff/libtiff/tif_write.c146
-rw-r--r--tiff/libtiff/tif_zip.c60
-rw-r--r--tiff/libtiff/tif_zstd.c440
-rw-r--r--tiff/libtiff/tiff.h18
-rw-r--r--tiff/libtiff/tiffconf.h.cmake.in9
-rw-r--r--tiff/libtiff/tiffconf.h.in9
-rw-r--r--tiff/libtiff/tiffconf.vc.h9
-rw-r--r--tiff/libtiff/tiffconf.wince.h11
-rw-r--r--tiff/libtiff/tiffio.h14
-rw-r--r--tiff/libtiff/tiffio.hxx3
-rw-r--r--tiff/libtiff/tiffiop.h37
-rw-r--r--tiff/libtiff/tiffvers.h4
-rw-r--r--tiff/m4/libtool.m427
-rw-r--r--tiff/man/Makefile.in17
-rw-r--r--tiff/man/TIFFClose.3tiff1
-rw-r--r--tiff/man/TIFFDataWidth.3tiff1
-rw-r--r--tiff/man/TIFFError.3tiff1
-rw-r--r--tiff/man/TIFFFieldDataType.3tiff1
-rw-r--r--tiff/man/TIFFFieldName.3tiff1
-rw-r--r--tiff/man/TIFFFieldPassCount.3tiff1
-rw-r--r--tiff/man/TIFFFieldReadCount.3tiff1
-rw-r--r--tiff/man/TIFFFieldTag.3tiff1
-rw-r--r--tiff/man/TIFFFieldWriteCount.3tiff1
-rw-r--r--tiff/man/TIFFFlush.3tiff1
-rw-r--r--tiff/man/TIFFGetField.3tiff1
-rw-r--r--tiff/man/TIFFOpen.3tiff16
-rw-r--r--tiff/man/TIFFPrintDirectory.3tiff1
-rw-r--r--tiff/man/TIFFRGBAImage.3tiff1
-rw-r--r--tiff/man/TIFFReadDirectory.3tiff1
-rw-r--r--tiff/man/TIFFReadEncodedStrip.3tiff1
-rw-r--r--tiff/man/TIFFReadEncodedTile.3tiff1
-rw-r--r--tiff/man/TIFFReadRGBAImage.3tiff1
-rw-r--r--tiff/man/TIFFReadRGBAStrip.3tiff1
-rw-r--r--tiff/man/TIFFReadRGBATile.3tiff1
-rw-r--r--tiff/man/TIFFReadRawStrip.3tiff1
-rw-r--r--tiff/man/TIFFReadRawTile.3tiff1
-rw-r--r--tiff/man/TIFFReadScanline.3tiff1
-rw-r--r--tiff/man/TIFFReadTile.3tiff1
-rw-r--r--tiff/man/TIFFSetDirectory.3tiff1
-rw-r--r--tiff/man/TIFFSetField.3tiff1
-rw-r--r--tiff/man/TIFFWarning.3tiff1
-rw-r--r--tiff/man/TIFFWriteDirectory.3tiff1
-rw-r--r--tiff/man/TIFFWriteEncodedStrip.3tiff1
-rw-r--r--tiff/man/TIFFWriteEncodedTile.3tiff1
-rw-r--r--tiff/man/TIFFWriteRawStrip.3tiff1
-rw-r--r--tiff/man/TIFFWriteRawTile.3tiff1
-rw-r--r--tiff/man/TIFFWriteScanline.3tiff1
-rw-r--r--tiff/man/TIFFWriteTile.3tiff1
-rw-r--r--tiff/man/TIFFbuffer.3tiff1
-rw-r--r--tiff/man/TIFFcodec.3tiff1
-rw-r--r--tiff/man/TIFFcolor.3tiff1
-rw-r--r--tiff/man/TIFFmemory.3tiff3
-rw-r--r--tiff/man/TIFFquery.3tiff3
-rw-r--r--tiff/man/TIFFsize.3tiff1
-rw-r--r--tiff/man/TIFFstrip.3tiff1
-rw-r--r--tiff/man/TIFFswab.3tiff1
-rw-r--r--tiff/man/TIFFtile.3tiff1
-rw-r--r--tiff/man/fax2ps.11
-rw-r--r--tiff/man/fax2tiff.11
-rw-r--r--tiff/man/libtiff.3tiff7
-rw-r--r--tiff/man/pal2rgb.11
-rw-r--r--tiff/man/ppm2tiff.11
-rw-r--r--tiff/man/raw2tiff.11
-rw-r--r--tiff/man/tiff2bw.11
-rw-r--r--tiff/man/tiff2pdf.11
-rw-r--r--tiff/man/tiff2ps.11
-rw-r--r--tiff/man/tiff2rgba.11
-rw-r--r--tiff/man/tiffcmp.11
-rw-r--r--tiff/man/tiffcp.11
-rw-r--r--tiff/man/tiffcrop.11
-rw-r--r--tiff/man/tiffdither.11
-rw-r--r--tiff/man/tiffdump.11
-rw-r--r--tiff/man/tiffgt.11
-rw-r--r--tiff/man/tiffinfo.11
-rw-r--r--tiff/man/tiffmedian.11
-rw-r--r--tiff/man/tiffset.11
-rw-r--r--tiff/man/tiffsplit.11
-rw-r--r--tiff/nmake.opt15
-rw-r--r--tiff/port/CMakeLists.txt8
-rw-r--r--tiff/port/Makefile.am4
-rw-r--r--tiff/port/Makefile.in92
-rw-r--r--tiff/port/Makefile.vc1
-rw-r--r--tiff/port/_strtol.h160
-rw-r--r--tiff/port/_strtoul.h127
-rw-r--r--tiff/port/dummy.c2
-rw-r--r--tiff/port/getopt.c2
-rw-r--r--tiff/port/lfind.c2
-rw-r--r--tiff/port/libport.h13
-rw-r--r--tiff/port/snprintf.c4
-rw-r--r--tiff/port/strcasecmp.c2
-rw-r--r--tiff/port/strtol.c45
-rw-r--r--tiff/port/strtoll.c44
-rw-r--r--tiff/port/strtoul.c91
-rw-r--r--tiff/port/strtoull.c108
-rw-r--r--tiff/test/CMakeLists.txt20
-rw-r--r--tiff/test/Makefile.am20
-rw-r--r--tiff/test/Makefile.in206
-rw-r--r--tiff/test/ascii_tag.c2
-rw-r--r--tiff/test/check_tag.c2
-rw-r--r--tiff/test/common.sh2
-rw-r--r--tiff/test/custom_dir.c2
-rw-r--r--tiff/test/defer_strile_loading.c311
-rw-r--r--tiff/test/defer_strile_writing.c239
-rwxr-xr-xtiff/test/fax2tiff.sh17
-rw-r--r--tiff/test/images/README.txt3
-rw-r--r--tiff/test/images/lzw-single-strip.tiffbin0 -> 76264 bytes
-rw-r--r--tiff/test/images/miniswhite-1c-1b.g3bin0 -> 9687 bytes
-rw-r--r--tiff/test/long_tag.c2
-rw-r--r--tiff/test/raw_decode.c2
-rw-r--r--tiff/test/refs/o-tiff2ps-EPS1.ps112
-rw-r--r--tiff/test/refs/o-tiff2ps-PS1.ps115
-rw-r--r--tiff/test/refs/o-tiff2ps-PS2.ps104
-rw-r--r--tiff/test/refs/o-tiff2ps-PS3.ps104
-rw-r--r--tiff/test/rewrite_tag.c41
-rw-r--r--tiff/test/short_tag.c2
-rw-r--r--tiff/test/strip.c2
-rw-r--r--tiff/test/strip_rw.c2
-rw-r--r--tiff/test/test_arrays.c2
-rw-r--r--tiff/test/test_arrays.h2
-rw-r--r--tiff/test/testtypes.c58
-rwxr-xr-xtiff/test/tiff2ps-EPS1.sh4
-rwxr-xr-xtiff/test/tiff2ps-PS1.sh4
-rwxr-xr-xtiff/test/tiff2ps-PS2.sh4
-rwxr-xr-xtiff/test/tiff2ps-PS3.sh4
-rwxr-xr-xtiff/test/tiffcp-lzw-scanline-decode.sh6
-rw-r--r--tiff/test/tifftest.h2
-rw-r--r--tiff/tools/CMakeLists.txt2
-rw-r--r--tiff/tools/Makefile.in125
-rw-r--r--tiff/tools/Makefile.vc1
-rw-r--r--tiff/tools/fax2ps.c2
-rw-r--r--tiff/tools/fax2tiff.c20
-rw-r--r--tiff/tools/pal2rgb.c44
-rw-r--r--tiff/tools/ppm2tiff.c19
-rw-r--r--tiff/tools/raw2tiff.c5
-rw-r--r--tiff/tools/rgb2ycbcr.c2
-rw-r--r--tiff/tools/thumbnail.c22
-rw-r--r--tiff/tools/tiff2bw.c50
-rw-r--r--tiff/tools/tiff2pdf.c166
-rw-r--r--tiff/tools/tiff2ps.c42
-rw-r--r--tiff/tools/tiff2rgba.c2
-rw-r--r--tiff/tools/tiffcmp.c7
-rw-r--r--tiff/tools/tiffcp.c38
-rw-r--r--tiff/tools/tiffcrop.c117
-rw-r--r--tiff/tools/tiffdither.c2
-rw-r--r--tiff/tools/tiffdump.c4
-rw-r--r--tiff/tools/tiffgt.c9
-rw-r--r--tiff/tools/tiffinfo.c4
-rw-r--r--tiff/tools/tiffmedian.c2
-rw-r--r--tiff/tools/tiffset.c23
-rw-r--r--tiff/tools/tiffsplit.c4
321 files changed, 9867 insertions, 3762 deletions
diff --git a/tiff/CMakeLists.txt b/tiff/CMakeLists.txt
index 52b5ae99c..35b48770c 100644
--- a/tiff/CMakeLists.txt
+++ b/tiff/CMakeLists.txt
@@ -23,7 +23,7 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-cmake_minimum_required(VERSION 2.8.9)
+cmake_minimum_required(VERSION 2.8.11) # b/c of use of BUILD_INTERFACE generator expression
# Default policy is from 2.8.9
cmake_policy(VERSION 2.8.9)
@@ -92,8 +92,9 @@ include(GNUInstallDirs)
include(CheckCCompilerFlag)
include(CheckCSourceCompiles)
include(CheckIncludeFile)
+include(CheckLibraryExists)
include(CheckTypeSize)
-include(CheckFunctionExists)
+include(CheckSymbolExists)
enable_testing()
macro(current_date var)
@@ -213,9 +214,6 @@ check_include_file(dlfcn.h HAVE_DLFCN_H)
check_include_file(fcntl.h HAVE_FCNTL_H)
check_include_file(inttypes.h HAVE_INTTYPES_H)
check_include_file(io.h HAVE_IO_H)
-check_include_file(limits.h HAVE_LIMITS_H)
-check_include_file(malloc.h HAVE_MALLOC_H)
-check_include_file(memory.h HAVE_MEMORY_H)
check_include_file(search.h HAVE_SEARCH_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(string.h HAVE_STRING_H)
@@ -271,8 +269,6 @@ int main(void){
# Check type sizes
# NOTE: Could be replaced with C99 <stdint.h>
-check_type_size("signed short" SIZEOF_SIGNED_SHORT)
-check_type_size("unsigned short" SIZEOF_UNSIGNED_SHORT)
check_type_size("signed int" SIZEOF_SIGNED_INT)
check_type_size("unsigned int" SIZEOF_UNSIGNED_INT)
check_type_size("signed long" SIZEOF_SIGNED_LONG)
@@ -342,29 +338,21 @@ endif()
if(SIZEOF_UNSIGNED_INT EQUAL SIZEOF_SIZE_T)
set(TIFF_SIZE_T "unsigned int")
set(TIFF_SIZE_FORMAT "%u")
+ set(TIFF_SSIZE_T "signed int")
+ set(TIFF_SSIZE_FORMAT "%d")
elseif(SIZEOF_UNSIGNED_LONG EQUAL SIZEOF_SIZE_T)
set(TIFF_SIZE_T "unsigned long")
set(TIFF_SIZE_FORMAT "%lu")
-elseif(SIZEOF_UNSIGNED_LONG_LONG EQUAL SIZEOF_SIZE_T)
- set(TIFF_SIZE_T "unsigned long")
- if (MINGW)
- set(TIFF_SIZE_FORMAT "%I64u")
- else()
- set(TIFF_SIZE_FORMAT "%llu")
- endif()
-endif()
-
-if(SIZEOF_SIGNED_INT EQUAL SIZEOF_UNSIGNED_CHAR_P)
- set(TIFF_SSIZE_T "signed int")
- set(TIFF_SSIZE_FORMAT "%d")
-elseif(SIZEOF_SIGNED_LONG EQUAL SIZEOF_UNSIGNED_CHAR_P)
set(TIFF_SSIZE_T "signed long")
set(TIFF_SSIZE_FORMAT "%ld")
-elseif(SIZEOF_SIGNED_LONG_LONG EQUAL SIZEOF_UNSIGNED_CHAR_P)
+elseif(SIZEOF_UNSIGNED_LONG_LONG EQUAL SIZEOF_SIZE_T)
+ set(TIFF_SIZE_T "unsigned long long")
set(TIFF_SSIZE_T "signed long long")
if (MINGW)
+ set(TIFF_SIZE_FORMAT "%I64u")
set(TIFF_SSIZE_FORMAT "%I64d")
else()
+ set(TIFF_SIZE_FORMAT "%llu")
set(TIFF_SSIZE_FORMAT "%lld")
endif()
endif()
@@ -388,80 +376,37 @@ endif()
# TIFF_SSIZE_T TIFF_SSIZE_FORMAT
# TIFF_PTRDIFF_T TIFF_PTRDIFF_FORMAT)
-# Nonstandard int types
-check_type_size(INT8 int8)
-set(HAVE_INT8 ${INT8})
-check_type_size(INT16 int16)
-set(HAVE_INT16 ${INT16})
-check_type_size(INT32 int32)
-set(HAVE_INT32 ${INT32})
-
-# Check functions
-set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
-set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${M_LIBRARY})
-check_function_exists(floor HAVE_FLOOR)
-check_function_exists(pow HAVE_POW)
-check_function_exists(sqrt HAVE_SQRT)
-set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
-
-check_function_exists(isascii HAVE_ISASCII)
-check_function_exists(memmove HAVE_MEMMOVE)
-check_function_exists(memset HAVE_MEMSET)
-check_function_exists(mmap HAVE_MMAP)
-check_function_exists(setmode HAVE_SETMODE)
-check_function_exists(strcasecmp HAVE_STRCASECMP)
-check_function_exists(strchr HAVE_STRCHR)
-check_function_exists(strrchr HAVE_STRRCHR)
-check_function_exists(strstr HAVE_STRSTR)
-check_function_exists(strtol HAVE_STRTOL)
-check_function_exists(strtol HAVE_STRTOUL)
-check_function_exists(strtoull HAVE_STRTOULL)
-check_function_exists(getopt HAVE_GETOPT)
-check_function_exists(lfind HAVE_LFIND)
-
-# May be inlined, so check it compiles:
-check_c_source_compiles("
-#include <stdio.h>
-int main(void) {
- char buf[10];
- snprintf(buf, 10, \"Test %d\", 1);
- return 0;
-}"
- HAVE_SNPRINTF)
+check_symbol_exists(mmap "sys/mman.h" HAVE_MMAP)
+check_symbol_exists(setmode "unistd.h" HAVE_SETMODE)
+check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
+check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP)
+check_symbol_exists(strtol "stdlib.h" HAVE_STRTOL)
+check_symbol_exists(strtoll "stdlib.h" HAVE_STRTOLL)
+check_symbol_exists(strtoul "stdlib.h" HAVE_STRTOUL)
+check_symbol_exists(strtoull "stdlib.h" HAVE_STRTOULL)
+check_symbol_exists(getopt "unistd.h;stdio.h" HAVE_GETOPT)
+check_symbol_exists(lfind "search.h" HAVE_LFIND)
if(NOT HAVE_SNPRINTF)
add_definitions(-DNEED_LIBPORT)
endif()
# CPU bit order
-set(fillorder FILLORDER_MSB2LSB)
+set(HOST_FILLORDER FILLORDER_MSB2LSB)
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i.*86.*" OR
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*" OR
+ # AMD64 on Windows
+ CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "AMD64" OR
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64.*")
- set(fillorder FILLORDER_LSB2MSB)
+ set(HOST_FILLORDER FILLORDER_LSB2MSB)
endif()
-set(HOST_FILLORDER ${fillorder} CACHE STRING "Native CPU bit order")
-mark_as_advanced(HOST_FILLORDER)
# CPU endianness
include(TestBigEndian)
-test_big_endian(bigendian)
-if (bigendian)
- set(bigendian ON)
-else()
- set(bigendian OFF)
-endif()
-set(HOST_BIG_ENDIAN ${bigendian} CACHE STRING "Native CPU bit order")
-mark_as_advanced(HOST_BIG_ENDIAN)
-if (HOST_BIG_ENDIAN)
- set(HOST_BIG_ENDIAN 1)
-else()
- set(HOST_BIG_ENDIAN 0)
-endif()
+test_big_endian(HOST_BIG_ENDIAN)
# IEEE floating point
-set(HAVE_IEEEFP 1 CACHE STRING "IEEE floating point is available")
-mark_as_advanced(HAVE_IEEEFP)
+set(HAVE_IEEEFP 1)
report_values(CMAKE_HOST_SYSTEM_PROCESSOR HOST_FILLORDER
HOST_BIG_ENDIAN HAVE_IEEEFP)
@@ -560,12 +505,9 @@ else()
set(JBIG_FOUND FALSE)
endif()
-set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR})
-set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARY})
-check_function_exists(jbg_newlen HAVE_JBG_NEWLEN)
-set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
+check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
# liblzma2
@@ -578,6 +520,42 @@ if(LIBLZMA_FOUND)
set(LZMA_SUPPORT 1)
endif()
+# libzstd
+option(zstd "use libzstd (required for ZSTD compression)" ON)
+if (zstd)
+ find_path(ZSTD_INCLUDE_DIR zstd.h)
+ find_library(ZSTD_LIBRARY NAMES zstd)
+ if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY)
+ check_library_exists ("${ZSTD_LIBRARY}" ZSTD_decompressStream "" ZSTD_RECENT_ENOUGH)
+ if (ZSTD_RECENT_ENOUGH)
+ set(ZSTD_FOUND TRUE)
+ set(ZSTD_LIBRARIES ${ZSTD_LIBRARY})
+ message(STATUS "Found ZSTD library: ${ZSTD_LIBRARY}")
+ else ()
+ message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0")
+ endif ()
+ endif ()
+endif()
+set(ZSTD_SUPPORT 0)
+if(ZSTD_FOUND)
+ set(ZSTD_SUPPORT 1)
+endif()
+
+# libwebp
+option(webp "use libwebp (required for WEBP compression)" ON)
+if (webp)
+ find_path(WEBP_INCLUDE_DIR /webp/decode.h)
+ find_library(WEBP_LIBRARY NAMES webp)
+endif()
+set(WEBP_SUPPORT 0)
+set(WEBP_FOUND FALSE)
+if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY)
+ set(WEBP_SUPPORT 1)
+ set(WEBP_FOUND TRUE)
+ set(WEBP_LIBRARIES ${WEBP_LIBRARY})
+ message(STATUS "Found WEBP library: ${WEBP_LIBRARY}")
+endif()
+
# 8/12-bit jpeg mode
option(jpeg12 "enable libjpeg 8/12-bit dual mode (requires separate
12-bit libjpeg build)" ON)
@@ -621,12 +599,8 @@ set(win32_io FALSE)
if(WIN32)
set(win32_io TRUE)
endif()
-set(USE_WIN32_FILEIO ${win32_io} CACHE BOOL "Use win32 IO system (Microsoft Windows only)")
-if (USE_WIN32_FILEIO)
- set(USE_WIN32_FILEIO TRUE)
-else()
- set(USE_WIN32_FILEIO FALSE)
-endif()
+
+set(USE_WIN32_FILEIO ${win32_io})
# Orthogonal features
@@ -643,7 +617,7 @@ if(strip-chopping)
endif()
# Defer loading of strip/tile offsets
-option(defer-strile-load "enable deferred strip/tile offset/size loading (experimental)" OFF)
+option(defer-strile-load "enable deferred strip/tile offset/size loading (also available at runtime with the 'D' flag of TIFFOpen())" OFF)
set(DEFER_STRILE_LOAD ${defer-strile-load})
# CHUNKY_STRIP_READ_SUPPORT
@@ -692,6 +666,12 @@ endif()
if(LIBLZMA_INCLUDE_DIRS)
list(APPEND TIFF_INCLUDES ${LIBLZMA_INCLUDE_DIRS})
endif()
+if(ZSTD_INCLUDE_DIR)
+ list(APPEND TIFF_INCLUDES ${ZSTD_INCLUDE_DIR})
+endif()
+if(WEBP_INCLUDE_DIR)
+ list(APPEND TIFF_INCLUDES ${WEBP_INCLUDE_DIR})
+endif()
# Libraries required by libtiff
set(TIFF_LIBRARY_DEPS)
@@ -713,6 +693,12 @@ endif()
if(LIBLZMA_LIBRARIES)
list(APPEND TIFF_LIBRARY_DEPS ${LIBLZMA_LIBRARIES})
endif()
+if(ZSTD_LIBRARIES)
+ list(APPEND TIFF_LIBRARY_DEPS ${ZSTD_LIBRARIES})
+endif()
+if(WEBP_LIBRARIES)
+ list(APPEND TIFF_LIBRARY_DEPS ${WEBP_LIBRARIES})
+endif()
#report_values(TIFF_INCLUDES TIFF_LIBRARY_DEPS)
@@ -756,6 +742,8 @@ message(STATUS " Old JPEG support: ${old-jpeg} (requested) ${
message(STATUS " JPEG 8/12 bit dual mode: ${jpeg12} (requested) ${JPEG12_FOUND} (availability)")
message(STATUS " ISO JBIG support: ${jbig} (requested) ${JBIG_FOUND} (availability)")
message(STATUS " LZMA2 support: ${lzma} (requested) ${LIBLZMA_FOUND} (availability)")
+message(STATUS " ZSTD support: ${zstd} (requested) ${ZSTD_FOUND} (availability)")
+message(STATUS " WEBP support: ${webp} (requested) ${WEBP_FOUND} (availability)")
message(STATUS "")
message(STATUS " C++ support: ${cxx} (requested) ${CXX_SUPPORT} (availability)")
message(STATUS "")
diff --git a/tiff/ChangeLog b/tiff/ChangeLog
index ea8622b8a..01e2182cf 100644
--- a/tiff/ChangeLog
+++ b/tiff/ChangeLog
@@ -1,3 +1,1582 @@
+2019-11-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ libtiff 4.1.0 released.
+
+ Added a step for updating the legacy ChangeLog file.
+
+ Ignore emacs temporary files (ending with tilde character).
+
+ Added release summary page for the 4.1.0 release.
+
+ Fix Cmake HAVE_GETOPT for systems which declare getopt in stdio.h. Fix utility baked-in getopt prototype which appears when HAVE_GETOPT is not defined.
+
+ Fax2tiff.sh needs to remove its output file in advance. Syntax changes so that bash is not required.
+
+2019-10-26 Even Rouault <even.rouault@spatialys.com>
+
+ tif_jpeg.c: extra cast to silence Coverity warning. GDAL CID 1406475.
+
+2019-10-23 Even Rouault <even.rouault@spatialys.com>
+
+ tif_jpeg.c: fix warning added by previous commit (on 32bit builds)
+
+2019-10-23 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'coverity-fixes' into 'master'
+ Coverity fixes
+
+ See merge request libtiff/libtiff!94
+
+2019-10-22 Timothy Lyanguzov <timothy.lyanguzov@sap.com>
+
+ Use 64-bit calculations correctly.
+
+ Fix size calculation to use 64-bit tmsize_t correctly.
+
+ Make bytesperclumpline calculations using tmsize_t type.
+
+2019-10-03 Even Rouault <even.rouault@spatialys.com>
+
+ tif_read: align code of TIFFReadRawStrip() and TIFFReadRawTile() that differed for non good reason. Non-functional change normally. (fixes GitLab #162)
+
+2019-10-01 Even Rouault <even.rouault@spatialys.com>
+
+ HTML: update for GitLab issues.
+
+2019-09-29 Even Rouault <even.rouault@spatialys.com>
+
+ html/v3.5.6-beta.html: redact URL of defunct web site.
+
+ Website: update links to mailing list.
+
+2019-09-17 Even Rouault <even.rouault@spatialys.com>
+
+ TIFFReadAndRealloc(): avoid too large memory allocation attempts. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17244
+
+2019-09-03 Even Rouault <even.rouault@spatialys.com>
+
+ ByteCountLooksBad and EstimateStripByteCounts: avoid unsigned integer overflows. Fixes https://oss-fuzz.com/testcase-detail/5686156066291712 and https://oss-fuzz.com/testcase-detail/6332499206078464
+
+2019-09-02 Even Rouault <even.rouault@spatialys.com>
+
+ tif_ojpeg.c: avoid relying on isTiled macro being wrapped in ()
+
+ tif_ojpeg.c: avoid use of uninitialized memory on edge/broken file. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16844
+
+ tiff_read_rgba_fuzzer.cc: add a -DSTANDALONE mode for easier reproduction of oss-fuzz reports
+
+2019-09-01 Even Rouault <even.rouault@spatialys.com>
+
+ tif_dirread.c: allocChoppedUpStripArrays(). avoid unsigned integer overflow. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16846
+
+2019-08-27 Even Rouault <even.rouault@spatialys.com>
+
+ tif_ojpeg.c: avoid unsigned integer overflow. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16793
+
+2019-08-26 Even Rouault <even.rouault@spatialys.com>
+
+ TIFFReadDirEntryData(): rewrite to avoid unsigned integer overflow (not a bug). Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16792
+
+ TIFFFetchDirectory(): fix invalid cast from uint64 to tmsize_t. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16784
+
+2019-08-25 Even Rouault <even.rouault@spatialys.com>
+
+ JPEG: avoid use of unintialized memory on corrupted files.
+ Follow-up of cf3ce6fab894414a336546f62adc57f02590a22c
+ Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16602
+ Credit to OSS Fuzz
+
+2019-08-23 Even Rouault <even.rouault@spatialys.com>
+
+ _TIFFPartialReadStripArray(): avoid unsigned integer overflow. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16685
+
+ OJPEGWriteHeaderInfo(): avoid unsigned integer overflow on strile dimensions close to UINT32_MAX. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16683
+
+ TIFFFillStrip(): avoid harmless unsigned integer overflow. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16653
+
+ EstimateStripByteCounts(): avoid unsigned integer overflow. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16643&
+
+ tif_ojpeg: avoid unsigned integer overflow (probably not a bug). Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16635
+
+ tif_thunder: avoid unsigned integer overflow (not a bug). Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16632
+
+2019-08-22 Even Rouault <even.rouault@spatialys.com>
+
+ _TIFFMultiply32() / _TIFFMultiply64(): avoid relying on unsigned integer overflow (not a bug)
+
+ EstimateStripByteCounts(): avoid unsigned integer overflow.
+
+2019-08-21 Even Rouault <even.rouault@spatialys.com>
+
+ EstimateStripByteCounts(): avoid unsigned integer overflow.
+
+2019-08-20 Even Rouault <even.rouault@spatialys.com>
+
+ EstimateStripByteCounts(): avoid harmless unsigned integer overflow.
+
+ _TIFFPartialReadStripArray(): avoid triggering unsigned integer overflow with -fsanitize=unsigned-integer-overflow (not a bug, this is well defined by itself)
+
+2019-08-18 Even Rouault <even.rouault@spatialys.com>
+
+ tiff2ps: fix use of wrong data type that caused issues (/Height being written as 0) on 64-bit big endian platforms
+
+2019-08-16 Even Rouault <even.rouault@spatialys.com>
+
+ setByteArray(): fix previous commit.
+
+ setByteArray(): avoid potential signed integer overflow. Pointed by Hendra Gunadi. No actual problem known (which does not mean there wouldn't be any. Particularly on 32bit builds)
+
+2019-08-15 Even Rouault <even.rouault@spatialys.com>
+
+ RGBA interface: fix integer overflow potentially causing write heap buffer overflow, especially on 32 bit builds. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16443. Credit to OSS Fuzz
+
+2019-08-14 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'fix_integer_overflow' into 'master'
+ Fix integer overflow in _TIFFCheckMalloc() and other implementation-defined behaviour (CVE-2019-14973)
+
+ See merge request libtiff/libtiff!90
+
+2019-08-13 Even Rouault <even.rouault@spatialys.com>
+
+ Fix integer overflow in _TIFFCheckMalloc() and other implementation-defined behaviour (CVE-2019-14973)
+ _TIFFCheckMalloc()/_TIFFCheckRealloc() used a unsafe way to detect overflow
+ in the multiplication of nmemb and elem_size (which are of type tmsize_t, thus
+ signed), which was especially easily triggered on 32-bit builds (with recent
+ enough compilers that assume that signed multiplication cannot overflow, since
+ this is undefined behaviour by the C standard). The original issue which lead to
+ this fix was trigged from tif_fax3.c
+
+ There were also unsafe (implementation defied), and broken in practice on 64bit
+ builds, ways of checking that a uint64 fits of a (signed) tmsize_t by doing
+ (uint64)(tmsize_t)uint64_var != uint64_var comparisons. Those have no known
+ at that time exploits, but are better to fix in a more bullet-proof way.
+ Or similarly use of (int64)uint64_var <= 0.
+
+2019-08-12 Even Rouault <even.rouault@spatialys.com>
+
+ TIFFClientOpen(): fix memory leak if one of the required callbacks is not provided. Fixed Coverity GDAL CID 1404110
+
+ OJPEGReadBufferFill(): avoid very long processing time on corrupted files. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16400. master only
+
+2019-08-10 Even Rouault <even.rouault@spatialys.com>
+
+ oss-fuzz/tiff_read_rgba_fuzzer.cc: fix wrong env variable value in previous commit
+
+ oss-fuzz/tiff_read_rgba_fuzzer.cc: avoid issue with libjpeg-turbo and MSAN
+
+ OJPEG: fix integer division by zero on corrupted subsampling factors. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15824. Credit to OSS Fuzz
+
+ Merge branch 'ossfuzz_i386'
+
+ contrib/oss-fuzz/build.sh: fix for i386 build of jbigkit, and use $LIB_FUZZING_ENGINE
+
+2019-08-10 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'patch-1' into 'master'
+ fix two tiny typos
+
+ See merge request libtiff/libtiff!89
+
+2019-08-10 Reto Kromer <rk@reto.ch>
+
+ fix two tiny typos.
+
+2019-08-09 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'patch-1' into 'master'
+ fix a typo in man page
+
+ See merge request libtiff/libtiff!88
+
+2019-08-09 Reto Kromer <rk@reto.ch>
+
+ fix typo.
+
+2019-08-04 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'TIFFTAGID_Zero_reading_IGNORE' into 'master'
+ Suppressed Reading of Tiff tags with ID = 0 (like GPSVERSIONID) corrected.
+
+ See merge request libtiff/libtiff!77
+
+2019-08-04 Su Laus <sulau@freenet.de>
+
+ Reading of Tiff tags with ID = 0 (like GPSVERSIONID) corrected.
+ IGNORE placeholder in tif_dirread.c is now replaced by a field dir_ignore in the TIFFDirEntry structure
+
+ Currently, in tif_dirread.c a special IGNORE value for the tif tags is defined
+ in order to flag status preventing already processed tags from further processing.
+ This irrational behaviour prevents reading of custom tags with id code 0 - like tag GPSVERSIONID from EXIF 2.31 definition.
+
+ An additional field 'tdir_ignore' is now added to the TIFFDirEntry structure and code is changed
+ to allow tags with id code 0 to be read correctly.
+
+ This change was already proposed as pending improvement in tif_dirread.c around line 32.
+
+ Reference is also made to:
+ - Discussion in https://gitlab.com/libtiff/libtiff/merge_requests/39
+ - http://bugzilla.maptools.org/show_bug.cgi?id=2540
+
+ Comments and indention adapted.
+
+ Preparation to rebase onto master
+
+2019-07-16 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'cmake_amd64' into 'master'
+ CMakeLists.txt: properly set value of HOST_FILLORDER to LSB2MSB for Windows CMake builds
+
+ See merge request libtiff/libtiff!87
+
+2019-07-15 Even Rouault <even.rouault@spatialys.com>
+
+ CMakeLists.txt: properly set value of HOST_FILLORDER to LSB2MSB for Windows CMake builds
+ As can be seen in https://ci.appveyor.com/project/rleigh-codelibre/libtiff-didfs/builds/25846668/job/ory5w098j8wcij9x
+ log, the HOST_FILLORDER is not properly set:
+
+ [00:02:58] -- CMAKE_HOST_SYSTEM_PROCESSOR set to AMD64
+ [00:02:58] -- HOST_FILLORDER set to FILLORDER_MSB2LSB
+
+ Ther reason is that we match the "amd64.*" lowercase string whereas
+ CMAKE_HOST_SYSTEM_PROCESSOR is set to AMD64 uppercase.
+
+2019-07-09 Even Rouault <even.rouault@spatialys.com>
+
+ TIFFWriteCheck(): call TIFFForceStrileArrayWriting() when needed (should have gone with eaeca6274ae71cdfaeb9f673b6fb0f3cfc0e6ce5) (master only)
+
+2019-07-09 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'fix_chromium_925269' into 'master'
+ OJPEG: avoid use of unintialized memory on corrupted files
+
+ See merge request libtiff/libtiff!86
+
+2019-07-05 Even Rouault <even.rouault@spatialys.com>
+
+ OJPEG: avoid use of unintialized memory on corrupted files.
+ Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=925269
+ Patch from Lei Zhang with little adaptations.
+
+2019-06-29 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'fix-division-by-zero' into 'master'
+ Return infinite distance when denominator is zero.
+
+ See merge request libtiff/libtiff!85
+
+2019-06-29 Dirk Lemstra <dirk@lemstra.org>
+
+ Return infinite distance when denominator is zero.
+
+2019-06-29 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'typetests' into 'master'
+ Add test to check that libtiff types have the correct size
+
+ See merge request libtiff/libtiff!57
+
+2019-05-31 Thomas Bernard <miniupnp@free.fr>
+
+ make TIFF_SSIZE_T the same bitwidth as TIFF_SIZE_T.
+ it was previously the same bitwidth as unsigned char *
+ Pointers can be larger than size_t.
+
+2019-05-31 Thomas Bernard <miniupnp@free.fr>
+
+ Add test to check that libtiff types have the correct size.
+ in configure/CMakeList.txt :
+
+ - TIFF_INT8_T/TIFF_UINT8_T is signed/unsigned char
+ sizeof(char)==1 in C standard
+ - TIFF_INT16_T/TIFF_UINT16_T is signed/unsigned short
+ sizeof(short)>=2 in C standard
+ - TIFF_INT32_T/TIFF_UINT32_T is defined so its sizeof() is 4
+
+ - TIFF_INT64_T/TIFF_UINT64_T is defined so its sizeof() is 8
+
+ - TIFF_SIZE_T is defined so it has same sizeof() than size_t
+
+ - TIFF_SSIZE_T is defined so it has same sizeof() than unsigned char *
+
+2019-05-29 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'defer_strile_writing' into 'master'
+ Add TIFFDeferStrileArrayWriting() and TIFFForceStrileArrayWriting()
+
+ See merge request libtiff/libtiff!82
+
+2019-05-29 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'TIFFReadFromUserBuffer' into 'master'
+ Add TIFFReadFromUserBuffer()
+
+ See merge request libtiff/libtiff!81
+
+2019-05-26 Even Rouault <even.rouault@spatialys.com>
+
+ Fix vulnerability in 'D' (DeferStrileLoad) mode (master only) (fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14908)
+
+2019-05-25 Even Rouault <even.rouault@spatialys.com>
+
+ Replace 'stripped' by 'striped' in error messages.
+
+2019-05-25 Even Rouault <even.rouault@spatialys.com>
+
+ Add TIFFDeferStrileArrayWriting() and TIFFForceStrileArrayWriting()
+ Those advanced writing functions must be used in a particular sequence
+ to make their intended effect. Their aim is to control when/where
+ the [Strip/Tile][Offsets/ByteCounts] arrays are written into the file.
+
+ The purpose of this is to generate 'cloud-optimized geotiff' files where
+ the first KB of the file only contain the IFD entries without the potentially
+ large strile arrays. Those are written afterwards.
+
+ The typical sequence of calls is:
+ TIFFOpen()
+ [ TIFFCreateDirectory(tif) ]
+ Set fields with calls to TIFFSetField(tif, ...)
+ TIFFDeferStrileArrayWriting(tif)
+ TIFFWriteCheck(tif, ...)
+ TIFFWriteDirectory(tif)
+ ... potentially create other directories and come back to the above directory
+ TIFFForceStrileArrayWriting(tif): emit the arrays at the end of file
+
+ See test/defer_strile_writing.c for a practical example.
+
+2019-05-24 Even Rouault <even.rouault@spatialys.com>
+
+ Fix vulnerability introduced by defer strile loading (master only)
+ Found on GDAL with https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14894
+ Disabling the TIFF_DEFERSTRILELOAD bit in ChopupStripArray() was a
+ bad idea since when using TIFFReadDirectory() to reload the directory again
+ would lead to a different value of td_rowsperstrip, which could confuse
+ readers if they relied on the value found initially.
+
+ Fix typo in error message (master only)
+
+2019-05-22 Even Rouault <even.rouault@spatialys.com>
+
+ Add TIFFReadFromUserBuffer()
+ This function replaces the use of TIFFReadEncodedStrip()/TIFFReadEncodedTile()
+ when the user can provide the buffer for the input data, for example when
+ he wants to avoid libtiff to read the strile offset/count values from the
+ [Strip|Tile][Offsets/ByteCounts] array.
+
+ libtiff.def: add missing new symbols.
+
+ test/defer_strile_loading.c: fix warning with Visual C++
+
+ _TIFFRewriteField(): fix for bigtiff case (master only)
+ 116cf67f4c59196605abdb244657c3070c4310af made StripByteCount/TileByteCount to
+ always be rewritten as TIFF_LONG8.
+
+2019-05-21 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'ondemand_strile_offbytecount_loading' into 'master'
+ Make defer strile offset/bytecount loading available at runtime
+
+ See merge request libtiff/libtiff!79
+
+2019-05-21 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'bigtiff_write_bytecount_on_long_when_possible' into 'master'
+ Create TileByteCounts/StripByteCounts tag with SHORT (ClassicTIFF/BigTIFF) or LONG (BigTIFF) type when possible
+
+ See merge request libtiff/libtiff!78
+
+2019-05-21 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'html_link' into 'master'
+ libtiff.html, bigtiffpr.html: absolute => relative link
+
+ See merge request libtiff/libtiff!80
+
+2019-05-14 Thomas Bernard <miniupnp@free.fr>
+
+ libtiff.html, bigtiffpr.html: absolute => relative link.
+
+2019-05-10 Even Rouault <even.rouault@spatialys.com>
+
+ Make defer strile offset/bytecount loading available at runtime.
+ ... and add per-strile offset/bytecount loading capabilities.
+
+ Part of this commit makes the behaviour that was previously met when
+ libtiff was compiled with -DDEFER_STRILE_LOAD available for default builds
+ when specifying the new 'D' (Deferred) TIFFOpen() flag. In that mode, the [Tile/Strip][ByteCounts/Offsets]
+ arrays are only loaded when first accessed. This can speed-up the opening
+ of files stored on the network when just metadata retrieval is needed.
+ This mode has been used for years by the GDAL library when compiled with
+ its embeded libtiff copy.
+
+ To avoid potential out-of-tree code (typically codecs) that would use
+ the td_stripbytecount and td_stripoffset array inconditionnaly assuming they
+ have been loaded, those have been suffixed with _p (for protected). The
+ use of the new functions mentionned below is then recommended.
+
+ Another addition of this commit is the capability of loading only the
+ values of the offset/bytecount of the strile of interest instead of the
+ whole array. This is enabled with the new 'O' (Ondemand) flag of TIFFOpen()
+ (which implies 'D'). That behaviour has also been used by GDAL, which hacked
+ into the td_stripoffset/td_stripbytecount arrays directly. The new code
+ added in the _TIFFFetchStrileValue() and _TIFFPartialReadStripArray() internal
+ functions is mostly a port of what was in GDAL GTiff driver previously.
+
+ Related to that, the public TIFFGetStrileOffset[WithErr]() and TIFFGetStrileByteCount[WithErr]()
+ functions have been added to API. They are of particular interest when
+ using sparse files (with offset == bytecount == 0) and you want to detect
+ if a strile is present or not without decompressing the data, or updating
+ an existing sparse file.
+ They will also be used to enable a future enhancement where client code can entirely
+ skip bytecount loading in some situtations
+
+ A new test/defer_strile_loading.c test has been added to test the above
+ capabilities.
+
+2019-05-10 Even Rouault <even.rouault@spatialys.com>
+
+ Creation: use SHORT type when possible for StripByteCounts/TileByteCounts
+ This follows the same logic as previous commit.
+
+2019-05-09 Even Rouault <even.rouault@spatialys.com>
+
+ BigTIFF creation: write TileByteCounts/StripByteCounts tag with LONG when possible
+ In most situations of BigTIFF file, the tile/strip sizes are of reasonable size,
+ that is they fit on a 4-byte LONG. So in that case, use LONG instead of LONG8
+ to save some space. For uncompressed file, it is easy to detect such situations
+ by checking at the TIFFTileSize64()/TIFFStripSize64() return. For compressed file,
+ we must take into account the fact that compression may sometimes result in
+ larger compressed data. So we allow this optimization only for a few select
+ compression times, and take a huge security margin (10x factor). We also only
+ apply this optimization on multi-strip files, so as to allow easy on-the-fly
+ growing of single-strip files whose strip size could grow above the 4GB threshold.
+
+ This change is compatible with the BigTIFF specification. According to
+ https://www.awaresystems.be/imaging/tiff/bigtiff.html:
+ "The StripOffsets, StripByteCounts, TileOffsets, and TileByteCounts tags are
+ allowed to have the datatype TIFF_LONG8 in BigTIFF. Old datatypes TIFF_LONG,
+ and TIFF_SHORT where allowed in the TIFF 6.0 specification, are still valid in BigTIFF, too. "
+ On a practical point of view, this is also compatible on reading/writing of
+ older libtiff 4.X versions.
+
+ The only glitch I found, which is rather minor, is when using such a BigTIFF
+ file with TileByteCounts/StripByteCounts written with TIFF_LONG, and updating
+ it with an older libtiff 4.X version with a change in the
+ [Tile/Strip][ByteCounts/Offsets] array. In that case the _TIFFRewriteField()
+ function will rewrite the directory and array with TIFF_LONG8, instead of updating
+ the existing array (this is an issue fixed by this commit). The file will
+ still be valid however, hence the minor severity of this.
+
+2019-05-08 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'bug2799' into 'master'
+ fix fax2tiff
+
+ See merge request libtiff/libtiff!55
+
+2019-05-08 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'bug_2829' into 'master'
+ WIN32: use tif_win32.c when building with CMake
+
+ See merge request libtiff/libtiff!75
+
+2019-05-06 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'FILESOURCE_SCENETYPE_reading' into 'master'
+ Reading error for FileSource and SceneType tags corrected.
+
+ See merge request libtiff/libtiff!76
+
+2019-05-06 Su Laus <sulau@freenet.de>
+
+ Reading error for FileSource and SceneType tags corrected.
+ EXIF tags FILESOURCE and SCENETYPE are defined as TIFF_UNDEFINED and field_readcount==1!
+ There is a bug in TIFFReadDirEntryByte() preventing to read correctly type TIFF_UNDEFINED fields with field_readcount==1
+ Upgrade of TIFFReadDirEntryByte() with added TIFF_UNDEFINED switch-entry allows libtiff to read those tags correctly.
+
+2019-04-25 Thomas Bernard <miniupnp@free.fr>
+
+ WIN32: use tif_win32.c when building with CMake.
+ see http://bugzilla.maptools.org/show_bug.cgi?id=2829
+
+ the top CMakeLists.txt defines
+ win32_io and USE_WIN32_FILEIO
+
+ WIN32_IO is defined nowhere in CMake (only in automake things)
+
+2019-04-25 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'gitlab_pages' into 'master'
+ Advertise https://libtiff.gitlab.io/libtiff/ as mirror
+
+ See merge request libtiff/libtiff!70
+
+2019-04-25 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'bug_2844' into 'master'
+ tiff2ps.c: PSDataColorContig(): avoid heap buffer overrun
+
+ See merge request libtiff/libtiff!69
+
+2019-04-25 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'issue_2785' into 'master'
+ tiff2pdf.c: don't call t2p_tile_collapse_left() for Ycbcr
+
+ See merge request libtiff/libtiff!64
+
+2019-04-11 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'fix_gdal_1439' into 'master'
+ TIFFWriteEncodedStrip/TIFFWriteEncodedTile: fix rewriting of LZW-compressed data
+
+ See merge request libtiff/libtiff!74
+
+2019-04-11 Even Rouault <even.rouault@spatialys.com>
+
+ TIFFWriteEncodedStrip/TIFFWriteEncodedTile: fix rewriting of LZW-compressed data
+ Fixes https://github.com/OSGeo/gdal/issues/1439
+
+ When rewriting a LZW tile/strip whose existing size is very close to a multiple of
+ 1024 bytes (and larger than 8192 bytes) with compressed data that is larger,
+ the new data was not placed at the end of the file, causing corruption.
+
+2019-04-08 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'bug2848' into 'master'
+ tif_luv.c: LogLuvSetupEncode() error must return 0
+
+ See merge request libtiff/libtiff!72
+
+2019-04-03 Thomas Bernard <miniupnp@free.fr>
+
+ build/gitlab-ci: fix typo.
+
+ show test-suite.log in gitlab-ci.
+ useful when build fails
+
+ Add output check for tiff2ps.
+ note : the reference files have been generated in master branch
+
+2019-03-23 Even Rouault <even.rouault@spatialys.com>
+
+ tif_read.c: potentially fix false positive from Coverity Scan. CID 1400288
+
+ tif_read.c: potentially fix false positive from Coverity Scan. CID 1400271
+
+ tif_zip.c: remove dead code. CID 1400360.
+
+ tif_webp.c: remove false positive warning about dereference before null check. CID 1400255
+
+ tif_pixarlog.c: remove dead code. CID 1400342.
+
+ tif_pixarlog.c: avoid false positive Coverity Scan warnings about overflow. CID 1400300 and 1400367
+
+ tif_lzw.c: silence CoverityScan false positive. CID 1400355.
+
+ tif_luv.c: silence CoverityScan false positive. CID 1400231, 1400251, 1400254, 1400272, 1400318, 1400356
+
+ TryChopUpUncompressedBigTiff(): avoid potential division by zero. master only. GDAL Coverity CID 1400263
+
+2019-03-22 Thomas Bernard <miniupnp@free.fr>
+
+ tif_luv.c: LogLuvSetupEncode() error must return 0.
+ see http://bugzilla.maptools.org/show_bug.cgi?id=2848
+
+ if wrongly returning 1, the processing of incorrect file continues,
+ which causes problems.
+
+2019-03-22 Thomas Bernard <miniupnp@free.fr>
+
+ add a test for fax2tiff tool.
+
+2019-02-28 Thomas Bernard <miniupnp@free.fr>
+
+ tiff2pdf.c: don't call t2p_tile_collapse_left() when buffer size is wrong
+ see http://bugzilla.maptools.org/show_bug.cgi?id=2785
+
+ Advertise https://libtiff.gitlab.io/libtiff/ as mirror.
+ I'm put it above the maptools.org mirror because
+ Even Rouault believe at some point it will be completely removed
+
+2019-02-28 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'bug_2826' into 'master'
+ tiff2pdf.c: check colormap pointers when loading CMYK with colormap
+
+ See merge request libtiff/libtiff!65
+
+2019-02-28 Thomas Bernard <miniupnp@free.fr>
+
+ tiff2pdf.c: check colormap pointers.
+ Avoid access to non initialized pointers
+ http://bugzilla.maptools.org/show_bug.cgi?id=2826
+
+2019-02-27 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'fix_warnings' into 'master'
+ tiff2ps.c: fix warning caused by integer promotion
+
+ See merge request libtiff/libtiff!68
+
+2019-02-23 Thomas Bernard <miniupnp@free.fr>
+
+ PSDataColorContig(): avoid heap buffer overrun.
+ fixes http://bugzilla.maptools.org/show_bug.cgi?id=2844
+ each iteration of the loop read nc bytes
+
+2019-02-22 Thomas Bernard <miniupnp@free.fr>
+
+ tiff2ps.c: fix warning caused by integer promotion.
+ uint8 value is promoted to int in (value << 24) so -fsanitize
+ yield runtime errors :
+ tiff2ps.c:2969:33: runtime error: left shift of 246 by 24 places cannot be represented in type 'int'
+
+2019-02-22 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'large_strile_improvements' into 'master'
+ Large strile support improvements
+
+ See merge request libtiff/libtiff!63
+
+2019-02-21 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'gitlab-pages' into 'master'
+ ci: Add pages job
+
+ See merge request libtiff/libtiff!45
+
+2019-02-19 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'issue_2833' into 'master'
+ tiffcp.c: check that (Tile Width)*(Samples/Pixel) do no overflow
+
+ See merge request libtiff/libtiff!60
+
+2019-02-19 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'issue_2831' into 'master'
+ tiffcrop.c: fix invertImage() for bps 2 and 4
+
+ See merge request libtiff/libtiff!61
+
+2019-02-19 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'issue_2842' into 'master'
+ move _TIFFClampDoubleToFloat() to tif_aux.c
+
+ See merge request libtiff/libtiff!62
+
+2019-02-19 Even Rouault <even.rouault@spatialys.com>
+
+ tif_zip.c: allow reading and writing strips/tiles with more than 4 GB of compressed or uncompressed data
+
+ tif_dirread.c: when strip chopping is enabled, extend this mechanism to multi-strip uncompressed files with strips larger than 2GB to expose them as strips of ~500 MB
+
+2019-02-19 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'size_t_typo' into 'master'
+ CMakeLists.txt: fix TIFF_SIZE_T
+
+ See merge request libtiff/libtiff!59
+
+2019-02-12 Thomas Bernard <miniupnp@free.fr>
+
+ move _TIFFClampDoubleToFloat() to tif_aux.c.
+ the same function was declared in tif_dir.c and tif_dirwrite.c
+
+ see http://bugzilla.maptools.org/show_bug.cgi?id=2842
+
+2019-02-11 Thomas Bernard <miniupnp@free.fr>
+
+ tiffcrop.c: fix invertImage() for bps 2 and 4.
+ too much bytes were processed, causing a heap buffer overrun
+ http://bugzilla.maptools.org/show_bug.cgi?id=2831
+ the loop counter must be
+ for (col = 0; col < width; col += 8 / bps)
+
+ Also the values were not properly calculated. It should be
+ 255-x, 15-x, 3-x for bps 8, 4, 2.
+
+ But anyway it is easyer to invert all bits as 255-x = ~x, etc.
+ (substracting from a binary number composed of all 1 is like inverting
+ the bits)
+
+2019-02-11 Thomas Bernard <miniupnp@free.fr>
+
+ tiffcp.c: use INT_MAX.
+
+ check that (Tile Width)*(Samples/Pixel) do no overflow.
+ fixes bug 2833
+
+2019-02-03 Thomas Bernard <miniupnp@free.fr>
+
+ CMakeLists.txt: fix TIFF_SIZE_T.
+
+2019-02-02 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'master' into 'master'
+ Fix for simple memory leak that was assigned CVE-2019-6128.
+
+ See merge request libtiff/libtiff!50
+
+2019-02-02 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'bug2835' into 'master'
+ tiff2ps: fix heap-buffer-overflow
+
+ See merge request libtiff/libtiff!53
+
+2019-02-02 Even Rouault <even.rouault@spatialys.com>
+
+ Fix warning (use of uninitialized value) added per d0a842c5dbad2609aed43c701a12ed12461d3405 (fixes https://gitlab.com/libtiff/libtiff/merge_requests/54#note_137742985)
+
+2019-02-02 Yuri Aksenov <yuri.aksenov@gmail.com>
+
+ fix fax2tiff.
+ see http://bugzilla.maptools.org/show_bug.cgi?id=2799
+ fixes d9bc8472e72549f29c0062c1cbd3d56f279f3be2
+
+2019-02-02 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'tiffcrop' into 'master'
+ tiffcrop: shut up clang warnings
+
+ See merge request libtiff/libtiff!52
+
+2019-02-01 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'bug2833' into 'master'
+ TIFFWriteDirectoryTagTransferfunction() : fix NULL dereferencing
+
+ See merge request libtiff/libtiff!54
+
+2019-02-01 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'gitignore' into 'master'
+ add test/ files to .gitignore
+
+ See merge request libtiff/libtiff!56
+
+2019-02-01 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'master' into 'master'
+ tif_dir: unset transferfunction field if necessary (CVE-2018-19210)
+
+ See merge request libtiff/libtiff!47
+
+2019-01-29 Thomas Bernard <miniupnp@free.fr>
+
+ add test/ files to .gitignore.
+
+2019-01-29 Thomas Bernard <miniupnp@free.fr>
+
+ TIFFWriteDirectoryTagTransferfunction() : fix NULL dereferencing.
+ http://bugzilla.maptools.org/show_bug.cgi?id=2833
+
+ we must check the pointer is not NULL before memcmp() the memory
+
+2019-01-29 Thomas Bernard <miniupnp@free.fr>
+
+ tiff2ps: fix heap-buffer-overflow.
+ http://bugzilla.maptools.org/show_bug.cgi?id=2834
+
+ usually the test (i < byte_count) is OK because the byte_count is divisible by samplesperpixel.
+ But if that is not the case, (i + ncomps) < byte_count should be used, or
+ maybe (i + samplesperpixel) <= byte_count
+
+2019-01-28 Thomas Bernard <miniupnp@free.fr>
+
+ tiffcrop: shut up clang warnings.
+ make the out filename building a bit more simple
+ and remove the use of strcat()
+
+2019-01-23 Scott Gayou <github.scott@gmail.com>
+
+ Fix for simple memory leak that was assigned CVE-2019-6128.
+ pal2rgb failed to free memory on a few errors. This was reported
+ here: http://bugzilla.maptools.org/show_bug.cgi?id=2836.
+
+2019-01-05 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Fix tiff2ps error regarding "Inconsistent value of es" by allowing es to be zero. Problem was reported to the tiff mailing list by Julian H. Stacey on January 5, 2019.
+
+2018-12-13 Hugo Lefeuvre <hle@debian.org>
+
+ tif_dir: unset transferfunction field if necessary.
+ The number of entries in the transfer table is determined as following:
+
+ (td->td_samplesperpixel - td->td_extrasamples) > 1 ? 3 : 1
+
+ This means that whenever td->td_samplesperpixel or td->td_extrasamples are
+ modified we also need to make sure that the number of required entries in
+ the transfer table didn't change.
+
+ If it changed and the number of entries is higher than before we should
+ invalidate the transfer table field and free previously allocated values.
+ In the other case there's nothing to do, additional tf entries won't harm
+ and properly written code will just ignore them since spp - es < 1.
+
+ For instance this situation might happen when reading an OJPEG compressed
+ image with missing SamplesPerPixel tag. In this case the SamplesPerPixel
+ field might be updated after setting the transfer table.
+
+ see http://bugzilla.maptools.org/show_bug.cgi?id=2500
+
+ This commit addresses CVE-2018-19210.
+
+2018-12-08 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Do not attempt to re-sync zip stream after reported data error from inflate().
+
+2018-12-07 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'resource-leaks' into 'master'
+ Fix two resource leaks
+
+ See merge request libtiff/libtiff!43
+
+2018-12-07 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'build-jbig' into 'master'
+ add jbig support to the fuzzer
+
+ See merge request libtiff/libtiff!42
+
+2018-12-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ tiffcrop.c: Avoid new clang warning about tools/tiffcrop.c "size argument in 'strncat' call appears to be size of the source".
+
+2018-11-28 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'webp_memleak' into 'master'
+ fixed mem leak in webp compression
+
+ See merge request libtiff/libtiff!48
+
+2018-11-28 Norman Barker <norman.barker@mapbox.com>
+
+ fixed mem leak in webp compression.
+
+2018-11-20 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'lossless_webp' into 'master'
+ fixed lossless webp compression config
+
+ See merge request libtiff/libtiff!46
+
+2018-11-20 Norman Barker <norman.barker@mapbox.com>
+
+ fixed lossless webp compression config.
+
+2018-11-18 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ snprintf porting fix for Visual Studio 2003.
+
+2018-11-18 Roger Leigh <rleigh@codelibre.net>
+
+ ci: Add pages job.
+
+2018-11-10 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Change references from defunct ftp site to https site.
+
+2018-11-10 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ * configure.ac: libtiff 4.0.10 released.
+
+ Change COMPRESSION_ZSTD to 50000 and COMPRESSION_WEBP to 50001.
+
+2018-11-04 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Added preliminary release notes for release 4.0.10.
+
+2018-11-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ tiff2pdf: Eliminate compiler warning about snprintf output truncation when formatting pdf_datetime.
+
+2018-11-03 Olivier Paquet <olivier.paquet@gmail.com>
+
+ Merge branch 'no_tif_platform_console' into 'master'
+ Remove builtin support for GUI warning and error message boxes
+
+ See merge request libtiff/libtiff!24
+
+2018-11-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ tiffcrop.c: Eliminate compiler warning about snprintf output truncation when formatting filenum.
+
+ TWebPVGetField(): Add apparently missing break statement impacting TIFFTAG_WEBP_LOSSLESS.
+
+ Eliminate compiler warnings about duplicate definitions of streq/strneq macros.
+
+ Ignore generated files.
+
+ Remove and ignore files which are a product of autogen.sh.
+
+2018-11-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Fix TIFFErrorExt() formatting of size_t type for 32-bit compiles.
+
+2018-10-30 Even Rouault <even.rouault@spatialys.com>
+
+ tiff2bw: avoid null pointer dereference in case of out of memory situation. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2819 / CVE-2018-18661
+
+ tiffio.h: fix comment.
+
+2018-10-26 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'header2' into 'master'
+ Fix 725279bd: Standalone tif_predict.h: tiff.h should be tiffiop.h
+
+ See merge request libtiff/libtiff!41
+
+2018-10-26 Kurt Schwehr <schwehr@google.com>
+
+ Fix 725279bd: Standalone tif_predict.h: tiff.h should be tiffiop.h.
+
+2018-10-25 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'headers' into 'master'
+ Add includes to headers to allow them to stand alone.
+
+ See merge request libtiff/libtiff!40
+
+2018-10-24 Kurt Schwehr <schwehr@google.com>
+
+ Add includes to headers to allow them to stand alone.
+ This allows compilers that can do header stand alone header parsing
+ to process libtiff.
+
+2018-10-18 Even Rouault <even.rouault@spatialys.com>
+
+ LZMAPreEncode: emit verbose error if lzma_stream_encoder() fails (typically because not enough memory available)
+
+2018-10-17 Even Rouault <even.rouault@spatialys.com>
+
+ tif_webp.c: fix previous commit that broke scanline decoding.
+
+ tif_webp.c: fix potential read outside libwebp buffer on corrupted images
+
+2018-10-14 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'jbig_decode_overflow' into 'master'
+ JBIG: fix potential out-of-bounds write in JBIGDecode()
+
+ See merge request libtiff/libtiff!38
+
+2018-10-14 Even Rouault <even.rouault@spatialys.com>
+
+ JBIG: fix potential out-of-bounds write in JBIGDecode()
+ JBIGDecode doesn't check if the user provided buffer is large enough
+ to store the JBIG decoded image, which can potentially cause out-of-bounds
+ write in the buffer.
+ This issue was reported and analyzed by Thomas Dullien.
+
+ Also fixes a (harmless) potential use of uninitialized memory when
+ tif->tif_rawsize > tif->tif_rawcc
+
+ And in case libtiff is compiled with CHUNKY_STRIP_READ_SUPPORT, make sure
+ that whole strip data is provided to JBIGDecode()
+
+2018-10-05 Even Rouault <even.rouault@spatialys.com>
+
+ tif_webp.c: fix scanline reading/writing.
+
+ WEBP codec: initialize nSamples in TWebPSetupDecode() and TWebPSetupEncode()
+
+2018-10-05 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'tif_webp' into 'master'
+ webp support
+
+ See merge request libtiff/libtiff!32
+
+2018-10-05 Norman Barker <norman.barker@mapbox.com>
+
+ webp in tiff.
+
+2018-09-17 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'master' into 'master'
+ fix three potential vulnerabilities.
+
+ See merge request libtiff/libtiff!33
+
+2018-09-08 Young_X <YangX92@hotmail.com>
+
+ fix out-of-bound read on some tiled images.
+
+ avoid potential int32 overflows in multiply_ms()
+
+ only read/write TIFFTAG_GROUP3OPTIONS or TIFFTAG_GROUP4OPTIONS if compression is COMPRESSION_CCITTFAX3 or COMPRESSION_CCITTFAX4
+
+2018-08-15 Even Rouault <even.rouault@spatialys.com>
+
+ TIFFSetupStrips(): avoid potential uint32 overflow on 32-bit systems with large number of strips. Probably relates to http://bugzilla.maptools.org/show_bug.cgi?id=2788 / CVE-2018-10779
+
+2018-08-07 Even Rouault <even.rouault@spatialys.com>
+
+ ZSTD: fix flush issue that can cause endless loop in ZSTDEncode()
+ Fixes https://github.com/OSGeo/gdal/issues/833
+
+2018-08-07 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'fix_bug_2800' into 'master'
+ Fix libtiff 4.0.8 regression when reading LZW-compressed strips with scanline API
+
+ See merge request libtiff/libtiff!31
+
+2018-08-07 Even Rouault <even.rouault@spatialys.com>
+
+ Fix libtiff 4.0.8 regression when reading LZW-compressed strips with scanline API
+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2800
+
+2018-07-05 Even Rouault <even.rouault@spatialys.com>
+
+ Add tag and pseudo-tag definitions for ESRI LERC codec (out of tree codec whose source is at https://github.com/OSGeo/gdal/blob/master/gdal/frmts/gtiff/tif_lerc.c)
+
+2018-07-02 Even Rouault <even.rouault@spatialys.com>
+
+ Fix TIFFTAG_ZSTD_LEVEL pseudo tag value to be > 65536, and the next one in the series
+
+2018-05-25 Stefan Weil <sw@weilnetz.de>
+
+ Remove builtin support for GUI warning and error message boxes.
+ Now warnings always go to the console by default unless applications
+ define their own warning and error handlers.
+
+ GUI applications (and Windows CE) are required to define such handlers.
+
+2018-05-12 Even Rouault <even.rouault@spatialys.com>
+
+ LZWDecodeCompat(): fix potential index-out-of-bounds write. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2780 / CVE-2018-8905
+ The fix consists in using the similar code LZWDecode() to validate we
+ don't write outside of the output buffer.
+
+ TIFFFetchNormalTag(): avoid (probably false positive) clang-tidy clang-analyzer-core.NullDereference warnings
+
+ TIFFWriteDirectorySec: avoid assertion. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2795. CVE-2018-10963
+
+2018-05-04 Even Rouault <even.rouault@spatialys.com>
+
+ tif_color.c: fix code comment.
+
+2018-04-17 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'fuzzer-fix' into 'master'
+ remove a pointless multiplication and a variable that's not necessary
+
+ See merge request libtiff/libtiff!29
+
+2018-04-17 Paul Kehrer <paul.l.kehrer@gmail.com>
+
+ remove a pointless multiplication and a variable that's not necessary.
+
+2018-04-17 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'ossfuzz' into 'master'
+ move oss-fuzz build script and fuzzer into libtiff tree
+
+ See merge request libtiff/libtiff!28
+
+2018-04-17 Paul Kehrer <paul.l.kehrer@gmail.com>
+
+ move oss-fuzz build script and fuzzer into libtiff tree.
+
+2018-04-14 Even Rouault <even.rouault@spatialys.com>
+
+ _TIFFGetMaxColorChannels: update for LOGLUV, ITULAB and ICCLAB that have 3 color channels
+
+2018-04-12 Even Rouault <even.rouault@spatialys.com>
+
+ Fix MSVC warning.
+
+2018-04-12 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'master' into 'master'
+ Fix NULL pointer dereference in TIFFPrintDirectory (bugzilla 2778/CVE-2018-7456)
+
+ See merge request libtiff/libtiff!27
+
+2018-04-11 Hugo Lefeuvre <hle@debian.org>
+
+ Fix NULL pointer dereference in TIFFPrintDirectory.
+ The TIFFPrintDirectory function relies on the following assumptions,
+ supposed to be guaranteed by the specification:
+
+ (a) A Transfer Function field is only present if the TIFF file has
+ photometric type < 3.
+
+ (b) If SamplesPerPixel > Color Channels, then the ExtraSamples field
+ has count SamplesPerPixel - (Color Channels) and contains
+ information about supplementary channels.
+
+ While respect of (a) and (b) are essential for the well functioning of
+ TIFFPrintDirectory, no checks are realized neither by the callee nor
+ by TIFFPrintDirectory itself. Hence, following scenarios might happen
+ and trigger the NULL pointer dereference:
+
+ (1) TIFF File of photometric type 4 or more has illegal Transfer
+ Function field.
+
+ (2) TIFF File has photometric type 3 or less and defines a
+ SamplesPerPixel field such that SamplesPerPixel > Color Channels
+ without defining all extra samples in the ExtraSamples fields.
+
+ In this patch, we address both issues with respect of the following
+ principles:
+
+ (A) In the case of (1), the defined transfer table should be printed
+ safely even if it isn't 'legal'. This allows us to avoid expensive
+ checks in TIFFPrintDirectory. Also, it is quite possible that
+ an alternative photometric type would be developed (not part of the
+ standard) and would allow definition of Transfer Table. We want
+ libtiff to be able to handle this scenario out of the box.
+
+ (B) In the case of (2), the transfer table should be printed at its
+ right size, that is if TIFF file has photometric type Palette
+ then the transfer table should have one row and not three, even
+ if two extra samples are declared.
+
+ In order to fulfill (A) we simply add a new 'i < 3' end condition to
+ the broken TIFFPrintDirectory loop. This makes sure that in any case
+ where (b) would be respected but not (a), everything stays fine.
+
+ (B) is fulfilled by the loop condition
+ 'i < td->td_samplesperpixel - td->td_extrasamples'. This is enough as
+ long as (b) is respected.
+
+ Naturally, we also make sure (b) is respected. This is done in the
+ TIFFReadDirectory function by making sure any non-color channel is
+ counted in ExtraSamples.
+
+ This commit addresses CVE-2018-7456.
+
+2018-03-27 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'tiffset-long8' into 'master'
+ tiffset: Add support for LONG8, SLONG8 and IFD8 field types
+
+ See merge request libtiff/libtiff!25
+
+2018-03-26 Roger Leigh <rleigh@codelibre.net>
+
+ port: Clean up NetBSD sources and headers to build standalone.
+
+2018-03-23 Roger Leigh <rleigh@dundee.ac.uk>
+
+ port: Add strtol, strtoll and strtoull.
+ Also update strtoul. All use the same implementation from NetBSD libc.
+
+ tiffset: Add support for LONG8, SLONG8 and IFD8 field types.
+
+2018-03-17 Even Rouault <even.rouault@spatialys.com>
+
+ ChopUpSingleUncompressedStrip: avoid memory exhaustion (CVE-2017-11613)
+ Rework fix done in 3719385a3fac5cfb20b487619a5f08abbf967cf8 to work in more
+ cases like https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6979.
+ Credit to OSS Fuzz
+
+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2724
+
+2018-03-13 Even Rouault <even.rouault@spatialys.com>
+
+ libtiff/tif_luv.c: rewrite loops in a more readable way (to avoid false positive reports like http://bugzilla.maptools.org/show_bug.cgi?id=2779)
+
+2018-03-13 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'avoid_memory_exhaustion_in_ChopUpSingleUncompressedStrip' into 'master'
+ ChopUpSingleUncompressedStrip: avoid memory exhaustion (CVE-2017-11613)
+
+ See merge request libtiff/libtiff!26
+
+2018-03-11 Even Rouault <even.rouault@spatialys.com>
+
+ ChopUpSingleUncompressedStrip: avoid memory exhaustion (CVE-2017-11613)
+ In ChopUpSingleUncompressedStrip(), if the computed number of strips is big
+ enough and we are in read only mode, validate that the file size is consistent
+ with that number of strips to avoid useless attempts at allocating a lot of
+ memory for the td_stripbytecount and td_stripoffset arrays.
+
+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2724
+
+2018-03-10 Even Rouault <even.rouault@spatialys.com>
+
+ Typo fix in comment.
+
+2018-03-03 Even Rouault <even.rouault@spatialys.com>
+
+ Avoid warning with gcc 8 (partially revert 647b0e8c11ee11896f319b92cf110775f538d75c)
+
+2018-02-25 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'typos' into 'master'
+ Fix some typos
+
+ See merge request libtiff/libtiff!23
+
+2018-02-24 Stefan Weil <sw@weilnetz.de>
+
+ Fix some typos.
+ Most of them were found by codespell.
+
+2018-02-14 Even Rouault <even.rouault@spatialys.com>
+
+ Typo fix in comment.
+
+ Merge branch 'zstd'
+
+ Add warning about COMPRESSION_ZSTD not being officialy registered.
+
+2018-02-14 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'bug2772' into 'master'
+ Fix for bug 2772
+
+ See merge request libtiff/libtiff!20
+
+2018-02-12 Nathan Baker <nathanb@lenovo-chrome.com>
+
+ Fix for bug 2772.
+ It is possible to craft a TIFF document where the IFD list is circular,
+ leading to an infinite loop while traversing the chain. The libtiff
+ directory reader has a failsafe that will break out of this loop after
+ reading 65535 directory entries, but it will continue processing,
+ consuming time and resources to process what is essentially a bogus TIFF
+ document.
+
+ This change fixes the above behavior by breaking out of processing when
+ a TIFF document has >= 65535 directories and terminating with an error.
+
+2018-02-09 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'libtiff-as-subdirectory-fixes' into 'master'
+ Prefer target_include_directories
+
+ See merge request libtiff/libtiff!12
+
+2018-02-06 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'cmake-cleanups' into 'master'
+ Cmake cleanups
+
+ See merge request libtiff/libtiff!11
+
+2018-02-06 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'check-right-cxx-variable' into 'master'
+ Check right cxx variable
+
+ See merge request libtiff/libtiff!19
+
+2018-02-06 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'dont-leak-stream-open' into 'master'
+ Fix a memory leak in TIFFStreamOpen
+
+ See merge request libtiff/libtiff!17
+
+2018-02-06 Ben Boeckel <ben.boeckel@kitware.com>
+
+ cmake: check CXX_SUPPORT.
+ This variable is set in response to the `cxx` cache variable; use it
+ instead.
+
+2018-02-04 Olivier Paquet <olivier.paquet@gmail.com>
+
+ Merge branch 'warnings' into 'master'
+ Fix all compiler warnings for default build
+
+ See merge request libtiff/libtiff!16
+
+2018-02-04 Nathan Baker <elitebadger@gmail.com>
+
+ Fix all compiler warnings for default build.
+
+2018-01-30 Paul Kehrer <paul.l.kehrer@gmail.com>
+
+ tabs are hard.
+
+2018-01-29 Paul Kehrer <paul.l.kehrer@gmail.com>
+
+ use hard tabs like the rest of the project.
+
+ Fix a memory leak in TIFFStreamOpen.
+ TIFFStreamOpen allocates a new tiff{o,i}s_data, but if TIFFClientOpen
+ fails then that struct is leaked. Delete it if the returned TIFF * is
+ null.
+
+2018-01-29 Kevin Funk <kfunk@kde.org>
+
+ Bump minimum required CMake version to v2.8.11.
+ Because we use the BUILD_INTERFACE generator expression
+
+2018-01-27 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'patch-1' into 'master'
+ Update CMakeLists.txt for build fix on Windows
+
+ See merge request libtiff/libtiff!14
+
+2018-01-27 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'patch-2' into 'master'
+ Update tiffgt.c for build fix on Windows
+
+ See merge request libtiff/libtiff!13
+
+2018-01-25 Olivier Paquet <olivier.paquet@gmail.com>
+
+ Merge branch 'bug2750' into 'master'
+ Add workaround to pal2rgb buffer overflow.
+
+ See merge request libtiff/libtiff!15
+
+2018-01-25 Nathan Baker <elitebadger@gmail.com>
+
+ Add workaround to pal2rgb buffer overflow.
+
+2018-01-23 Andrea <andrea@andreaplanet.com>
+
+ Update tiffgt.c for build fix on Windows.
+
+ Update CMakeLists.txt for build fix on Windows.
+
+2018-01-15 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'has-attribute-check' into 'master'
+ tiffiop: use __has_attribute to detect the no_sanitize attribute
+
+ See merge request libtiff/libtiff!10
+
+2018-01-15 Ben Boeckel <ben.boeckel@kitware.com>
+
+ cmake: avoid setting hard-coded variables in the cache.
+
+ cmake: avoid an unnecessary intermediate variable.
+
+ cmake: avoid an unnecessary intermediate variable.
+
+ cmake: avoid tautological logic.
+
+ cmake: use check_symbol_exists.
+ This accounts for symbols being provided by macros.
+
+ cmake: remove unused configure checks.
+
+2018-01-12 Kevin Funk <kfunk@kde.org>
+
+ Prefer target_include_directories.
+ When libtiff is included in a super project via a simple
+ `add_subdirectory(libtiff)`, this way the `tiff` library target has all
+ the necessary information to build against it.
+
+ Note: The BUILD_INTERFACE generator expression feature requires at least
+ CMake v2.8.11 if I'm correct.
+
+2018-01-09 Ben Boeckel <ben.boeckel@kitware.com>
+
+ tiffiop: use __has_attribute to detect the no_sanitize attribute.
+
+2017-12-31 Even Rouault <even.rouault@spatialys.com>
+
+ man/TIFFquery.3tiff: remove reference to non-existing TIFFReadStrip() function in TIFFIsByteSwapped() documentation. Patch by Eric Piel. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2763
+
+ libtiff/tif_dir.c: _TIFFVGetField(): fix heap out-of-bounds access when requesting TIFFTAG_NUMBEROFINKS on a EXIF directory. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2765. Reported by Google Autofuzz project
+
+ libtiff/tif_print.c: TIFFPrintDirectory(): fix null pointer dereference on corrupted file. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2770
+
+2017-12-21 Even Rouault <even.rouault@spatialys.com>
+
+ Add libzstd to gitlab-ci.
+
+2017-12-21 Even Rouault <even.rouault@spatialys.com>
+
+ Add ZSTD compression codec.
+ From https://github.com/facebook/zstd
+ "Zstandard, or zstd as short version, is a fast lossless compression
+ algorithm, targeting real-time compression scenarios at zlib-level
+ and better compression ratios. It's backed by a very fast entropy stage,
+ provided by Huff0 and FSE library."
+
+ We require libzstd >= 1.0.0 so as to be able to use streaming compression
+ and decompression methods.
+
+ The default compression level we have selected is 9 (range goes from 1 to 22),
+ which experimentally offers equivalent or better compression ratio than
+ the default deflate/ZIP level of 6, and much faster compression.
+
+ For example on a 6600x4400 16bit image, tiffcp -c zip runs in 10.7 seconds,
+ while tiffcp -c zstd runs in 5.3 seconds. Decompression time for zip is
+ 840 ms, and for zstd 650 ms. File size is 42735936 for zip, and
+ 42586822 for zstd. Similar findings on other images.
+
+ On a 25894x16701 16bit image,
+
+ Compression time Decompression time File size
+
+ ZSTD 35 s 3.2 s 399 700 498
+ ZIP/Deflate 1m 20 s 4.9 s 419 622 336
+
+2017-12-10 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'fix_cve-2017-9935' into 'master'
+ Fix CVE-2017-9935
+
+ See merge request libtiff/libtiff!7
+
+2017-12-10 Brian May <brian@linuxpenguins.xyz>
+
+ tiff2pdf: Fix apparent incorrect type for transfer table.
+ The standard says the transfer table contains unsigned 16 bit values,
+ I have no idea why we refer to them as floats.
+
+2017-12-10 Brian May <brian@linuxpenguins.xyz>
+
+ tiff2pdf: Fix CVE-2017-9935.
+ Fix for http://bugzilla.maptools.org/show_bug.cgi?id=2704
+
+ This vulnerability - at least for the supplied test case - is because we
+ assume that a tiff will only have one transfer function that is the same
+ for all pages. This is not required by the TIFF standards.
+
+ We than read the transfer function for every page. Depending on the
+ transfer function, we allocate either 2 or 4 bytes to the XREF buffer.
+ We allocate this memory after we read in the transfer function for the
+ page.
+
+ For the first exploit - POC1, this file has 3 pages. For the first page
+ we allocate 2 extra extra XREF entries. Then for the next page 2 more
+ entries. Then for the last page the transfer function changes and we
+ allocate 4 more entries.
+
+ When we read the file into memory, we assume we have 4 bytes extra for
+ each and every page (as per the last transfer function we read). Which
+ is not correct, we only have 2 bytes extra for the first 2 pages. As a
+ result, we end up writing past the end of the buffer.
+
+ There are also some related issues that this also fixes. For example,
+ TIFFGetField can return uninitalized pointer values, and the logic to
+ detect a N=3 vs N=1 transfer function seemed rather strange.
+
+ It is also strange that we declare the transfer functions to be of type
+ float, when the standard says they are unsigned 16 bit values. This is
+ fixed in another patch.
+
+ This patch will check to ensure that the N value for every transfer
+ function is the same for every page. If this changes, we abort with an
+ error. In theory, we should perhaps check that the transfer function
+ itself is identical for every page, however we don't do that due to the
+ confusion of the type of the data in the transfer function.
+
+2017-12-10 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'undef-warn-fixes' into 'master'
+ Fix a couple of harmless but annoying -Wundef warnings
+
+ See merge request libtiff/libtiff!8
+
+2017-12-07 Vadim Zeitlin <vadim@zeitlins.org>
+
+ Remove tests for undefined SIZEOF_VOIDP.
+ As configure never uses AC_CHECK_SIZEOF(void*), this symbol is never
+ defined and so it doesn't make sense to test it in the code, this just
+ results in -Wundef warnings if they're enabled.
+
+ Avoid harmless -Wundef warnings for __clang_major__
+ Check that we're using Clang before checking its version.
+
+2017-12-02 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'remove_autogenerated_files' into 'master'
+ Remove autogenerated files
+
+ See merge request libtiff/libtiff!5
+
+2017-12-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Merge branch 'tif_config_h_includes' into 'master'
+ 'tif_config.h' or 'tiffiop.h' must be included before any system header.
+
+ See merge request libtiff/libtiff!6
+
+2017-12-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ 'tif_config.h' or 'tiffio.h' must be included before any system header.
+
+2017-12-01 Even Rouault <even.rouault@spatialys.com>
+
+ .gitignore: add patterns for build from root.
+
+ Remove remaining .cvsignore files.
+
+ Remove autoconf/automake generated files, and add them to .gitignore.
+
+2017-12-01 Olivier Paquet <olivier.paquet@gmail.com>
+
+ Merge branch 'makedistcheck' into 'master'
+ build/gitlab-ci and build/travis-ci: add a 'make dist' step in autoconf_build()…
+
+ See merge request libtiff/libtiff!4
+
+2017-12-01 Even Rouault <even.rouault@spatialys.com>
+
+ build/gitlab-ci and build/travis-ci: add a 'make dist' step in autoconf_build() target, to check we are release-ready
+
+2017-12-01 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'git_updates' into 'master'
+ CVS to Git updates
+
+ See merge request libtiff/libtiff!2
+
+2017-12-01 Even Rouault <even.rouault@spatialys.com>
+
+ HOWTO-RELEASE: update to use signed tags.
+
+ README.md: use markdown syntax for hyperlinks.
+
+2017-11-30 Even Rouault <even.rouault@spatialys.com>
+
+ Add .gitignore.
+
+ Regenerate autoconf files.
+
+ Makefile.am: update to reflect removal of README.vms and README -> README.md
+
+ Remove all $Id and $Headers comments with CVS versions.
+
+ HOWTO-RELEASE: update for git.
+
+ Remove outdated .cvsignore.
+
+ Remove outdated commit script.
+
+ Remove README.vms.
+
+ Rename README as README.md, and update content.
+
+ html/index.html: reflect change from CVS to gitlab.
+
+2017-11-30 Olivier Paquet <olivier.paquet@gmail.com>
+
+ Merge branch 'test-ci' into 'master'
+ Update CI configuration
+
+ See merge request libtiff/libtiff!1
+
+2017-11-23 Roger Leigh <rleigh@codelibre.net>
+
+ appveyor: Correct path for git clone and skip artefact archival.
+
+2017-11-22 Roger Leigh <rleigh@codelibre.net>
+
+ travis-ci: Remove unused matrix exclusion.
+
+ Add gitlab-ci build support.
+
2017-11-18 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* configure.ac: libtiff 4.0.9 released.
@@ -1849,7 +3428,7 @@
* libtiff/tif_jpeg.c: in JPEGFixupTags(), recognize SOF2, SOF9 and SOF10
markers to avoid emitting a warning (even if, according to the TechNote,
- there are admitedly unusual/not recommended or even forbidden variants, but
+ there are admittedly unusual/not recommended or even forbidden variants, but
they do work well with libjpeg for SOF2, and with libjpeg-turbo for SOF2,
SOF9 and SOF10).
Define in_color_space and input_components to the right values in
@@ -2432,7 +4011,7 @@
2012-05-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* man/TIFFGetField.3tiff: Correct the 'count' field type in the
- example for how to retreive the value of unsupported tags.
+ example for how to retrieve the value of unsupported tags.
2012-03-30 Frank Warmerdam <warmerdam@google.com>
@@ -3039,7 +4618,7 @@
2010-04-21 Frank Warmerdam <warmerdam@pobox.com>
- * libtiff/tif_jpeg.c: avoid preparing jpeg tables everytime
+ * libtiff/tif_jpeg.c: avoid preparing jpeg tables every time
JPEGSetupEncode() is called if the tables already seem to be
established. This prevents spurious updates and rewriting of
directories with jpegtables when doing updates to existing images.
@@ -3371,7 +4950,7 @@
* test/common.sh - start verbose mode after common settings.
- * libtiff/tif_dirinfo.c: Replace lfind() with local equivelent to
+ * libtiff/tif_dirinfo.c: Replace lfind() with local equivalent to
avoid type mismatches on different platforms.
http://bugzilla.maptools.org/show_bug.cgi?id=1889
@@ -3518,7 +5097,7 @@
* tools/tiffdump.c: When compiling for Microsoft Windows, apply
consistent (__int64) casting when testing if _lseeki64 has
- successfully seeked as requested. This is necessary for large
+ successfully sought as requested. This is necessary for large
file support to work since off_t is only 32-bit.
2008-07-29 Frank Warmerdam <warmerdam@pobox.com>
@@ -4316,7 +5895,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
* libtiff/tif_getimage.c: replaced usage of TIFFScanlineSize in
gtStripContig with TIFFNewScanlineSize so as to fix buggy behaviour
on subsampled images - this ought to get sorted when we feel brave
- enough to replace TIFFScanlineSize alltogether
+ enough to replace TIFFScanlineSize altogether
* libtiff/tif_ojpeg.c: fixed bug in OJPEGReadSkip
@@ -4974,7 +6553,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
2005-06-03 Andrey Kiselev <dron@ak4719.spb.edu>
- * libtiff/tif_open.c: Replace runtime endianess check with the compile
+ * libtiff/tif_open.c: Replace runtime endianness check with the compile
time one.
* libtiff/tif_predict.c: Floating point predictor now works on
@@ -6316,7 +7895,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
2003-11-16 Andrey Kiselev <dron@ak4719.spb.edu>
* libtiff/{tiff.h, tif_dirinfo.c}: Added support for IFD (13)
- datatype, intruduced in "Adobe PageMaker TIFF Tech. Notes".
+ datatype, introduced in "Adobe PageMaker TIFF Tech. Notes".
2003-11-15 Frank Warmerdam <warmerdam@pobox.com>
@@ -6627,7 +8206,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
* contrib/ojpeg/{Makefile.in, jdhuff.h, jinclude.h, ojpeg.c, README},
configure, Makefile.in: Improved libtiff compilation with OJPEG
- support. Now no need for patching IJG JPEG library, hack requred by
+ support. Now no need for patching IJG JPEG library, hack required by
libtiff will be compiled and used in-place. Implemented with
suggestion and help from Bill Allombert, Debian's libjpeg maintainer.
@@ -7485,7 +9064,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
sizes. It fixes two problems:
Without scaling (-S) the fax is now centered on the page size specified
- with -H and/or -W. Before, fax2ps was using an obscure and practially
+ with -H and/or -W. Before, fax2ps was using an obscure and practically
useless algorithm to allocate the image relative to Letter sized paper
which sometime sled to useless whitespace on the paper, while at the
same time cutting of the faxes printable area at the opposite border.
diff --git a/tiff/HOWTO-RELEASE b/tiff/HOWTO-RELEASE
index ae7501192..abcdc9ba9 100644
--- a/tiff/HOWTO-RELEASE
+++ b/tiff/HOWTO-RELEASE
@@ -1,4 +1,4 @@
-HOWTO-RELEASE:
+HOWTO-RELEASE:
Notes on releasing.
@@ -22,17 +22,30 @@ Notes on releasing.
and correctly set system clock and on a filesystem which accurately
records file update times. Use of GNU make is recommended.
-1. Commit any unsaved changes.
+1. Commit any unsaved changes.
-2. Create html/vX.X.html and add it to cvs with 'cvs add html/vX.X.html'.
- Take ChangeLog entries and html-ify in there.
+2. Use gnulib's gitlog-to-changelog script to add new (since the last
+ release) entries to the traditional ChangeLog file. Take note of
+ the most recent change note time stamp and use that as the starting
+ point. Concatenate the old logs to the new logs. The added logs
+ may be used to help produce the release notes (in next step). For
+ example:
+
+ gitlog-to-changelog --since=`head -n 1 ChangeLog | sed -e 's/ .*//g'` --append-dot > ChangeLog.added
+ printf "\n" >> ChangeLog.added
+ cat ChangeLog.added ChangeLog > ChangeLog.new
+ mv ChangeLog.new ChangeLog
+ rm ChangeLog.added
+
+3. Create html/vX.X.html and add it to git with 'git add html/vX.X.html'.
+ Take ChangeLog entries and html-ify in there.
Easist thing to do is take html/vX.(X-1).html and use it as a template.
-3. Add vX.X.html file to the list of 'docfiles' files in the html/Makefile.am.
+4. Add vX.X.html file to the list of 'docfiles' files in the html/Makefile.am.
-4. Update html/index.html to refer to this new page as the current release.
+5. Update html/index.html to refer to this new page as the current release.
-5. Increment the release version in configure.ac. Put 'alpha' or
+6. Increment the release version in configure.ac. Put 'alpha' or
'beta' after the version, if applicable. For example:
4.0.0
@@ -42,7 +55,7 @@ Notes on releasing.
Version should be updated in two places: in the second argument of the
AC_INIT macro and in LIBTIFF_xxx_VERSION variables.
-6. Update library ELF versioning in configure.ac (LIBTIFF_CURRENT,
+7. Update library ELF versioning in configure.ac (LIBTIFF_CURRENT,
LIBTIFF_REVISION, and LIBTIFF_AGE). These numbers have nothing to
do with the libtiff release version numbers.
@@ -53,11 +66,11 @@ Notes on releasing.
have been added, removed, or interface structures have changed,
then more care is required.
-7. Add an entry to Changelog similar to:
+8. Add an entry to Changelog similar to:
* libtiff 4.0.0 released.
-8. In the source tree do
+9. In the source tree do
./autogen.sh
@@ -65,7 +78,7 @@ Notes on releasing.
maintainer build with current autoconf, automake, and libtool
packages. It is only needed when updating tool versions.
-9. It is recommended (but not required) to build outside of the source
+10. It is recommended (but not required) to build outside of the source
tree so that the source tree is kept in a pristine state. This
also allows sharing the source directory on several networked
systems. For example:
@@ -78,17 +91,17 @@ Notes on releasing.
./configure --enable-maintainer-mode
-10. In the build tree do
+11. In the build tree do
make release
This will update "RELEASE-DATE", "VERSION", and libtiff/tiffvers.h
in the source tree.
-11. In the source tree, verify that the version info in RELEASE-DATE,
+12. In the source tree, verify that the version info in RELEASE-DATE,
VERSION and libtiff/tiffvers.h is right.
-12. In the build tree do
+13. In the build tree do
make
make distcheck
@@ -99,21 +112,35 @@ Notes on releasing.
Two files with names tiff-version.tar.gz and tiff-version.zip will
be created in the top level build directory.
-13. In the source tree do
+14. In the source tree do
- 'cvs commit'.
+ 'git status', 'git add .', 'git commit' and 'git push'
-14. In the source tree do
+15. In the source tree, create a signed tag
- cvs tag Release-v4-0-0
+ git tag -s v4.0.0 -m "Create tag for v4.0.0"
(or the appropriate name for the release)
-15. Copy release packages from the build tree to the
+ and push it to "origin" (if "origin" points to the official repository)
+
+ git push origin v4.0.0
+
+16. Sign the release files in the build tree using your private key
+
+ export GPG_TTY=$(tty)
+ for file in tiff-*.tar.gz tiff-*.zip ; do \
+ gpg2 --output ${file}.sig --detach-sig $file ; \
+ done
+
+ for file in tiff-*.tar.gz tiff-*.zip ; do \
+ gpg2 --verify ${file}.sig $file ; \
+ done
+
+17. Copy release packages from the build tree to the
ftp.remotesensing.org ftp site.
scp tiff-*.tar.gz tiff-*.zip \
- warmerdam@upload.osgeo.org:/osgeo/download/libtiff
-
-16. Announce to list, tiff@lists.maptools.org
+ bfriesen@upload.osgeo.org:/osgeo/download/libtiff
+18. Announce to list, tiff@lists.maptools.org
diff --git a/tiff/Makefile.am b/tiff/Makefile.am
index 418a3b932..d19e58ee9 100644
--- a/tiff/Makefile.am
+++ b/tiff/Makefile.am
@@ -31,8 +31,7 @@ ACLOCAL_AMFLAGS = -I m4
docfiles = \
COPYRIGHT \
ChangeLog \
- README \
- README.vms \
+ README.md \
RELEASE-DATE \
TODO \
VERSION
diff --git a/tiff/Makefile.in b/tiff/Makefile.in
index c9c0645fe..625934a38 100644
--- a/tiff/Makefile.in
+++ b/tiff/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -125,7 +125,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(dist_doc_DATA) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES = libtiff-4.pc
@@ -193,7 +193,7 @@ am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- cscope distdir dist dist-all distcheck
+ cscope distdir distdir-am dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
@@ -219,11 +219,9 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libtiff-4.pc.in \
$(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \
$(top_srcdir)/config/config.sub \
$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
- $(top_srcdir)/config/missing \
- $(top_srcdir)/config/mkinstalldirs ChangeLog README TODO \
- config/compile config/config.guess config/config.sub \
- config/depcomp config/install-sh config/ltmain.sh \
- config/missing config/mkinstalldirs
+ $(top_srcdir)/config/missing ChangeLog TODO config/compile \
+ config/config.guess config/config.sub config/depcomp \
+ config/install-sh config/ltmain.sh config/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -419,8 +417,7 @@ ACLOCAL_AMFLAGS = -I m4
docfiles = \
COPYRIGHT \
ChangeLog \
- README \
- README.vms \
+ README.md \
RELEASE-DATE \
TODO \
VERSION
@@ -470,8 +467,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -642,7 +639,10 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -707,7 +707,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
@@ -733,7 +733,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
@@ -750,7 +750,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@@ -760,7 +760,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
diff --git a/tiff/Makefile.vc b/tiff/Makefile.vc
index 2d894c2b4..6e66c730e 100644
--- a/tiff/Makefile.vc
+++ b/tiff/Makefile.vc
@@ -1,4 +1,3 @@
-# $Id: Makefile.vc,v 1.7 2008/01/01 15:53:10 fwarmerdam Exp $
#
# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
#
diff --git a/tiff/README b/tiff/README.md
index 5f30f4ee5..2573dab14 100644
--- a/tiff/README
+++ b/tiff/README.md
@@ -1,6 +1,3 @@
-$Header: /cvs/maptools/cvsroot/libtiff/README,v 1.7 2012-02-18 21:53:27 bfriesen Exp $
-
-
TIFF Software Distribution
--------------------------
This file is just a placeholder; all the documentation is now in
@@ -14,7 +11,7 @@ e.g.
If you don't have an HTML viewer then you can read the HTML source
or fetch a PostScript version of this documentation from the directory
- ftp://ftp.remotesensing.org/pub/libtiff/
+ http://download.osgeo.org/libtiff/
If you can't hack either of these options then basically what you
want to do is:
@@ -25,8 +22,21 @@ want to do is:
# make install
More information, email contacts, and mailing list information can be
-found online at http://www.remotesensing.org/libtiff/.
+found online at http://www.simplesystems.org/libtiff/
+
+Source code repository
+----------------------
+
+[GitLab](https://gitlab.com/libtiff/libtiff)
+
+Bug database
+------------
+
+[GitLab issues](https://gitlab.com/libtiff/libtiff/issues)
+Previously, the project used
+[Bugzilla](http://bugzilla.maptools.org/buglist.cgi?product=libtiff). This
+is no longer in use, and all remaining issues have been migrated to GitLab.
Use and Copyright
-----------------
diff --git a/tiff/README.vms b/tiff/README.vms
deleted file mode 100644
index 44d966392..000000000
--- a/tiff/README.vms
+++ /dev/null
@@ -1,12 +0,0 @@
-Dear OpenVMS user
-to make this library, execute
-$@CONFIGURE
-$@BUILD
-
-Build process should be error and warning free. When process will be finished,
-LIBTIFF$STRATUP.COM file containing all required definitions, will be created.
-Please call it from system startup procedure or individual user procedure LOGIN.COM
-To link software with libtiff, use TIFF:LIBTIFF.OPT
-
-best regards,
-Alexey Chupahin, elvis_75@mail.ru
diff --git a/tiff/RELEASE-DATE b/tiff/RELEASE-DATE
index f5a5ad729..ad4fa62a4 100644
--- a/tiff/RELEASE-DATE
+++ b/tiff/RELEASE-DATE
@@ -1 +1 @@
-20171118
+20191103
diff --git a/tiff/SConstruct b/tiff/SConstruct
index 682246ea0..ee87fedf5 100644
--- a/tiff/SConstruct
+++ b/tiff/SConstruct
@@ -1,5 +1,3 @@
-# $Id: SConstruct,v 1.4 2007/02/24 15:03:47 dron Exp $
-
# Tag Image File Format (TIFF) Software
#
# Copyright (C) 2005, Andrey Kiselev <dron@ak4719.spb.edu>
diff --git a/tiff/TODO b/tiff/TODO
index 2ff86272b..ea266aadf 100644
--- a/tiff/TODO
+++ b/tiff/TODO
@@ -1,5 +1,3 @@
-# $Header: /cvs/libtiff/TODO,v 1.6 2002/10/10 05:28:43 warmerda Exp $
-
o gif2tiff segaulting on selected images
o tiffcmp read data by strip/tile instead of scanline
o YCbCr sampling support
diff --git a/tiff/VERSION b/tiff/VERSION
index 7919852fe..ee74734aa 100644
--- a/tiff/VERSION
+++ b/tiff/VERSION
@@ -1 +1 @@
-4.0.9
+4.1.0
diff --git a/tiff/aclocal.m4 b/tiff/aclocal.m4
index ca19cbad0..9299d04d9 100644
--- a/tiff/aclocal.m4
+++ b/tiff/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.15'
+[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.16.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.16.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -332,13 +332,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@@ -346,49 +345,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ AS_CASE([$CONFIG_FILES],
+ [*\'*], [eval set x "$CONFIG_FILES"],
+ [*], [set x $CONFIG_FILES])
shift
- for mf
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
do
# Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
+ am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`AS_DIRNAME(["$am_mf"])`
+ am_filepart=`AS_BASENAME(["$am_mf"])`
+ AM_RUN_LOG([cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles]) || am_rc=$?
done
+ if test $am_rc -ne 0; then
+ AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. Try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).])
+ fi
+ AS_UNSET([am_dirpart])
+ AS_UNSET([am_filepart])
+ AS_UNSET([am_mf])
+ AS_UNSET([am_rc])
+ rm -f conftest-deps.mk
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
@@ -397,18 +388,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
+ [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -495,8 +485,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
@@ -563,7 +553,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -605,7 +595,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -626,7 +616,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -648,7 +638,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -683,7 +673,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -691,49 +681,42 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# AM_MAKE_INCLUDE()
# -----------------
-# Check to see how make treats includes.
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
am__doit:
- @echo this is the am__doit target
+ @echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+ AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+ ['0:this is the am__doit target'],
+ [AS_CASE([$s],
+ [BSD], [am__include='.include' am__quote='"'],
+ [am__include='include' am__quote=''])])
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -772,7 +755,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -801,7 +784,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -848,7 +831,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -867,7 +850,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -948,7 +931,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1008,7 +991,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1036,7 +1019,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1055,7 +1038,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/tiff/build/Makefile.in b/tiff/build/Makefile.in
index 69d54d1f1..92906d4d8 100644
--- a/tiff/build/Makefile.in
+++ b/tiff/build/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -122,7 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -161,7 +161,7 @@ am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- distdir
+ distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
@@ -182,8 +182,7 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
- $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
@@ -383,8 +382,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -501,7 +500,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/tiff/config/compile b/tiff/config/compile
index a85b723c7..99e50524b 100755
--- a/tiff/config/compile
+++ b/tiff/config/compile
@@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2012-10-14.11; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -255,7 +255,8 @@ EOF
echo "compile $scriptversion"
exit $?
;;
- cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
@@ -339,9 +340,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/tiff/config/config.guess b/tiff/config/config.guess
index d3229129d..6c32c8645 100755
--- a/tiff/config/config.guess
+++ b/tiff/config/config.guess
@@ -1,14 +1,12 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
+# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2008-01-08'
+timestamp='2014-11-04'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -17,26 +15,22 @@ timestamp='2008-01-08'
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches to <config-patches@gnu.org>.
+
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -56,8 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright 1992-2014 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."
@@ -139,12 +132,33 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval $set_cc_for_build
+ cat <<-EOF > $dummy.c
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ ;;
+esac
+
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
@@ -170,7 +184,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
+ | grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
@@ -180,7 +194,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
fi
;;
*)
- os=netbsd
+ os=netbsd
;;
esac
# The OS release
@@ -201,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
@@ -223,7 +241,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
@@ -269,7 +287,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
@@ -295,12 +316,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
+ echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -324,14 +345,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
@@ -375,23 +415,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
@@ -461,8 +501,8 @@ EOF
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -475,7 +515,7 @@ EOF
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
@@ -532,15 +572,16 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
- *:AIX:*:[456])
+ *:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
+ if [ -x /usr/bin/lslpp ] ; then
+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
@@ -575,52 +616,52 @@ EOF
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
+ esac ;;
+ esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ sed 's/^ //' << EOF >$dummy.c
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -640,7 +681,7 @@ EOF
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep __LP64__ >/dev/null
+ grep -q __LP64__
then
HP_ARCH="hppa2.0w"
else
@@ -711,22 +752,22 @@ EOF
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit ;;
+ exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit ;;
+ exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit ;;
+ exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit ;;
+ exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
@@ -750,14 +791,14 @@ EOF
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@@ -769,34 +810,39 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
+ *:MINGW64*:*)
+ echo ${UNAME_MACHINE}-pc-mingw64
+ exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
+ *:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
- *:Interix*:[3456]*)
- case ${UNAME_MACHINE} in
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
- EM64T | authenticamd)
+ authenticamd | genuineintel | EM64T)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
@@ -806,6 +852,9 @@ EOF
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -826,213 +875,157 @@ EOF
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
+ aarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ fi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
cris:Linux:*:*)
- echo cris-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
frv:Linux:*:*)
- echo frv-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ hexagon:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:Linux:*:*)
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- mips64:Linux:*:*)
+ mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
- #undef mips64
- #undef mips64el
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
+ CPU=${UNAME_MACHINE}el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
+ CPU=${UNAME_MACHINE}
#else
CPU=
#endif
#endif
EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
- or32:Linux:*:*)
- echo or32-unknown-linux-gnu
+ openrisc*:Linux:*:*)
+ echo or1k-unknown-linux-${LIBC}
exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
+ or32:Linux:*:* | or1k*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-${LIBC}
exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-${LIBC}
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+ *) echo hppa-unknown-linux-${LIBC} ;;
esac
exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-${LIBC}
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-${LIBC}
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-${LIBC}
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
- aarch64:Linux:*.*)
- echo x86_64-unknown-linux-gnu
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
- test x"${LIBC}" != x && {
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit
- }
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
- ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
@@ -1040,11 +1033,11 @@ EOF
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
+ # Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
@@ -1061,7 +1054,7 @@ EOF
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
@@ -1076,7 +1069,7 @@ EOF
fi
exit ;;
i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
@@ -1104,10 +1097,13 @@ EOF
exit ;;
pc:*:*:*)
# Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit ;;
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
@@ -1142,8 +1138,18 @@ EOF
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
@@ -1156,7 +1162,7 @@ EOF
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
@@ -1176,10 +1182,10 @@ EOF
echo ns32k-sni-sysv
fi
exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
@@ -1205,11 +1211,11 @@ EOF
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ echo mips-nec-sysv${UNAME_RELEASE}
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ echo mips-unknown-sysv${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
@@ -1219,6 +1225,12 @@ EOF
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@@ -1245,9 +1257,31 @@ EOF
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
+ eval $set_cc_for_build
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # Avoid executing cc on OS X 10.9, as it ships with a stub
+ # that puts up a graphical alert prompting to install
+ # developer tools. Any system running Mac OS X 10.7 or
+ # later (Darwin 11 and later) is required to have a 64-bit
+ # processor. This is not true of the ARM version of Darwin
+ # that Apple uses in portable devices.
+ UNAME_PROCESSOR=x86_64
+ fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1261,7 +1295,10 @@ EOF
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
@@ -1306,13 +1343,13 @@ EOF
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
+ echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
@@ -1327,158 +1364,13 @@ EOF
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
exit ;;
- c4*)
- echo c4-convex-bsd
+ x86_64:VMkernel:*:*)
+ echo ${UNAME_MACHINE}-unknown-esx
exit ;;
- esac
-fi
+esac
cat >&2 <<EOF
$0: unable to guess system type
@@ -1487,9 +1379,9 @@ This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
diff --git a/tiff/config/config.sub b/tiff/config/config.sub
index 6759825a5..7ffe37378 100755
--- a/tiff/config/config.sub
+++ b/tiff/config/config.sub
@@ -1,44 +1,40 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
+# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2008-01-16'
+timestamp='2014-12-03'
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
+# Please send patches to <config-patches@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
@@ -72,8 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright 1992-2014 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."
@@ -120,12 +115,18 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
@@ -148,10 +149,13 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray)
+ -apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
+ -bluegene*)
+ os=-cnk
+ ;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
@@ -166,10 +170,10 @@ case $os in
os=-chorusos
basic_machine=$1
;;
- -chorusrdb)
- os=-chorusrdb
+ -chorusrdb)
+ os=-chorusrdb
basic_machine=$1
- ;;
+ ;;
-hiux*)
os=-hiuxwe2
;;
@@ -214,6 +218,12 @@ case $os in
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
-lynx*)
os=-lynxos
;;
@@ -238,59 +248,90 @@ case $basic_machine in
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
+ | aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | be32 | be64 \
| bfin \
- | c4x | clipper \
+ | c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
+ | epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
- | mips64vr | mips64vrel \
+ | mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
+ | moxie \
| mt \
| msp430 \
- | nios | nios2 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
- | or32 \
+ | open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
+ | riscv32 | riscv64 \
+ | rl78 | rx \
| score \
- | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | visium \
| we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
- | z8k)
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
basic_machine=$basic_machine-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ leon|leon[3-9])
+ basic_machine=sparc-$basic_machine
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
@@ -300,6 +341,21 @@ case $basic_machine in
basic_machine=mt-unknown
;;
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
@@ -314,64 +370,83 @@ case $basic_machine in
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
+ | aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
+ | be32-* | be64-* \
| bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | craynv-* | cydra-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
+ | k1om-* \
+ | le32-* | le64-* \
+ | lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
+ | mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
- | nios-* | nios2-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
+ | or1k*-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
| tron-* \
- | v850-* | v850e-* | vax-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
+ | visium-* \
| we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
- | z8k-*)
+ | z8k-* | z80-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
@@ -393,7 +468,7 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
- abacus)
+ abacus)
basic_machine=abacus-unknown
;;
adobe68k)
@@ -439,6 +514,10 @@ case $basic_machine in
basic_machine=m68k-apollo
os=-bsd
;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
aux)
basic_machine=m68k-apple
os=-aux
@@ -455,10 +534,27 @@ case $basic_machine in
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
c90)
basic_machine=c90-cray
os=-unicos
;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
convex-c1)
basic_machine=c1-convex
os=-bsd
@@ -487,7 +583,7 @@ case $basic_machine in
basic_machine=craynv-cray
os=-unicosmp
;;
- cr16)
+ cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
@@ -526,6 +622,10 @@ case $basic_machine in
basic_machine=m88k-motorola
os=-sysv3
;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
@@ -641,7 +741,6 @@ case $basic_machine in
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
@@ -680,6 +779,9 @@ case $basic_machine in
basic_machine=m68k-isi
os=-sysv
;;
+ leon-*|leon[3-9]-*)
+ basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+ ;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
@@ -699,8 +801,15 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
+ microblaze*)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
mingw32)
- basic_machine=i386-pc
+ basic_machine=i686-pc
os=-mingw32
;;
mingw32ce)
@@ -728,6 +837,10 @@ case $basic_machine in
basic_machine=powerpc-unknown
os=-morphos
;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ os=-moxiebox
+ ;;
msdos)
basic_machine=i386-pc
os=-msdos
@@ -735,10 +848,18 @@ case $basic_machine in
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
+ msys)
+ basic_machine=i686-pc
+ os=-msys
+ ;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
@@ -803,6 +924,12 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -885,9 +1012,10 @@ case $basic_machine in
;;
power) basic_machine=power-ibm
;;
- ppc) basic_machine=powerpc-unknown
+ ppc | ppcbe) basic_machine=powerpc-unknown
;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
@@ -912,7 +1040,11 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
- rdos)
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
basic_machine=i386-pc
os=-rdos
;;
@@ -981,6 +1113,9 @@ case $basic_machine in
basic_machine=i860-stratus
os=-sysv4
;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
sun2)
basic_machine=m68000-sun
;;
@@ -1037,20 +1172,8 @@ case $basic_machine in
basic_machine=t90-cray
os=-unicos
;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
tile*)
- basic_machine=tile-unknown
+ basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
@@ -1120,6 +1243,9 @@ case $basic_machine in
xps | xps100)
basic_machine=xps100-honeywell
;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
ymp)
basic_machine=ymp-cray
os=-unicos
@@ -1128,6 +1254,10 @@ case $basic_machine in
basic_machine=z8k-unknown
os=-sim
;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
none)
basic_machine=none-none
os=-none
@@ -1166,7 +1296,7 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
@@ -1213,9 +1343,12 @@ esac
if [ x"$os" != x"" ]
then
case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
+ # First match some system type aliases
+ # that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
@@ -1236,29 +1369,31 @@ case $os in
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
+ | -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1297,7 +1432,7 @@ case $os in
-opened*)
os=-openedition
;;
- -os400*)
+ -os400*)
os=-os400
;;
-wince*)
@@ -1346,7 +1481,7 @@ case $os in
-sinix*)
os=-sysv4
;;
- -tpf*)
+ -tpf*)
os=-tpf
;;
-triton*)
@@ -1382,12 +1517,14 @@ case $os in
-aros*)
os=-aros
;;
- -kaos*)
- os=-kaos
- ;;
-zvmoe)
os=-zvmoe
;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
-none)
;;
*)
@@ -1410,10 +1547,10 @@ else
# system, and we'll never get to this point.
case $basic_machine in
- score-*)
+ score-*)
os=-elf
;;
- spu-*)
+ spu-*)
os=-elf
;;
*-acorn)
@@ -1425,8 +1562,23 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
- c4x-* | tic4x-*)
- os=-coff
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ c8051-*)
+ os=-elf
+ ;;
+ hexagon-*)
+ os=-elf
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
@@ -1446,14 +1598,11 @@ case $basic_machine in
;;
m68000-sun)
os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
;;
m68*-cisco)
os=-aout
;;
- mep-*)
+ mep-*)
os=-elf
;;
mips*-cisco)
@@ -1480,7 +1629,7 @@ case $basic_machine in
*-ibm)
os=-aix
;;
- *-knuth)
+ *-knuth)
os=-mmixware
;;
*-wec)
@@ -1585,7 +1734,7 @@ case $basic_machine in
-sunos*)
vendor=sun
;;
- -aix*)
+ -cnk*|-aix*)
vendor=ibm
;;
-beos*)
diff --git a/tiff/config/depcomp b/tiff/config/depcomp
index fc98710e2..65cbf7093 100755
--- a/tiff/config/depcomp
+++ b/tiff/config/depcomp
@@ -1,9 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2013-05-30.07; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2013-05-30.07; # UTC
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -783,9 +783,9 @@ exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/tiff/config/install-sh b/tiff/config/install-sh
index 4fbbae7b7..0b0fdcbba 100755
--- a/tiff/config/install-sh
+++ b/tiff/config/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2006-10-14.15
+scriptversion=2013-12-25.23; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,57 +35,57 @@ scriptversion=2006-10-14.15
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
+tab=' '
nl='
'
-IFS=" "" $nl"
+IFS=" $tab$nl"
-# set DOITPROG to echo to test this script
+# Set DOITPROG to "echo" to test this script.
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-if test -z "$doit"; then
- doit_exec=exec
-else
- doit_exec=$doit
-fi
+doit=${DOITPROG-}
+doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
-posix_glob=
posix_mkdir=
# Desired mode of installed file.
mode=0755
+chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
-chgrpcmd=
-stripcmd=
+mvcmd=$mvprog
rmcmd="$rmprog -f"
-mvcmd="$mvprog"
+stripcmd=
+
src=
dst=
dir_arg=
-dstarg=
-no_target_directory=
+dst_arg=
+
+copy_on_change=false
+is_target_a_directory=possibly
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
@@ -95,91 +95,101 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--c (ignored)
--d create directories instead of installing files.
--g GROUP $chgrpprog installed files to GROUP.
--m MODE $chmodprog installed files to MODE.
--o USER $chownprog installed files to USER.
--s $stripprog installed files.
--t DIRECTORY install into DIRECTORY.
--T report an error if DSTFILE is a directory.
---help display this help and exit.
---version display version info and exit.
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
- -c) shift
- continue;;
+ -c) ;;
- -d) dir_arg=true
- shift
- continue;;
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
+ shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
- shift
- shift
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- continue;;
+ case $mode in
+ *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
-o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
+ shift;;
- -s) stripcmd=$stripprog
- shift
- continue;;
+ -s) stripcmd=$stripprog;;
- -t) dstarg=$2
- shift
- shift
- continue;;
+ -t)
+ is_target_a_directory=always
+ dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
- -T) no_target_directory=true
- shift
- continue;;
+ -T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
- --) shift
- break;;
+ --) shift
+ break;;
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
*) break;;
esac
+ shift
done
-if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+ if test -n "$dst_arg"; then
+ echo "$0: target directory not allowed when installing a directory." >&2
+ exit 1
+ fi
+fi
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
- if test -n "$dstarg"; then
+ if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dstarg"
+ set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
- dstarg=$arg
+ dst_arg=$arg
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
done
fi
@@ -188,13 +198,26 @@ if test $# -eq 0; then
echo "$0: no input file specified." >&2
exit 1
fi
- # It's OK to call `install-sh -d' without argument.
+ # It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
- trap '(exit $?); exit' 1 2 13 15
+ if test $# -gt 1 || test "$is_target_a_directory" = always; then
+ if test ! -d "$dst_arg"; then
+ echo "$0: $dst_arg: Is not a directory." >&2
+ exit 1
+ fi
+ fi
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
@@ -205,16 +228,16 @@ if test -z "$dir_arg"; then
*[0-7])
if test -z "$stripcmd"; then
- u_plus_rw=
+ u_plus_rw=
else
- u_plus_rw='% 200'
+ u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
- u_plus_rw=
+ u_plus_rw=
else
- u_plus_rw=,u+rw
+ u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
@@ -222,9 +245,9 @@ fi
for src
do
- # Protect names starting with `-'.
+ # Protect names problematic for 'test' and other utilities.
case $src in
- -*) src=./$src ;;
+ -* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
@@ -242,55 +265,24 @@ do
exit 1
fi
- if test -z "$dstarg"; then
+ if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
-
- dst=$dstarg
- # Protect names starting with `-'.
- case $dst in
- -*) dst=./$dst ;;
- esac
+ dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dstarg: Is a directory" >&2
- exit 1
+ if test "$is_target_a_directory" = never; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
- # Prefer dirname, but fall back on a substitute if dirname fails.
- dstdir=`
- (dirname "$dst") 2>/dev/null ||
- expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$dst" : 'X\(//\)[^/]' \| \
- X"$dst" : 'X\(//\)$' \| \
- X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
- echo X"$dst" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'
- `
-
+ dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
@@ -301,74 +293,74 @@ do
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
- else
- mkdir_mode=
- fi
-
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writeable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
esac
if
$posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
@@ -378,60 +370,51 @@ do
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
- /*) prefix=/ ;;
- -*) prefix=./ ;;
- *) prefix= ;;
- esac
-
- case $posix_glob in
- '')
- if (set -f) 2>/dev/null; then
- posix_glob=true
- else
- posix_glob=false
- fi ;;
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
esac
oIFS=$IFS
IFS=/
- $posix_glob && set -f
+ set -f
set fnord $dstdir
shift
- $posix_glob && set +f
+ set +f
IFS=$oIFS
prefixes=
for d
do
- test -z "$d" && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
done
if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
fi
fi
fi
@@ -459,41 +442,51 @@ do
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
- && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
- && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
- # Now rename the file to the real destination.
- { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
- || {
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
-
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- if test -f "$dst"; then
- $doit $rmcmd -f "$dst" 2>/dev/null \
- || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
- && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
- || {
- echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- else
- :
- fi
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
- }
- } || exit 1
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+ set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ set +f &&
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
trap '' 0
fi
@@ -503,5 +496,6 @@ done
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
# End:
diff --git a/tiff/config/ltmain.sh b/tiff/config/ltmain.sh
index 147d758ab..0f0a2da3f 100755..100644
--- a/tiff/config/ltmain.sh
+++ b/tiff/config/ltmain.sh
@@ -31,7 +31,7 @@
PROGRAM=libtool
PACKAGE=libtool
-VERSION="2.4.6 Debian-2.4.6-0.1"
+VERSION=2.4.6
package_revision=2.4.6
@@ -2073,7 +2073,7 @@ include the following information:
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
Report bugs to <bug-libtool@gnu.org>.
-GNU libtool home page: <http://www.gnu.org/s/libtool/>.
+GNU libtool home page: <http://www.gnu.org/software/libtool/>.
General help using GNU software: <http://www.gnu.org/gethelp/>."
exit 0
}
@@ -7272,13 +7272,10 @@ func_mode_link ()
# -tp=* Portland pgcc target processor selection
# --sysroot=* for sysroot support
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
- # -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
- # -fsanitize=* Clang/GCC memory and address sanitizer
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
- -specs=*|-fsanitize=*)
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
func_append compile_command " $arg"
@@ -7571,10 +7568,7 @@ func_mode_link ()
case $pass in
dlopen) libs=$dlfiles ;;
dlpreopen) libs=$dlprefiles ;;
- link)
- libs="$deplibs %DEPLIBS%"
- test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
- ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac
fi
if test lib,dlpreopen = "$linkmode,$pass"; then
@@ -7893,19 +7887,19 @@ func_mode_link ()
# It is a libtool convenience library, so add in its objects.
func_append convenience " $ladir/$objdir/$old_library"
func_append old_convenience " $ladir/$objdir/$old_library"
- tmp_libs=
- for deplib in $dependency_libs; do
- deplibs="$deplib $deplibs"
- if $opt_preserve_dup_deps; then
- case "$tmp_libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- esac
- fi
- func_append tmp_libs " $deplib"
- done
elif test prog != "$linkmode" && test lib != "$linkmode"; then
func_fatal_error "'$lib' is not a convenience library"
fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
continue
fi # $pass = conv
@@ -8829,9 +8823,6 @@ func_mode_link ()
revision=$number_minor
lt_irix_increment=no
;;
- *)
- func_fatal_configuration "$modename: unknown library version type '$version_type'"
- ;;
esac
;;
no)
diff --git a/tiff/config/missing b/tiff/config/missing
index f62bbae30..625aeb118 100755
--- a/tiff/config/missing
+++ b/tiff/config/missing
@@ -1,9 +1,9 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2013-10-28.13; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2013-10-28.13; # UTC
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -101,9 +101,9 @@ else
exit $st
fi
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
program_details ()
{
@@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
exit $st
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/tiff/config/mkinstalldirs b/tiff/config/mkinstalldirs
deleted file mode 100755
index ef7e16fda..000000000
--- a/tiff/config/mkinstalldirs
+++ /dev/null
@@ -1,161 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-
-scriptversion=2006-05-11.19
-
-# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain.
-#
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-nl='
-'
-IFS=" "" $nl"
-errstatus=0
-dirmode=
-
-usage="\
-Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
-
-Create each directory DIR (with mode MODE, if specified), including all
-leading file name components.
-
-Report bugs to <bug-automake@gnu.org>."
-
-# process command line arguments
-while test $# -gt 0 ; do
- case $1 in
- -h | --help | --h*) # -h for help
- echo "$usage"
- exit $?
- ;;
- -m) # -m PERM arg
- shift
- test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
- dirmode=$1
- shift
- ;;
- --version)
- echo "$0 $scriptversion"
- exit $?
- ;;
- --) # stop option processing
- shift
- break
- ;;
- -*) # unknown option
- echo "$usage" 1>&2
- exit 1
- ;;
- *) # first non-opt arg
- break
- ;;
- esac
-done
-
-for file
-do
- if test -d "$file"; then
- shift
- else
- break
- fi
-done
-
-case $# in
- 0) exit 0 ;;
-esac
-
-# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
-# mkdir -p a/c at the same time, both will detect that a is missing,
-# one will create a, then the other will try to create a and die with
-# a "File exists" error. This is a problem when calling mkinstalldirs
-# from a parallel make. We use --version in the probe to restrict
-# ourselves to GNU mkdir, which is thread-safe.
-case $dirmode in
- '')
- if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- echo "mkdir -p -- $*"
- exec mkdir -p -- "$@"
- else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- test -d ./-p && rmdir ./-p
- test -d ./--version && rmdir ./--version
- fi
- ;;
- *)
- if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
- test ! -d ./--version; then
- echo "mkdir -m $dirmode -p -- $*"
- exec mkdir -m "$dirmode" -p -- "$@"
- else
- # Clean up after NextStep and OpenStep mkdir.
- for d in ./-m ./-p ./--version "./$dirmode";
- do
- test -d $d && rmdir $d
- done
- fi
- ;;
-esac
-
-for file
-do
- case $file in
- /*) pathcomp=/ ;;
- *) pathcomp= ;;
- esac
- oIFS=$IFS
- IFS=/
- set fnord $file
- shift
- IFS=$oIFS
-
- for d
- do
- test "x$d" = x && continue
-
- pathcomp=$pathcomp$d
- case $pathcomp in
- -*) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp"
-
- mkdir "$pathcomp" || lasterr=$?
-
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- else
- if test ! -z "$dirmode"; then
- echo "chmod $dirmode $pathcomp"
- lasterr=
- chmod "$dirmode" "$pathcomp" || lasterr=$?
-
- if test ! -z "$lasterr"; then
- errstatus=$lasterr
- fi
- fi
- fi
- fi
-
- pathcomp=$pathcomp/
- done
-done
-
-exit $errstatus
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/tiff/config/test-driver b/tiff/config/test-driver
index aba4d1d26..8e575b017 100755
--- a/tiff/config/test-driver
+++ b/tiff/config/test-driver
@@ -1,9 +1,9 @@
#! /bin/sh
-# test-driver - basic driver script for the 'parallel-tests' mode.
+# test-driver - basic testsuite driver script.
-scriptversion=2012-06-27.10; # UTC
+scriptversion=2013-07-13.22; # UTC
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2014 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -44,13 +44,12 @@ print_usage ()
Usage:
test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
[--expect-failure={yes|no}] [--color-tests={yes|no}]
- [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT
+ [--enable-hard-errors={yes|no}] [--]
+ TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
END
}
-# TODO: better error handling in option parsing (in particular, ensure
-# TODO: $log_file, $trs_file and $test_name are defined).
test_name= # Used for reporting.
log_file= # Where to save the output of the test script.
trs_file= # Where to save the metadata of the test run.
@@ -69,10 +68,23 @@ while test $# -gt 0; do
--enable-hard-errors) enable_hard_errors=$2; shift;;
--) shift; break;;
-*) usage_error "invalid option: '$1'";;
+ *) break;;
esac
shift
done
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file" = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+ usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+ usage_error "missing argument"
+fi
+
if test $color_tests = yes; then
# Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
red='' # Red.
@@ -94,11 +106,14 @@ trap "st=143; $do_exit" 15
# Test script is run here.
"$@" >$log_file 2>&1
estatus=$?
+
if test $enable_hard_errors = no && test $estatus -eq 99; then
- estatus=1
+ tweaked_estatus=1
+else
+ tweaked_estatus=$estatus
fi
-case $estatus:$expect_failure in
+case $tweaked_estatus:$expect_failure in
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
0:*) col=$grn res=PASS recheck=no gcopy=no;;
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
@@ -107,6 +122,12 @@ case $estatus:$expect_failure in
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
esac
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>$log_file
+
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
diff --git a/tiff/configure b/tiff/configure
index 4bb7c05a5..17597b791 100755
--- a/tiff/configure
+++ b/tiff/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for LibTIFF Software 4.0.9.
+# Generated by GNU Autoconf 2.69 for LibTIFF Software 4.1.0.
#
# Report bugs to <tiff@lists.maptools.org>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='LibTIFF Software'
PACKAGE_TARNAME='tiff'
-PACKAGE_VERSION='4.0.9'
-PACKAGE_STRING='LibTIFF Software 4.0.9'
+PACKAGE_VERSION='4.1.0'
+PACKAGE_STRING='LibTIFF Software 4.1.0'
PACKAGE_BUGREPORT='tiff@lists.maptools.org'
PACKAGE_URL=''
@@ -656,6 +656,10 @@ X_CFLAGS
XMKMF
HAVE_CXX_FALSE
HAVE_CXX_TRUE
+HAVE_WEBP_FALSE
+HAVE_WEBP_TRUE
+HAVE_ZSTD_FALSE
+HAVE_ZSTD_TRUE
HAVE_LZMA_FALSE
HAVE_LZMA_TRUE
HAVE_JBIG_FALSE
@@ -708,7 +712,6 @@ am__nodep
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
-am__quote
am__include
DEPDIR
OBJEXT
@@ -800,7 +803,8 @@ PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
-SHELL'
+SHELL
+am__quote'
ac_subst_files=''
ac_user_opts='
enable_option_checking
@@ -840,6 +844,12 @@ with_jbig_lib_dir
enable_lzma
with_lzma_include_dir
with_lzma_lib_dir
+enable_zstd
+with_zstd_include_dir
+with_zstd_lib_dir
+enable_webp
+with_webp_include_dir
+with_webp_lib_dir
enable_jpeg12
with_jpeg12_include_dir
with_jpeg12_lib
@@ -1408,7 +1418,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures LibTIFF Software 4.0.9 to adapt to many kinds of systems.
+\`configure' configures LibTIFF Software 4.1.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1482,7 +1492,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of LibTIFF Software 4.0.9:";;
+ short | recursive ) echo "Configuration of LibTIFF Software 4.1.0:";;
esac
cat <<\_ACEOF
@@ -1528,6 +1538,10 @@ Optional Features:
compression, enabled by default)
--disable-lzma disable liblzma usage (required for LZMA2
compression, enabled by default)
+ --disable-zstd disable libzstd usage (required for zstd
+ compression, enabled by default)
+ --disable-webp disable libwebp usage (required for webp
+ compression, enabled by default)
--enable-jpeg12 enable libjpeg 8/12bit dual mode
--enable-cxx enable C++ stream API building (requires C++
compiler)
@@ -1539,8 +1553,8 @@ Optional Features:
mutiple strips of specified size to reduce memory
usage)
--enable-defer-strile-load
- enable deferred strip/tile offset/size loading
- (experimental)
+ enable deferred strip/tile offset/size loading (also
+ available at runtime with the 'D' flag of TIFFOpen()
--enable-chunky-strip-read
enable reading large strips in chunks for
TIFFReadScanline() (experimental)
@@ -1577,6 +1591,12 @@ Optional Packages:
--with-lzma-include-dir=DIR
location of liblzma headers
--with-lzma-lib-dir=DIR location of liblzma library binary
+ --with-zstd-include-dir=DIR
+ location of libzstd headers
+ --with-zstd-lib-dir=DIR location of libzstd library binary
+ --with-webp-include-dir=DIR
+ location of libwebp headers
+ --with-webp-lib-dir=DIR location of libwebp library binary
--with-jpeg12-include-dir=DIR
location of libjpeg 12bit headers
--with-jpeg12-lib=LIBRARY
@@ -1668,7 +1688,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-LibTIFF Software configure 4.0.9
+LibTIFF Software configure 4.1.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2441,7 +2461,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by LibTIFF Software $as_me 4.0.9, which was
+It was created by LibTIFF Software $as_me 4.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2898,7 +2918,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-am__api_version='1.15'
+am__api_version='1.16'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -3384,7 +3404,7 @@ fi
# Define the identity of the package.
PACKAGE='tiff'
- VERSION='4.0.9'
+ VERSION='4.1.0'
cat >>confdefs.h <<_ACEOF
@@ -3414,8 +3434,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target (and possibly the TAP driver). The
@@ -3551,7 +3571,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -3587,15 +3607,15 @@ fi
LIBTIFF_MAJOR_VERSION=4
-LIBTIFF_MINOR_VERSION=0
-LIBTIFF_MICRO_VERSION=9
+LIBTIFF_MINOR_VERSION=1
+LIBTIFF_MICRO_VERSION=0
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=8
+LIBTIFF_CURRENT=10
LIBTIFF_REVISION=0
-LIBTIFF_AGE=3
+LIBTIFF_AGE=5
LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE
# This is a special hack for OpenBSD and MirOS systems. The dynamic linker
@@ -4470,45 +4490,45 @@ DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
am__doit:
- @echo this is the am__doit target
+ @echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#"
am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+ (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ case $?:`cat confinc.out 2>/dev/null` in #(
+ '0:this is the am__doit target') :
+ case $s in #(
+ BSD) :
+ am__include='.include' am__quote='"' ;; #(
+ *) :
+ am__include='include' am__quote='' ;;
+esac ;; #(
+ *) :
;;
- esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
+esac
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
# Check whether --enable-dependency-tracking was given.
if test "${enable_dependency_tracking+set}" = set; then :
@@ -6104,7 +6124,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-netbsd* | netbsdelf*-gnu)
+netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
else
@@ -10091,9 +10111,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
openbsd* | bitrig*)
with_gnu_ld=no
;;
- linux* | k*bsd*-gnu | gnu*)
- link_all_deplibs=no
- ;;
esac
ld_shlibs=yes
@@ -10348,7 +10365,7 @@ _LT_EOF
fi
;;
- netbsd* | netbsdelf*-gnu)
+ netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@@ -11018,7 +11035,6 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
if test yes = "$lt_cv_irix_exported_symbol"; then
archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
fi
- link_all_deplibs=no
else
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
@@ -11040,7 +11056,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
esac
;;
- netbsd* | netbsdelf*-gnu)
+ netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@@ -12155,18 +12171,6 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;
-netbsdelf*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -15479,7 +15483,7 @@ lt_prog_compiler_static_CXX=
;;
esac
;;
- netbsd* | netbsdelf*-gnu)
+ netbsd*)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -15854,9 +15858,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
;;
esac
;;
- linux* | k*bsd*-gnu | gnu*)
- link_all_deplibs_CXX=no
- ;;
*)
export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
@@ -16550,18 +16551,6 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;
-netbsdelf*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -16988,7 +16977,7 @@ fi
;;
esac
-for ac_header in assert.h fcntl.h io.h limits.h malloc.h search.h sys/time.h unistd.h
+for ac_header in assert.h fcntl.h io.h search.h unistd.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -17524,76 +17513,6 @@ _ACEOF
-# Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed short" >&5
-$as_echo_n "checking size of signed short... " >&6; }
-if ${ac_cv_sizeof_signed_short+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed short))" "ac_cv_sizeof_signed_short" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_signed_short" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (signed short)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_signed_short=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_short" >&5
-$as_echo "$ac_cv_sizeof_signed_short" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIGNED_SHORT $ac_cv_sizeof_signed_short
-_ACEOF
-
-
-
-# Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned short" >&5
-$as_echo_n "checking size of unsigned short... " >&6; }
-if ${ac_cv_sizeof_unsigned_short+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned short))" "ac_cv_sizeof_unsigned_short" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_unsigned_short" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (unsigned short)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_unsigned_short=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_short" >&5
-$as_echo "$ac_cv_sizeof_unsigned_short" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short
-_ACEOF
-
-
-
# Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
@@ -18094,15 +18013,15 @@ _ACEOF
$as_echo_n "checking for signed size type... " >&6; }
SSIZE_T='unknown'
SSIZE_FORMAT='unknown'
-if test $ac_cv_sizeof_signed_int -eq $ac_cv_sizeof_unsigned_char_p
+if test $ac_cv_sizeof_signed_int -eq $ac_cv_sizeof_size_t
then
SSIZE_T='signed int'
SSIZE_FORMAT='"%d"'
-elif test $ac_cv_sizeof_signed_long -eq $ac_cv_sizeof_unsigned_char_p
+elif test $ac_cv_sizeof_signed_long -eq $ac_cv_sizeof_size_t
then
SSIZE_T='signed long'
SSIZE_FORMAT='"%ld"'
-elif test $ac_cv_sizeof_signed_long_long -eq $ac_cv_sizeof_unsigned_char_p
+elif test $ac_cv_sizeof_signed_long_long -eq $ac_cv_sizeof_size_t
then
SSIZE_T='signed long long'
case "${host_os}" in
@@ -18158,52 +18077,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-ac_fn_c_check_type "$LINENO" "int8" "ac_cv_type_int8" "
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-
-"
-if test "x$ac_cv_type_int8" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_INT8 1
-_ACEOF
-
-
-fi
-ac_fn_c_check_type "$LINENO" "int16" "ac_cv_type_int16" "
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-
-"
-if test "x$ac_cv_type_int16" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_INT16 1
-_ACEOF
-
-
-fi
-ac_fn_c_check_type "$LINENO" "int32" "ac_cv_type_int32" "
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-
-"
-if test "x$ac_cv_type_int32" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_INT32 1
-_ACEOF
-
-
-fi
-
-
-for ac_func in floor isascii memmove memset mmap pow setmode snprintf sqrt \
-strchr strrchr strstr strtol strtoul strtoull
+for ac_func in mmap setmode snprintf
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -18258,6 +18132,34 @@ esac
fi
+ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol"
+if test "x$ac_cv_func_strtol" = xyes; then :
+ $as_echo "#define HAVE_STRTOL 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" strtol.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strtol.$ac_objext"
+ ;;
+esac
+
+fi
+
+
+ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll"
+if test "x$ac_cv_func_strtoll" = xyes; then :
+ $as_echo "#define HAVE_STRTOLL 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" strtoll.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strtoll.$ac_objext"
+ ;;
+esac
+
+fi
+
+
ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul"
if test "x$ac_cv_func_strtoul" = xyes; then :
$as_echo "#define HAVE_STRTOUL 1" >>confdefs.h
@@ -19183,6 +19085,238 @@ fi
+HAVE_ZSTD=no
+
+# Check whether --enable-zstd was given.
+if test "${enable_zstd+set}" = set; then :
+ enableval=$enable_zstd;
+fi
+
+
+# Check whether --with-zstd-include-dir was given.
+if test "${with_zstd_include_dir+set}" = set; then :
+ withval=$with_zstd_include_dir;
+fi
+
+
+# Check whether --with-zstd-lib-dir was given.
+if test "${with_zstd_lib_dir+set}" = set; then :
+ withval=$with_zstd_lib_dir;
+fi
+
+
+if test "x$enable_zstd" != "xno" ; then
+
+ if test "x$with_zstd_lib_dir" != "x" ; then
+ LDFLAGS="-L$with_zstd_lib_dir $LDFLAGS"
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZSTD_decompressStream in -lzstd" >&5
+$as_echo_n "checking for ZSTD_decompressStream in -lzstd... " >&6; }
+if ${ac_cv_lib_zstd_ZSTD_decompressStream+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lzstd $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ZSTD_decompressStream ();
+int
+main ()
+{
+return ZSTD_decompressStream ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_zstd_ZSTD_decompressStream=yes
+else
+ ac_cv_lib_zstd_ZSTD_decompressStream=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zstd_ZSTD_decompressStream" >&5
+$as_echo "$ac_cv_lib_zstd_ZSTD_decompressStream" >&6; }
+if test "x$ac_cv_lib_zstd_ZSTD_decompressStream" = xyes; then :
+ zstd_lib=yes
+else
+ zstd_lib=no
+fi
+
+ if test "$zstd_lib" = "no" -a "x$with_zstd_lib_dir" != "x"; then
+ as_fn_error $? "zstd library not found at $with_zstd_lib_dir" "$LINENO" 5
+ fi
+
+ if test "x$with_zstd_include_dir" != "x" ; then
+ CPPFLAGS="-I$with_zstd_include_dir $CPPFLAGS"
+ fi
+ ac_fn_c_check_header_mongrel "$LINENO" "zstd.h" "ac_cv_header_zstd_h" "$ac_includes_default"
+if test "x$ac_cv_header_zstd_h" = xyes; then :
+ zstd_h=yes
+else
+ zstd_h=no
+fi
+
+
+ if test "$zstd_h" = "no" -a "x$with_zstd_include_dir" != "x" ; then
+ as_fn_error $? "Libzstd headers not found at $with_zstd_include_dir" "$LINENO" 5
+ fi
+
+ if test "$zstd_lib" = "yes" -a "$zstd_h" = "yes" ; then
+ HAVE_ZSTD=yes
+ fi
+
+fi
+
+if test "$HAVE_ZSTD" = "yes" ; then
+
+$as_echo "#define ZSTD_SUPPORT 1" >>confdefs.h
+
+ LIBS="-lzstd $LIBS"
+ tiff_libs_private="-lzstd ${tiff_libs_private}"
+
+ if test "$HAVE_RPATH" = "yes" -a "x$with_zstd_lib_dir" != "x" ; then
+ LIBDIR="-R $with_zstd_lib_dir $LIBDIR"
+ fi
+
+fi
+
+ if test "$HAVE_ZSTD" = 'yes'; then
+ HAVE_ZSTD_TRUE=
+ HAVE_ZSTD_FALSE='#'
+else
+ HAVE_ZSTD_TRUE='#'
+ HAVE_ZSTD_FALSE=
+fi
+
+
+
+HAVE_WEBP=no
+
+# Check whether --enable-webp was given.
+if test "${enable_webp+set}" = set; then :
+ enableval=$enable_webp;
+fi
+
+
+# Check whether --with-webp-include-dir was given.
+if test "${with_webp_include_dir+set}" = set; then :
+ withval=$with_webp_include_dir;
+fi
+
+
+# Check whether --with-webp-lib-dir was given.
+if test "${with_webp_lib_dir+set}" = set; then :
+ withval=$with_webp_lib_dir;
+fi
+
+
+if test "x$enable_webp" != "xno" ; then
+
+ if test "x$with_webp_lib_dir" != "x" ; then
+ LDFLAGS="-L$with_webp_lib_dir $LDFLAGS"
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WebPDecode in -lwebp" >&5
+$as_echo_n "checking for WebPDecode in -lwebp... " >&6; }
+if ${ac_cv_lib_webp_WebPDecode+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lwebp $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char WebPDecode ();
+int
+main ()
+{
+return WebPDecode ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_webp_WebPDecode=yes
+else
+ ac_cv_lib_webp_WebPDecode=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_webp_WebPDecode" >&5
+$as_echo "$ac_cv_lib_webp_WebPDecode" >&6; }
+if test "x$ac_cv_lib_webp_WebPDecode" = xyes; then :
+ webp_lib=yes
+else
+ webp_lib=no
+fi
+
+ if test "$webp_lib" = "no" -a "x$with_webp_lib_dir" != "x"; then
+ as_fn_error $? "webp library not found at $with_webp_lib_dir" "$LINENO" 5
+ fi
+
+ if test "x$with_webp_include_dir" != "x" ; then
+ CPPFLAGS="-I$with_webp_include_dir $CPPFLAGS"
+ fi
+ ac_fn_c_check_header_mongrel "$LINENO" "webp/decode.h" "ac_cv_header_webp_decode_h" "$ac_includes_default"
+if test "x$ac_cv_header_webp_decode_h" = xyes; then :
+ webp_h=yes
+else
+ webp_h=no
+fi
+
+
+ if test "$webp_h" = "no" -a "x$with_webp_include_dir" != "x" ; then
+ as_fn_error $? "Libwebp headers not found at $with_webp_include_dir" "$LINENO" 5
+ fi
+
+ if test "$webp_lib" = "yes" -a "$webp_h" = "yes" ; then
+ HAVE_WEBP=yes
+ fi
+
+fi
+
+if test "$HAVE_WEBP" = "yes" ; then
+
+$as_echo "#define WEBP_SUPPORT 1" >>confdefs.h
+
+ LIBS="-lwebp $LIBS"
+ tiff_libs_private="-lwebp ${tiff_libs_private}"
+
+ if test "$HAVE_RPATH" = "yes" -a "x$with_webp_lib_dir" != "x" ; then
+ LIBDIR="-R $with_webp_lib_dir $LIBDIR"
+ fi
+
+fi
+
+ if test "$HAVE_WEBP" = 'yes'; then
+ HAVE_WEBP_TRUE=
+ HAVE_WEBP_FALSE='#'
+else
+ HAVE_WEBP_TRUE='#'
+ HAVE_WEBP_FALSE=
+fi
+
+
+
HAVE_JPEG12=no
# Check whether --enable-jpeg12 was given.
@@ -21122,6 +21256,14 @@ if test -z "${HAVE_LZMA_TRUE}" && test -z "${HAVE_LZMA_FALSE}"; then
as_fn_error $? "conditional \"HAVE_LZMA\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${HAVE_ZSTD_TRUE}" && test -z "${HAVE_ZSTD_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_ZSTD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_WEBP_TRUE}" && test -z "${HAVE_WEBP_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_WEBP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${HAVE_CXX_TRUE}" && test -z "${HAVE_CXX_FALSE}"; then
as_fn_error $? "conditional \"HAVE_CXX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -21531,7 +21673,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by LibTIFF Software $as_me 4.0.9, which was
+This file was extended by LibTIFF Software $as_me 4.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21597,7 +21739,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-LibTIFF Software config.status 4.0.9
+LibTIFF Software config.status 4.1.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -21716,7 +21858,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
# The HP-UX ksh and POSIX shell print the target directory to stdout
@@ -22734,29 +22876,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ case $CONFIG_FILES in #(
+ *\'*) :
+ eval set x "$CONFIG_FILES" ;; #(
+ *) :
+ set x $CONFIG_FILES ;; #(
+ *) :
+ ;;
+esac
shift
- for mf
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
do
# Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
+ am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$am_mf" : 'X\(//\)[^/]' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$am_mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -22774,53 +22922,48 @@ $as_echo X"$mf" |
q
}
s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
+ am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$am_mf" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
- /^X\(\/\/\)$/{
+ /^X\/\(\/\/\)$/{
s//\1/
q
}
- /^X\(\/\).*/{
+ /^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
+ { echo "$as_me:$LINENO: cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles" >&5
+ (cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } || am_rc=$?
done
+ if test $am_rc -ne 0; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. Try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ { am_dirpart=; unset am_dirpart;}
+ { am_filepart=; unset am_filepart;}
+ { am_mf=; unset am_mf;}
+ { am_rc=; unset am_rc;}
+ rm -f conftest-deps.mk
}
;;
"libtool":C)
@@ -23604,6 +23747,8 @@ echo " Old JPEG support: ${HAVE_OJPEG}"
echo " JPEG 8/12 bit dual mode: ${HAVE_JPEG12}"
echo " ISO JBIG support: ${HAVE_JBIG}"
echo " LZMA2 support: ${HAVE_LZMA}"
+echo " ZSTD support: ${HAVE_ZSTD}"
+echo " WEBP support: ${HAVE_WEBP}"
echo ""
echo " C++ support: ${HAVE_CXX}"
echo ""
diff --git a/tiff/configure.ac b/tiff/configure.ac
index 0dd32b759..eecb8e99c 100644
--- a/tiff/configure.ac
+++ b/tiff/configure.ac
@@ -25,7 +25,7 @@ dnl OF THIS SOFTWARE.
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.64)
-AC_INIT([LibTIFF Software],[4.0.9],[tiff@lists.maptools.org],[tiff])
+AC_INIT([LibTIFF Software],[4.1.0],[tiff@lists.maptools.org],[tiff])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(m4)
AC_LANG(C)
@@ -40,8 +40,8 @@ AM_MAINTAINER_MODE
dnl Versioning.
dnl Don't fill the ALPHA_VERSION field, if not applicable.
LIBTIFF_MAJOR_VERSION=4
-LIBTIFF_MINOR_VERSION=0
-LIBTIFF_MICRO_VERSION=9
+LIBTIFF_MINOR_VERSION=1
+LIBTIFF_MICRO_VERSION=0
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
@@ -76,9 +76,9 @@ dnl 5. If any interfaces have been added since the last public release, then
dnl increment age.
dnl 6. If any interfaces have been removed since the last public release,
dnl then set age to 0.
-LIBTIFF_CURRENT=8
+LIBTIFF_CURRENT=10
LIBTIFF_REVISION=0
-LIBTIFF_AGE=3
+LIBTIFF_AGE=5
LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE
# This is a special hack for OpenBSD and MirOS systems. The dynamic linker
@@ -174,7 +174,7 @@ case "${host_os}" in
esac
dnl Checks for header files.
-AC_CHECK_HEADERS([assert.h fcntl.h io.h limits.h malloc.h search.h sys/time.h unistd.h])
+AC_CHECK_HEADERS([assert.h fcntl.h io.h search.h unistd.h])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -196,12 +196,6 @@ dnl ---------------------------------------------------------------------------
dnl Compute sized types for current CPU and compiler options
dnl ---------------------------------------------------------------------------
-# Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
-AC_CHECK_SIZEOF(signed short)
-
-# Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
-AC_CHECK_SIZEOF(unsigned short)
-
# Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
AC_CHECK_SIZEOF(signed int)
@@ -371,15 +365,15 @@ AC_DEFINE_UNQUOTED([TIFF_SIZE_FORMAT],[$SIZE_FORMAT],[Size type formatter])
AC_MSG_CHECKING(for signed size type)
SSIZE_T='unknown'
SSIZE_FORMAT='unknown'
-if test $ac_cv_sizeof_signed_int -eq $ac_cv_sizeof_unsigned_char_p
+if test $ac_cv_sizeof_signed_int -eq $ac_cv_sizeof_size_t
then
SSIZE_T='signed int'
SSIZE_FORMAT='"%d"'
-elif test $ac_cv_sizeof_signed_long -eq $ac_cv_sizeof_unsigned_char_p
+elif test $ac_cv_sizeof_signed_long -eq $ac_cv_sizeof_size_t
then
SSIZE_T='signed long'
SSIZE_FORMAT='"%ld"'
-elif test $ac_cv_sizeof_signed_long_long -eq $ac_cv_sizeof_unsigned_char_p
+elif test $ac_cv_sizeof_signed_long_long -eq $ac_cv_sizeof_size_t
then
SSIZE_T='signed long long'
case "${host_os}" in
@@ -412,22 +406,15 @@ AC_MSG_RESULT($PTRDIFF_T)
AC_DEFINE_UNQUOTED(TIFF_PTRDIFF_T,$PTRDIFF_T,[Pointer difference type])
AC_DEFINE_UNQUOTED(TIFF_PTRDIFF_FORMAT,$PTRDIFF_FORMAT,[Pointer difference type formatter])
-dnl Some compilers (IBM VisualAge) has these types defined, so check it here:
-AC_CHECK_TYPES([int8, int16, int32],,,
-[
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-])
-
dnl Checks for library functions.
-AC_CHECK_FUNCS([floor isascii memmove memset mmap pow setmode snprintf sqrt \
-strchr strrchr strstr strtol strtoul strtoull])
+AC_CHECK_FUNCS([mmap setmode snprintf])
dnl Will use local replacements for unavailable functions
AC_REPLACE_FUNCS(getopt)
AC_REPLACE_FUNCS(snprintf)
AC_REPLACE_FUNCS(strcasecmp)
+AC_REPLACE_FUNCS(strtol)
+AC_REPLACE_FUNCS(strtoll)
AC_REPLACE_FUNCS(strtoul)
AC_REPLACE_FUNCS(strtoull)
AC_REPLACE_FUNCS(lfind)
@@ -827,6 +814,114 @@ fi
AM_CONDITIONAL(HAVE_LZMA, test "$HAVE_LZMA" = 'yes')
dnl ---------------------------------------------------------------------------
+dnl Check for libzstd.
+dnl ---------------------------------------------------------------------------
+
+HAVE_ZSTD=no
+
+AC_ARG_ENABLE(zstd,
+ AS_HELP_STRING([--disable-zstd],
+ [disable libzstd usage (required for zstd compression, enabled by default)]),,)
+AC_ARG_WITH(zstd-include-dir,
+ AS_HELP_STRING([--with-zstd-include-dir=DIR],
+ [location of libzstd headers]),,)
+AC_ARG_WITH(zstd-lib-dir,
+ AS_HELP_STRING([--with-zstd-lib-dir=DIR],
+ [location of libzstd library binary]),,)
+
+if test "x$enable_zstd" != "xno" ; then
+
+ if test "x$with_zstd_lib_dir" != "x" ; then
+ LDFLAGS="-L$with_zstd_lib_dir $LDFLAGS"
+ fi
+
+ AC_CHECK_LIB(zstd, ZSTD_decompressStream, [zstd_lib=yes], [zstd_lib=no],)
+ if test "$zstd_lib" = "no" -a "x$with_zstd_lib_dir" != "x"; then
+ AC_MSG_ERROR([zstd library not found at $with_zstd_lib_dir])
+ fi
+
+ if test "x$with_zstd_include_dir" != "x" ; then
+ CPPFLAGS="-I$with_zstd_include_dir $CPPFLAGS"
+ fi
+ AC_CHECK_HEADER(zstd.h, [zstd_h=yes], [zstd_h=no])
+ if test "$zstd_h" = "no" -a "x$with_zstd_include_dir" != "x" ; then
+ AC_MSG_ERROR([Libzstd headers not found at $with_zstd_include_dir])
+ fi
+
+ if test "$zstd_lib" = "yes" -a "$zstd_h" = "yes" ; then
+ HAVE_ZSTD=yes
+ fi
+
+fi
+
+if test "$HAVE_ZSTD" = "yes" ; then
+ AC_DEFINE(ZSTD_SUPPORT,1,[Support zstd compression])
+ LIBS="-lzstd $LIBS"
+ tiff_libs_private="-lzstd ${tiff_libs_private}"
+
+ if test "$HAVE_RPATH" = "yes" -a "x$with_zstd_lib_dir" != "x" ; then
+ LIBDIR="-R $with_zstd_lib_dir $LIBDIR"
+ fi
+
+fi
+
+AM_CONDITIONAL(HAVE_ZSTD, test "$HAVE_ZSTD" = 'yes')
+
+dnl ---------------------------------------------------------------------------
+dnl Check for libwebp.
+dnl ---------------------------------------------------------------------------
+
+HAVE_WEBP=no
+
+AC_ARG_ENABLE(webp,
+ AS_HELP_STRING([--disable-webp],
+ [disable libwebp usage (required for webp compression, enabled by default)]),,)
+AC_ARG_WITH(webp-include-dir,
+ AS_HELP_STRING([--with-webp-include-dir=DIR],
+ [location of libwebp headers]),,)
+AC_ARG_WITH(webp-lib-dir,
+ AS_HELP_STRING([--with-webp-lib-dir=DIR],
+ [location of libwebp library binary]),,)
+
+if test "x$enable_webp" != "xno" ; then
+
+ if test "x$with_webp_lib_dir" != "x" ; then
+ LDFLAGS="-L$with_webp_lib_dir $LDFLAGS"
+ fi
+
+ AC_CHECK_LIB(webp, WebPDecode, [webp_lib=yes], [webp_lib=no],)
+ if test "$webp_lib" = "no" -a "x$with_webp_lib_dir" != "x"; then
+ AC_MSG_ERROR([webp library not found at $with_webp_lib_dir])
+ fi
+
+ if test "x$with_webp_include_dir" != "x" ; then
+ CPPFLAGS="-I$with_webp_include_dir $CPPFLAGS"
+ fi
+ AC_CHECK_HEADER(webp/decode.h, [webp_h=yes], [webp_h=no])
+ if test "$webp_h" = "no" -a "x$with_webp_include_dir" != "x" ; then
+ AC_MSG_ERROR([Libwebp headers not found at $with_webp_include_dir])
+ fi
+
+ if test "$webp_lib" = "yes" -a "$webp_h" = "yes" ; then
+ HAVE_WEBP=yes
+ fi
+
+fi
+
+if test "$HAVE_WEBP" = "yes" ; then
+ AC_DEFINE(WEBP_SUPPORT,1,[Support webp compression])
+ LIBS="-lwebp $LIBS"
+ tiff_libs_private="-lwebp ${tiff_libs_private}"
+
+ if test "$HAVE_RPATH" = "yes" -a "x$with_webp_lib_dir" != "x" ; then
+ LIBDIR="-R $with_webp_lib_dir $LIBDIR"
+ fi
+
+fi
+
+AM_CONDITIONAL(HAVE_WEBP, test "$HAVE_WEBP" = 'yes')
+
+dnl ---------------------------------------------------------------------------
dnl Should 8/12 bit jpeg mode be enabled?
dnl ---------------------------------------------------------------------------
@@ -975,17 +1070,16 @@ fi
dnl ---------------------------------------------------------------------------
dnl Should we try to defer loading of strip/tile offsets and sizes to
-dnl optimize directory scanning? These is an experimental feature for
-dnl libtiff 4.0.
+dnl optimize directory scanning?
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(defer-strile-load,
AS_HELP_STRING([--enable-defer-strile-load],
- [enable deferred strip/tile offset/size loading (experimental)]),
+ [enable deferred strip/tile offset/size loading (also available at runtime with the 'D' flag of TIFFOpen()]),
[HAVE_DEFER_STRILE_LOAD=$enableval], [HAVE_DEFER_STRILE_LOAD=no])
if test "$HAVE_DEFER_STRILE_LOAD" = "yes" ; then
- AC_DEFINE(DEFER_STRILE_LOAD,1,[enable deferred strip/tile offset/size loading (experimental)])
+ AC_DEFINE(DEFER_STRILE_LOAD,1,[enable deferred strip/tile offset/size loading])
fi
@@ -1103,6 +1197,8 @@ LOC_MSG([ Old JPEG support: ${HAVE_OJPEG}])
LOC_MSG([ JPEG 8/12 bit dual mode: ${HAVE_JPEG12}])
LOC_MSG([ ISO JBIG support: ${HAVE_JBIG}])
LOC_MSG([ LZMA2 support: ${HAVE_LZMA}])
+LOC_MSG([ ZSTD support: ${HAVE_ZSTD}])
+LOC_MSG([ WEBP support: ${HAVE_WEBP}])
LOC_MSG()
LOC_MSG([ C++ support: ${HAVE_CXX}])
LOC_MSG()
diff --git a/tiff/configure.com b/tiff/configure.com
index 226751725..a30644258 100644
--- a/tiff/configure.com
+++ b/tiff/configure.com
@@ -1,4 +1,3 @@
-$! $Id: configure.com,v 1.3 2012-07-29 15:45:29 tgl Exp $
$!
$! OpenVMS configure procedure for libtiff
$! (c) Alexey Chupahin 22-NOV-2007
diff --git a/tiff/contrib/Makefile.in b/tiff/contrib/Makefile.in
index 1d1d02934..c4d5cd6ed 100644
--- a/tiff/contrib/Makefile.in
+++ b/tiff/contrib/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -160,7 +160,7 @@ am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- distdir
+ distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
@@ -181,8 +181,7 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
- $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
@@ -382,8 +381,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -500,7 +499,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/tiff/contrib/addtiffo/Makefile.in b/tiff/contrib/addtiffo/Makefile.in
index 24c604e18..abe4c0274 100644
--- a/tiff/contrib/addtiffo/Makefile.in
+++ b/tiff/contrib/addtiffo/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -123,7 +123,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -151,7 +151,9 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/addtiffo.Po \
+ ./$(DEPDIR)/tif_overview.Po ./$(DEPDIR)/tif_ovrcache.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -198,7 +200,7 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
- $(top_srcdir)/config/mkinstalldirs README
+ README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -378,8 +380,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -410,9 +412,15 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addtiffo.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_overview.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_ovrcache.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addtiffo.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_overview.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_ovrcache.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -493,7 +501,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -563,7 +574,9 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/addtiffo.Po
+ -rm -f ./$(DEPDIR)/tif_overview.Po
+ -rm -f ./$(DEPDIR)/tif_ovrcache.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -609,7 +622,9 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/addtiffo.Po
+ -rm -f ./$(DEPDIR)/tif_overview.Po
+ -rm -f ./$(DEPDIR)/tif_ovrcache.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -630,9 +645,9 @@ uninstall-am:
.MAKE: install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-generic clean-libtool clean-noinstPROGRAMS 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-data \
install-data-am install-dvi install-dvi-am install-exec \
diff --git a/tiff/contrib/addtiffo/addtiffo.c b/tiff/contrib/addtiffo/addtiffo.c
index 7bc3f4444..e1d706230 100644
--- a/tiff/contrib/addtiffo/addtiffo.c
+++ b/tiff/contrib/addtiffo/addtiffo.c
@@ -1,6 +1,4 @@
/******************************************************************************
- * $Id: addtiffo.c,v 1.8 2015-05-30 20:30:27 bfriesen Exp $
- *
* Project: GeoTIFF Overview Builder
* Purpose: Mainline for building overviews in a TIFF file.
* Author: Frank Warmerdam, warmerdam@pobox.com
diff --git a/tiff/contrib/addtiffo/tif_overview.c b/tiff/contrib/addtiffo/tif_overview.c
index c61ffbb8c..03b357334 100644
--- a/tiff/contrib/addtiffo/tif_overview.c
+++ b/tiff/contrib/addtiffo/tif_overview.c
@@ -65,6 +65,8 @@
# define MAX(a,b) ((a>b) ? a : b)
#endif
+#define TIFF_DIR_MAX 65534
+
void TIFFBuildOverviews( TIFF *, int, int *, int, const char *,
int (*)(double,void*), void * );
@@ -91,6 +93,7 @@ uint32 TIFF_WriteOverview( TIFF *hTIFF, uint32 nXSize, uint32 nYSize,
{
toff_t nBaseDirOffset;
toff_t nOffset;
+ tdir_t iNumDir;
(void) bUseSubIFDs;
@@ -147,7 +150,16 @@ uint32 TIFF_WriteOverview( TIFF *hTIFF, uint32 nXSize, uint32 nYSize,
return 0;
TIFFWriteDirectory( hTIFF );
- TIFFSetDirectory( hTIFF, (tdir_t) (TIFFNumberOfDirectories(hTIFF)-1) );
+ iNumDir = TIFFNumberOfDirectories(hTIFF);
+ if( iNumDir > TIFF_DIR_MAX )
+ {
+ TIFFErrorExt( TIFFClientdata(hTIFF),
+ "TIFF_WriteOverview",
+ "File `%s' has too many directories.\n",
+ TIFFFileName(hTIFF) );
+ exit(-1);
+ }
+ TIFFSetDirectory( hTIFF, (tdir_t) (iNumDir - 1) );
nOffset = TIFFCurrentDirOffset( hTIFF );
diff --git a/tiff/contrib/addtiffo/tif_ovrcache.c b/tiff/contrib/addtiffo/tif_ovrcache.c
index 171527b5c..67a88120b 100644
--- a/tiff/contrib/addtiffo/tif_ovrcache.c
+++ b/tiff/contrib/addtiffo/tif_ovrcache.c
@@ -1,6 +1,4 @@
/******************************************************************************
- * $Id: tif_ovrcache.c,v 1.11 2015-05-29 03:08:19 bfriesen Exp $
- *
* Project: TIFF Overview Builder
* Purpose: Library functions to maintain two rows of tiles or two strips
* of data for output overviews as an output cache.
diff --git a/tiff/contrib/dbs/Makefile.in b/tiff/contrib/dbs/Makefile.in
index e3503e107..38a13830a 100644
--- a/tiff/contrib/dbs/Makefile.in
+++ b/tiff/contrib/dbs/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -124,7 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -160,7 +160,10 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/tiff-bi.Po \
+ ./$(DEPDIR)/tiff-grayscale.Po ./$(DEPDIR)/tiff-palette.Po \
+ ./$(DEPDIR)/tiff-rgb.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -204,7 +207,7 @@ am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- distdir
+ distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
@@ -226,7 +229,7 @@ ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
- $(top_srcdir)/config/mkinstalldirs README
+ README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
@@ -437,8 +440,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -481,10 +484,16 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-bi.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-grayscale.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-palette.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-rgb.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-bi.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-grayscale.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-palette.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-rgb.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -612,7 +621,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -708,7 +720,10 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-recursive
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/tiff-bi.Po
+ -rm -f ./$(DEPDIR)/tiff-grayscale.Po
+ -rm -f ./$(DEPDIR)/tiff-palette.Po
+ -rm -f ./$(DEPDIR)/tiff-rgb.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -754,7 +769,10 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/tiff-bi.Po
+ -rm -f ./$(DEPDIR)/tiff-grayscale.Po
+ -rm -f ./$(DEPDIR)/tiff-palette.Po
+ -rm -f ./$(DEPDIR)/tiff-rgb.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -775,8 +793,8 @@ uninstall-am:
.MAKE: $(am__recursive_targets) install-am install-strip
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
- check-am clean clean-generic clean-libtool \
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--depfiles check check-am clean clean-generic clean-libtool \
clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
diff --git a/tiff/contrib/dbs/tiff-bi.c b/tiff/contrib/dbs/tiff-bi.c
index 33f05c7d0..db0e8c89d 100644
--- a/tiff/contrib/dbs/tiff-bi.c
+++ b/tiff/contrib/dbs/tiff-bi.c
@@ -1,5 +1,3 @@
-/* $Id: tiff-bi.c,v 1.3 2010-06-08 18:55:15 bfriesen Exp $ */
-
/*
* tiff-bi.c -- create a Class B (bilevel) TIFF file
*
diff --git a/tiff/contrib/dbs/tiff-grayscale.c b/tiff/contrib/dbs/tiff-grayscale.c
index 00b229f34..92c7b9045 100644
--- a/tiff/contrib/dbs/tiff-grayscale.c
+++ b/tiff/contrib/dbs/tiff-grayscale.c
@@ -1,5 +1,3 @@
-/* $Id: tiff-grayscale.c,v 1.6 2010-06-08 18:55:15 bfriesen Exp $ */
-
/*
* tiff-grayscale.c -- create a Class G (grayscale) TIFF file
* with a gray response curve in linear optical density
diff --git a/tiff/contrib/dbs/tiff-palette.c b/tiff/contrib/dbs/tiff-palette.c
index 3d9e862ba..7b3d433fe 100644
--- a/tiff/contrib/dbs/tiff-palette.c
+++ b/tiff/contrib/dbs/tiff-palette.c
@@ -1,5 +1,3 @@
-/* $Id: tiff-palette.c,v 1.5 2010-06-08 18:55:15 bfriesen Exp $ */
-
/*
* tiff-palette.c -- create a Class P (palette) TIFF file
*
diff --git a/tiff/contrib/dbs/tiff-rgb.c b/tiff/contrib/dbs/tiff-rgb.c
index bf9049902..d14ed0059 100644
--- a/tiff/contrib/dbs/tiff-rgb.c
+++ b/tiff/contrib/dbs/tiff-rgb.c
@@ -1,5 +1,3 @@
-/* $Id: tiff-rgb.c,v 1.4 2010-06-08 18:55:15 bfriesen Exp $ */
-
/*
* tiff-rgb.c -- create a 24-bit Class R (rgb) TIFF file
*
diff --git a/tiff/contrib/dbs/xtiff/Makefile.in b/tiff/contrib/dbs/xtiff/Makefile.in
index 08993c442..61594863a 100644
--- a/tiff/contrib/dbs/xtiff/Makefile.in
+++ b/tiff/contrib/dbs/xtiff/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -124,7 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -149,8 +149,7 @@ am__can_run_installinfo = \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
- $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -327,8 +326,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -352,7 +351,10 @@ ctags CTAGS:
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/tiff/contrib/dbs/xtiff/xtiff.c b/tiff/contrib/dbs/xtiff/xtiff.c
index 97e4ffe2f..bc10b670a 100644
--- a/tiff/contrib/dbs/xtiff/xtiff.c
+++ b/tiff/contrib/dbs/xtiff/xtiff.c
@@ -1,6 +1,4 @@
/*
- * $Id: xtiff.c,v 1.4 2013-05-02 14:44:29 tgl Exp $
- *
* xtiff - view a TIFF file in an X window
*
* Dan Sears
diff --git a/tiff/contrib/iptcutil/Makefile.in b/tiff/contrib/iptcutil/Makefile.in
index 0ee5ad3cb..790bb6c09 100644
--- a/tiff/contrib/iptcutil/Makefile.in
+++ b/tiff/contrib/iptcutil/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -123,7 +123,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -150,7 +150,8 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/iptcutil.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -197,7 +198,7 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
- $(top_srcdir)/config/mkinstalldirs README
+ README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -378,8 +379,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -410,7 +411,13 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iptcutil.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iptcutil.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -491,7 +498,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -561,7 +571,7 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/iptcutil.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -607,7 +617,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/iptcutil.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -628,9 +638,9 @@ uninstall-am:
.MAKE: install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-generic clean-libtool clean-noinstPROGRAMS 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-data \
install-data-am install-dvi install-dvi-am install-exec \
diff --git a/tiff/contrib/iptcutil/iptcutil.c b/tiff/contrib/iptcutil/iptcutil.c
index c359df875..621716df6 100644
--- a/tiff/contrib/iptcutil/iptcutil.c
+++ b/tiff/contrib/iptcutil/iptcutil.c
@@ -1,5 +1,3 @@
-/* $Id: iptcutil.c,v 1.11 2015-06-21 01:09:09 bfriesen Exp $ */
-
#include "tif_config.h"
#include <stdio.h>
@@ -784,7 +782,7 @@ int sindex(char ch,char *string)
char *cp;
for(cp=string;*cp;++cp)
if(ch==*cp)
- return (int)(cp-string); /* return postion of character */
+ return (int)(cp-string); /* return position of character */
return -1; /* eol ... no match found */
}
@@ -928,6 +926,7 @@ int tokenizer(unsigned inflag,char *token,int tokmax,char *line,
{
case IN_WHITE:
_p_state=IN_TOKEN; /* switch states */
+ /* Fall through */
case IN_TOKEN: /* these 2 are */
case IN_QUOTE: /* identical here */
diff --git a/tiff/contrib/mfs/Makefile.in b/tiff/contrib/mfs/Makefile.in
index 0a3b8406e..201e700b0 100644
--- a/tiff/contrib/mfs/Makefile.in
+++ b/tiff/contrib/mfs/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -146,8 +146,7 @@ am__can_run_installinfo = \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
- $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -322,8 +321,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -347,7 +346,10 @@ ctags CTAGS:
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/tiff/contrib/pds/Makefile.in b/tiff/contrib/pds/Makefile.in
index 29e48aa3d..e4c4651d4 100644
--- a/tiff/contrib/pds/Makefile.in
+++ b/tiff/contrib/pds/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -146,8 +146,7 @@ am__can_run_installinfo = \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
- $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -325,8 +324,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -350,7 +349,10 @@ ctags CTAGS:
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/tiff/contrib/pds/README b/tiff/contrib/pds/README
index b9abc6b3c..a36b05490 100644
--- a/tiff/contrib/pds/README
+++ b/tiff/contrib/pds/README
@@ -30,7 +30,7 @@ Your ReadRGBA() routine works well for reading many different formats
(TILED, STIP, compressed or not, etc.) of the most basic types of data
(RGB, 8-bit greyscale, 8-bit colormapped) into an SGI-style data array,
and serves as a good template for users with other needs. I used it as
-an exmaple of how to make an iterator which, rather than fill a data
+an example of how to make an iterator which, rather than fill a data
array, calls an arbitrary user-supplied callback function for each
"chunk" of data - that "chunk" might be a strip or a tile, and might
have one sample-per-pixel or two, and might be 8-bit data or 16-bit or
diff --git a/tiff/contrib/pds/tif_imageiter.c b/tiff/contrib/pds/tif_imageiter.c
index e025dc523..243cfd658 100644
--- a/tiff/contrib/pds/tif_imageiter.c
+++ b/tiff/contrib/pds/tif_imageiter.c
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_imageiter.c,v 1.4 2010-06-08 18:55:15 bfriesen Exp $ */
-
/*
* Copyright (c) 1991-1996 Sam Leffler
* Copyright (c) 1991-1996 Silicon Graphics, Inc.
@@ -116,7 +114,7 @@ TIFFImageIterBegin(TIFFImageIter* img, TIFF* tif, int stop, char emsg[1024])
TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Missing required \"Colormap\" tag");
return (0);
}
- /* fall thru... */
+ /* fall through... */
case PHOTOMETRIC_MINISWHITE:
case PHOTOMETRIC_MINISBLACK:
/* This should work now so skip the check - BSR
@@ -183,7 +181,7 @@ TIFFImageIterBegin(TIFFImageIter* img, TIFF* tif, int stop, char emsg[1024])
case ORIENTATION_LEFTBOT: /* XXX */
TIFFWarning(TIFFFileName(tif), "using bottom-left orientation");
img->orientation = ORIENTATION_BOTLEFT;
- /* fall thru... */
+ /* fall through... */
case ORIENTATION_BOTLEFT:
break;
case ORIENTATION_TOPRIGHT:
@@ -192,7 +190,7 @@ TIFFImageIterBegin(TIFFImageIter* img, TIFF* tif, int stop, char emsg[1024])
default:
TIFFWarning(TIFFFileName(tif), "using top-left orientation");
img->orientation = ORIENTATION_TOPLEFT;
- /* fall thru... */
+ /* fall through... */
case ORIENTATION_TOPLEFT:
break;
}
diff --git a/tiff/contrib/pds/tif_imageiter.h b/tiff/contrib/pds/tif_imageiter.h
index e7dbe46cc..4f4fd2791 100644
--- a/tiff/contrib/pds/tif_imageiter.h
+++ b/tiff/contrib/pds/tif_imageiter.h
@@ -44,7 +44,7 @@ struct _TIFFImageIter {
uint16 samplesperpixel; /* image samples/pixel */
uint16 orientation; /* image orientation */
uint16 photometric; /* image photometric interp */
- uint16* redcmap; /* colormap pallete */
+ uint16* redcmap; /* colormap palette */
uint16* greencmap;
uint16* bluecmap;
/* get image data routine */
diff --git a/tiff/contrib/pds/tif_pdsdirread.c b/tiff/contrib/pds/tif_pdsdirread.c
index 37e513ae3..cc6231da5 100644
--- a/tiff/contrib/pds/tif_pdsdirread.c
+++ b/tiff/contrib/pds/tif_pdsdirread.c
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_pdsdirread.c,v 1.4 2010-06-08 18:55:15 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1996 Sam Leffler
* Copyright (c) 1991-1996 Silicon Graphics, Inc.
@@ -194,7 +192,7 @@ TIFFReadPrivateDataSubDirectory(TIFF* tif, toff_t pdir_offset,
* 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.
*/
td = &tif->tif_dir;
@@ -827,7 +825,7 @@ TIFFFetchNormalSubTag(TIFF* tif, TIFFDirEntry* dp, const TIFFFieldInfo* fip,
break;
}
}
- /* fall thru... */
+ /* fall through... */
case TIFF_LONG:
case TIFF_SLONG:
{ uint32 v32 =
diff --git a/tiff/contrib/pds/tif_pdsdirwrite.c b/tiff/contrib/pds/tif_pdsdirwrite.c
index 3c632da69..a670bda1c 100644
--- a/tiff/contrib/pds/tif_pdsdirwrite.c
+++ b/tiff/contrib/pds/tif_pdsdirwrite.c
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_pdsdirwrite.c,v 1.4 2010-06-08 18:55:15 bfriesen Exp $ */
-
/* When writing data to TIFF files, it is often useful to store application-
specific data in a private TIFF directory so that the tags don't need to
be registered and won't conflict with other people's user-defined tags.
diff --git a/tiff/contrib/ras/Makefile.in b/tiff/contrib/ras/Makefile.in
index 67075acb5..0028f0912 100644
--- a/tiff/contrib/ras/Makefile.in
+++ b/tiff/contrib/ras/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -146,8 +146,7 @@ am__can_run_installinfo = \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
- $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -323,8 +322,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -348,7 +347,10 @@ ctags CTAGS:
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/tiff/contrib/ras/tif2ras.c b/tiff/contrib/ras/tif2ras.c
index e1c321df1..79db104eb 100644
--- a/tiff/contrib/ras/tif2ras.c
+++ b/tiff/contrib/ras/tif2ras.c
@@ -1,6 +1,3 @@
-#ifndef lint
-static char id[] = "$Id: tif2ras.c,v 1.3 2010-06-08 18:55:15 bfriesen Exp $";
-#endif
/*-
* tif2ras.c - Converts from a Tagged Image File Format image to a Sun Raster.
*
diff --git a/tiff/contrib/stream/Makefile.in b/tiff/contrib/stream/Makefile.in
index a7e314ceb..481faa829 100644
--- a/tiff/contrib/stream/Makefile.in
+++ b/tiff/contrib/stream/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -146,8 +146,7 @@ am__can_run_installinfo = \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
- $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -323,8 +322,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -348,7 +347,10 @@ ctags CTAGS:
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/tiff/contrib/tags/Makefile.in b/tiff/contrib/tags/Makefile.in
index ec8302c6a..0b53ed76b 100644
--- a/tiff/contrib/tags/Makefile.in
+++ b/tiff/contrib/tags/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -146,8 +146,7 @@ am__can_run_installinfo = \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
- $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -326,8 +325,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -351,7 +350,10 @@ ctags CTAGS:
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/tiff/contrib/tags/README b/tiff/contrib/tags/README
index 73c6c2132..3220b7b1b 100644
--- a/tiff/contrib/tags/README
+++ b/tiff/contrib/tags/README
@@ -2,7 +2,7 @@
NOTE: Sept/2004
The following described approach to managing tag extensions has been
-mostly superceeded since libtiff 3.6.0. The described approach requires
+mostly superseded since libtiff 3.6.0. The described approach requires
internal knowledge of the libtiff API and tends to be very fragile
in the face of libtiff upgrades.
diff --git a/tiff/contrib/tags/xtif_dir.c b/tiff/contrib/tags/xtif_dir.c
index e67a6abf7..352955267 100644
--- a/tiff/contrib/tags/xtif_dir.c
+++ b/tiff/contrib/tags/xtif_dir.c
@@ -269,7 +269,7 @@ _XTIFFDefaultDirectory(TIFF *tif)
* Install into TIFF structure.
*/
TIFFMEMBER(tif,clientdir) = (tidata_t)xt;
- tif->tif_flags |= XTIFF_INITIALIZED; /* dont do this again! */
+ tif->tif_flags |= XTIFF_INITIALIZED; /* don't do this again! */
}
/* set up our own defaults */
diff --git a/tiff/contrib/win_dib/Makefile.in b/tiff/contrib/win_dib/Makefile.in
index 478057861..7663106dd 100644
--- a/tiff/contrib/win_dib/Makefile.in
+++ b/tiff/contrib/win_dib/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -146,8 +146,7 @@ am__can_run_installinfo = \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
- $(top_srcdir)/config/mkinstalldirs
+am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -325,8 +324,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -350,7 +349,10 @@ ctags CTAGS:
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/tiff/contrib/win_dib/Makefile.w95 b/tiff/contrib/win_dib/Makefile.w95
index 3f461ef5a..3f15e8329 100644
--- a/tiff/contrib/win_dib/Makefile.w95
+++ b/tiff/contrib/win_dib/Makefile.w95
@@ -1,5 +1,3 @@
-# $Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.w95,v 1.2 1994/11/28
-06:13:31 sam Exp $
#
# Tag Image File Format Library
#
diff --git a/tiff/contrib/win_dib/README.tiff2dib b/tiff/contrib/win_dib/README.tiff2dib
index 3e6075fb1..ff70ca1a2 100644
--- a/tiff/contrib/win_dib/README.tiff2dib
+++ b/tiff/contrib/win_dib/README.tiff2dib
@@ -40,7 +40,7 @@ it contain the function LoadTIFFinDIB that load
a TIFF file and build a memory DIB with it and return the
HANDLE (HDIB) of the memory bloc containing this DIB.
Since DIB is the "natural" bitmap format for Windows 3.1, 95 and NT,
-this function sould be usefull for some Windows 95 (or NT) developer.
+this function should be useful for some Windows 95 (or NT) developer.
Sorry for my approximate english ...
diff --git a/tiff/contrib/win_dib/Tiffile.cpp b/tiff/contrib/win_dib/Tiffile.cpp
index 9d958b1c8..2f7965d63 100644
--- a/tiff/contrib/win_dib/Tiffile.cpp
+++ b/tiff/contrib/win_dib/Tiffile.cpp
@@ -360,7 +360,7 @@ setorientation(TIFFRGBAImage* img, uint32 h)
case ORIENTATION_LEFTBOT: /* XXX */
TIFFWarning(TIFFFileName(tif), "using bottom-left orientation");
img->orientation = ORIENTATION_BOTLEFT;
- /* fall thru... */
+ /* fall through... */
case ORIENTATION_BOTLEFT:
y = 0;
break;
@@ -370,7 +370,7 @@ setorientation(TIFFRGBAImage* img, uint32 h)
default:
TIFFWarning(TIFFFileName(tif), "using top-left orientation");
img->orientation = ORIENTATION_TOPLEFT;
- /* fall thru... */
+ /* fall through... */
case ORIENTATION_TOPLEFT:
y = h-1;
break;
diff --git a/tiff/html/Makefile.am b/tiff/html/Makefile.am
index 12193df70..10b419b27 100644
--- a/tiff/html/Makefile.am
+++ b/tiff/html/Makefile.am
@@ -86,7 +86,9 @@ docfiles = \
v4.0.6.html \
v4.0.7.html \
v4.0.8.html \
- v4.0.9.html
+ v4.0.9.html \
+ v4.0.10.html \
+ v4.1.0.html
dist_doc_DATA = $(docfiles)
diff --git a/tiff/html/Makefile.in b/tiff/html/Makefile.in
index 4c0c8e3e7..30932e635 100644
--- a/tiff/html/Makefile.in
+++ b/tiff/html/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -124,7 +124,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_doc_DATA) \
$(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -192,7 +192,7 @@ am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- distdir
+ distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
@@ -213,8 +213,7 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
- $(top_srcdir)/config/mkinstalldirs
+am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
@@ -449,7 +448,9 @@ docfiles = \
v4.0.6.html \
v4.0.7.html \
v4.0.8.html \
- v4.0.9.html
+ v4.0.9.html \
+ v4.0.10.html \
+ v4.1.0.html
dist_doc_DATA = $(docfiles)
SUBDIRS = images man
@@ -476,8 +477,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -615,7 +616,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/tiff/html/addingtags.html b/tiff/html/addingtags.html
index 4e89205b6..c61a26232 100644
--- a/tiff/html/addingtags.html
+++ b/tiff/html/addingtags.html
@@ -12,7 +12,7 @@ Defining New TIFF Tags
</H1>
Libtiff has built-in knowledge of all the standard TIFF tags, as
-well as extentions. The following describes how to add knowledge of
+well as extensions. The following describes how to add knowledge of
new tags as builtins to libtiff, or how to application specific tags can
be used by applications without modifying libtiff.
<p>
@@ -113,7 +113,7 @@ their own tags to store information outside the core TIFF specification.
This is done by calling TIFFMergeFieldInfo() with one or more TIFFFieldInfos.
<p>
-The libgeotiff library provides geospatial information extentions within
+The libgeotiff library provides geospatial information extensions within
a TIFF file. First, a set of TIFFFieldInfo's is prepared with information
on the new tags:<p>
diff --git a/tiff/html/bugs.html b/tiff/html/bugs.html
index 07fc78b89..bc27955e5 100644
--- a/tiff/html/bugs.html
+++ b/tiff/html/bugs.html
@@ -14,19 +14,20 @@ This software is free. Please let us know when you find a problem or
fix a bug.
<P>
-Thanks to <A HREF=http://www.maptools.org/>MapTools.org</a>, libtiff now uses
-bugzilla to track bugs. All bugs filed in the older bugzilla at
+The project is using <a href="https://gitlab.com/libtiff/libtiff/issues">
+GitLab issues</a> since October 2019.
+Previously, the project used MapTools.org
+bugzilla to track bugs: remaining tickets in that bugzilla instance have been
+migrated to GitLab issues. All bugs filed in a older bugzilla at
bugzilla.remotesensing.org (pre April 2008) have unfortunately been lost.
<P>
If you think you've discovered a bug, please first check to see if it is
-already known by looking at the list of already reported bugs. You can do so
-by visiting the buglist at
-<A HREF=http://bugzilla.maptools.org/buglist.cgi?product=libtiff>http://bugzilla.maptools.org/buglist.cgi?product=libtiff</A>. Also verify that
-the problem is still reproducable with the current development software
+already known by looking at the list of already reported bugs. Also verify that
+the problem is still reproducible with the current development software
from CVS.
<P>
If you'd like to enter a new bug, you can do so at
-<A HREF=http://bugzilla.maptools.org/enter_bug.cgi?product=libtiff>http://bugzilla.maptools.org/enter_bug.cgi?product=libtiff</A>.
+<A HREF=https://gitlab.com/libtiff/libtiff/issues/new>https://gitlab.com/libtiff/libtiff/issues/new</A>.
<P>
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.
@@ -37,12 +38,12 @@ Bob Friesenhahn
<P>
Of course, reporting bugs is no substitute for discussion. The
-<a href="mailto:tiff@lists.maptools.org">tiff@lists.maptools.org</a> mailing
+<a href="mailto:tiff@lists.osgeo.org">tiff@lists.osgeo.org</a> mailing
list is for users of this software, and discussion TIFF issues in general.
It is managed with the Mailman software, and the web interface for subscribing
and managing your access to the list is at:<p>
- <a href="http://lists.maptools.org/mailman/listinfo/tiff">http://lists.maptools.org/mailman/listinfo/tiff</a><P>
+ <a href="http://lists.osgeo.org/mailman/listinfo/tiff">http://lists.osgeo.org/mailman/listinfo/tiff</a><P>
Posts to the list are only accepted from members of the list in order
to limit the amount of spam propagated.<p>
@@ -56,6 +57,6 @@ Systems</a>. <p>
<HR>
-Last updated: $Date: 2016-04-08 02:34:03 $
+Last updated: 2019-10-01
</BODY>
</HTML>
diff --git a/tiff/html/build.html b/tiff/html/build.html
index f52b09664..77fbc40b9 100644
--- a/tiff/html/build.html
+++ b/tiff/html/build.html
@@ -689,7 +689,7 @@ libtiff/uvcode.h LogL/LogLuv codec-specific definitions
libtiff/version.h version string (generated by Makefile)
libtiff/tif_apple.c Apple-related OS support
libtiff/tif_atari.c Atari-related OS support
-libtiff/tif_aux.c auxilary directory-related functions
+libtiff/tif_aux.c auxiliary directory-related functions
libtiff/tif_close.c close an open TIFF file
libtiff/tif_codec.c configuration table of builtin codecs
libtiff/tif_compress.c compression scheme support
diff --git a/tiff/html/document.html b/tiff/html/document.html
index 936635bc7..71d04126b 100644
--- a/tiff/html/document.html
+++ b/tiff/html/document.html
@@ -14,8 +14,8 @@ TIFF Documentation
<P>
A copy of the 6.0 specification is available from Adobe at
<A HREF="http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf">http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf</A>, or from the libtiff
-ftp site at <a href="ftp://download.osgeo.org/libtiff/doc/TIFF6.pdf">
-ftp://download.osgeo.org/libtiff/doc/TIFF6.pdf</A>.<p>
+ftp site at <a href="https://download.osgeo.org/libtiff/doc/TIFF6.pdf">
+https://download.osgeo.org/libtiff/doc/TIFF6.pdf</A>.<p>
<P>
Draft <a href="TIFFTechNote2.html">TIFF Technical Note #2</A> covers problems
diff --git a/tiff/html/images.html b/tiff/html/images.html
index b2c5664c0..6e2e29be4 100644
--- a/tiff/html/images.html
+++ b/tiff/html/images.html
@@ -22,8 +22,8 @@ the same directory as this software.
<P>
The latest archive of test images is located at
-<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>
+<A HREF="https://download.osgeo.org/libtiff/pics-3.8.0.tar.gz">
+https://download.osgeo.org/libtiff/pics-3.8.0.tar.gz</A>
<P>
There are two other good sources for TIFF test images:
diff --git a/tiff/html/images/Makefile.in b/tiff/html/images/Makefile.in
index 80b74bfeb..234a29a53 100644
--- a/tiff/html/images/Makefile.in
+++ b/tiff/html/images/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -123,7 +123,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_doc_DATA) \
$(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -177,8 +177,7 @@ am__uninstall_files_from_dir = { \
am__installdirs = "$(DESTDIR)$(docdir)"
DATA = $(dist_doc_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
- $(top_srcdir)/config/mkinstalldirs
+am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -370,8 +369,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -416,7 +415,10 @@ ctags CTAGS:
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/tiff/html/index.html b/tiff/html/index.html
index 1c5a3ec31..dca511e7f 100644
--- a/tiff/html/index.html
+++ b/tiff/html/index.html
@@ -20,33 +20,31 @@
</tr>
<tr>
<th>Home Page #2</th>
+ <td><a href="https://libtiff.gitlab.io/libtiff/" title="Mirror of the LibTIFF software">https://libtiff.gitlab.io/libtiff/</a></td>
+ </tr>
+ <tr>
+ <th>Home Page #3</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.9.html">v4.0.9</a></td>
+ <td><a href="v4.1.0.html">v4.1.0</a></td>
</tr>
<tr>
<th>Master Download Site</th>
- <td><a href="ftp://download.osgeo.org/libtiff">download.osgeo.org</a>, directory libtiff</td>
+ <td><a href="https://download.osgeo.org/libtiff/">download.osgeo.org</a>, directory libtiff</td>
</tr>
<tr>
<th>Mailing List</th>
- <td><a href="mailto:tiff@lists.maptools.org">tiff@lists.maptools.org</a>,
- <a href="http://lists.maptools.org/mailman/listinfo/tiff/">Subscription</a>,
+ <td><a href="mailto:tiff@lists.osgeo.org">tiff@lists.osgeo.org</a>,
+ <a href="http://lists.osgeo.org/mailman/listinfo/tiff/">Subscription</a>,
<a href="http://www.awaresystems.be/imaging/tiff/tml.html">Archive</a>.
Please, read the <a href="http://www.awaresystems.be/imaging/tiff/faq.html">TIFF FAQ</a>
before asking questions.</td>
</tr>
<tr>
- <th>Anonymous CVS</th>
- <td><tt>export CVSROOT=:pserver:cvsanon@cvs.maptools.org:/cvs/maptools/cvsroot<br>
- cvs login</tt><br>
- (use empty password)<br>
- <tt>cvs checkout libtiff<br></tt>
- to get the stable libtiff code or<br>
- <tt>cvs checkout -r branch-3-9 libtiff</tt><br>
- to get the previous stable branch supporting the 3.9.X release series.</td>
+ <th>git repository</th>
+ <td><tt><a href="https://gitlab.com/libtiff/libtiff">https://gitlab.com/libtiff/libtiff</a></td>
</tr>
</table>
<hr>
@@ -76,9 +74,9 @@
</p>
<p>
Questions should be sent to the TIFF mailing list:
- <a href="mailto:tiff@lists.maptools.org">tiff@lists.maptools.org</a>, with
+ <a href="mailto:tiff@lists.osgeo.org">tiff@lists.osgeo.org</a>, with
a subscription interface at
- <a href="http://lists.maptools.org/mailman/listinfo/tiff">http://lists.maptools.org/mailman/listinfo/tiff</a>.
+ <a href="http://lists.osgeo.org/mailman/listinfo/tiff">http://lists.osgeo.org/mailman/listinfo/tiff</a>.
</p>
<p>
The persons currently actively maintaining and releasing libtiff
@@ -102,7 +100,7 @@
<li><a href="contrib.html">Contributed software</a></li>
<li><a href="document.html">TIFF documentation</a></li>
<li><a href="build.html">Building the software distribution</a></li>
- <li><a href="bugs.html">Bugs, Bugzilla, and the TIFF mailing list</a></li>
+ <li><a href="bugs.html">Bugs, GitLab issues, and the TIFF mailing list</a></li>
<li><a href="images.html">Test images</a></li>
<li><a href="misc.html">Acknowledgements and copyright issues</a></li>
<li><a href="man/index.html">Man Pages</a></li>
@@ -116,7 +114,7 @@
</ul>
<hr>
<p>
- Last updated $Date: 2017-11-07 02:00:06 $.
+ Last updated 2019-11-03
</p>
</body>
</html>
diff --git a/tiff/html/libtiff.html b/tiff/html/libtiff.html
index b1de7a27f..56535d97d 100644
--- a/tiff/html/libtiff.html
+++ b/tiff/html/libtiff.html
@@ -45,8 +45,8 @@
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.simplesystems.org/libtiff/man/index.html">UNIX
- manual pages</a> that accompany this software.
+ the <a href="man/index.html">UNIX manual pages</a> that accompany
+ this software.
</p>
<p>
Michael Still has also written a useful introduction to libtiff for the
@@ -97,7 +97,7 @@
information.
The library include file <tt>&lt;tiffio.h&gt;</tt> contains a C pre-processor
define <tt>TIFFLIB_VERSION</tt> that can be used to check library
- version compatiblity at compile time.
+ version compatibility at compile time.
</p>
<hr>
<h2 id="typedefs">Library Datatypes</h2>
diff --git a/tiff/html/man/Makefile.in b/tiff/html/man/Makefile.in
index eb99fd1ba..c435bad59 100644
--- a/tiff/html/man/Makefile.in
+++ b/tiff/html/man/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -123,7 +123,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_doc_DATA) \
$(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -177,8 +177,7 @@ am__uninstall_files_from_dir = { \
am__installdirs = "$(DESTDIR)$(docdir)"
DATA = $(dist_doc_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
- $(top_srcdir)/config/mkinstalldirs
+am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -426,8 +425,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -472,7 +471,10 @@ ctags CTAGS:
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/tiff/html/man/TIFFReadDirectory.3tiff.html b/tiff/html/man/TIFFReadDirectory.3tiff.html
index 1e32f7cd2..5e4004db7 100644
--- a/tiff/html/man/TIFFReadDirectory.3tiff.html
+++ b/tiff/html/man/TIFFReadDirectory.3tiff.html
@@ -151,23 +151,23 @@ specification. This error is not fatal.</big></p>
unknown tag was encountered in the directory; the library
ignores all such tags.</big></p>
<!-- INDENTATION -->
-<p><big><b>TIFF directory is missing requred
+<p><big><b>TIFF directory is missing required
&quot;ImageLength&quot; field</b>. The image violates the
specification by not having a necessary field. There is no
way for the library to recover from this error.</big></p>
<!-- INDENTATION -->
-<p><big><b>TIFF directory is missing requred
+<p><big><b>TIFF directory is missing required
&quot;PlanarConfig&quot; field</b>. The image violates the
specification by not having a necessary field. There is no
way for the library to recover from this error.</big></p>
<!-- INDENTATION -->
-<p><big><b>TIFF directory is missing requred
+<p><big><b>TIFF directory is missing required
&quot;StripOffsets&quot; field</b>. The image has multiple
strips, but is missing the tag that specifies the file
offset to each strip of data. There is no way for the
library to recover from this error.</big></p>
<!-- INDENTATION -->
-<p><big><b>TIFF directory is missing requred
+<p><big><b>TIFF directory is missing required
&quot;TileOffsets&quot; field</b>. The image has multiple
tiles, but is missing the tag that specifies the file offset
to each tile of data. There is no way for the library to
diff --git a/tiff/html/man/TIFFWriteDirectory.3tiff.html b/tiff/html/man/TIFFWriteDirectory.3tiff.html
index 9aff8c4c9..6483aa6ac 100644
--- a/tiff/html/man/TIFFWriteDirectory.3tiff.html
+++ b/tiff/html/man/TIFFWriteDirectory.3tiff.html
@@ -69,7 +69,7 @@ have an established location in the file. It will rewrite
the directory, but instead of place it at it&rsquo;s old
location (as <i>TIFFWriteDirectory</i> would) it will place
them at the end of the file, correcting the pointer from the
-preceeding directory or file header to point to it&rsquo;s
+preceding directory or file header to point to it&rsquo;s
new location. This is particularly important in cases where
the size of the directory and pointed to data has grown, so
it won&rsquo;t fit in the space available at the old
diff --git a/tiff/html/man/TIFFmemory.3tiff.html b/tiff/html/man/TIFFmemory.3tiff.html
index 39fa78948..283be9bdf 100644
--- a/tiff/html/man/TIFFmemory.3tiff.html
+++ b/tiff/html/man/TIFFmemory.3tiff.html
@@ -76,7 +76,7 @@ another memory location using <i>_TIFFmemcpy</i>, or
compared for equality using <i>_TIFFmemcmp</i>. These
routines conform to the equivalent <small>ANSI</small> C
routines: <i>memset</i>, <i>memcpy</i>, and <i>memcmp</i>,
-repsectively.</p>
+respectively.</p>
</td>
</table>
<a name="DIAGNOSTICS"></a>
diff --git a/tiff/html/v3.4beta007.html b/tiff/html/v3.4beta007.html
index 10a2946dc..103072052 100644
--- a/tiff/html/v3.4beta007.html
+++ b/tiff/html/v3.4beta007.html
@@ -16,7 +16,7 @@ Changes in TIFF v3.4beta007
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.4beta007<BR>
<B>Previous Version</B>: v3.4beta004<BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<B>Master Download Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.4beta016.html b/tiff/html/v3.4beta016.html
index 133a46974..170f33842 100644
--- a/tiff/html/v3.4beta016.html
+++ b/tiff/html/v3.4beta016.html
@@ -16,7 +16,7 @@ Changes in TIFF v3.4beta016
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.4beta016<BR>
<B>Previous Version</B>: <A HREF=v3.4beta007.html>v3.4beta007</A><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<B>Master Download Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.4beta018.html b/tiff/html/v3.4beta018.html
index 1256c8a9d..4843c95d9 100644
--- a/tiff/html/v3.4beta018.html
+++ b/tiff/html/v3.4beta018.html
@@ -16,7 +16,7 @@ Changes in TIFF v3.4beta018
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.4beta018<BR>
<B>Previous Version</B>: <A HREF=v3.4beta016.html>v3.4beta016</A><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<B>Master Download Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.4beta024.html b/tiff/html/v3.4beta024.html
index 09da9262a..ee2b243bb 100644
--- a/tiff/html/v3.4beta024.html
+++ b/tiff/html/v3.4beta024.html
@@ -16,7 +16,7 @@ Changes in TIFF v3.4beta024
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.4beta024<BR>
<B>Previous Version</B>: <A HREF=v3.4beta018.html>v3.4beta018</A><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<B>Master Download Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.4beta028.html b/tiff/html/v3.4beta028.html
index 827229efc..5ac9d75f9 100644
--- a/tiff/html/v3.4beta028.html
+++ b/tiff/html/v3.4beta028.html
@@ -16,7 +16,7 @@ Changes in TIFF v3.4beta028
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.4beta028<BR>
<B>Previous Version</B>: <A HREF=v3.4beta024.html>v3.4beta024</A><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<B>Master Download Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.4beta029.html b/tiff/html/v3.4beta029.html
index 442a2f397..f7e863d08 100644
--- a/tiff/html/v3.4beta029.html
+++ b/tiff/html/v3.4beta029.html
@@ -16,7 +16,7 @@ Changes in TIFF v3.4beta029
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.4beta029<BR>
<B>Previous Version</B>: <A HREF=v3.4beta028.html>v3.4beta028</A><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<B>Master Download Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.4beta031.html b/tiff/html/v3.4beta031.html
index 5f350c784..137368dac 100644
--- a/tiff/html/v3.4beta031.html
+++ b/tiff/html/v3.4beta031.html
@@ -16,7 +16,7 @@ Changes in TIFF v3.4beta031
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.4beta031<BR>
<B>Previous Version</B>: <A HREF=v3.4beta029.html>v3.4beta029</A><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<B>Master Download Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.4beta032.html b/tiff/html/v3.4beta032.html
index 87d18cd8d..4651539ed 100644
--- a/tiff/html/v3.4beta032.html
+++ b/tiff/html/v3.4beta032.html
@@ -16,7 +16,7 @@ Changes in TIFF v3.4beta032
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.4beta032<BR>
<B>Previous Version</B>: <A HREF=v3.4beta031.html>v3.4beta031</A><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<B>Master Download Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.4beta033.html b/tiff/html/v3.4beta033.html
index a6a6bbe2e..f311e6a32 100644
--- a/tiff/html/v3.4beta033.html
+++ b/tiff/html/v3.4beta033.html
@@ -16,7 +16,7 @@ Changes in TIFF v3.4beta033
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.4beta033 (aka the v3.4 release)<BR>
<B>Previous Version</B>: <A HREF=v3.4beta032.html>v3.4beta032</A><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<B>Master Download Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.4beta034.html b/tiff/html/v3.4beta034.html
index c7ac9bd93..a2735de23 100644
--- a/tiff/html/v3.4beta034.html
+++ b/tiff/html/v3.4beta034.html
@@ -16,7 +16,7 @@ Changes in TIFF v3.4beta034
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.4beta034<BR>
<B>Previous Version</B>: <A HREF=v3.4beta033.html>v3.4beta033</A><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<B>Master Download Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.4beta035.html b/tiff/html/v3.4beta035.html
index 72c009075..5b0901d32 100644
--- a/tiff/html/v3.4beta035.html
+++ b/tiff/html/v3.4beta035.html
@@ -16,7 +16,7 @@ Changes in TIFF v3.4beta035
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.4beta035<BR>
<B>Previous Version</B>: <A HREF=v3.4beta034.html>v3.4beta034</A><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<B>Master Download Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.4beta036.html b/tiff/html/v3.4beta036.html
index 7a2fa8b38..a853113d9 100644
--- a/tiff/html/v3.4beta036.html
+++ b/tiff/html/v3.4beta036.html
@@ -16,7 +16,7 @@ Changes in TIFF v3.4beta036
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.4beta036<BR>
<B>Previous Version</B>: <A HREF=v3.4beta035.html>v3.4beta035</A><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<B>Master Download Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.5.1.html b/tiff/html/v3.5.1.html
index 365700ce7..e3ee7077f 100644
--- a/tiff/html/v3.5.1.html
+++ b/tiff/html/v3.5.1.html
@@ -17,7 +17,7 @@ Changes in TIFF v3.5.1
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.5.1<BR>
<B>Previous Version</B>: v3.4beta037<BR>
-<B>Master FTP Site</B>: <A HREF="ftp://ftp.onshore.com/pub/libtiff">ftp.onshore.com, directory graphics/tiff</A><BR>
+<B>Master Download 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.simplesystems.org/libtiff//>http://www.simplesystems.org/libtiff/</a>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.5.2.html b/tiff/html/v3.5.2.html
index 48ad398e2..daad4c554 100644
--- a/tiff/html/v3.5.2.html
+++ b/tiff/html/v3.5.2.html
@@ -17,7 +17,7 @@ Changes in TIFF v3.5.2
<HR SIZE=4 WIDTH=65% ALIGN=left>
<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 Download 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.simplesystems.org/libtiff//">http://www.simplesystems.org/libtiff/</a>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.5.3.html b/tiff/html/v3.5.3.html
index 78f469839..9ea785621 100644
--- a/tiff/html/v3.5.3.html
+++ b/tiff/html/v3.5.3.html
@@ -17,7 +17,7 @@ Changes in TIFF v3.5.3
<HR SIZE=4 WIDTH=65% ALIGN=left>
<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 Download 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.simplesystems.org/libtiff//">http://www.simplesystems.org/libtiff/</a>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
@@ -49,7 +49,7 @@ From <A HREF=http://burnallgifs.org>Burn All GIF's Day</a>:
Unisys license to use LZW in free software that complies with the Open
Source Definition</em>
<P>
-Unfortunatly, the removal of LZW compression means that saved image size has
+Unfortunately, the removal of LZW compression means that saved image size has
grown dramatically. Without a change in the TIFF spec to support
another lossless compression format, this is unavoidable.
<P>
diff --git a/tiff/html/v3.5.4.html b/tiff/html/v3.5.4.html
index 1d988bf6d..7e3eb8418 100644
--- a/tiff/html/v3.5.4.html
+++ b/tiff/html/v3.5.4.html
@@ -17,7 +17,7 @@ Changes in TIFF v3.5.4
<HR SIZE=4 WIDTH=65% ALIGN=left>
<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 Download 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.simplesystems.org/libtiff//">http://www.simplesystems.org/libtiff/</a>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.5.5.html b/tiff/html/v3.5.5.html
index 0b67f5cda..779e3772c 100644
--- a/tiff/html/v3.5.5.html
+++ b/tiff/html/v3.5.5.html
@@ -17,7 +17,7 @@ Changes in TIFF v3.5.5
<HR SIZE=4 WIDTH=65% ALIGN=left>
<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 Download 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.simplesystems.org/libtiff//">http://www.simplesystems.org/libtiff/</a>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v3.5.6-beta.html b/tiff/html/v3.5.6-beta.html
index b552c371e..498cc4390 100644
--- a/tiff/html/v3.5.6-beta.html
+++ b/tiff/html/v3.5.6-beta.html
@@ -17,7 +17,7 @@ Changes in TIFF v3.5.6
<HR SIZE=4 WIDTH=65% ALIGN=left>
<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 Download 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.simplesystems.org/libtiff//">http://www.simplesystems.org/libtiff/</a>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
@@ -112,7 +112,7 @@ The following information is located here:
<LI> Modified tiffio.h logic with regard to including windows.h. It
won't include it when building with __CYGWIN__.
- <LI> README: update to mention www.libtiff.org, don't list Sam's old
+ <LI> README: update to mention {REDACTED - defunct web site}, don't list Sam's old
email address.
<LI> libtiff/tif_dirread.c: Don't use estimate strip byte count for
diff --git a/tiff/html/v3.5.7.html b/tiff/html/v3.5.7.html
index 96f479169..b68e29ee5 100644
--- a/tiff/html/v3.5.7.html
+++ b/tiff/html/v3.5.7.html
@@ -17,7 +17,7 @@ Changes in TIFF v3.5.7
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.5.7<BR>
<B>Previous Version</B>: <A HREF=v3.5.6-beta.html>v3.5.6 Beta</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master Download Site</B>: <A HREF="https://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>
@@ -200,7 +200,7 @@ that corrects behaviour for non-Letter paper
sizes. (Bug 35) It fixes two problems:
<br>
Without scaling (-S) the fax is now centered on the page size specified
- with -H and/or -W. Before, fax2ps was using an obscure and practially
+ with -H and/or -W. Before, fax2ps was using an obscure and practically
useless algorithm to allocate the image relative to Letter sized paper
which sometime sled to useless whitespace on the paper, while at the
same time cutting of the faxes printable area at the opposite border.
diff --git a/tiff/html/v3.6.0.html b/tiff/html/v3.6.0.html
index c53cd155b..11b10af02 100644
--- a/tiff/html/v3.6.0.html
+++ b/tiff/html/v3.6.0.html
@@ -17,7 +17,7 @@ Changes in TIFF v3.6.0
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.6.0<BR>
<B>Previous Version</B>: <A HREF=v3.5.7.html>v3.5.7</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
@@ -64,12 +64,12 @@ TIFFDirectory structure would changing, breaking any dynamically linked
software that used the private data structures.<p>
Also, any tag not recognised
-by libtiff would not be read and accessable to applications without some
+by libtiff would not be read and accessible to applications without some
fairly complicated work on the applications part to pre-register the tags
as exemplified by the support for "Geo"TIFF tags by libgeotiff layered on
libtiff. <p>
-Amoung other things this approach required the extension code
+Among other things this approach required the extension code
to access the private libtiff structures ... which made the higher level
non-libtiff code be locked into a specific version of libtiff at compile time.
This caused no end of bug reports!<p>
diff --git a/tiff/html/v3.6.1.html b/tiff/html/v3.6.1.html
index 3d6d838d5..3f0e93c35 100644
--- a/tiff/html/v3.6.1.html
+++ b/tiff/html/v3.6.1.html
@@ -17,7 +17,7 @@ Changes in TIFF v3.6.1
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.6.1<BR>
<B>Previous Version</B>: <A HREF=v3.6.0.html>v3.6.0</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
@@ -116,7 +116,7 @@ Patch supplied by Ross Finlayson.
it was done in 3.6.0).
<li> libtiff/{tiff.h, tif_dirinfo.c}: Added support for IFD (13) datatype,
-intruduced in "Adobe PageMaker TIFF Technical Notes".
+introduced in "Adobe PageMaker TIFF Technical Notes".
<li> libtiff/{tif_color.c, tif_getimage.c, tiffio.h}: New color space
conversion code: CIE L*a*b* 1976 images now supported by the TIFFRGBAImage
diff --git a/tiff/html/v3.7.0.html b/tiff/html/v3.7.0.html
index 777782faf..c70e8e72c 100644
--- a/tiff/html/v3.7.0.html
+++ b/tiff/html/v3.7.0.html
@@ -17,7 +17,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v3.7.0alpha.html b/tiff/html/v3.7.0alpha.html
index 5f1aed9c2..5ce60069c 100644
--- a/tiff/html/v3.7.0alpha.html
+++ b/tiff/html/v3.7.0alpha.html
@@ -17,7 +17,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v3.7.0beta.html b/tiff/html/v3.7.0beta.html
index 6ec852bc1..a29e521f5 100644
--- a/tiff/html/v3.7.0beta.html
+++ b/tiff/html/v3.7.0beta.html
@@ -17,7 +17,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v3.7.0beta2.html b/tiff/html/v3.7.0beta2.html
index 4c4301770..9a313aca1 100644
--- a/tiff/html/v3.7.0beta2.html
+++ b/tiff/html/v3.7.0beta2.html
@@ -17,7 +17,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v3.7.1.html b/tiff/html/v3.7.1.html
index 6794a8d5a..3e332b144 100644
--- a/tiff/html/v3.7.1.html
+++ b/tiff/html/v3.7.1.html
@@ -17,7 +17,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v3.7.2.html b/tiff/html/v3.7.2.html
index 45347b728..2be1edef4 100644
--- a/tiff/html/v3.7.2.html
+++ b/tiff/html/v3.7.2.html
@@ -17,7 +17,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
@@ -46,7 +46,7 @@ The following information is located here:
<UL>
- <li> Maintainance release. Many bugfixes in the build environment
+ <li> Maintenance release. Many bugfixes in the build environment
and compatibility improvements.
</UL>
diff --git a/tiff/html/v3.7.3.html b/tiff/html/v3.7.3.html
index 28981aef8..c3aafff49 100644
--- a/tiff/html/v3.7.3.html
+++ b/tiff/html/v3.7.3.html
@@ -17,7 +17,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
@@ -45,7 +45,7 @@ The following information is located here:
<A NAME="highlights"><B><FONT SIZE=+3>M</FONT>AJOR CHANGES:</B></A>
<UL>
- <li> Replace runtime endianess check with the compile time one.
+ <li> Replace runtime endianness check with the compile time one.
<li> Added support for the new predictor type (floating point
predictor), defined at the TIFF Technical Note 3.
diff --git a/tiff/html/v3.7.4.html b/tiff/html/v3.7.4.html
index 8b4e5dd8f..465af218d 100644
--- a/tiff/html/v3.7.4.html
+++ b/tiff/html/v3.7.4.html
@@ -17,7 +17,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v3.8.0.html b/tiff/html/v3.8.0.html
index 05a96c729..8ac23f38b 100644
--- a/tiff/html/v3.8.0.html
+++ b/tiff/html/v3.8.0.html
@@ -17,7 +17,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v3.8.1.html b/tiff/html/v3.8.1.html
index c4710f1d6..6b069e32b 100644
--- a/tiff/html/v3.8.1.html
+++ b/tiff/html/v3.8.1.html
@@ -17,7 +17,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v3.8.2.html b/tiff/html/v3.8.2.html
index 8d64ef736..10fa57d2a 100644
--- a/tiff/html/v3.8.2.html
+++ b/tiff/html/v3.8.2.html
@@ -17,7 +17,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v3.9.0beta.html b/tiff/html/v3.9.0beta.html
index 52def61b1..e973ca8b9 100644
--- a/tiff/html/v3.9.0beta.html
+++ b/tiff/html/v3.9.0beta.html
@@ -17,7 +17,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v3.9.1.html b/tiff/html/v3.9.1.html
index 0cffd21c7..fc6bca198 100644
--- a/tiff/html/v3.9.1.html
+++ b/tiff/html/v3.9.1.html
@@ -17,7 +17,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v3.9.2.html b/tiff/html/v3.9.2.html
index 83f2cc9f5..34a117a46 100644
--- a/tiff/html/v3.9.2.html
+++ b/tiff/html/v3.9.2.html
@@ -17,7 +17,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v4.0.0.html b/tiff/html/v4.0.0.html
index d869c17c4..f64208acd 100644
--- a/tiff/html/v4.0.0.html
+++ b/tiff/html/v4.0.0.html
@@ -17,10 +17,10 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
+<B>Master HTTP Site</B>: <A HREF="https://download.osgeo.org/libtiff">
+https://download.osgeo.org/libtiff</a>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>
diff --git a/tiff/html/v4.0.1.html b/tiff/html/v4.0.1.html
index d75cd2406..b4a8bc2fe 100644
--- a/tiff/html/v4.0.1.html
+++ b/tiff/html/v4.0.1.html
@@ -16,7 +16,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v4.0.10.html b/tiff/html/v4.0.10.html
new file mode 100644
index 000000000..b7d87361f
--- /dev/null
+++ b/tiff/html/v4.0.10.html
@@ -0,0 +1,326 @@
+<HTML>
+<HEAD>
+<TITLE>
+ Changes in TIFF v4.0.10
+</TITLE>
+<STYLE>
+table, th, td {
+ border: 1px solid black;
+ border-collapse: collapse;
+}
+th, td {
+ padding: 8pt;
+ text-align: center;
+}
+th {
+ text-align: center;
+}
+td {
+ text-align: center;
+}
+
+ul li {
+ padding: 3pt;
+}
+
+ul.a {
+ list-style-type: circle;
+}
+
+ul.b {
+ list-style-type: square;
+}
+
+ol.c {
+ list-style-type: upper-roman;
+}
+
+ol.d {
+ list-style-type: lower-alpha;
+}
+
+</STYLE>
+</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.10<BR>
+<B>Previous Version</B>: <A HREF=v4.0.9.html>v4.0.9</a><BR>
+<B>Master Download Site</B>: <A HREF="https://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 source repository is changed from CVS to Git and the master libtiff source repository is now at <A HREF="https://gitlab.com/libtiff/libtiff">Gitlab</A>. This is the first release to be made from the new Git repository.</LI>
+
+</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>Minimum CMake version is now v2.8.11 for the CMake-based build.</LI>
+
+ <LI>Libwebp will be automatically detected and used by configure/cmake if present.
+
+ <LI>Libzstd will be automatically detected and used by configure/cmake if present.
+
+
+</UL>
+
+<P><HR WIDTH=65% ALIGN=left>
+
+<!--------------------------------------------------------------------------->
+
+<A NAME="libtiff"><B><FONT SIZE=+3>C</FONT>HANGES IN LIBTIFF:</B></A>
+
+<UL>
+
+ <LI>
+ <P>Added ZSTD compression codec.
+ <A HREF="https://github.com/facebook/zstd">Zstandard<A> or zstd as
+ short version, is a fast lossless compression algorithm, targeting
+ real-time compression scenarios at zlib-level and better
+ compression ratios. It's backed by a very fast entropy stage,
+ provided by Huff0 and FSE library.</P>
+
+ <P>We require libzstd >= 1.0.0 so as to be able to use streaming
+ compression and decompression methods.</P>
+
+ <P>The default compression level we have selected is 9 (range goes
+ from 1 to 22), which experimentally offers equivalent or better
+ compression ratio than the default deflate/ZIP level of 6, and
+ much faster compression.</P>
+
+ <P>For example on a 6600x4400 16bit image, tiffcp -c zip runs in
+ 10.7 seconds, while tiffcp -c zstd runs in 5.3
+ seconds. Decompression time for zip is 840 ms, and for zstd 650
+ ms. File size is 42735936 for zip, and 42586822 for zstd. Similar
+ findings on other images.</P>
+
+ <P>On a 25894x16701 16bit image,</P>
+
+ <TABLE>
+ <TR><TH>Compressor</TH> <TH>Compression time</TH> <TH>Decompression time</TH> <TH>File size</TH></TR>
+
+ <TR><TD>ZSTD</TD> <TD>35 s</TD> <TD>3.2 s</TD> <TD>399 700 498</TD></TR>
+ <TR><TD>ZIP/Deflate</TD> <TD>1m 20 s</TD> <TD>4.9 s </TD> <TD>419 622 336</TD></TR>
+ </TABLE>
+
+ <P>Please note that COMPRESSION_ZSTD is self-assigned the id 50000
+ by the libtiff project and is not officially registered with Adobe
+ since Adobe's registration function is defunct.</P>
+ </LI>
+
+ <LI><P>Added WebP compression codec.
+
+ <A HREF="https://developers.google.com/speed/webp/">WebP</A> is
+ a high performance compressor intended for photos as commonly used
+ on the Web. The WebP encoder is not designed for huge images, but
+ serves very well for compressing strips and tiles in TIFF as long
+ as the strips or tiles do not exceed the capability of the
+ encoder.</P>
+
+ <P>As a test of compression performance metrics, GraphicsMagick
+ was used on an extremely high quality 8-bit TIFF image from a
+ Hasselblad H4D-200MS camera with pixel dimensions of
+ 16352x12264. The image was re-encoded with 1024x1024 tiles and
+ various compression algorithms, using default settings for each
+ algorithm. Based on this test, the compression and decompression
+ performance (in iterations per second), the resulting file size,
+ and the calculated total PSNR are provided here. It can be seen
+ that WebP provided excellent encode and decode performance, and
+ the compressed file size was very small:</P>
+
+ <TABLE>
+ <caption>Compressor Relative Performance</caption>
+ <TR><TH>Compressor</TH> <TH>Compression</TH> <TH>Decompression</TH> <TH>File size</TH> <TH>PSNR</TH></TR>
+
+
+ <TR><TD>None</TD> <TD>0.536 iter/s</TD> <TD>1.506 iter/s</TD> <TD>576.03MiB</TD> <TD>Inf</TD></TR>
+ <TR><TD>LZW</TD> <TD>0.105 iter/s</TD> <TD>0.266 iter/s</TD> <TD>270.68MiB</TD> <TD>Inf</TD></TR>
+ <TR><TD>ZStd</TD> <TD>0.020 iter/s</TD> <TD>0.518 iter/s</TD> <TD>238.42MiB</TD> <TD>Inf</TD></TR>
+ <TR><TD>LZMA</TD> <TD>0.009 iter/s</TD> <TD>0.056 iter/s</TD> <TD>247.61MiB</TD> <TD>Inf</TD></TR>
+ <TR><TD>ZIP</TD> <TD>0.009 iter/s</TD> <TD>0.301 iter/s</TD> <TD>247.88MiB</TD> <TD>Inf</TD></TR>
+ <TR><TD>JPEG</TD> <TD>0.446 iter/s</TD> <TD>0.760 iter/s</TD> <TD>18.59MiB</TD> <TD>39.00</TD></TR>
+ <TR><TD>WebP</TD> <TD>0.019 iter/s</TD> <TD>0.330 iter/s</TD> <TD>9.38MiB</TD> <TD>37.78</TD></TR>
+
+ </TABLE>
+
+ <P>Please note that COMPRESSION_WEBP is self-assigned the id 50001
+ by the libtiff project and is not officially registered with Adobe
+ since Adobe's registration function is defunct.</P>
+
+ </LI>
+
+ <LI>TIFFPrintDirectory(): fix null pointer dereference on corrupted
+ file. Fixes <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2770">Bug
+ 2770 - NULL Pointer Dereference in tiffinfo.c with crafted TIFF
+ image</A>.</LI>
+
+ <LI>_TIFFVGetField(): fix heap out-of-bounds access when requesting
+ TIFFTAG_NUMBEROFINKS on a EXIF
+ directory. Fixes <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2765">Bug
+ 2765 - Heap Out-Of-Bounds Memory Access - 68122422</A>. Reported by
+ Google Autofuzz project</LI>
+
+ <LI>Fix a memory leak in TIFFStreamOpen. TIFFStreamOpen allocates a
+ new tiff{o,i}s_data, but if TIFFClientOpen fails then that struct is
+ leaked.</LI>
+
+ <LI><P>Fix for bug 2772. It is possible to craft a TIFF document where
+ the IFD list is circular, leading to an infinite loop while
+ traversing the chain. The libtiff directory reader has a failsafe
+ that will break out of this loop after reading 65535 directory
+ entries, but it will continue processing, consuming time and
+ resources to process what is essentially a bogus TIFFdocument.</P>
+
+ <P>This change fixes the above behavior by breaking out of processing
+ when a TIFF document has >= 65535 directories and terminating with an
+ error.</P></LI>
+
+ <LI>ChopUpSingleUncompressedStrip: avoid memory exhaustion
+ (CVE-2017-11613). In ChopUpSingleUncompressedStrip(), if the
+ computed number of strips is big enough and we are in read only
+ mode, validate that the file size is consistent with that number of
+ strips to avoid useless attempts at allocating a lot of memory for
+ the td_stripbytecount and td_stripoffset
+ arrays. Fixes <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2724">Bug
+ 2724 - memory exhaustion in ChopUpSingleUncompressedStrip</A></LI>
+
+ <LI>Port code: Add strtol, strtoll and strtoull. Also update
+ strtoul. All use the same implementation from NetBSD libc.</LI>
+
+ <LI>Fix for CVE-2018-7456 "NULL pointer dereference in
+ TIFFPrintDirectory".</LI>
+
+ <LI>TIFFWriteDirectorySec: avoid
+ assertion. Fixes <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2795">Bug
+ 2795 - There is a reachable assertion abort in function
+ TIFFWriteDirectorySec() of libtiff 4.0.9. A crafted input will lead
+ to remote denial of attack. (CVE-2018-10963)</A>.</LI>
+
+ <LI>LZWDecodeCompat(): fix potential index-out-of-bounds
+ write. Fixes <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2780">Bug
+ 2780 - A heap-buffer-overflow in function LZWDecodeCompat in
+ libtiff4.0.9 (CVE-2018-8905)</A>. The fix consists in using the
+ similar code as LZWDecode() to validate we don't write outside of
+ the output buffer.</LI>
+
+ <LI><P>Remove builtin support for GUI warning and error message
+ boxes. Now warnings always go to the console by default unless
+ applications define their own warning and error handlers.</P>
+
+ <P>GUI applications (and Windows CE) are required to define such handlers.</P></LI>
+
+ <LI>Add tag and pseudo-tag definitions for ESRI LERC codec (out of
+ tree codec whose source is
+ at <A HREF="https://github.com/OSGeo/gdal/blob/master/gdal/frmts/gtiff/tif_lerc.c">
+ https://github.com/OSGeo/gdal/blob/master/gdal/frmts/gtiff/tif_lerc.c</A>).</LI>
+
+ <LI>Fix libtiff 4.0.8 regression when reading LZW-compressed strips with scanline API
+ Fixes <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2800">
+ Bug 2800 - Regression: Opening a tiff file with v4.0.9 gives an error with LZWDecode</A>.</LI>
+
+ <LI>TIFFSetupStrips(): avoid potential uint32 overflow on 32-bit
+ systems with large number of strips. Probably relates
+ to <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2788">Bug
+ 2788 - Heap Buffer Overflow in TIFFWriteScanline of tif_write.c
+ (CVE-2018-10779)</A></LI>
+
+ <LI>Fix out-of-bound read on some tiled images.</LI>
+
+ <LI>Avoid potential int32 overflows in multiply_ms().</LI>
+
+ <LI>Only read/write TIFFTAG_GROUP3OPTIONS or TIFFTAG_GROUP4OPTIONS
+ if compression is COMPRESSION_CCITTFAX3 or
+ COMPRESSION_CCITTFAX4.</LI>
+
+ <LI>JBIG: fix potential out-of-bounds write in JBIGDecode(). Also
+ fix a (harmless) potential use of uninitialized memory when
+ tif->tif_rawsize > tif->tif_rawcc. In case libtiff is compiled with
+ CHUNKY_STRIP_READ_SUPPORT, make sure that whole strip data is
+ provided to JBIGDecode().</LI>
+
+ <LI>LZMAPreEncode: emit verbose error if lzma_stream_encoder() fails
+ (typically because not enough memory available)</LI>
+
+
+</UL>
+
+<P><HR WIDTH=65% ALIGN=left>
+
+<!-------------------------------------------------------------------------->
+
+<A NAME="tools"><B><FONT SIZE=+3>C</FONT>HANGES IN THE TOOLS:</B></A>
+
+<UL>
+
+ <LI>tiff2pdf: Fix
+ CVE-2017-9935, <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2704">Bug
+ 2704 - There is a heap based buffer overflow in the tiff2pdf tool of
+ the libtiff library. A crafted TIFF document can lead to a heap
+ based buffer overflow resulting in multiple damages.</A>.</LI>
+
+ <LI>pal2rgb: Add workaround to pal2rgb buffer overflow.</LI>
+
+ <LI>tiffset: Add support for LONG8, SLONG8 and IFD8 field types</LI>
+
+ <LI>tiff2bw: avoid null pointer dereference in case of out of memory
+ situation. Fixes <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2819">Bug
+ 2819 - There is a NULL pointer dereference at function LZWDecode in
+ libtiff 4.0.9 (CVE-2018-18661)</A></LI>
+
+</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</LI>
+
+</UL>
+
+</BODY>
+</HTML>
diff --git a/tiff/html/v4.0.2.html b/tiff/html/v4.0.2.html
index 8dade5f3d..91f20dde3 100644
--- a/tiff/html/v4.0.2.html
+++ b/tiff/html/v4.0.2.html
@@ -16,7 +16,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v4.0.3.html b/tiff/html/v4.0.3.html
index 1e9e79251..14ccfb39b 100644
--- a/tiff/html/v4.0.3.html
+++ b/tiff/html/v4.0.3.html
@@ -16,7 +16,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v4.0.4.html b/tiff/html/v4.0.4.html
index 6ddf2a1e2..a5691140b 100644
--- a/tiff/html/v4.0.4.html
+++ b/tiff/html/v4.0.4.html
@@ -16,7 +16,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v4.0.4beta.html b/tiff/html/v4.0.4beta.html
index 28c543fd4..e06a2c224 100644
--- a/tiff/html/v4.0.4beta.html
+++ b/tiff/html/v4.0.4beta.html
@@ -16,7 +16,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v4.0.5.html b/tiff/html/v4.0.5.html
index ac91d72f6..c638638aa 100644
--- a/tiff/html/v4.0.5.html
+++ b/tiff/html/v4.0.5.html
@@ -16,7 +16,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v4.0.6.html b/tiff/html/v4.0.6.html
index 317491990..8fc63b5cd 100644
--- a/tiff/html/v4.0.6.html
+++ b/tiff/html/v4.0.6.html
@@ -16,7 +16,7 @@
<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://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v4.0.7.html b/tiff/html/v4.0.7.html
index e29e8d535..e1b5dec9f 100644
--- a/tiff/html/v4.0.7.html
+++ b/tiff/html/v4.0.7.html
@@ -16,7 +16,7 @@
<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">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v4.0.8.html b/tiff/html/v4.0.8.html
index 8b85e9c2e..86db3bbfd 100644
--- a/tiff/html/v4.0.8.html
+++ b/tiff/html/v4.0.8.html
@@ -16,7 +16,7 @@
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v4.0.8<BR>
<B>Previous Version</B>: <A HREF=v4.0.7.html>v4.0.7</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v4.0.9.html b/tiff/html/v4.0.9.html
index 9be5f274b..4efe987f8 100644
--- a/tiff/html/v4.0.9.html
+++ b/tiff/html/v4.0.9.html
@@ -16,7 +16,7 @@
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v4.0.9<BR>
<B>Previous Version</B>: <A HREF=v4.0.8.html>v4.0.8</a><BR>
-<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+<B>Master Download Site</B>: <A HREF="https://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>
diff --git a/tiff/html/v4.1.0.html b/tiff/html/v4.1.0.html
new file mode 100644
index 000000000..7c61fac73
--- /dev/null
+++ b/tiff/html/v4.1.0.html
@@ -0,0 +1,198 @@
+<HTML>
+<HEAD>
+<TITLE>
+ Changes in TIFF v4.1.0
+</TITLE>
+<STYLE>
+table, th, td {
+ border: 1px solid black;
+ border-collapse: collapse;
+}
+th, td {
+ padding: 8pt;
+ text-align: center;
+}
+th {
+ text-align: center;
+}
+td {
+ text-align: center;
+}
+
+ul li {
+ padding: 3pt;
+}
+
+ul.a {
+ list-style-type: circle;
+}
+
+ul.b {
+ list-style-type: square;
+}
+
+ol.c {
+ list-style-type: upper-roman;
+}
+
+ol.d {
+ list-style-type: lower-alpha;
+}
+
+</STYLE>
+</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.1.0<BR>
+<B>Previous Version</B>: <A HREF=v4.0.10.html>v4.0.10</a><BR>
+<B>Master Download Site</B>: <A HREF="https://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. A change summary is also provided by the
+ChangeLog file included in the release package and by the Git commit
+history:
+<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>Make defer strile offset/bytecount loading available at runtime
+ and add per-strile offset/bytecount loading capabilities. Part of
+ this commit makes the behaviour that was previously met when libtiff
+ was compiled with -DDEFER_STRILE_LOAD available for default builds
+ when specifying the new 'D' (Deferred) TIFFOpen() flag. In that
+ mode, the [Tile/Strip][ByteCounts/Offsets] arrays are only loaded
+ when first accessed. This can speed-up the opening of files stored
+ on the network when just metadata retrieval is needed.
+
+ Another addition is the capability of loading only the values of
+ the offset/bytecount of the strile of interest instead of the
+ whole array. This is enabled with the new 'O' (Ondemand) flag of
+ TIFFOpen() (which implies 'D').
+
+ The public TIFFGetStrileOffset[WithErr]() and
+ TIFFGetStrileByteCount[WithErr]() functions have been added to
+ API. They are of particular interest when using sparse files (with
+ offset == bytecount == 0) and you want to detect if a strile is
+ present or not without decompressing the data, or updating an
+ existing sparse file.
+ </LI>
+
+ <LI>The BigTIFF writer now optimizes file size by using 32-bit LONG
+ values (rather than 64-bit) where it is reasonable and safe to do
+ so. Likewise, the 16-bit SHORT type is used when possible for
+ StripByteCounts/TileByteCounts.
+ </LI>
+
+</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>The WIN32 build now uses tif_win32.c when building with CMake.</LI>
+
+ <LI>Properly set value of HOST_FILLORDER to LSB2MSB for Windows
+ CMake builds. It was not being properly set!</LI>
+
+</UL>
+
+<P><HR WIDTH=65% ALIGN=left>
+
+<!--------------------------------------------------------------------------->
+
+<A NAME="libtiff"><B><FONT SIZE=+3>C</FONT>HANGES IN LIBTIFF:</B></A>
+
+<UL>
+
+ <LI>
+ Changes in the libtiff library may be viewed on-line
+ at <A HREF="https://gitlab.com/libtiff/libtiff/commits/master/libtiff">Libtiff
+ Library Commits</A>.
+ </LI>
+
+ <LI>
+ New function TIFFReadFromUserBuffer() which replaces the use of
+ TIFFReadEncodedStrip()/TIFFReadEncodedTile() when the user can
+ provide the buffer for the input data, for example when he wants
+ to avoid libtiff to read the strile offset/count values from the
+ [Strip|Tile][Offsets/ByteCounts] array.
+ </LI>
+
+ <LI>
+ New functions TIFFDeferStrileArrayWriting() and TIFFForceStrileArrayWriting()
+ Those advanced writing functions must be used in a particular sequence
+ to make their intended effect. Their aim is to control when/where
+ the [Strip/Tile][Offsets/ByteCounts] arrays are written into the file.
+
+ The purpose of this is to generate 'cloud-optimized geotiff' files where
+ the first KB of the file only contain the IFD entries without the potentially
+ large strile arrays. Those are written afterwards.
+ </LI>
+
+</UL>
+
+<P><HR WIDTH=65% ALIGN=left>
+
+<!-------------------------------------------------------------------------->
+
+<A NAME="tools"><B><FONT SIZE=+3>C</FONT>HANGES IN THE TOOLS:</B></A>
+
+<UL>
+
+ <LI>Changes in the libtiff utilities may be viewed on-line
+ at <A HREF="https://gitlab.com/libtiff/libtiff/commits/master/tools">Libtiff
+ Tools Commits</A></LI>
+
+</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>Changes in the libtiff contrib area may be viewed on-line
+ at <A HREF="https://gitlab.com/libtiff/libtiff/commits/master/contrib">Libtiff
+ Contrib Commits</A></LI>
+
+</UL>
+
+</BODY>
+</HTML>
diff --git a/tiff/libtiff/CMakeLists.txt b/tiff/libtiff/CMakeLists.txt
index 087dfa9ea..080685db3 100644
--- a/tiff/libtiff/CMakeLists.txt
+++ b/tiff/libtiff/CMakeLists.txt
@@ -93,8 +93,10 @@ set(tiff_SOURCES
tif_tile.c
tif_version.c
tif_warning.c
+ tif_webp.c
tif_write.c
- tif_zip.c)
+ tif_zip.c
+ tif_zstd.c)
set(tiffxx_HEADERS
tiffio.hxx)
@@ -102,7 +104,7 @@ set(tiffxx_HEADERS
set(tiffxx_SOURCES
tif_stream.cxx)
-if(WIN32_IO)
+if(USE_WIN32_FILEIO)
extra_dist(tif_unix.c)
list(APPEND tiff_SOURCES tif_win32.c)
else()
@@ -110,12 +112,14 @@ else()
list(APPEND tiff_SOURCES tif_unix.c)
endif()
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${TIFF_INCLUDES})
-
add_library(tiff ${tiff_SOURCES} ${tiff_HEADERS} ${nodist_tiff_HEADERS}
${tiff_port_SOURCES} libtiff.def)
+target_include_directories(tiff
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
+ ${TIFF_INCLUDES}
+)
target_link_libraries(tiff ${TIFF_LIBRARY_DEPS})
set_target_properties(tiff PROPERTIES SOVERSION ${SO_COMPATVERSION})
if(NOT CYGWIN)
@@ -138,7 +142,7 @@ install(TARGETS tiff
install(FILES ${tiff_HEADERS} ${nodist_tiff_HEADERS}
DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
-if(cxx)
+if(CXX_SUPPORT)
add_library(tiffxx ${tiffxx_SOURCES} ${tiffxx_HEADERS})
target_link_libraries(tiffxx tiff)
set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION})
diff --git a/tiff/libtiff/Makefile.am b/tiff/libtiff/Makefile.am
index 9cbc5b1d1..14a250a5a 100644
--- a/tiff/libtiff/Makefile.am
+++ b/tiff/libtiff/Makefile.am
@@ -98,8 +98,10 @@ libtiff_la_SOURCES = \
tif_tile.c \
tif_version.c \
tif_warning.c \
+ tif_webp.c \
tif_write.c \
- tif_zip.c
+ tif_zip.c \
+ tif_zstd.c
libtiffxx_la_SOURCES = \
tif_stream.cxx
diff --git a/tiff/libtiff/Makefile.in b/tiff/libtiff/Makefile.in
index 62fb7bc87..a593fc22d 100644
--- a/tiff/libtiff/Makefile.in
+++ b/tiff/libtiff/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -136,10 +136,11 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__libtiffinclude_HEADERS_DIST) \
$(noinst_HEADERS) $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = tif_config.h tiffconf.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -180,8 +181,8 @@ am__libtiff_la_SOURCES_DIST = tif_aux.c tif_close.c tif_codec.c \
tif_lzma.c tif_lzw.c tif_next.c tif_ojpeg.c tif_open.c \
tif_packbits.c tif_pixarlog.c tif_predict.c tif_print.c \
tif_read.c tif_strip.c tif_swab.c tif_thunder.c tif_tile.c \
- tif_version.c tif_warning.c tif_write.c tif_zip.c tif_win32.c \
- tif_unix.c
+ tif_version.c tif_warning.c tif_webp.c tif_write.c tif_zip.c \
+ tif_zstd.c tif_win32.c tif_unix.c
@WIN32_IO_TRUE@am__objects_1 = tif_win32.lo
@WIN32_IO_FALSE@am__objects_2 = tif_unix.lo
am_libtiff_la_OBJECTS = tif_aux.lo tif_close.lo tif_codec.lo \
@@ -193,7 +194,8 @@ am_libtiff_la_OBJECTS = tif_aux.lo tif_close.lo tif_codec.lo \
tif_open.lo tif_packbits.lo tif_pixarlog.lo tif_predict.lo \
tif_print.lo tif_read.lo tif_strip.lo tif_swab.lo \
tif_thunder.lo tif_tile.lo tif_version.lo tif_warning.lo \
- tif_write.lo tif_zip.lo $(am__objects_1) $(am__objects_2)
+ tif_webp.lo tif_write.lo tif_zip.lo tif_zstd.lo \
+ $(am__objects_1) $(am__objects_2)
libtiff_la_OBJECTS = $(am_libtiff_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -208,7 +210,6 @@ libtiffxx_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(libtiffxx_la_LDFLAGS) $(LDFLAGS) -o $@
@HAVE_CXX_TRUE@am_libtiffxx_la_rpath = -rpath $(libdir)
-PROGRAMS = $(noinst_PROGRAMS)
am_mkg3states_OBJECTS = mkg3states.$(OBJEXT)
mkg3states_OBJECTS = $(am_mkg3states_OBJECTS)
mkg3states_DEPENDENCIES = $(LIBPORT)
@@ -226,7 +227,30 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/mkg3states.Po \
+ ./$(DEPDIR)/tif_aux.Plo ./$(DEPDIR)/tif_close.Plo \
+ ./$(DEPDIR)/tif_codec.Plo ./$(DEPDIR)/tif_color.Plo \
+ ./$(DEPDIR)/tif_compress.Plo ./$(DEPDIR)/tif_dir.Plo \
+ ./$(DEPDIR)/tif_dirinfo.Plo ./$(DEPDIR)/tif_dirread.Plo \
+ ./$(DEPDIR)/tif_dirwrite.Plo ./$(DEPDIR)/tif_dumpmode.Plo \
+ ./$(DEPDIR)/tif_error.Plo ./$(DEPDIR)/tif_extension.Plo \
+ ./$(DEPDIR)/tif_fax3.Plo ./$(DEPDIR)/tif_fax3sm.Plo \
+ ./$(DEPDIR)/tif_flush.Plo ./$(DEPDIR)/tif_getimage.Plo \
+ ./$(DEPDIR)/tif_jbig.Plo ./$(DEPDIR)/tif_jpeg.Plo \
+ ./$(DEPDIR)/tif_jpeg_12.Plo ./$(DEPDIR)/tif_luv.Plo \
+ ./$(DEPDIR)/tif_lzma.Plo ./$(DEPDIR)/tif_lzw.Plo \
+ ./$(DEPDIR)/tif_next.Plo ./$(DEPDIR)/tif_ojpeg.Plo \
+ ./$(DEPDIR)/tif_open.Plo ./$(DEPDIR)/tif_packbits.Plo \
+ ./$(DEPDIR)/tif_pixarlog.Plo ./$(DEPDIR)/tif_predict.Plo \
+ ./$(DEPDIR)/tif_print.Plo ./$(DEPDIR)/tif_read.Plo \
+ ./$(DEPDIR)/tif_stream.Plo ./$(DEPDIR)/tif_strip.Plo \
+ ./$(DEPDIR)/tif_swab.Plo ./$(DEPDIR)/tif_thunder.Plo \
+ ./$(DEPDIR)/tif_tile.Plo ./$(DEPDIR)/tif_unix.Plo \
+ ./$(DEPDIR)/tif_version.Plo ./$(DEPDIR)/tif_warning.Plo \
+ ./$(DEPDIR)/tif_webp.Plo ./$(DEPDIR)/tif_win32.Plo \
+ ./$(DEPDIR)/tif_write.Plo ./$(DEPDIR)/tif_zip.Plo \
+ ./$(DEPDIR)/tif_zstd.Plo
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -298,8 +322,7 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/tif_config.h.in \
- $(srcdir)/tiffconf.h.in $(top_srcdir)/config/depcomp \
- $(top_srcdir)/config/mkinstalldirs
+ $(srcdir)/tiffconf.h.in $(top_srcdir)/config/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -476,8 +499,8 @@ libtiff_la_SOURCES = tif_aux.c tif_close.c tif_codec.c tif_color.c \
tif_next.c tif_ojpeg.c tif_open.c tif_packbits.c \
tif_pixarlog.c tif_predict.c tif_print.c tif_read.c \
tif_strip.c tif_swab.c tif_thunder.c tif_tile.c tif_version.c \
- tif_warning.c tif_write.c tif_zip.c $(am__append_3) \
- $(am__append_5)
+ tif_warning.c tif_webp.c tif_write.c tif_zip.c tif_zstd.c \
+ $(am__append_3) $(am__append_5)
libtiffxx_la_SOURCES = \
tif_stream.cxx
@@ -513,8 +536,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -549,6 +572,15 @@ stamp-h2: $(srcdir)/tiffconf.h.in $(top_builddir)/config.status
distclean-hdr:
-rm -f tif_config.h stamp-h1 tiffconf.h stamp-h2
+clean-noinstPROGRAMS:
+ @list='$(noinst_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
+
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
@@ -590,15 +622,6 @@ libtiff.la: $(libtiff_la_OBJECTS) $(libtiff_la_DEPENDENCIES) $(EXTRA_libtiff_la_
libtiffxx.la: $(libtiffxx_la_OBJECTS) $(libtiffxx_la_DEPENDENCIES) $(EXTRA_libtiffxx_la_DEPENDENCIES)
$(AM_V_CXXLD)$(libtiffxx_la_LINK) $(am_libtiffxx_la_rpath) $(libtiffxx_la_OBJECTS) $(libtiffxx_la_LIBADD) $(LIBS)
-clean-noinstPROGRAMS:
- @list='$(noinst_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
-
mkg3states$(EXEEXT): $(mkg3states_OBJECTS) $(mkg3states_DEPENDENCIES) $(EXTRA_mkg3states_DEPENDENCIES)
@rm -f mkg3states$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(mkg3states_OBJECTS) $(mkg3states_LDADD) $(LIBS)
@@ -609,48 +632,56 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkg3states.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_aux.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_close.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_codec.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_color.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_compress.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dir.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirinfo.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirread.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirwrite.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dumpmode.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_error.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_extension.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_fax3.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_fax3sm.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_flush.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_getimage.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jbig.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jpeg.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jpeg_12.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_luv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_lzma.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_lzw.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_next.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_ojpeg.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_open.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_packbits.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_pixarlog.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_predict.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_print.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_read.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_stream.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_strip.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_swab.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_thunder.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_tile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_version.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_warning.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_win32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_write.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_zip.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkg3states.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_aux.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_close.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_codec.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_color.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_compress.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dir.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirinfo.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirread.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirwrite.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dumpmode.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_error.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_extension.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_fax3.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_fax3sm.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_flush.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_getimage.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jbig.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jpeg.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jpeg_12.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_luv.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_lzma.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_lzw.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_next.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_ojpeg.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_open.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_packbits.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_pixarlog.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_predict.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_print.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_read.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_stream.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_strip.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_swab.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_thunder.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_tile.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_unix.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_version.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_warning.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_webp.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_win32.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_write.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_zip.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_zstd.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -794,7 +825,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -826,7 +860,7 @@ distdir: $(DISTFILES)
done
check-am: all-am
check: check-am
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) tif_config.h \
+all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(HEADERS) tif_config.h \
tiffconf.h
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libtiffincludedir)" "$(DESTDIR)$(libtiffincludedir)"; do \
@@ -868,7 +902,50 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/mkg3states.Po
+ -rm -f ./$(DEPDIR)/tif_aux.Plo
+ -rm -f ./$(DEPDIR)/tif_close.Plo
+ -rm -f ./$(DEPDIR)/tif_codec.Plo
+ -rm -f ./$(DEPDIR)/tif_color.Plo
+ -rm -f ./$(DEPDIR)/tif_compress.Plo
+ -rm -f ./$(DEPDIR)/tif_dir.Plo
+ -rm -f ./$(DEPDIR)/tif_dirinfo.Plo
+ -rm -f ./$(DEPDIR)/tif_dirread.Plo
+ -rm -f ./$(DEPDIR)/tif_dirwrite.Plo
+ -rm -f ./$(DEPDIR)/tif_dumpmode.Plo
+ -rm -f ./$(DEPDIR)/tif_error.Plo
+ -rm -f ./$(DEPDIR)/tif_extension.Plo
+ -rm -f ./$(DEPDIR)/tif_fax3.Plo
+ -rm -f ./$(DEPDIR)/tif_fax3sm.Plo
+ -rm -f ./$(DEPDIR)/tif_flush.Plo
+ -rm -f ./$(DEPDIR)/tif_getimage.Plo
+ -rm -f ./$(DEPDIR)/tif_jbig.Plo
+ -rm -f ./$(DEPDIR)/tif_jpeg.Plo
+ -rm -f ./$(DEPDIR)/tif_jpeg_12.Plo
+ -rm -f ./$(DEPDIR)/tif_luv.Plo
+ -rm -f ./$(DEPDIR)/tif_lzma.Plo
+ -rm -f ./$(DEPDIR)/tif_lzw.Plo
+ -rm -f ./$(DEPDIR)/tif_next.Plo
+ -rm -f ./$(DEPDIR)/tif_ojpeg.Plo
+ -rm -f ./$(DEPDIR)/tif_open.Plo
+ -rm -f ./$(DEPDIR)/tif_packbits.Plo
+ -rm -f ./$(DEPDIR)/tif_pixarlog.Plo
+ -rm -f ./$(DEPDIR)/tif_predict.Plo
+ -rm -f ./$(DEPDIR)/tif_print.Plo
+ -rm -f ./$(DEPDIR)/tif_read.Plo
+ -rm -f ./$(DEPDIR)/tif_stream.Plo
+ -rm -f ./$(DEPDIR)/tif_strip.Plo
+ -rm -f ./$(DEPDIR)/tif_swab.Plo
+ -rm -f ./$(DEPDIR)/tif_thunder.Plo
+ -rm -f ./$(DEPDIR)/tif_tile.Plo
+ -rm -f ./$(DEPDIR)/tif_unix.Plo
+ -rm -f ./$(DEPDIR)/tif_version.Plo
+ -rm -f ./$(DEPDIR)/tif_warning.Plo
+ -rm -f ./$(DEPDIR)/tif_webp.Plo
+ -rm -f ./$(DEPDIR)/tif_win32.Plo
+ -rm -f ./$(DEPDIR)/tif_write.Plo
+ -rm -f ./$(DEPDIR)/tif_zip.Plo
+ -rm -f ./$(DEPDIR)/tif_zstd.Plo
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-tags
@@ -915,7 +992,50 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/mkg3states.Po
+ -rm -f ./$(DEPDIR)/tif_aux.Plo
+ -rm -f ./$(DEPDIR)/tif_close.Plo
+ -rm -f ./$(DEPDIR)/tif_codec.Plo
+ -rm -f ./$(DEPDIR)/tif_color.Plo
+ -rm -f ./$(DEPDIR)/tif_compress.Plo
+ -rm -f ./$(DEPDIR)/tif_dir.Plo
+ -rm -f ./$(DEPDIR)/tif_dirinfo.Plo
+ -rm -f ./$(DEPDIR)/tif_dirread.Plo
+ -rm -f ./$(DEPDIR)/tif_dirwrite.Plo
+ -rm -f ./$(DEPDIR)/tif_dumpmode.Plo
+ -rm -f ./$(DEPDIR)/tif_error.Plo
+ -rm -f ./$(DEPDIR)/tif_extension.Plo
+ -rm -f ./$(DEPDIR)/tif_fax3.Plo
+ -rm -f ./$(DEPDIR)/tif_fax3sm.Plo
+ -rm -f ./$(DEPDIR)/tif_flush.Plo
+ -rm -f ./$(DEPDIR)/tif_getimage.Plo
+ -rm -f ./$(DEPDIR)/tif_jbig.Plo
+ -rm -f ./$(DEPDIR)/tif_jpeg.Plo
+ -rm -f ./$(DEPDIR)/tif_jpeg_12.Plo
+ -rm -f ./$(DEPDIR)/tif_luv.Plo
+ -rm -f ./$(DEPDIR)/tif_lzma.Plo
+ -rm -f ./$(DEPDIR)/tif_lzw.Plo
+ -rm -f ./$(DEPDIR)/tif_next.Plo
+ -rm -f ./$(DEPDIR)/tif_ojpeg.Plo
+ -rm -f ./$(DEPDIR)/tif_open.Plo
+ -rm -f ./$(DEPDIR)/tif_packbits.Plo
+ -rm -f ./$(DEPDIR)/tif_pixarlog.Plo
+ -rm -f ./$(DEPDIR)/tif_predict.Plo
+ -rm -f ./$(DEPDIR)/tif_print.Plo
+ -rm -f ./$(DEPDIR)/tif_read.Plo
+ -rm -f ./$(DEPDIR)/tif_stream.Plo
+ -rm -f ./$(DEPDIR)/tif_strip.Plo
+ -rm -f ./$(DEPDIR)/tif_swab.Plo
+ -rm -f ./$(DEPDIR)/tif_thunder.Plo
+ -rm -f ./$(DEPDIR)/tif_tile.Plo
+ -rm -f ./$(DEPDIR)/tif_unix.Plo
+ -rm -f ./$(DEPDIR)/tif_version.Plo
+ -rm -f ./$(DEPDIR)/tif_warning.Plo
+ -rm -f ./$(DEPDIR)/tif_webp.Plo
+ -rm -f ./$(DEPDIR)/tif_win32.Plo
+ -rm -f ./$(DEPDIR)/tif_write.Plo
+ -rm -f ./$(DEPDIR)/tif_zip.Plo
+ -rm -f ./$(DEPDIR)/tif_zstd.Plo
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -937,16 +1057,17 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-libtiffincludeHEADERS \
.MAKE: all install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \
- cscopelist-am ctags ctags-am distclean distclean-compile \
- distclean-generic distclean-hdr distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am 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-libLTLIBRARIES install-libtiffincludeHEADERS \
- install-man install-nodist_libtiffincludeHEADERS install-pdf \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-generic clean-libLTLIBRARIES clean-libtool \
+ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am 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-libLTLIBRARIES \
+ install-libtiffincludeHEADERS install-man \
+ install-nodist_libtiffincludeHEADERS install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
diff --git a/tiff/libtiff/Makefile.vc b/tiff/libtiff/Makefile.vc
index b73091546..5aac3310e 100644
--- a/tiff/libtiff/Makefile.vc
+++ b/tiff/libtiff/Makefile.vc
@@ -1,5 +1,3 @@
-# $Id: Makefile.vc,v 1.23 2015-08-19 02:31:04 bfriesen Exp $
-#
# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
#
# Permission to use, copy, modify, distribute, and sell this software and
diff --git a/tiff/libtiff/SConstruct b/tiff/libtiff/SConstruct
index cb6a7cc95..af3daace0 100644
--- a/tiff/libtiff/SConstruct
+++ b/tiff/libtiff/SConstruct
@@ -1,5 +1,3 @@
-# $Id: SConstruct,v 1.4 2007/02/24 15:03:50 dron Exp $
-
# Tag Image File Format (TIFF) Software
#
# Copyright (C) 2005, Andrey Kiselev <dron@ak4719.spb.edu>
diff --git a/tiff/libtiff/libtiff.def b/tiff/libtiff/libtiff.def
index 341c719dd..e34fac58a 100644
--- a/tiff/libtiff/libtiff.def
+++ b/tiff/libtiff/libtiff.def
@@ -20,6 +20,7 @@ EXPORTS TIFFAccessTagMethods
TIFFDataWidth
TIFFDefaultStripSize
TIFFDefaultTileSize
+ TIFFDeferStrileArrayWriting
TIFFError
TIFFErrorExt
TIFFFdOpen
@@ -37,6 +38,7 @@ EXPORTS TIFFAccessTagMethods
TIFFFindField
TIFFFlush
TIFFFlushData
+ TIFFForceStrileArrayWriting
TIFFFreeDirectory
TIFFGetBitRevTable
TIFFGetClientInfo
@@ -49,6 +51,10 @@ EXPORTS TIFFAccessTagMethods
TIFFGetReadProc
TIFFGetSeekProc
TIFFGetSizeProc
+ TIFFGetStrileByteCount
+ TIFFGetStrileByteCountWithErr
+ TIFFGetStrileOffset
+ TIFFGetStrileOffsetWithErr
TIFFGetTagListCount
TIFFGetTagListEntry
TIFFGetUnmapFileProc
@@ -82,6 +88,7 @@ EXPORTS TIFFAccessTagMethods
TIFFReadEXIFDirectory
TIFFReadEncodedStrip
TIFFReadEncodedTile
+ TIFFReadFromUserBuffer
TIFFReadRGBAImage
TIFFReadRGBAImageOriented
TIFFReadRGBAStrip
diff --git a/tiff/libtiff/mkg3states.c b/tiff/libtiff/mkg3states.c
index 16ad3c237..2cb9174c6 100644
--- a/tiff/libtiff/mkg3states.c
+++ b/tiff/libtiff/mkg3states.c
@@ -1,5 +1,3 @@
-/* "$Id: mkg3states.c,v 1.12 2015-06-21 01:09:09 bfriesen Exp $ */
-
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -42,7 +40,7 @@
#include "tif_fax3.h"
#ifndef HAVE_GETOPT
-extern int getopt(int, char**, char*);
+extern int getopt(int argc, char * const argv[], const char *optstring);
#endif
#define streq(a,b) (strcmp(a,b) == 0)
diff --git a/tiff/libtiff/t4.h b/tiff/libtiff/t4.h
index b908f54f0..fb0951a16 100644
--- a/tiff/libtiff/t4.h
+++ b/tiff/libtiff/t4.h
@@ -1,5 +1,3 @@
-/* $Id: t4.h,v 1.3 2010-03-10 18:56:48 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_aux.c b/tiff/libtiff/tif_aux.c
index 10b8d00c2..8188db533 100644
--- a/tiff/libtiff/tif_aux.c
+++ b/tiff/libtiff/tif_aux.c
@@ -1,5 +1,3 @@
-/* $Id: tif_aux.c,v 1.31 2017-11-17 20:21:00 erouault Exp $ */
-
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -32,31 +30,66 @@
#include "tiffiop.h"
#include "tif_predict.h"
#include <math.h>
+#include <float.h>
uint32
_TIFFMultiply32(TIFF* tif, uint32 first, uint32 second, const char* where)
{
- uint32 bytes = first * second;
-
- if (second && bytes / second != first) {
+ if (second && first > TIFF_UINT32_MAX / second) {
TIFFErrorExt(tif->tif_clientdata, where, "Integer overflow in %s", where);
- bytes = 0;
+ return 0;
}
- return bytes;
+ return first * second;
}
uint64
_TIFFMultiply64(TIFF* tif, uint64 first, uint64 second, const char* where)
{
- uint64 bytes = first * second;
-
- if (second && bytes / second != first) {
+ if (second && first > TIFF_UINT64_MAX / second) {
TIFFErrorExt(tif->tif_clientdata, where, "Integer overflow in %s", where);
- bytes = 0;
+ return 0;
}
- return bytes;
+ return first * second;
+}
+
+tmsize_t
+_TIFFMultiplySSize(TIFF* tif, tmsize_t first, tmsize_t second, const char* where)
+{
+ if( first <= 0 || second <= 0 )
+ {
+ if( tif != NULL && where != NULL )
+ {
+ TIFFErrorExt(tif->tif_clientdata, where,
+ "Invalid argument to _TIFFMultiplySSize() in %s", where);
+ }
+ return 0;
+ }
+
+ if( first > TIFF_TMSIZE_T_MAX / second )
+ {
+ if( tif != NULL && where != NULL )
+ {
+ TIFFErrorExt(tif->tif_clientdata, where,
+ "Integer overflow in %s", where);
+ }
+ return 0;
+ }
+ return first * second;
+}
+
+tmsize_t _TIFFCastUInt64ToSSize(TIFF* tif, uint64 val, const char* module)
+{
+ if( val > (uint64)TIFF_TMSIZE_T_MAX )
+ {
+ if( tif != NULL && module != NULL )
+ {
+ TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
+ }
+ return 0;
+ }
+ return (tmsize_t)val;
}
void*
@@ -64,13 +97,14 @@ _TIFFCheckRealloc(TIFF* tif, void* buffer,
tmsize_t nmemb, tmsize_t elem_size, const char* what)
{
void* cp = NULL;
- tmsize_t bytes = nmemb * elem_size;
-
+ tmsize_t count = _TIFFMultiplySSize(tif, nmemb, elem_size, NULL);
/*
- * XXX: Check for integer overflow.
+ * Check for integer overflow.
*/
- if (nmemb && elem_size && bytes / elem_size == nmemb)
- cp = _TIFFrealloc(buffer, bytes);
+ if (count != 0)
+ {
+ cp = _TIFFrealloc(buffer, count);
+ }
if (cp == NULL) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
@@ -359,6 +393,15 @@ _TIFFUInt64ToDouble(uint64 ui64)
}
}
+float _TIFFClampDoubleToFloat( double val )
+{
+ if( val > FLT_MAX )
+ return FLT_MAX;
+ if( val < -FLT_MAX )
+ return -FLT_MAX;
+ return (float)val;
+}
+
int _TIFFSeekOK(TIFF* tif, toff_t off)
{
/* Huge offsets, especially -1 / UINT64_MAX, can cause issues */
diff --git a/tiff/libtiff/tif_close.c b/tiff/libtiff/tif_close.c
index a0cb66131..e4228df9c 100644
--- a/tiff/libtiff/tif_close.c
+++ b/tiff/libtiff/tif_close.c
@@ -1,5 +1,3 @@
-/* $Id: tif_close.c,v 1.21 2016-01-23 21:20:34 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_codec.c b/tiff/libtiff/tif_codec.c
index 7cb46f630..b6c04f01d 100644
--- a/tiff/libtiff/tif_codec.c
+++ b/tiff/libtiff/tif_codec.c
@@ -1,5 +1,3 @@
-/* $Id: tif_codec.c,v 1.17 2015-08-19 02:31:04 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -72,6 +70,12 @@ static int NotConfigured(TIFF*, int);
#ifndef LZMA_SUPPORT
#define TIFFInitLZMA NotConfigured
#endif
+#ifndef ZSTD_SUPPORT
+#define TIFFInitZSTD NotConfigured
+#endif
+#ifndef WEBP_SUPPORT
+#define TIFFInitWebP NotConfigured
+#endif
/*
* Compression schemes statically built into the library.
@@ -99,6 +103,8 @@ TIFFCodec _TIFFBuiltinCODECS[] = {
{ "SGILog", COMPRESSION_SGILOG, TIFFInitSGILog },
{ "SGILog24", COMPRESSION_SGILOG24, TIFFInitSGILog },
{ "LZMA", COMPRESSION_LZMA, TIFFInitLZMA },
+ { "ZSTD", COMPRESSION_ZSTD, TIFFInitZSTD },
+ { "WEBP", COMPRESSION_WEBP, TIFFInitWebP },
{ NULL, 0, NULL }
};
diff --git a/tiff/libtiff/tif_color.c b/tiff/libtiff/tif_color.c
index 71cafcde6..8fae40ea4 100644
--- a/tiff/libtiff/tif_color.c
+++ b/tiff/libtiff/tif_color.c
@@ -1,5 +1,3 @@
-/* $Id: tif_color.c,v 1.24 2017-05-29 10:12:54 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -168,7 +166,7 @@ TIFFCIELabToRGBInit(TIFFCIELabToRGB* cielab,
}
/*
- * Convert color value from the YCbCr space to CIE XYZ.
+ * Convert color value from the YCbCr space to RGB.
* The colorspace conversion algorithm comes from the IJG v5a code;
* see below for more information on how it works.
*/
diff --git a/tiff/libtiff/tif_compress.c b/tiff/libtiff/tif_compress.c
index b571d1954..8130ef08e 100644
--- a/tiff/libtiff/tif_compress.c
+++ b/tiff/libtiff/tif_compress.c
@@ -1,5 +1,3 @@
-/* $Id: tif_compress.c,v 1.25 2016-10-25 20:04:22 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_config.h.cmake.in b/tiff/libtiff/tif_config.h.cmake.in
index de0f3a3c2..241446033 100644
--- a/tiff/libtiff/tif_config.h.cmake.in
+++ b/tiff/libtiff/tif_config.h.cmake.in
@@ -26,9 +26,6 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H 1
-/* Define to 1 if you have the `floor' function. */
-#cmakedefine HAVE_FLOOR 1
-
/* Define to 1 if you have the `getopt' function. */
#cmakedefine HAVE_GETOPT 1
@@ -50,30 +47,12 @@
/* Define to 1 if you have the <io.h> header file. */
#cmakedefine HAVE_IO_H 1
-/* Define to 1 if you have the `isascii' function. */
-#cmakedefine HAVE_ISASCII 1
-
/* Define to 1 if you have the `jbg_newlen' function. */
#cmakedefine HAVE_JBG_NEWLEN 1
/* Define to 1 if you have the `lfind' function. */
#cmakedefine HAVE_LFIND 1
-/* Define to 1 if you have the <limits.h> header file. */
-#cmakedefine HAVE_LIMITS_H 1
-
-/* Define to 1 if you have the <malloc.h> header file. */
-#cmakedefine HAVE_MALLOC_H 1
-
-/* Define to 1 if you have the `memmove' function. */
-#cmakedefine HAVE_MEMMOVE 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#cmakedefine HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the `memset' function. */
-#cmakedefine HAVE_MEMSET 1
-
/* Define to 1 if you have the `mmap' function. */
#cmakedefine HAVE_MMAP 1
@@ -83,9 +62,6 @@
/* Define to 1 if you have the <OpenGL/gl.h> header file. */
#cmakedefine HAVE_OPENGL_GL_H 1
-/* Define to 1 if you have the `pow' function. */
-#cmakedefine HAVE_POW 1
-
/* Define to 1 if you have the <search.h> header file. */
#cmakedefine HAVE_SEARCH_H 1
@@ -95,33 +71,24 @@
/* Define to 1 if you have the `snprintf' function. */
#cmakedefine HAVE_SNPRINTF 1
-/* Define to 1 if you have the `sqrt' function. */
-#cmakedefine HAVE_SQRT 1
-
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H 1
/* Define to 1 if you have the `strcasecmp' function. */
#cmakedefine HAVE_STRCASECMP 1
-/* Define to 1 if you have the `strchr' function. */
-#cmakedefine HAVE_STRCHR 1
-
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H 1
-/* Define to 1 if you have the `strrchr' function. */
-#cmakedefine HAVE_STRRCHR 1
-
-/* Define to 1 if you have the `strstr' function. */
-#cmakedefine HAVE_STRSTR 1
-
/* Define to 1 if you have the `strtol' function. */
#cmakedefine HAVE_STRTOL 1
+/* Define to 1 if you have the `strtoll' function. */
+#cmakedefine HAVE_STRTOLL 1
+
/* Define to 1 if you have the `strtoul' function. */
#cmakedefine HAVE_STRTOUL 1
@@ -146,6 +113,12 @@
/* Support LZMA2 compression */
#cmakedefine LZMA_SUPPORT 1
+/* Support ZSTD compression */
+#cmakedefine ZSTD_SUPPORT 1
+
+/* Support WEBP compression */
+#cmakedefine WEBP_SUPPORT 1
+
/* Name of package */
#define PACKAGE "@PACKAGE_NAME@"
@@ -176,9 +149,6 @@
/* The size of `signed long long', as computed by sizeof. */
#define SIZEOF_SIGNED_LONG_LONG @SIZEOF_SIGNED_LONG_LONG@
-/* The size of `signed short', as computed by sizeof. */
-#define SIZEOF_SIGNED_SHORT @SIZEOF_SIGNED_SHORT@
-
/* The size of `unsigned char *', as computed by sizeof. */
#define SIZEOF_UNSIGNED_CHAR_P @SIZEOF_UNSIGNED_CHAR_P@
diff --git a/tiff/libtiff/tif_config.h.in b/tiff/libtiff/tif_config.h.in
index a4b2e60ac..523da3e3f 100644
--- a/tiff/libtiff/tif_config.h.in
+++ b/tiff/libtiff/tif_config.h.in
@@ -21,7 +21,7 @@
packages produce RGBA files but don't mark the alpha properly. */
#undef DEFAULT_EXTRASAMPLE_AS_ALPHA
-/* enable deferred strip/tile offset/size loading (experimental) */
+/* enable deferred strip/tile offset/size loading */
#undef DEFER_STRILE_LOAD
/* Define to 1 if you have the <assert.h> header file. */
@@ -37,9 +37,6 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
-/* Define to 1 if you have the `floor' function. */
-#undef HAVE_FLOOR
-
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#undef HAVE_FSEEKO
@@ -62,45 +59,21 @@
machine */
#undef HAVE_IEEEFP
-/* Define to 1 if the system has the type `int16'. */
-#undef HAVE_INT16
-
-/* Define to 1 if the system has the type `int32'. */
-#undef HAVE_INT32
-
-/* Define to 1 if the system has the type `int8'. */
-#undef HAVE_INT8
-
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <io.h> header file. */
#undef HAVE_IO_H
-/* Define to 1 if you have the `isascii' function. */
-#undef HAVE_ISASCII
-
/* Define to 1 if you have the `jbg_newlen' function. */
#undef HAVE_JBG_NEWLEN
/* Define to 1 if you have the `lfind' function. */
#undef HAVE_LFIND
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define to 1 if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define to 1 if you have the `memmove' function. */
-#undef HAVE_MEMMOVE
-
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
-/* Define to 1 if you have the `memset' function. */
-#undef HAVE_MEMSET
-
/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP
@@ -110,9 +83,6 @@
/* Define to 1 if you have the <OpenGL/gl.h> header file. */
#undef HAVE_OPENGL_GL_H
-/* Define to 1 if you have the `pow' function. */
-#undef HAVE_POW
-
/* Define if you have POSIX threads libraries and header files. */
#undef HAVE_PTHREAD
@@ -125,9 +95,6 @@
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
-/* Define to 1 if you have the `sqrt' function. */
-#undef HAVE_SQRT
-
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -137,24 +104,18 @@
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
-/* Define to 1 if you have the `strchr' function. */
-#undef HAVE_STRCHR
-
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
-/* Define to 1 if you have the `strrchr' function. */
-#undef HAVE_STRRCHR
-
-/* Define to 1 if you have the `strstr' function. */
-#undef HAVE_STRSTR
-
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
+/* Define to 1 if you have the `strtoll' function. */
+#undef HAVE_STRTOLL
+
/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL
@@ -164,9 +125,6 @@
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
@@ -259,9 +217,6 @@
/* The size of `signed long long', as computed by sizeof. */
#undef SIZEOF_SIGNED_LONG_LONG
-/* The size of `signed short', as computed by sizeof. */
-#undef SIZEOF_SIGNED_SHORT
-
/* The size of `size_t', as computed by sizeof. */
#undef SIZEOF_SIZE_T
@@ -277,9 +232,6 @@
/* The size of `unsigned long long', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_LONG_LONG
-/* The size of `unsigned short', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_SHORT
-
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
@@ -362,6 +314,9 @@
/* Version number of package */
#undef VERSION
+/* Support webp compression */
+#undef WEBP_SUPPORT
+
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
@@ -380,6 +335,9 @@
/* Support Deflate compression */
#undef ZIP_SUPPORT
+/* Support zstd compression */
+#undef ZSTD_SUPPORT
+
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
diff --git a/tiff/libtiff/tif_config.wince.h b/tiff/libtiff/tif_config.wince.h
index 94e92bbf9..e85e2e62c 100644
--- a/tiff/libtiff/tif_config.wince.h
+++ b/tiff/libtiff/tif_config.wince.h
@@ -1,5 +1,3 @@
-/* $Id: tif_config.wince.h,v 1.3 2010-03-10 18:56:48 bfriesen Exp $ */
-
/*
* TIFF library configuration header for Windows CE platform.
*/
diff --git a/tiff/libtiff/tif_dir.c b/tiff/libtiff/tif_dir.c
index f00f8080a..1e0a76c3d 100644
--- a/tiff/libtiff/tif_dir.c
+++ b/tiff/libtiff/tif_dir.c
@@ -1,5 +1,3 @@
-/* $Id: tif_dir.c,v 1.131 2017-07-11 21:38:04 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -31,7 +29,6 @@
* (and also some miscellaneous stuff)
*/
#include "tiffiop.h"
-#include <float.h>
/*
* These are used in the backwards compatibility code...
@@ -49,8 +46,8 @@ setByteArray(void** vpp, void* vp, size_t nmemb, size_t elem_size)
*vpp = 0;
}
if (vp) {
- tmsize_t bytes = (tmsize_t)(nmemb * elem_size);
- if (elem_size && bytes / elem_size == nmemb)
+ tmsize_t bytes = _TIFFMultiplySSize(NULL, nmemb, elem_size, NULL);
+ if (bytes)
*vpp = (void*) _TIFFmalloc(bytes);
if (*vpp)
_TIFFmemcpy(*vpp, vp, bytes);
@@ -90,13 +87,15 @@ setDoubleArrayOneValue(double** vpp, double value, size_t nmemb)
* Install extra samples information.
*/
static int
-setExtraSamples(TIFFDirectory* td, va_list ap, uint32* v)
+setExtraSamples(TIFF* tif, va_list ap, uint32* v)
{
/* XXX: Unassociated alpha data == 999 is a known Corel Draw bug, see below */
#define EXTRASAMPLE_COREL_UNASSALPHA 999
uint16* va;
uint32 i;
+ TIFFDirectory* td = &tif->tif_dir;
+ static const char module[] = "setExtraSamples";
*v = (uint16) va_arg(ap, uint16_vap);
if ((uint16) *v > td->td_samplesperpixel)
@@ -118,6 +117,18 @@ setExtraSamples(TIFFDirectory* td, va_list ap, uint32* v)
return 0;
}
}
+
+ if ( td->td_transferfunction[0] != NULL && (td->td_samplesperpixel - *v > 1) &&
+ !(td->td_samplesperpixel - td->td_extrasamples > 1))
+ {
+ TIFFWarningExt(tif->tif_clientdata,module,
+ "ExtraSamples tag value is changing, "
+ "but TransferFunction was read with a different value. Cancelling it");
+ TIFFClrFieldBit(tif,FIELD_TRANSFERFUNCTION);
+ _TIFFfree(td->td_transferfunction[0]);
+ td->td_transferfunction[0] = NULL;
+ }
+
td->td_extrasamples = (uint16) *v;
_TIFFsetShortArray(&td->td_sampleinfo, va, td->td_extrasamples);
return 1;
@@ -155,15 +166,6 @@ bad:
return (0);
}
-static float TIFFClampDoubleToFloat( double val )
-{
- if( val > FLT_MAX )
- return FLT_MAX;
- if( val < -FLT_MAX )
- return -FLT_MAX;
- return (float)val;
-}
-
static int
_TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
{
@@ -287,6 +289,18 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
_TIFFfree(td->td_smaxsamplevalue);
td->td_smaxsamplevalue = NULL;
}
+ /* Test if 3 transfer functions instead of just one are now needed
+ See http://bugzilla.maptools.org/show_bug.cgi?id=2820 */
+ if( td->td_transferfunction[0] != NULL && (v - td->td_extrasamples > 1) &&
+ !(td->td_samplesperpixel - td->td_extrasamples > 1))
+ {
+ TIFFWarningExt(tif->tif_clientdata,module,
+ "SamplesPerPixel tag value is changing, "
+ "but TransferFunction was read with a different value. Cancelling it");
+ TIFFClrFieldBit(tif,FIELD_TRANSFERFUNCTION);
+ _TIFFfree(td->td_transferfunction[0]);
+ td->td_transferfunction[0] = NULL;
+ }
}
td->td_samplesperpixel = (uint16) v;
break;
@@ -322,13 +336,13 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
dblval = va_arg(ap, double);
if( dblval < 0 )
goto badvaluedouble;
- td->td_xresolution = TIFFClampDoubleToFloat( dblval );
+ td->td_xresolution = _TIFFClampDoubleToFloat( dblval );
break;
case TIFFTAG_YRESOLUTION:
dblval = va_arg(ap, double);
if( dblval < 0 )
goto badvaluedouble;
- td->td_yresolution = TIFFClampDoubleToFloat( dblval );
+ td->td_yresolution = _TIFFClampDoubleToFloat( dblval );
break;
case TIFFTAG_PLANARCONFIG:
v = (uint16) va_arg(ap, uint16_vap);
@@ -337,10 +351,10 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
td->td_planarconfig = (uint16) v;
break;
case TIFFTAG_XPOSITION:
- td->td_xposition = TIFFClampDoubleToFloat( va_arg(ap, double) );
+ td->td_xposition = _TIFFClampDoubleToFloat( va_arg(ap, double) );
break;
case TIFFTAG_YPOSITION:
- td->td_yposition = TIFFClampDoubleToFloat( va_arg(ap, double) );
+ td->td_yposition = _TIFFClampDoubleToFloat( va_arg(ap, double) );
break;
case TIFFTAG_RESOLUTIONUNIT:
v = (uint16) va_arg(ap, uint16_vap);
@@ -363,7 +377,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
_TIFFsetShortArray(&td->td_colormap[2], va_arg(ap, uint16*), v32);
break;
case TIFFTAG_EXTRASAMPLES:
- if (!setExtraSamples(td, ap, &v))
+ if (!setExtraSamples(tif, ap, &v))
goto badvalue;
break;
case TIFFTAG_MATTEING:
@@ -686,7 +700,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
case TIFF_SRATIONAL:
case TIFF_FLOAT:
{
- float v2 = TIFFClampDoubleToFloat(va_arg(ap, double));
+ float v2 = _TIFFClampDoubleToFloat(va_arg(ap, double));
_TIFFmemcpy(val, &v2, tv_size);
}
break;
@@ -863,14 +877,24 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY);
if( fip == NULL ) /* cannot happen since TIFFGetField() already checks it */
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 (i.e. EXIF)
+ */
+ if (fip->field_bit == FIELD_CUSTOM) {
+ standard_tag = 0;
+ }
- if( tag == TIFFTAG_NUMBEROFINKS )
+ if( standard_tag == TIFFTAG_NUMBEROFINKS )
{
int i;
for (i = 0; i < td->td_customValueCount; i++) {
uint16 val;
TIFFTagValue *tv = td->td_customValues + i;
- if (tv->info->field_tag != tag)
+ if (tv->info->field_tag != standard_tag)
continue;
if( tv->value == NULL )
return 0;
@@ -892,16 +916,6 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list 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 (i.e. EXIF)
- */
- if (fip->field_bit == FIELD_CUSTOM) {
- standard_tag = 0;
- }
-
switch (standard_tag) {
case TIFFTAG_SUBFILETYPE:
*va_arg(ap, uint32*) = td->td_subfiletype;
@@ -1004,12 +1018,12 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
case TIFFTAG_STRIPOFFSETS:
case TIFFTAG_TILEOFFSETS:
_TIFFFillStriles( tif );
- *va_arg(ap, uint64**) = td->td_stripoffset;
+ *va_arg(ap, uint64**) = td->td_stripoffset_p;
break;
case TIFFTAG_STRIPBYTECOUNTS:
case TIFFTAG_TILEBYTECOUNTS:
_TIFFFillStriles( tif );
- *va_arg(ap, uint64**) = td->td_stripbytecount;
+ *va_arg(ap, uint64**) = td->td_stripbytecount_p;
break;
case TIFFTAG_MATTEING:
*va_arg(ap, uint16*) =
@@ -1067,6 +1081,9 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
if (td->td_samplesperpixel - td->td_extrasamples > 1) {
*va_arg(ap, uint16**) = td->td_transferfunction[1];
*va_arg(ap, uint16**) = td->td_transferfunction[2];
+ } else {
+ *va_arg(ap, uint16**) = NULL;
+ *va_arg(ap, uint16**) = NULL;
}
break;
case TIFFTAG_REFERENCEBLACKWHITE:
@@ -1265,8 +1282,9 @@ TIFFFreeDirectory(TIFF* tif)
CleanupField(td_transferfunction[0]);
CleanupField(td_transferfunction[1]);
CleanupField(td_transferfunction[2]);
- CleanupField(td_stripoffset);
- CleanupField(td_stripbytecount);
+ CleanupField(td_stripoffset_p);
+ CleanupField(td_stripbytecount_p);
+ td->td_stripoffsetbyteallocsize = 0;
TIFFClrFieldBit(tif, FIELD_YCBCRSUBSAMPLING);
TIFFClrFieldBit(tif, FIELD_YCBCRPOSITIONING);
@@ -1279,10 +1297,8 @@ TIFFFreeDirectory(TIFF* tif)
td->td_customValueCount = 0;
CleanupField(td_customValues);
-#if defined(DEFER_STRILE_LOAD)
_TIFFmemset( &(td->td_stripoffset_entry), 0, sizeof(TIFFDirEntry));
_TIFFmemset( &(td->td_stripbytecount_entry), 0, sizeof(TIFFDirEntry));
-#endif
}
#undef CleanupField
@@ -1370,7 +1386,9 @@ TIFFDefaultDirectory(TIFF* tif)
td->td_tilewidth = 0;
td->td_tilelength = 0;
td->td_tiledepth = 1;
+#ifdef STRIPBYTECOUNTSORTED_UNUSED
td->td_stripbytecountsorted = 1; /* Our own arrays always sorted. */
+#endif
td->td_resolutionunit = RESUNIT_INCH;
td->td_sampleformat = SAMPLEFORMAT_UINT;
td->td_imagedepth = 1;
diff --git a/tiff/libtiff/tif_dir.h b/tiff/libtiff/tif_dir.h
index 5a3807673..e7f06673c 100644
--- a/tiff/libtiff/tif_dir.h
+++ b/tiff/libtiff/tif_dir.h
@@ -1,5 +1,3 @@
-/* $Id: tif_dir.h,v 1.55 2017-06-01 12:44:04 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -26,6 +24,10 @@
#ifndef _TIFFDIR_
#define _TIFFDIR_
+
+#include "tiff.h"
+#include "tiffio.h"
+
/*
* ``Library-private'' Directory-related Definitions.
*/
@@ -56,6 +58,7 @@ typedef struct {
uint32 toff_long;
uint64 toff_long8;
} tdir_offset; /* either offset or the data itself if fits */
+ uint8 tdir_ignore; /* flag status to ignore tag when parsing tags in tif_dirread.c */
} TIFFDirEntry;
/*
@@ -95,13 +98,14 @@ typedef struct {
* number of striles */
uint32 td_stripsperimage;
uint32 td_nstrips; /* size of offset & bytecount arrays */
- uint64* td_stripoffset;
- uint64* td_stripbytecount;
+ uint64* td_stripoffset_p; /* should be accessed with TIFFGetStrileOffset */
+ uint64* td_stripbytecount_p; /* should be accessed with TIFFGetStrileByteCount */
+ uint32 td_stripoffsetbyteallocsize; /* number of elements currently allocated for td_stripoffset/td_stripbytecount. Only used if TIFF_LAZYSTRILELOAD is set */
+#ifdef STRIPBYTECOUNTSORTED_UNUSED
int td_stripbytecountsorted; /* is the bytecount array sorted ascending? */
-#if defined(DEFER_STRILE_LOAD)
+#endif
TIFFDirEntry td_stripoffset_entry; /* for deferred loading */
TIFFDirEntry td_stripbytecount_entry; /* for deferred loading */
-#endif
uint16 td_nsubifd;
uint64* td_subifd;
/* YCbCr parameters */
@@ -116,6 +120,8 @@ typedef struct {
int td_customValueCount;
TIFFTagValue *td_customValues;
+
+ unsigned char td_deferstrilearraywriting; /* see TIFFDeferStrileArrayWriting() */
} TIFFDirectory;
/*
diff --git a/tiff/libtiff/tif_dirinfo.c b/tiff/libtiff/tif_dirinfo.c
index 4904f540e..e1f6b23e9 100644
--- a/tiff/libtiff/tif_dirinfo.c
+++ b/tiff/libtiff/tif_dirinfo.c
@@ -1,5 +1,3 @@
-/* $Id: tif_dirinfo.c,v 1.127 2017-06-01 12:44:04 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -979,6 +977,8 @@ _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag)
case TIFFTAG_CONSECUTIVEBADFAXLINES:
case TIFFTAG_GROUP3OPTIONS:
case TIFFTAG_GROUP4OPTIONS:
+ /* LERC */
+ case TIFFTAG_LERC_PARAMETERS:
break;
default:
return 1;
@@ -1054,7 +1054,18 @@ _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag)
if (tag == TIFFTAG_PREDICTOR)
return 1;
break;
-
+ case COMPRESSION_ZSTD:
+ if (tag == TIFFTAG_PREDICTOR)
+ return 1;
+ break;
+ case COMPRESSION_LERC:
+ if (tag == TIFFTAG_LERC_PARAMETERS)
+ return 1;
+ break;
+ case COMPRESSION_WEBP:
+ if (tag == TIFFTAG_PREDICTOR)
+ return 1;
+ break;
}
return 0;
}
diff --git a/tiff/libtiff/tif_dirread.c b/tiff/libtiff/tif_dirread.c
index 5e62e8131..6f9094138 100644
--- a/tiff/libtiff/tif_dirread.c
+++ b/tiff/libtiff/tif_dirread.c
@@ -1,5 +1,3 @@
-/* $Id: tif_dirread.c,v 1.218 2017-09-09 21:44:42 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -31,9 +29,6 @@
*/
/* Suggested pending improvements:
- * - add a field 'ignore' to the TIFFDirEntry structure, to flag status,
- * eliminating current use of the IGNORE value, and therefore eliminating
- * current irrational behaviour on tags with tag id code 0
* - add a field 'field_info' to the TIFFDirEntry structure, and set that with
* the pointer to the appropriate TIFFField structure early on in
* TIFFReadDirectory, so as to eliminate current possibly repetitive lookup.
@@ -43,9 +38,13 @@
#include <float.h>
#include <stdlib.h>
-#define IGNORE 0 /* tag placeholder used below */
#define FAILED_FII ((uint32) -1)
+/*
+ * Largest 64-bit signed integer value.
+ */
+#define TIFF_INT64_MAX ((int64)(TIFF_UINT64_MAX >> 1))
+
#ifdef HAVE_IEEEFP
# define TIFFCvtIEEEFloatToNative(tif, n, fp)
# define TIFFCvtIEEEDoubleToNative(tif, n, dp)
@@ -166,7 +165,9 @@ static int TIFFFetchNormalTag(TIFF*, TIFFDirEntry*, int recover);
static int TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uint64** lpp);
static int TIFFFetchSubjectDistance(TIFF*, TIFFDirEntry*);
static void ChopUpSingleUncompressedStrip(TIFF*);
+static void TryChopUpUncompressedBigTiff(TIFF*);
static uint64 TIFFReadUInt64(const uint8 *value);
+static int _TIFFGetMaxColorChannels(uint16 photometric);
static int _TIFFFillStrilesInternal( TIFF *tif, int loadStripByteCount );
@@ -206,6 +207,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryByte(TIFF* tif, TIFFDirEntry* di
switch (direntry->tdir_type)
{
case TIFF_BYTE:
+ case TIFF_UNDEFINED: /* Support to read TIFF_UNDEFINED with field_readcount==1 */
TIFFReadDirEntryCheckedByte(tif,direntry,value);
return(TIFFReadDirEntryErrOk);
case TIFF_SBYTE:
@@ -776,7 +778,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8(TIFF* tif, TIFFDirEntry* di
static enum TIFFReadDirEntryErr TIFFReadDirEntryDataAndRealloc(
TIFF* tif, uint64 offset, tmsize_t size, void** pdest)
{
-#if SIZEOF_VOIDP == 8 || SIZEOF_SIZE_T == 8
+#if SIZEOF_SIZE_T == 8
tmsize_t threshold = INITIAL_THRESHOLD;
#endif
tmsize_t already_read = 0;
@@ -797,7 +799,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryDataAndRealloc(
void* new_dest;
tmsize_t bytes_read;
tmsize_t to_read = size - already_read;
-#if SIZEOF_VOIDP == 8 || SIZEOF_SIZE_T == 8
+#if SIZEOF_SIZE_T == 8
if( to_read >= threshold && threshold < MAX_THRESHOLD )
{
to_read = threshold;
@@ -3288,11 +3290,6 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong(int32 value)
return(TIFFReadDirEntryErrOk);
}
-/*
- * Largest 32-bit unsigned integer value.
- */
-#define TIFF_UINT32_MAX 0xFFFFFFFFU
-
static enum TIFFReadDirEntryErr
TIFFReadDirEntryCheckRangeLongLong8(uint64 value)
{
@@ -3311,8 +3308,6 @@ TIFFReadDirEntryCheckRangeLongSlong8(int64 value)
return(TIFFReadDirEntryErrOk);
}
-#undef TIFF_UINT32_MAX
-
static enum TIFFReadDirEntryErr
TIFFReadDirEntryCheckRangeSlongLong(uint32 value)
{
@@ -3378,11 +3373,6 @@ TIFFReadDirEntryCheckRangeLong8Slong8(int64 value)
return(TIFFReadDirEntryErrOk);
}
-/*
- * Largest 64-bit signed integer value.
- */
-#define TIFF_INT64_MAX ((int64)(((uint64) ~0) >> 1))
-
static enum TIFFReadDirEntryErr
TIFFReadDirEntryCheckRangeSlong8Long8(uint64 value)
{
@@ -3392,8 +3382,6 @@ TIFFReadDirEntryCheckRangeSlong8Long8(uint64 value)
return(TIFFReadDirEntryErrOk);
}
-#undef TIFF_INT64_MAX
-
static enum TIFFReadDirEntryErr
TIFFReadDirEntryData(TIFF* tif, uint64 offset, tmsize_t size, void* dest)
{
@@ -3406,13 +3394,13 @@ TIFFReadDirEntryData(TIFF* tif, uint64 offset, tmsize_t size, void* dest)
} else {
size_t ma,mb;
ma=(size_t)offset;
+ if( (uint64)ma!=offset ||
+ ma > (~(size_t)0) - (size_t)size )
+ {
+ return TIFFReadDirEntryErrIo;
+ }
mb=ma+size;
- if (((uint64)ma!=offset)
- || (mb < ma)
- || (mb - ma != (size_t) size)
- || (mb < (size_t)size)
- || (mb > (size_t)tif->tif_size)
- )
+ if (mb > (size_t)tif->tif_size)
return(TIFFReadDirEntryErrIo);
_TIFFmemcpy(dest,tif->tif_base+ma,size);
}
@@ -3507,6 +3495,78 @@ static void TIFFReadDirEntryOutputErr(TIFF* tif, enum TIFFReadDirEntryErr err, c
}
/*
+ * Return the maximum number of color channels specified for a given photometric
+ * type. 0 is returned if photometric type isn't supported or no default value
+ * is defined by the specification.
+ */
+static int _TIFFGetMaxColorChannels( uint16 photometric )
+{
+ switch (photometric) {
+ case PHOTOMETRIC_PALETTE:
+ case PHOTOMETRIC_MINISWHITE:
+ case PHOTOMETRIC_MINISBLACK:
+ return 1;
+ case PHOTOMETRIC_YCBCR:
+ case PHOTOMETRIC_RGB:
+ case PHOTOMETRIC_CIELAB:
+ case PHOTOMETRIC_LOGLUV:
+ case PHOTOMETRIC_ITULAB:
+ case PHOTOMETRIC_ICCLAB:
+ return 3;
+ case PHOTOMETRIC_SEPARATED:
+ case PHOTOMETRIC_MASK:
+ return 4;
+ case PHOTOMETRIC_LOGL:
+ case PHOTOMETRIC_CFA:
+ default:
+ return 0;
+ }
+}
+
+static int ByteCountLooksBad(TIFF* tif)
+{
+ /*
+ * Assume we have wrong StripByteCount value (in case
+ * of single strip) in following cases:
+ * - it is equal to zero along with StripOffset;
+ * - it is larger than file itself (in case of uncompressed
+ * image);
+ * - it is smaller than the size of the bytes per row
+ * multiplied on the number of rows. The last case should
+ * not be checked in the case of writing new image,
+ * because we may do not know the exact strip size
+ * until the whole image will be written and directory
+ * dumped out.
+ */
+ uint64 bytecount = TIFFGetStrileByteCount(tif, 0);
+ uint64 offset = TIFFGetStrileOffset(tif, 0);
+ uint64 filesize;
+
+ if( offset == 0 )
+ return 0;
+ if (bytecount == 0)
+ return 1;
+ if ( tif->tif_dir.td_compression != COMPRESSION_NONE )
+ return 0;
+ filesize = TIFFGetFileSize(tif);
+ if( offset <= filesize && bytecount > filesize - offset )
+ return 1;
+ if( tif->tif_mode == O_RDONLY )
+ {
+ uint64 scanlinesize = TIFFScanlineSize64(tif);
+ if( tif->tif_dir.td_imagelength > 0 &&
+ scanlinesize > TIFF_UINT64_MAX / tif->tif_dir.td_imagelength )
+ {
+ return 1;
+ }
+ if( bytecount < scanlinesize * tif->tif_dir.td_imagelength)
+ return 1;
+ }
+ return 0;
+}
+
+
+/*
* Read the next TIFF directory from a file and convert it to the internal
* format. We read directories sequentially.
*/
@@ -3522,6 +3582,7 @@ TIFFReadDirectory(TIFF* tif)
uint32 fii=FAILED_FII;
toff_t nextdiroff;
int bitspersample_read = FALSE;
+ int color_channels;
tif->tif_diroff=tif->tif_nextdiroff;
if (!TIFFCheckDirOffset(tif,tif->tif_nextdiroff))
@@ -3551,14 +3612,17 @@ TIFFReadDirectory(TIFF* tif)
uint16 nb;
for (na=ma+1, nb=mb+1; nb<dircount; na++, nb++)
{
- if (ma->tdir_tag==na->tdir_tag)
- na->tdir_tag=IGNORE;
+ if (ma->tdir_tag == na->tdir_tag) {
+ na->tdir_ignore = TRUE;
+ }
}
}
}
tif->tif_flags &= ~TIFF_BEENWRITING; /* reset before new dir */
tif->tif_flags &= ~TIFF_BUF4WRITE; /* reset before new dir */
+ tif->tif_flags &= ~TIFF_CHOPPEDUPARRAYS;
+
/* free any old stuff and reinit */
TIFFFreeDirectory(tif);
TIFFDefaultDirectory(tif);
@@ -3591,7 +3655,7 @@ TIFFReadDirectory(TIFF* tif)
{
if (!TIFFFetchNormalTag(tif,dp,0))
goto bad;
- dp->tdir_tag=IGNORE;
+ dp->tdir_ignore = TRUE;
}
dp=TIFFReadDirectoryFindEntry(tif,dir,dircount,TIFFTAG_COMPRESSION);
if (dp)
@@ -3614,7 +3678,7 @@ TIFFReadDirectory(TIFF* tif)
}
if (!TIFFSetField(tif,TIFFTAG_COMPRESSION,value))
goto bad;
- dp->tdir_tag=IGNORE;
+ dp->tdir_ignore = TRUE;
}
else
{
@@ -3626,7 +3690,7 @@ TIFFReadDirectory(TIFF* tif)
*/
for (di=0, dp=dir; di<dircount; di++, dp++)
{
- if (dp->tdir_tag!=IGNORE)
+ if (!dp->tdir_ignore)
{
TIFFReadDirectoryFindFieldInfo(tif,dp->tdir_tag,&fii);
if (fii == FAILED_FII)
@@ -3634,8 +3698,8 @@ TIFFReadDirectory(TIFF* tif)
TIFFWarningExt(tif->tif_clientdata, module,
"Unknown field with tag %d (0x%x) encountered",
dp->tdir_tag,dp->tdir_tag);
- /* the following knowingly leaks the
- anonymous field structure */
+ /* the following knowingly leaks the
+ anonymous field structure */
if (!_TIFFMergeFields(tif,
_TIFFCreateAnonField(tif,
dp->tdir_tag,
@@ -3646,18 +3710,18 @@ TIFFReadDirectory(TIFF* tif)
"Registering anonymous field with tag %d (0x%x) failed",
dp->tdir_tag,
dp->tdir_tag);
- dp->tdir_tag=IGNORE;
+ dp->tdir_ignore = TRUE;
} else {
TIFFReadDirectoryFindFieldInfo(tif,dp->tdir_tag,&fii);
assert(fii != FAILED_FII);
}
}
}
- if (dp->tdir_tag!=IGNORE)
+ if (!dp->tdir_ignore)
{
fip=tif->tif_fields[fii];
if (fip->field_bit==FIELD_IGNORE)
- dp->tdir_tag=IGNORE;
+ dp->tdir_ignore = TRUE;
else
{
switch (dp->tdir_tag)
@@ -3679,12 +3743,12 @@ TIFFReadDirectory(TIFF* tif)
case TIFFTAG_EXTRASAMPLES:
if (!TIFFFetchNormalTag(tif,dp,0))
goto bad;
- dp->tdir_tag=IGNORE;
+ dp->tdir_ignore = TRUE;
+ break;
+ default:
+ if( !_TIFFCheckFieldIsValidForCodec(tif, dp->tdir_tag) )
+ dp->tdir_ignore = TRUE;
break;
- default:
- if( !_TIFFCheckFieldIsValidForCodec(tif, dp->tdir_tag) )
- dp->tdir_tag=IGNORE;
- break;
}
}
}
@@ -3700,8 +3764,8 @@ TIFFReadDirectory(TIFF* tif)
if ((tif->tif_dir.td_compression==COMPRESSION_OJPEG)&&
(tif->tif_dir.td_planarconfig==PLANARCONFIG_SEPARATE))
{
- if (!_TIFFFillStriles(tif))
- goto bad;
+ if (!_TIFFFillStriles(tif))
+ goto bad;
dp=TIFFReadDirectoryFindEntry(tif,dir,dircount,TIFFTAG_STRIPOFFSETS);
if ((dp!=0)&&(dp->tdir_count==1))
{
@@ -3773,190 +3837,200 @@ TIFFReadDirectory(TIFF* tif)
*/
for (di=0, dp=dir; di<dircount; di++, dp++)
{
- switch (dp->tdir_tag)
- {
- case IGNORE:
- break;
- case TIFFTAG_MINSAMPLEVALUE:
- case TIFFTAG_MAXSAMPLEVALUE:
- case TIFFTAG_BITSPERSAMPLE:
- case TIFFTAG_DATATYPE:
- case TIFFTAG_SAMPLEFORMAT:
- /*
- * The MinSampleValue, MaxSampleValue, BitsPerSample
- * 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 (yuck). Other vendors write correct
- * value for NumberOfSamples, but incorrect one for
- * BitsPerSample and friends, and we will read this
- * too.
- */
- {
- uint16 value;
- enum TIFFReadDirEntryErr err;
- err=TIFFReadDirEntryShort(tif,dp,&value);
- if (err==TIFFReadDirEntryErrCount)
- err=TIFFReadDirEntryPersampleShort(tif,dp,&value);
- if (err!=TIFFReadDirEntryErrOk)
- {
- fip = TIFFFieldWithTag(tif,dp->tdir_tag);
- TIFFReadDirEntryOutputErr(tif,err,module,fip ? fip->field_name : "unknown tagname",0);
- goto bad;
- }
- if (!TIFFSetField(tif,dp->tdir_tag,value))
- goto bad;
- if( dp->tdir_tag == TIFFTAG_BITSPERSAMPLE )
- bitspersample_read = TRUE;
- }
- break;
- case TIFFTAG_SMINSAMPLEVALUE:
- case TIFFTAG_SMAXSAMPLEVALUE:
- {
-
- double *data = NULL;
- enum TIFFReadDirEntryErr err;
- uint32 saved_flags;
- int m;
- if (dp->tdir_count != (uint64)tif->tif_dir.td_samplesperpixel)
- err = TIFFReadDirEntryErrCount;
- else
- err = TIFFReadDirEntryDoubleArray(tif, dp, &data);
- if (err!=TIFFReadDirEntryErrOk)
- {
- fip = TIFFFieldWithTag(tif,dp->tdir_tag);
- TIFFReadDirEntryOutputErr(tif,err,module,fip ? fip->field_name : "unknown tagname",0);
- goto bad;
- }
- saved_flags = tif->tif_flags;
- tif->tif_flags |= TIFF_PERSAMPLE;
- m = TIFFSetField(tif,dp->tdir_tag,data);
- tif->tif_flags = saved_flags;
- _TIFFfree(data);
- if (!m)
- goto bad;
- }
- break;
- case TIFFTAG_STRIPOFFSETS:
- case TIFFTAG_TILEOFFSETS:
-#if defined(DEFER_STRILE_LOAD)
- _TIFFmemcpy( &(tif->tif_dir.td_stripoffset_entry),
- dp, sizeof(TIFFDirEntry) );
-#else
- if( tif->tif_dir.td_stripoffset != NULL )
- {
- TIFFErrorExt(tif->tif_clientdata, module,
- "tif->tif_dir.td_stripoffset is "
- "already allocated. Likely duplicated "
- "StripOffsets/TileOffsets tag");
- goto bad;
- }
- if (!TIFFFetchStripThing(tif,dp,tif->tif_dir.td_nstrips,&tif->tif_dir.td_stripoffset))
- goto bad;
-#endif
- break;
- case TIFFTAG_STRIPBYTECOUNTS:
- case TIFFTAG_TILEBYTECOUNTS:
-#if defined(DEFER_STRILE_LOAD)
- _TIFFmemcpy( &(tif->tif_dir.td_stripbytecount_entry),
- dp, sizeof(TIFFDirEntry) );
-#else
- if( tif->tif_dir.td_stripbytecount != NULL )
- {
- TIFFErrorExt(tif->tif_clientdata, module,
- "tif->tif_dir.td_stripbytecount is "
- "already allocated. Likely duplicated "
- "StripByteCounts/TileByteCounts tag");
- goto bad;
- }
- if (!TIFFFetchStripThing(tif,dp,tif->tif_dir.td_nstrips,&tif->tif_dir.td_stripbytecount))
- goto bad;
-#endif
- break;
- case TIFFTAG_COLORMAP:
- case TIFFTAG_TRANSFERFUNCTION:
- {
- enum TIFFReadDirEntryErr err;
- uint32 countpersample;
- uint32 countrequired;
- uint32 incrementpersample;
- uint16* value=NULL;
- /* 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 */
- /* crashes in user code */
- if( !bitspersample_read )
- {
- fip = TIFFFieldWithTag(tif,dp->tdir_tag);
- TIFFWarningExt(tif->tif_clientdata,module,
- "Ignoring %s since BitsPerSample tag not found",
- fip ? fip->field_name : "unknown tagname");
- continue;
- }
- /* 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))
+ if (!dp->tdir_ignore) {
+ switch (dp->tdir_tag)
+ {
+ case TIFFTAG_MINSAMPLEVALUE:
+ case TIFFTAG_MAXSAMPLEVALUE:
+ case TIFFTAG_BITSPERSAMPLE:
+ case TIFFTAG_DATATYPE:
+ case TIFFTAG_SAMPLEFORMAT:
+ /*
+ * The MinSampleValue, MaxSampleValue, BitsPerSample
+ * 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 (yuck). Other vendors write correct
+ * value for NumberOfSamples, but incorrect one for
+ * BitsPerSample and friends, and we will read this
+ * too.
+ */
{
- countrequired=countpersample;
- incrementpersample=0;
+ uint16 value;
+ enum TIFFReadDirEntryErr err;
+ err=TIFFReadDirEntryShort(tif,dp,&value);
+ if (err==TIFFReadDirEntryErrCount)
+ err=TIFFReadDirEntryPersampleShort(tif,dp,&value);
+ if (err!=TIFFReadDirEntryErrOk)
+ {
+ fip = TIFFFieldWithTag(tif,dp->tdir_tag);
+ TIFFReadDirEntryOutputErr(tif,err,module,fip ? fip->field_name : "unknown tagname",0);
+ goto bad;
+ }
+ if (!TIFFSetField(tif,dp->tdir_tag,value))
+ goto bad;
+ if( dp->tdir_tag == TIFFTAG_BITSPERSAMPLE )
+ bitspersample_read = TRUE;
}
- else
+ break;
+ case TIFFTAG_SMINSAMPLEVALUE:
+ case TIFFTAG_SMAXSAMPLEVALUE:
{
- countrequired=3*countpersample;
- incrementpersample=countpersample;
+
+ double *data = NULL;
+ enum TIFFReadDirEntryErr err;
+ uint32 saved_flags;
+ int m;
+ if (dp->tdir_count != (uint64)tif->tif_dir.td_samplesperpixel)
+ err = TIFFReadDirEntryErrCount;
+ else
+ err = TIFFReadDirEntryDoubleArray(tif, dp, &data);
+ if (err!=TIFFReadDirEntryErrOk)
+ {
+ fip = TIFFFieldWithTag(tif,dp->tdir_tag);
+ TIFFReadDirEntryOutputErr(tif,err,module,fip ? fip->field_name : "unknown tagname",0);
+ goto bad;
+ }
+ saved_flags = tif->tif_flags;
+ tif->tif_flags |= TIFF_PERSAMPLE;
+ m = TIFFSetField(tif,dp->tdir_tag,data);
+ tif->tif_flags = saved_flags;
+ _TIFFfree(data);
+ if (!m)
+ goto bad;
}
- if (dp->tdir_count!=(uint64)countrequired)
- err=TIFFReadDirEntryErrCount;
- else
- err=TIFFReadDirEntryShortArray(tif,dp,&value);
- if (err!=TIFFReadDirEntryErrOk)
- {
- fip = TIFFFieldWithTag(tif,dp->tdir_tag);
- TIFFReadDirEntryOutputErr(tif,err,module,fip ? fip->field_name : "unknown tagname",1);
- }
- else
+ break;
+ case TIFFTAG_STRIPOFFSETS:
+ case TIFFTAG_TILEOFFSETS:
+ _TIFFmemcpy( &(tif->tif_dir.td_stripoffset_entry),
+ dp, sizeof(TIFFDirEntry) );
+ break;
+ case TIFFTAG_STRIPBYTECOUNTS:
+ case TIFFTAG_TILEBYTECOUNTS:
+ _TIFFmemcpy( &(tif->tif_dir.td_stripbytecount_entry),
+ dp, sizeof(TIFFDirEntry) );
+ break;
+ case TIFFTAG_COLORMAP:
+ case TIFFTAG_TRANSFERFUNCTION:
{
- TIFFSetField(tif,dp->tdir_tag,value,value+incrementpersample,value+2*incrementpersample);
- _TIFFfree(value);
+ enum TIFFReadDirEntryErr err;
+ uint32 countpersample;
+ uint32 countrequired;
+ uint32 incrementpersample;
+ uint16* value=NULL;
+ /* 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 */
+ /* crashes in user code */
+ if( !bitspersample_read )
+ {
+ fip = TIFFFieldWithTag(tif,dp->tdir_tag);
+ TIFFWarningExt(tif->tif_clientdata,module,
+ "Ignoring %s since BitsPerSample tag not found",
+ fip ? fip->field_name : "unknown tagname");
+ continue;
+ }
+ /* 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;
+ incrementpersample=0;
+ }
+ else
+ {
+ countrequired=3*countpersample;
+ incrementpersample=countpersample;
+ }
+ if (dp->tdir_count!=(uint64)countrequired)
+ err=TIFFReadDirEntryErrCount;
+ else
+ err=TIFFReadDirEntryShortArray(tif,dp,&value);
+ if (err!=TIFFReadDirEntryErrOk)
+ {
+ fip = TIFFFieldWithTag(tif,dp->tdir_tag);
+ TIFFReadDirEntryOutputErr(tif,err,module,fip ? fip->field_name : "unknown tagname",1);
+ }
+ else
+ {
+ TIFFSetField(tif,dp->tdir_tag,value,value+incrementpersample,value+2*incrementpersample);
+ _TIFFfree(value);
+ }
}
- }
- break;
+ break;
/* BEGIN REV 4.0 COMPATIBILITY */
- case TIFFTAG_OSUBFILETYPE:
- {
- uint16 valueo;
- uint32 value;
- if (TIFFReadDirEntryShort(tif,dp,&valueo)==TIFFReadDirEntryErrOk)
+ case TIFFTAG_OSUBFILETYPE:
{
- switch (valueo)
+ uint16 valueo;
+ uint32 value;
+ if (TIFFReadDirEntryShort(tif,dp,&valueo)==TIFFReadDirEntryErrOk)
{
- case OFILETYPE_REDUCEDIMAGE: value=FILETYPE_REDUCEDIMAGE; break;
- case OFILETYPE_PAGE: value=FILETYPE_PAGE; break;
- default: value=0; break;
+ switch (valueo)
+ {
+ case OFILETYPE_REDUCEDIMAGE: value=FILETYPE_REDUCEDIMAGE; break;
+ case OFILETYPE_PAGE: value=FILETYPE_PAGE; break;
+ default: value=0; break;
+ }
+ if (value!=0)
+ TIFFSetField(tif,TIFFTAG_SUBFILETYPE,value);
}
- if (value!=0)
- TIFFSetField(tif,TIFFTAG_SUBFILETYPE,value);
}
- }
- break;
+ break;
/* END REV 4.0 COMPATIBILITY */
- default:
- (void) TIFFFetchNormalTag(tif, dp, TRUE);
- break;
- }
- }
+ default:
+ (void) TIFFFetchNormalTag(tif, dp, TRUE);
+ break;
+ }
+ } /* -- if (!dp->tdir_ignore) */
+ } /* -- for-loop -- */
+
+ if( tif->tif_mode == O_RDWR &&
+ tif->tif_dir.td_stripoffset_entry.tdir_tag != 0 &&
+ tif->tif_dir.td_stripoffset_entry.tdir_count == 0 &&
+ tif->tif_dir.td_stripoffset_entry.tdir_type == 0 &&
+ tif->tif_dir.td_stripoffset_entry.tdir_offset.toff_long8 == 0 &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_tag != 0 &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_count == 0 &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_type == 0 &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_offset.toff_long8 == 0 )
+ {
+ /* Directory typically created with TIFFDeferStrileArrayWriting() */
+ TIFFSetupStrips(tif);
+ }
+ else if( !(tif->tif_flags&TIFF_DEFERSTRILELOAD) )
+ {
+ if( tif->tif_dir.td_stripoffset_entry.tdir_tag != 0 )
+ {
+ if (!TIFFFetchStripThing(tif,&(tif->tif_dir.td_stripoffset_entry),
+ tif->tif_dir.td_nstrips,
+ &tif->tif_dir.td_stripoffset_p))
+ {
+ goto bad;
+ }
+ }
+ if( tif->tif_dir.td_stripbytecount_entry.tdir_tag != 0 )
+ {
+ if (!TIFFFetchStripThing(tif,&(tif->tif_dir.td_stripbytecount_entry),
+ tif->tif_dir.td_nstrips,
+ &tif->tif_dir.td_stripbytecount_p))
+ {
+ goto bad;
+ }
+ }
+ }
+
/*
* OJPEG hack:
* - If a) compression is OJPEG, and b) photometric tag is missing,
@@ -4026,6 +4100,37 @@ TIFFReadDirectory(TIFF* tif)
}
}
}
+
+ /*
+ * Make sure all non-color channels are extrasamples.
+ * If it's not the case, define them as such.
+ */
+ color_channels = _TIFFGetMaxColorChannels(tif->tif_dir.td_photometric);
+ if (color_channels && tif->tif_dir.td_samplesperpixel - tif->tif_dir.td_extrasamples > color_channels) {
+ uint16 old_extrasamples;
+ uint16 *new_sampleinfo;
+
+ TIFFWarningExt(tif->tif_clientdata,module, "Sum of Photometric type-related "
+ "color channels and ExtraSamples doesn't match SamplesPerPixel. "
+ "Defining non-color channels as ExtraSamples.");
+
+ old_extrasamples = tif->tif_dir.td_extrasamples;
+ tif->tif_dir.td_extrasamples = (uint16) (tif->tif_dir.td_samplesperpixel - color_channels);
+
+ // sampleinfo should contain information relative to these new extra samples
+ new_sampleinfo = (uint16*) _TIFFcalloc(tif->tif_dir.td_extrasamples, sizeof(uint16));
+ if (!new_sampleinfo) {
+ TIFFErrorExt(tif->tif_clientdata, module, "Failed to allocate memory for "
+ "temporary new sampleinfo array (%d 16 bit elements)",
+ tif->tif_dir.td_extrasamples);
+ goto bad;
+ }
+
+ memcpy(new_sampleinfo, tif->tif_dir.td_sampleinfo, old_extrasamples * sizeof(uint16));
+ _TIFFsetShortArray(&tif->tif_dir.td_sampleinfo, new_sampleinfo, tif->tif_dir.td_extrasamples);
+ _TIFFfree(new_sampleinfo);
+ }
+
/*
* Verify Palette image has a Colormap.
*/
@@ -4068,33 +4173,10 @@ TIFFReadDirectory(TIFF* tif)
"\"StripByteCounts\" field, calculating from imagelength");
if (EstimateStripByteCounts(tif, dir, dircount) < 0)
goto bad;
- /*
- * Assume we have wrong StripByteCount value (in case
- * of single strip) in following cases:
- * - it is equal to zero along with StripOffset;
- * - it is larger than file itself (in case of uncompressed
- * image);
- * - it is smaller than the size of the bytes per row
- * multiplied on the number of rows. The last case should
- * not be checked in the case of writing new image,
- * because we may do not know the exact strip size
- * until the whole image will be written and directory
- * dumped out.
- */
- #define BYTECOUNTLOOKSBAD \
- ( (tif->tif_dir.td_stripbytecount[0] == 0 && tif->tif_dir.td_stripoffset[0] != 0) || \
- (tif->tif_dir.td_compression == COMPRESSION_NONE && \
- (tif->tif_dir.td_stripoffset[0] <= TIFFGetFileSize(tif) && \
- tif->tif_dir.td_stripbytecount[0] > TIFFGetFileSize(tif) - tif->tif_dir.td_stripoffset[0])) || \
- (tif->tif_mode == O_RDONLY && \
- tif->tif_dir.td_compression == COMPRESSION_NONE && \
- tif->tif_dir.td_stripbytecount[0] < TIFFScanlineSize64(tif) * tif->tif_dir.td_imagelength) )
} else if (tif->tif_dir.td_nstrips == 1
&& !(tif->tif_flags&TIFF_ISTILED)
- && _TIFFFillStriles(tif)
- && tif->tif_dir.td_stripoffset[0] != 0
- && BYTECOUNTLOOKSBAD) {
+ && ByteCountLooksBad(tif)) {
/*
* XXX: Plexus (and others) sometimes give a value of
* zero for a tag when they don't know what the
@@ -4106,13 +4188,13 @@ TIFFReadDirectory(TIFF* tif)
if(EstimateStripByteCounts(tif, dir, dircount) < 0)
goto bad;
-#if !defined(DEFER_STRILE_LOAD)
- } else if (tif->tif_dir.td_planarconfig == PLANARCONFIG_CONTIG
+ } else if (!(tif->tif_flags&TIFF_DEFERSTRILELOAD)
+ && tif->tif_dir.td_planarconfig == PLANARCONFIG_CONTIG
&& tif->tif_dir.td_nstrips > 2
&& tif->tif_dir.td_compression == COMPRESSION_NONE
- && tif->tif_dir.td_stripbytecount[0] != tif->tif_dir.td_stripbytecount[1]
- && tif->tif_dir.td_stripbytecount[0] != 0
- && tif->tif_dir.td_stripbytecount[1] != 0 ) {
+ && TIFFGetStrileByteCount(tif, 0) != TIFFGetStrileByteCount(tif, 1)
+ && TIFFGetStrileByteCount(tif, 0) != 0
+ && TIFFGetStrileByteCount(tif, 1) != 0 ) {
/*
* XXX: Some vendors fill StripByteCount array with
* absolutely wrong values (it can be equal to
@@ -4127,7 +4209,6 @@ TIFFReadDirectory(TIFF* tif)
"Wrong \"StripByteCounts\" field, ignoring and calculating from imagelength");
if (EstimateStripByteCounts(tif, dir, dircount) < 0)
goto bad;
-#endif /* !defined(DEFER_STRILE_LOAD) */
}
}
if (dir)
@@ -4142,26 +4223,27 @@ TIFFReadDirectory(TIFF* tif)
else
tif->tif_dir.td_maxsamplevalue = (uint16)((1L<<tif->tif_dir.td_bitspersample)-1);
}
+
+#ifdef STRIPBYTECOUNTSORTED_UNUSED
/*
* XXX: We can optimize checking for the strip bounds using the sorted
* bytecounts array. See also comments for TIFFAppendToStrip()
* function in tif_write.c.
*/
-#if !defined(DEFER_STRILE_LOAD)
- if (tif->tif_dir.td_nstrips > 1) {
+ if (!(tif->tif_flags&TIFF_DEFERSTRILELOAD) && tif->tif_dir.td_nstrips > 1) {
uint32 strip;
tif->tif_dir.td_stripbytecountsorted = 1;
for (strip = 1; strip < tif->tif_dir.td_nstrips; strip++) {
- if (tif->tif_dir.td_stripoffset[strip - 1] >
- tif->tif_dir.td_stripoffset[strip]) {
+ if (TIFFGetStrileOffset(tif, strip - 1) >
+ TIFFGetStrileOffset(tif, strip)) {
tif->tif_dir.td_stripbytecountsorted = 0;
break;
}
}
}
-#endif /* !defined(DEFER_STRILE_LOAD) */
-
+#endif
+
/*
* An opportunity for compression mode dependent tag fixup
*/
@@ -4180,11 +4262,20 @@ TIFFReadDirectory(TIFF* tif)
(tif->tif_dir.td_nstrips==1)&&
(tif->tif_dir.td_compression==COMPRESSION_NONE)&&
((tif->tif_flags&(TIFF_STRIPCHOP|TIFF_ISTILED))==TIFF_STRIPCHOP))
- {
- if ( !_TIFFFillStriles(tif) || !tif->tif_dir.td_stripbytecount )
- return 0;
- ChopUpSingleUncompressedStrip(tif);
- }
+ {
+ ChopUpSingleUncompressedStrip(tif);
+ }
+
+ /* There are also uncompressed striped files with strips larger than */
+ /* 2 GB, which make them unfriendly with a lot of code. If possible, */
+ /* try to expose smaller "virtual" strips. */
+ if( tif->tif_dir.td_planarconfig == PLANARCONFIG_CONTIG &&
+ tif->tif_dir.td_compression == COMPRESSION_NONE &&
+ (tif->tif_flags&(TIFF_STRIPCHOP|TIFF_ISTILED)) == TIFF_STRIPCHOP &&
+ TIFFStripSize64(tif) > 0x7FFFFFFFUL )
+ {
+ TryChopUpUncompressedBigTiff(tif);
+ }
/*
* Clear the dirty directory flag.
@@ -4336,17 +4427,17 @@ TIFFReadCustomDirectory(TIFF* tif, toff_t diroff,
TIFFWarningExt(tif->tif_clientdata, module,
"Registering anonymous field with tag %d (0x%x) failed",
dp->tdir_tag, dp->tdir_tag);
- dp->tdir_tag=IGNORE;
+ dp->tdir_ignore = TRUE;
} else {
TIFFReadDirectoryFindFieldInfo(tif,dp->tdir_tag,&fii);
assert( fii != FAILED_FII );
}
}
- if (dp->tdir_tag!=IGNORE)
+ if (!dp->tdir_ignore)
{
fip=tif->tif_fields[fii];
if (fip->field_bit==FIELD_IGNORE)
- dp->tdir_tag=IGNORE;
+ dp->tdir_ignore = TRUE;
else
{
/* check data type */
@@ -4366,7 +4457,7 @@ TIFFReadCustomDirectory(TIFF* tif, toff_t diroff,
TIFFWarningExt(tif->tif_clientdata, module,
"Wrong data type %d for \"%s\"; tag ignored",
dp->tdir_type,fip->field_name);
- dp->tdir_tag=IGNORE;
+ dp->tdir_ignore = TRUE;
}
else
{
@@ -4380,21 +4471,21 @@ TIFFReadCustomDirectory(TIFF* tif, toff_t diroff,
else
expected=(uint32)fip->field_readcount;
if (!CheckDirCount(tif,dp,expected))
- dp->tdir_tag=IGNORE;
+ dp->tdir_ignore = TRUE;
}
}
}
- switch (dp->tdir_tag)
- {
- case IGNORE:
- break;
- case EXIFTAG_SUBJECTDISTANCE:
- (void) TIFFFetchSubjectDistance(tif,dp);
- break;
- default:
- (void) TIFFFetchNormalTag(tif, dp, TRUE);
- break;
- }
+ if (!dp->tdir_ignore) {
+ switch (dp->tdir_tag)
+ {
+ case EXIFTAG_SUBJECTDISTANCE:
+ (void)TIFFFetchSubjectDistance(tif, dp);
+ break;
+ default:
+ (void)TIFFFetchNormalTag(tif, dp, TRUE);
+ break;
+ }
+ } /*-- if (!dp->tdir_ignore) */
}
}
if (dir)
@@ -4427,12 +4518,12 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
if( !_TIFFFillStrilesInternal( tif, 0 ) )
return -1;
- if (td->td_stripbytecount)
- _TIFFfree(td->td_stripbytecount);
- td->td_stripbytecount = (uint64*)
+ if (td->td_stripbytecount_p)
+ _TIFFfree(td->td_stripbytecount_p);
+ td->td_stripbytecount_p = (uint64*)
_TIFFCheckMalloc(tif, td->td_nstrips, sizeof (uint64),
"for \"StripByteCounts\" array");
- if( td->td_stripbytecount == NULL )
+ if( td->td_stripbytecount_p == NULL )
return -1;
if (td->td_compression != COMPRESSION_NONE) {
@@ -4456,6 +4547,8 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
dp->tdir_type);
return -1;
}
+ if( dp->tdir_count > TIFF_UINT64_MAX / typewidth )
+ return -1;
datasize=(uint64)typewidth*dp->tdir_count;
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
@@ -4467,6 +4560,8 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
if (datasize<=8)
datasize=0;
}
+ if( space > TIFF_UINT64_MAX - datasize )
+ return -1;
space+=datasize;
}
if( filesize < space )
@@ -4477,7 +4572,7 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
space /= td->td_samplesperpixel;
for (strip = 0; strip < td->td_nstrips; strip++)
- td->td_stripbytecount[strip] = space;
+ td->td_stripbytecount_p[strip] = space;
/*
* This gross hack handles the case were the offset to
* the last strip is past the place where we think the strip
@@ -4486,18 +4581,30 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
* of data in the strip and trim this number back accordingly.
*/
strip--;
- if (td->td_stripoffset[strip]+td->td_stripbytecount[strip] > filesize)
- td->td_stripbytecount[strip] = filesize - td->td_stripoffset[strip];
+ if (td->td_stripoffset_p[strip] > TIFF_UINT64_MAX - td->td_stripbytecount_p[strip])
+ return -1;
+ if (td->td_stripoffset_p[strip]+td->td_stripbytecount_p[strip] > filesize) {
+ if( td->td_stripoffset_p[strip] >= filesize ) {
+ /* Not sure what we should in that case... */
+ td->td_stripbytecount_p[strip] = 0;
+ } else {
+ td->td_stripbytecount_p[strip] = filesize - td->td_stripoffset_p[strip];
+ }
+ }
} else if (isTiled(tif)) {
uint64 bytespertile = TIFFTileSize64(tif);
for (strip = 0; strip < td->td_nstrips; strip++)
- td->td_stripbytecount[strip] = bytespertile;
+ td->td_stripbytecount_p[strip] = bytespertile;
} else {
uint64 rowbytes = TIFFScanlineSize64(tif);
uint32 rowsperstrip = td->td_imagelength/td->td_stripsperimage;
for (strip = 0; strip < td->td_nstrips; strip++)
- td->td_stripbytecount[strip] = rowbytes * rowsperstrip;
+ {
+ if( rowbytes > 0 && rowsperstrip > TIFF_UINT64_MAX / rowbytes )
+ return -1;
+ td->td_stripbytecount_p[strip] = rowbytes * rowsperstrip;
+ }
}
TIFFSetFieldBit(tif, FIELD_STRIPBYTECOUNTS);
if (!TIFFFieldSet(tif, FIELD_ROWSPERSTRIP))
@@ -4691,12 +4798,13 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
}
} else {
tmsize_t m;
- tmsize_t off = (tmsize_t) tif->tif_diroff;
- if ((uint64)off!=tif->tif_diroff)
+ tmsize_t off;
+ if (tif->tif_diroff > (uint64)TIFF_INT64_MAX)
{
TIFFErrorExt(tif->tif_clientdata,module,"Can not read TIFF directory count");
return(0);
}
+ off = (tmsize_t) tif->tif_diroff;
/*
* Check for integer overflow when validating the dir_off,
@@ -4814,6 +4922,7 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
mb=dir;
for (n=0; n<dircount16; n++)
{
+ mb->tdir_ignore = FALSE;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort((uint16*)ma);
mb->tdir_tag=*(uint16*)ma;
@@ -4828,6 +4937,7 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
TIFFSwabLong((uint32*)ma);
mb->tdir_count=(uint64)(*(uint32*)ma);
ma+=sizeof(uint32);
+ mb->tdir_offset.toff_long8=0;
*(uint32*)(&mb->tdir_offset)=*(uint32*)ma;
ma+=sizeof(uint32);
}
@@ -4881,17 +4991,18 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
err=TIFFReadDirEntryByteArray(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
- uint8* ma;
- uint32 mb;
+ uint32 mb = 0;
int n;
- ma=data;
- mb=0;
- while (mb<(uint32)dp->tdir_count)
+ if (data != NULL)
{
- if (*ma==0)
- break;
- ma++;
- mb++;
+ uint8* ma = data;
+ while (mb<(uint32)dp->tdir_count)
+ {
+ if (*ma==0)
+ break;
+ ma++;
+ mb++;
+ }
}
if (mb+1<(uint32)dp->tdir_count)
TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" contains null byte in value; value incorrectly truncated during reading due to implementation limitations",fip->field_name);
@@ -5141,11 +5252,11 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
if (err==TIFFReadDirEntryErrOk)
{
int m;
- if( dp->tdir_count > 0 && data[dp->tdir_count-1] != '\0' )
- {
- TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte. Forcing it to be null",fip->field_name);
- data[dp->tdir_count-1] = '\0';
- }
+ if( data != 0 && 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);
@@ -5318,11 +5429,11 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
if (err==TIFFReadDirEntryErrOk)
{
int m;
- if( dp->tdir_count > 0 && data[dp->tdir_count-1] != '\0' )
- {
- TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte. Forcing it to be null",fip->field_name);
- data[dp->tdir_count-1] = '\0';
- }
+ if( data != 0 && 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);
@@ -5620,7 +5731,7 @@ TIFFFetchSubjectDistance(TIFF* tif, TIFFDirEntry* dir)
TIFFSwabArrayOfLong(m.i,2);
if (m.i[0]==0)
n=0.0;
- else if (m.i[0]==0xFFFFFFFF)
+ else if (m.i[0]==0xFFFFFFFF || m.i[1]==0)
/*
* XXX: Numerator 0xFFFFFFFF means that we have infinite
* distance. Indicate that with a negative floating point
@@ -5638,6 +5749,75 @@ TIFFFetchSubjectDistance(TIFF* tif, TIFFDirEntry* dir)
}
}
+static void allocChoppedUpStripArrays(TIFF* tif, uint32 nstrips,
+ uint64 stripbytes, uint32 rowsperstrip)
+{
+ TIFFDirectory *td = &tif->tif_dir;
+ uint64 bytecount;
+ uint64 offset;
+ uint64 last_offset;
+ uint64 last_bytecount;
+ uint32 i;
+ uint64 *newcounts;
+ uint64 *newoffsets;
+
+ offset = TIFFGetStrileOffset(tif, 0);
+ last_offset = TIFFGetStrileOffset(tif, td->td_nstrips-1);
+ last_bytecount = TIFFGetStrileByteCount(tif, td->td_nstrips-1);
+ if( last_offset > TIFF_UINT64_MAX - last_bytecount ||
+ last_offset + last_bytecount < offset )
+ {
+ return;
+ }
+ bytecount = last_offset + last_bytecount - offset;
+
+ newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
+ "for chopped \"StripByteCounts\" array");
+ newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
+ "for chopped \"StripOffsets\" array");
+ if (newcounts == NULL || newoffsets == NULL) {
+ /*
+ * Unable to allocate new strip information, give up and use
+ * the original one strip information.
+ */
+ if (newcounts != NULL)
+ _TIFFfree(newcounts);
+ if (newoffsets != NULL)
+ _TIFFfree(newoffsets);
+ return;
+ }
+
+ /*
+ * Fill the strip information arrays with new bytecounts and offsets
+ * that reflect the broken-up format.
+ */
+ for (i = 0; i < nstrips; i++)
+ {
+ if (stripbytes > bytecount)
+ stripbytes = bytecount;
+ newcounts[i] = stripbytes;
+ newoffsets[i] = stripbytes ? offset : 0;
+ offset += stripbytes;
+ bytecount -= stripbytes;
+ }
+
+ /*
+ * Replace old single strip info with multi-strip info.
+ */
+ td->td_stripsperimage = td->td_nstrips = nstrips;
+ TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
+
+ _TIFFfree(td->td_stripbytecount_p);
+ _TIFFfree(td->td_stripoffset_p);
+ td->td_stripbytecount_p = newcounts;
+ td->td_stripoffset_p = newoffsets;
+#ifdef STRIPBYTECOUNTSORTED_UNUSED
+ td->td_stripbytecountsorted = 1;
+#endif
+ tif->tif_flags |= TIFF_CHOPPEDUPARRAYS;
+}
+
+
/*
* Replace a single strip (tile) of uncompressed data by multiple strips
* (tiles), each approximately STRIP_SIZE_DEFAULT bytes. This is useful for
@@ -5653,19 +5833,16 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
uint32 rowblock;
uint64 rowblockbytes;
uint64 stripbytes;
- uint32 strip;
uint32 nstrips;
uint32 rowsperstrip;
- uint64* newcounts;
- uint64* newoffsets;
- bytecount = td->td_stripbytecount[0];
+ bytecount = TIFFGetStrileByteCount(tif, 0);
/* On a newly created file, just re-opened to be filled, we */
/* don't want strip chop to trigger as it is going to cause issues */
/* later ( StripOffsets and StripByteCounts improperly filled) . */
if( bytecount == 0 && tif->tif_mode != O_RDONLY )
return;
- offset = td->td_stripoffset[0];
+ offset = TIFFGetStrileByteCount(tif, 0);
assert(td->td_planarconfig == PLANARCONFIG_CONTIG);
if ((td->td_photometric == PHOTOMETRIC_YCBCR)&&
(!isUpSampled(tif)))
@@ -5698,98 +5875,513 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
if( nstrips == 0 )
return;
- newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
- "for chopped \"StripByteCounts\" array");
- newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
- "for chopped \"StripOffsets\" array");
- if (newcounts == NULL || newoffsets == NULL) {
- /*
- * Unable to allocate new strip information, give up and use
- * the original one strip information.
- */
- if (newcounts != NULL)
- _TIFFfree(newcounts);
- if (newoffsets != NULL)
- _TIFFfree(newoffsets);
- return;
- }
- /*
- * Fill the strip information arrays with new bytecounts and offsets
- * that reflect the broken-up format.
- */
- for (strip = 0; strip < nstrips; strip++) {
- if (stripbytes > bytecount)
- stripbytes = bytecount;
- newcounts[strip] = stripbytes;
- newoffsets[strip] = stripbytes ? offset : 0;
- offset += stripbytes;
- bytecount -= stripbytes;
- }
- /*
- * Replace old single strip info with multi-strip info.
- */
- td->td_stripsperimage = td->td_nstrips = nstrips;
- TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
-
- _TIFFfree(td->td_stripbytecount);
- _TIFFfree(td->td_stripoffset);
- td->td_stripbytecount = newcounts;
- td->td_stripoffset = newoffsets;
- td->td_stripbytecountsorted = 1;
+ /* If we are going to allocate a lot of memory, make sure that the */
+ /* file is as big as needed */
+ if( tif->tif_mode == O_RDONLY &&
+ nstrips > 1000000 &&
+ (offset >= TIFFGetFileSize(tif) ||
+ stripbytes > (TIFFGetFileSize(tif) - offset) / (nstrips - 1)) )
+ {
+ return;
+ }
+
+ allocChoppedUpStripArrays(tif, nstrips, stripbytes, rowsperstrip);
}
-int _TIFFFillStriles( TIFF *tif )
+
+/*
+ * Replace a file with contiguous strips > 2 GB of uncompressed data by
+ * multiple smaller strips. This is useful for
+ * dealing with large images or for dealing with machines with a limited
+ * amount memory.
+ */
+static void TryChopUpUncompressedBigTiff( TIFF* tif )
{
- return _TIFFFillStrilesInternal( tif, 1 );
+ TIFFDirectory *td = &tif->tif_dir;
+ uint32 rowblock;
+ uint64 rowblockbytes;
+ uint32 i;
+ uint64 stripsize;
+ uint32 rowblocksperstrip;
+ uint32 rowsperstrip;
+ uint64 stripbytes;
+ uint32 nstrips;
+
+ stripsize = TIFFStripSize64(tif);
+
+ assert( tif->tif_dir.td_planarconfig == PLANARCONFIG_CONTIG );
+ assert( tif->tif_dir.td_compression == COMPRESSION_NONE );
+ assert( (tif->tif_flags&(TIFF_STRIPCHOP|TIFF_ISTILED)) == TIFF_STRIPCHOP );
+ assert( stripsize > 0x7FFFFFFFUL );
+
+ /* On a newly created file, just re-opened to be filled, we */
+ /* don't want strip chop to trigger as it is going to cause issues */
+ /* later ( StripOffsets and StripByteCounts improperly filled) . */
+ if( TIFFGetStrileByteCount(tif, 0) == 0 && tif->tif_mode != O_RDONLY )
+ return;
+
+ if ((td->td_photometric == PHOTOMETRIC_YCBCR)&&
+ (!isUpSampled(tif)))
+ rowblock = td->td_ycbcrsubsampling[1];
+ else
+ rowblock = 1;
+ rowblockbytes = TIFFVStripSize64(tif, rowblock);
+ if( rowblockbytes == 0 || rowblockbytes > 0x7FFFFFFFUL )
+ {
+ /* In case of file with gigantic width */
+ return;
+ }
+
+ /* Check that the strips are contiguous and of the expected size */
+ for( i = 0; i < td->td_nstrips; i++ )
+ {
+ if( i == td->td_nstrips - 1 )
+ {
+ if( TIFFGetStrileByteCount(tif, i) < TIFFVStripSize64(
+ tif, td->td_imagelength - i * td->td_rowsperstrip ) )
+ {
+ return;
+ }
+ }
+ else
+ {
+ if( TIFFGetStrileByteCount(tif, i) != stripsize )
+ {
+ return;
+ }
+ if( i > 0 && TIFFGetStrileOffset(tif, i) !=
+ TIFFGetStrileOffset(tif, i-1) + TIFFGetStrileByteCount(tif, i-1) )
+ {
+ return;
+ }
+ }
+ }
+
+ /* Aim for 512 MB strips (that will still be manageable by 32 bit builds */
+ rowblocksperstrip = (uint32) (512 * 1024 * 1024 / rowblockbytes);
+ if( rowblocksperstrip == 0 )
+ rowblocksperstrip = 1;
+ rowsperstrip = rowblocksperstrip * rowblock;
+ stripbytes = rowblocksperstrip * rowblockbytes;
+ assert( stripbytes <= 0x7FFFFFFFUL );
+
+ nstrips = TIFFhowmany_32(td->td_imagelength, rowsperstrip);
+ if( nstrips == 0 )
+ return;
+
+ /* If we are going to allocate a lot of memory, make sure that the */
+ /* file is as big as needed */
+ if( tif->tif_mode == O_RDONLY &&
+ nstrips > 1000000 )
+ {
+ uint64 last_offset = TIFFGetStrileOffset(tif, td->td_nstrips-1);
+ uint64 filesize = TIFFGetFileSize(tif);
+ uint64 last_bytecount = TIFFGetStrileByteCount(tif, td->td_nstrips-1);
+ if( last_offset > filesize ||
+ last_bytecount > filesize - last_offset )
+ {
+ return;
+ }
+ }
+
+ allocChoppedUpStripArrays(tif, nstrips, stripbytes, rowsperstrip);
}
-static int _TIFFFillStrilesInternal( TIFF *tif, int loadStripByteCount )
+
+TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
+static uint64 _TIFFUnsanitizedAddUInt64AndInt(uint64 a, int b)
{
-#if defined(DEFER_STRILE_LOAD)
- register TIFFDirectory *td = &tif->tif_dir;
- int return_value = 1;
+ return a + b;
+}
- if( td->td_stripoffset != NULL )
- return 1;
+/* Read the value of [Strip|Tile]Offset or [Strip|Tile]ByteCount around
+ * strip/tile of number strile. Also fetch the neighbouring values using a
+ * 4096 byte page size.
+ */
+static
+int _TIFFPartialReadStripArray( TIFF* tif, TIFFDirEntry* dirent,
+ int strile, uint64* panVals )
+{
+ static const char module[] = "_TIFFPartialReadStripArray";
+#define IO_CACHE_PAGE_SIZE 4096
+
+ size_t sizeofval;
+ const int bSwab = (tif->tif_flags & TIFF_SWAB) != 0;
+ int sizeofvalint;
+ uint64 nBaseOffset;
+ uint64 nOffset;
+ uint64 nOffsetStartPage;
+ uint64 nOffsetEndPage;
+ tmsize_t nToRead;
+ tmsize_t nRead;
+ uint64 nLastStripOffset;
+ int iStartBefore;
+ int i;
+ const uint32 arraySize = tif->tif_dir.td_stripoffsetbyteallocsize;
+ unsigned char buffer[2 * IO_CACHE_PAGE_SIZE];
+
+ assert( dirent->tdir_count > 4 );
+
+ if( dirent->tdir_type == TIFF_SHORT )
+ {
+ sizeofval = sizeof(uint16);
+ }
+ else if( dirent->tdir_type == TIFF_LONG )
+ {
+ sizeofval = sizeof(uint32);
+ }
+ else if( dirent->tdir_type == TIFF_LONG8 )
+ {
+ sizeofval = sizeof(uint64);
+ }
+ else
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Invalid type for [Strip|Tile][Offset/ByteCount] tag");
+ panVals[strile] = 0;
+ return 0;
+ }
+ sizeofvalint = (int)(sizeofval);
- if( td->td_stripoffset_entry.tdir_count == 0 )
+ if( tif->tif_flags&TIFF_BIGTIFF )
+ {
+ uint64 offset = dirent->tdir_offset.toff_long8;
+ if( bSwab )
+ TIFFSwabLong8(&offset);
+ nBaseOffset = offset;
+ }
+ else
+ {
+ uint32 offset = dirent->tdir_offset.toff_long;
+ if( bSwab )
+ TIFFSwabLong(&offset);
+ nBaseOffset = offset;
+ }
+ /* To avoid later unsigned integer overflows */
+ if( nBaseOffset > (uint64)TIFF_INT64_MAX )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Cannot read offset/size for strile %d", strile);
+ panVals[strile] = 0;
+ return 0;
+ }
+ nOffset = nBaseOffset + sizeofval * strile;
+ nOffsetStartPage =
+ (nOffset / IO_CACHE_PAGE_SIZE) * IO_CACHE_PAGE_SIZE;
+ nOffsetEndPage = nOffsetStartPage + IO_CACHE_PAGE_SIZE;
+
+ if( nOffset + sizeofval > nOffsetEndPage )
+ nOffsetEndPage += IO_CACHE_PAGE_SIZE;
+#undef IO_CACHE_PAGE_SIZE
+
+ nLastStripOffset = nBaseOffset + arraySize * sizeofval;
+ if( nLastStripOffset < nOffsetEndPage )
+ nOffsetEndPage = nLastStripOffset;
+ if( nOffsetStartPage >= nOffsetEndPage )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Cannot read offset/size for strile %d", strile);
+ panVals[strile] = 0;
+ return 0;
+ }
+ if (!SeekOK(tif,nOffsetStartPage))
+ {
+ panVals[strile] = 0;
+ return 0;
+ }
+
+ nToRead = (tmsize_t)(nOffsetEndPage - nOffsetStartPage);
+ nRead = TIFFReadFile(tif, buffer, nToRead);
+ if( nRead < nToRead )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Cannot read offset/size for strile around ~%d", strile);
+ return 0;
+ }
+ iStartBefore = -(int)((nOffset - nOffsetStartPage) / sizeofval);
+ if( strile + iStartBefore < 0 )
+ iStartBefore = -strile;
+ for( i = iStartBefore;
+ (uint32)(strile + i) < arraySize &&
+ _TIFFUnsanitizedAddUInt64AndInt(nOffset, (i + 1) * sizeofvalint) <= nOffsetEndPage;
+ ++i )
+ {
+ if( sizeofval == sizeof(uint16) )
+ {
+ uint16 val;
+ memcpy(&val,
+ buffer + (nOffset - nOffsetStartPage) + i * sizeofvalint,
+ sizeof(val));
+ if( bSwab )
+ TIFFSwabShort(&val);
+ panVals[strile + i] = val;
+ }
+ else if( sizeofval == sizeof(uint32) )
+ {
+ uint32 val;
+ memcpy(&val,
+ buffer + (nOffset - nOffsetStartPage) + i * sizeofvalint,
+ sizeof(val));
+ if( bSwab )
+ TIFFSwabLong(&val);
+ panVals[strile + i] = val;
+ }
+ else
+ {
+ uint64 val;
+ memcpy(&val,
+ buffer + (nOffset - nOffsetStartPage) + i * sizeofvalint,
+ sizeof(val));
+ if( bSwab )
+ TIFFSwabLong8(&val);
+ panVals[strile + i] = val;
+ }
+ }
+ return 1;
+}
+
+static int _TIFFFetchStrileValue(TIFF* tif,
+ uint32 strile,
+ TIFFDirEntry* dirent,
+ uint64** parray)
+{
+ static const char module[] = "_TIFFFetchStrileValue";
+ TIFFDirectory *td = &tif->tif_dir;
+ if( strile >= dirent->tdir_count )
+ {
+ return 0;
+ }
+ if( strile >= td->td_stripoffsetbyteallocsize )
+ {
+ uint32 nStripArrayAllocBefore = td->td_stripoffsetbyteallocsize;
+ uint32 nStripArrayAllocNew;
+ uint64 nArraySize64;
+ size_t nArraySize;
+ uint64* offsetArray;
+ uint64* bytecountArray;
+
+ if( strile > 1000000 )
+ {
+ uint64 filesize = TIFFGetFileSize(tif);
+ /* Avoid excessive memory allocation attempt */
+ /* For such a big blockid we need at least a TIFF_LONG per strile */
+ /* for the offset array. */
+ if( strile > filesize / sizeof(uint32) )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module, "File too short");
return 0;
+ }
+ }
- if (!TIFFFetchStripThing(tif,&(td->td_stripoffset_entry),
- td->td_nstrips,&td->td_stripoffset))
+ if( td->td_stripoffsetbyteallocsize == 0 &&
+ td->td_nstrips < 1024 * 1024 )
+ {
+ nStripArrayAllocNew = td->td_nstrips;
+ }
+ else
+ {
+#define TIFF_MAX(a,b) (((a)>(b)) ? (a) : (b))
+#define TIFF_MIN(a,b) (((a)<(b)) ? (a) : (b))
+ nStripArrayAllocNew = TIFF_MAX(strile + 1, 1024U * 512U );
+ if( nStripArrayAllocNew < 0xFFFFFFFFU / 2 )
+ nStripArrayAllocNew *= 2;
+ nStripArrayAllocNew = TIFF_MIN(nStripArrayAllocNew, td->td_nstrips);
+ }
+ assert( strile < nStripArrayAllocNew );
+ nArraySize64 = (uint64)sizeof(uint64) * nStripArrayAllocNew;
+ nArraySize = (size_t)(nArraySize64);
+#if SIZEOF_SIZE_T == 4
+ if( nArraySize != nArraySize64 )
{
- return_value = 0;
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Cannot allocate strip offset and bytecount arrays");
+ return 0;
}
+#endif
+ offsetArray = (uint64*)(
+ _TIFFrealloc( td->td_stripoffset_p, nArraySize ) );
+ bytecountArray = (uint64*)(
+ _TIFFrealloc( td->td_stripbytecount_p, nArraySize ) );
+ if( offsetArray )
+ td->td_stripoffset_p = offsetArray;
+ if( bytecountArray )
+ td->td_stripbytecount_p = bytecountArray;
+ if( offsetArray && bytecountArray )
+ {
+ td->td_stripoffsetbyteallocsize = nStripArrayAllocNew;
+ /* Initialize new entries to ~0 / -1 */
+ memset(td->td_stripoffset_p + nStripArrayAllocBefore,
+ 0xFF,
+ (td->td_stripoffsetbyteallocsize - nStripArrayAllocBefore) * sizeof(uint64) );
+ memset(td->td_stripbytecount_p + nStripArrayAllocBefore,
+ 0xFF,
+ (td->td_stripoffsetbyteallocsize - nStripArrayAllocBefore) * sizeof(uint64) );
+ }
+ else
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Cannot allocate strip offset and bytecount arrays");
+ _TIFFfree(td->td_stripoffset_p);
+ td->td_stripoffset_p = NULL;
+ _TIFFfree(td->td_stripbytecount_p);
+ td->td_stripbytecount_p = NULL;
+ td->td_stripoffsetbyteallocsize = 0;
+ }
+ }
+ if( *parray == NULL || strile >= td->td_stripoffsetbyteallocsize )
+ return 0;
- if (loadStripByteCount &&
- !TIFFFetchStripThing(tif,&(td->td_stripbytecount_entry),
- td->td_nstrips,&td->td_stripbytecount))
+ if( ~((*parray)[strile]) == 0 )
+ {
+ if( !_TIFFPartialReadStripArray( tif, dirent, strile, *parray ) )
{
- return_value = 0;
+ (*parray)[strile] = 0;
+ return 0;
}
+ }
- _TIFFmemset( &(td->td_stripoffset_entry), 0, sizeof(TIFFDirEntry));
- _TIFFmemset( &(td->td_stripbytecount_entry), 0, sizeof(TIFFDirEntry));
+ return 1;
+}
- if (tif->tif_dir.td_nstrips > 1 && return_value == 1 ) {
- uint32 strip;
+static uint64 _TIFFGetStrileOffsetOrByteCountValue(TIFF *tif, uint32 strile,
+ TIFFDirEntry* dirent,
+ uint64** parray,
+ int *pbErr)
+{
+ TIFFDirectory *td = &tif->tif_dir;
+ if( pbErr )
+ *pbErr = 0;
+ if( (tif->tif_flags&TIFF_DEFERSTRILELOAD) && !(tif->tif_flags&TIFF_CHOPPEDUPARRAYS) )
+ {
+ if( !(tif->tif_flags&TIFF_LAZYSTRILELOAD) ||
+ /* If the values may fit in the toff_long/toff_long8 member */
+ /* then use _TIFFFillStriles to simplify _TIFFFetchStrileValue */
+ dirent->tdir_count <= 4 )
+ {
+ if( !_TIFFFillStriles(tif) )
+ {
+ if( pbErr )
+ *pbErr = 1;
+ /* Do not return, as we want this function to always */
+ /* return the same value if called several times with */
+ /* the same arguments */
+ }
+ }
+ else
+ {
+ if( !_TIFFFetchStrileValue(tif, strile, dirent, parray) )
+ {
+ if( pbErr )
+ *pbErr = 1;
+ return 0;
+ }
+ }
+ }
+ if( *parray == NULL || strile >= td->td_nstrips )
+ {
+ if( pbErr )
+ *pbErr = 1;
+ return 0;
+ }
+ return (*parray)[strile];
+}
- tif->tif_dir.td_stripbytecountsorted = 1;
- for (strip = 1; strip < tif->tif_dir.td_nstrips; strip++) {
- if (tif->tif_dir.td_stripoffset[strip - 1] >
- tif->tif_dir.td_stripoffset[strip]) {
- tif->tif_dir.td_stripbytecountsorted = 0;
- break;
- }
- }
- }
+/* Return the value of the TileOffsets/StripOffsets array for the specified tile/strile */
+uint64 TIFFGetStrileOffset(TIFF *tif, uint32 strile)
+{
+ return TIFFGetStrileOffsetWithErr(tif, strile, NULL);
+}
+
+/* Return the value of the TileOffsets/StripOffsets array for the specified tile/strile */
+uint64 TIFFGetStrileOffsetWithErr(TIFF *tif, uint32 strile, int *pbErr)
+{
+ TIFFDirectory *td = &tif->tif_dir;
+ return _TIFFGetStrileOffsetOrByteCountValue(tif, strile,
+ &(td->td_stripoffset_entry),
+ &(td->td_stripoffset_p), pbErr);
+}
+
+/* Return the value of the TileByteCounts/StripByteCounts array for the specified tile/strile */
+uint64 TIFFGetStrileByteCount(TIFF *tif, uint32 strile)
+{
+ return TIFFGetStrileByteCountWithErr(tif, strile, NULL);
+}
+
+/* Return the value of the TileByteCounts/StripByteCounts array for the specified tile/strile */
+uint64 TIFFGetStrileByteCountWithErr(TIFF *tif, uint32 strile, int *pbErr)
+{
+ TIFFDirectory *td = &tif->tif_dir;
+ return _TIFFGetStrileOffsetOrByteCountValue(tif, strile,
+ &(td->td_stripbytecount_entry),
+ &(td->td_stripbytecount_p), pbErr);
+}
+
+
+int _TIFFFillStriles( TIFF *tif )
+{
+ return _TIFFFillStrilesInternal( tif, 1 );
+}
+
+static int _TIFFFillStrilesInternal( TIFF *tif, int loadStripByteCount )
+{
+ register TIFFDirectory *td = &tif->tif_dir;
+ int return_value = 1;
- return return_value;
-#else /* !defined(DEFER_STRILE_LOAD) */
- (void) tif;
- (void) loadStripByteCount;
+ /* Do not do anything if TIFF_DEFERSTRILELOAD is not set */
+ if( !(tif->tif_flags&TIFF_DEFERSTRILELOAD) || (tif->tif_flags&TIFF_CHOPPEDUPARRAYS) != 0 )
return 1;
-#endif
+
+ if( tif->tif_flags&TIFF_LAZYSTRILELOAD )
+ {
+ /* In case of lazy loading, reload completely the arrays */
+ _TIFFfree(td->td_stripoffset_p);
+ _TIFFfree(td->td_stripbytecount_p);
+ td->td_stripoffset_p = NULL;
+ td->td_stripbytecount_p = NULL;
+ td->td_stripoffsetbyteallocsize = 0;
+ tif->tif_flags &= ~TIFF_LAZYSTRILELOAD;
+ }
+
+ /* If stripoffset array is already loaded, exit with success */
+ if( td->td_stripoffset_p != NULL )
+ return 1;
+
+ /* If tdir_count was cancelled, then we already got there, but in error */
+ if( td->td_stripoffset_entry.tdir_count == 0 )
+ return 0;
+
+ if (!TIFFFetchStripThing(tif,&(td->td_stripoffset_entry),
+ td->td_nstrips,&td->td_stripoffset_p))
+ {
+ return_value = 0;
+ }
+
+ if (loadStripByteCount &&
+ !TIFFFetchStripThing(tif,&(td->td_stripbytecount_entry),
+ td->td_nstrips,&td->td_stripbytecount_p))
+ {
+ return_value = 0;
+ }
+
+ _TIFFmemset( &(td->td_stripoffset_entry), 0, sizeof(TIFFDirEntry));
+ _TIFFmemset( &(td->td_stripbytecount_entry), 0, sizeof(TIFFDirEntry));
+
+#ifdef STRIPBYTECOUNTSORTED_UNUSED
+ if (tif->tif_dir.td_nstrips > 1 && return_value == 1 ) {
+ uint32 strip;
+
+ tif->tif_dir.td_stripbytecountsorted = 1;
+ for (strip = 1; strip < tif->tif_dir.td_nstrips; strip++) {
+ if (tif->tif_dir.td_stripoffset_p[strip - 1] >
+ tif->tif_dir.td_stripoffset_p[strip]) {
+ tif->tif_dir.td_stripbytecountsorted = 0;
+ break;
+ }
+ }
+ }
+#endif
+
+ return return_value;
}
diff --git a/tiff/libtiff/tif_dirwrite.c b/tiff/libtiff/tif_dirwrite.c
index c68d6d21d..9e4d30600 100644
--- a/tiff/libtiff/tif_dirwrite.c
+++ b/tiff/libtiff/tif_dirwrite.c
@@ -1,5 +1,3 @@
-/* $Id: tif_dirwrite.c,v 1.89 2017-08-23 13:33:42 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -30,7 +28,6 @@
* Directory Write Support Routines.
*/
#include "tiffiop.h"
-#include <float.h>
#ifdef HAVE_IEEEFP
#define TIFFCvtNativeToIEEEFloat(tif, n, fp)
@@ -185,6 +182,51 @@ TIFFWriteDirectory(TIFF* tif)
}
/*
+ * This is an advanced writing function that must be used in a particular
+ * sequence, and generally together with TIFFForceStrileArrayWriting(),
+ * to make its intended effect. Its aim is to modify the location
+ * where the [Strip/Tile][Offsets/ByteCounts] arrays are located in the file.
+ * More precisely, when TIFFWriteCheck() will be called, the tag entries for
+ * those arrays will be written with type = count = offset = 0 as a temporary
+ * value.
+ *
+ * Its effect is only valid for the current directory, and before
+ * TIFFWriteDirectory() is first called, and will be reset when
+ * changing directory.
+ *
+ * The typical sequence of calls is:
+ * TIFFOpen()
+ * [ TIFFCreateDirectory(tif) ]
+ * Set fields with calls to TIFFSetField(tif, ...)
+ * TIFFDeferStrileArrayWriting(tif)
+ * TIFFWriteCheck(tif, ...)
+ * TIFFWriteDirectory(tif)
+ * ... potentially create other directories and come back to the above directory
+ * TIFFForceStrileArrayWriting(tif): emit the arrays at the end of file
+ *
+ * Returns 1 in case of success, 0 otherwise.
+ */
+int TIFFDeferStrileArrayWriting(TIFF* tif)
+{
+ static const char module[] = "TIFFDeferStrileArrayWriting";
+ if (tif->tif_mode == O_RDONLY)
+ {
+ TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+ "File opened in read-only mode");
+ return 0;
+ }
+ if( tif->tif_diroff != 0 )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Directory has already been written");
+ return 0;
+ }
+
+ tif->tif_dir.td_deferstrilearraywriting = TRUE;
+ return 1;
+}
+
+/*
* Similar to TIFFWriteDirectory(), writes the directory out
* but leaves all data structures in memory so that it can be
* written again. This will make a partially written TIFF file
@@ -195,7 +237,7 @@ TIFFCheckpointDirectory(TIFF* tif)
{
int rc;
/* Setup the strips arrays, if they haven't already been. */
- if (tif->tif_dir.td_stripoffset == NULL)
+ if (tif->tif_dir.td_stripoffset_p == NULL)
(void) TIFFSetupStrips(tif);
rc = TIFFWriteDirectorySec(tif,TRUE,FALSE,NULL);
(void) TIFFSetWriteOffset(tif, TIFFSeekFile(tif, 0, SEEK_END));
@@ -530,12 +572,12 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
{
if (!isTiled(tif))
{
- if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_STRIPBYTECOUNTS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripbytecount))
+ if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_STRIPBYTECOUNTS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripbytecount_p))
goto bad;
}
else
{
- if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_TILEBYTECOUNTS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripbytecount))
+ if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_TILEBYTECOUNTS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripbytecount_p))
goto bad;
}
}
@@ -543,7 +585,7 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
{
if (!isTiled(tif))
{
- /* td_stripoffset might be NULL in an odd OJPEG case. See
+ /* td_stripoffset_p 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,
@@ -554,13 +596,13 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
* 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))
+ if (tif->tif_dir.td_stripoffset_p != NULL &&
+ !TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_STRIPOFFSETS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripoffset_p))
goto bad;
}
else
{
- if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_TILEOFFSETS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripoffset))
+ if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_TILEOFFSETS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripoffset_p))
goto bad;
}
}
@@ -697,8 +739,11 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
}
break;
default:
- assert(0); /* we should never get here */
- break;
+ TIFFErrorExt(tif->tif_clientdata,module,
+ "Cannot write tag %d (%s)",
+ TIFFFieldTag(o),
+ o->field_name ? o->field_name : "unknown");
+ goto bad;
}
}
}
@@ -945,15 +990,6 @@ bad:
return(0);
}
-static float TIFFClampDoubleToFloat( double val )
-{
- if( val > FLT_MAX )
- return FLT_MAX;
- if( val < -FLT_MAX )
- return -FLT_MAX;
- return (float)val;
-}
-
static int8 TIFFClampDoubleToInt8( double val )
{
if( val > 127 )
@@ -1028,7 +1064,7 @@ TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* di
if (tif->tif_dir.td_bitspersample<=32)
{
for (i = 0; i < count; ++i)
- ((float*)conv)[i] = TIFFClampDoubleToFloat(value[i]);
+ ((float*)conv)[i] = _TIFFClampDoubleToFloat(value[i]);
ok = TIFFWriteDirectoryTagFloatArray(tif,ndir,dir,tag,count,(float*)conv);
}
else
@@ -1660,22 +1696,52 @@ TIFFWriteDirectoryTagShortLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint1
return(TIFFWriteDirectoryTagCheckedLong(tif,ndir,dir,tag,value));
}
+static int _WriteAsType(TIFF* tif, uint64 strile_size, uint64 uncompressed_threshold)
+{
+ const uint16 compression = tif->tif_dir.td_compression;
+ if ( compression == COMPRESSION_NONE )
+ {
+ return strile_size > uncompressed_threshold;
+ }
+ else if ( compression == COMPRESSION_JPEG ||
+ compression == COMPRESSION_LZW ||
+ compression == COMPRESSION_ADOBE_DEFLATE ||
+ compression == COMPRESSION_LZMA ||
+ compression == COMPRESSION_LERC ||
+ compression == COMPRESSION_ZSTD ||
+ compression == COMPRESSION_WEBP )
+ {
+ /* For a few select compression types, we assume that in the worst */
+ /* case the compressed size will be 10 times the uncompressed size */
+ /* This is overly pessismistic ! */
+ return strile_size >= uncompressed_threshold / 10;
+ }
+ return 1;
+}
+
+static int WriteAsLong8(TIFF* tif, uint64 strile_size)
+{
+ return _WriteAsType(tif, strile_size, 0xFFFFFFFFU);
+}
+
+static int WriteAsLong4(TIFF* tif, uint64 strile_size)
+{
+ return _WriteAsType(tif, strile_size, 0xFFFFU);
+}
+
/************************************************************************/
/* TIFFWriteDirectoryTagLongLong8Array() */
/* */
-/* Write out LONG8 array as LONG8 for BigTIFF or LONG for */
-/* Classic TIFF with some checking. */
+/* Write out LONG8 array and write a SHORT/LONG/LONG8 depending */
+/* on strile size and Classic/BigTIFF mode. */
/************************************************************************/
static int
TIFFWriteDirectoryTagLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value)
{
static const char module[] = "TIFFWriteDirectoryTagLongLong8Array";
- uint64* ma;
- uint32 mb;
- uint32* p;
- uint32* q;
int o;
+ int write_aslong4;
/* is this just a counting pass? */
if (dir==NULL)
@@ -1684,37 +1750,105 @@ TIFFWriteDirectoryTagLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir,
return(1);
}
- /* We always write LONG8 for BigTIFF, no checking needed. */
- if( tif->tif_flags&TIFF_BIGTIFF )
- return TIFFWriteDirectoryTagCheckedLong8Array(tif,ndir,dir,
- tag,count,value);
-
- /*
- ** For classic tiff we want to verify everything is in range for LONG
- ** and convert to long format.
- */
+ if( tif->tif_dir.td_deferstrilearraywriting )
+ {
+ return TIFFWriteDirectoryTagData(tif, ndir, dir, tag, TIFF_NOTYPE, 0, 0, NULL);
+ }
- p = _TIFFmalloc(count*sizeof(uint32));
- if (p==NULL)
+ if( tif->tif_flags&TIFF_BIGTIFF )
{
- TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
- return(0);
+ int write_aslong8 = 1;
+ /* In the case of ByteCounts array, we may be able to write them on */
+ /* LONG if the strip/tilesize is not too big. */
+ /* Also do that for count > 1 in the case someone would want to create */
+ /* a single-strip file with a growing height, in which case using */
+ /* LONG8 will be safer. */
+ if( count > 1 && tag == TIFFTAG_STRIPBYTECOUNTS )
+ {
+ write_aslong8 = WriteAsLong8(tif, TIFFStripSize64(tif));
+ }
+ else if( count > 1 && tag == TIFFTAG_TILEBYTECOUNTS )
+ {
+ write_aslong8 = WriteAsLong8(tif, TIFFTileSize64(tif));
+ }
+ if( write_aslong8 )
+ {
+ return TIFFWriteDirectoryTagCheckedLong8Array(tif,ndir,dir,
+ tag,count,value);
+ }
}
- for (q=p, ma=value, mb=0; mb<count; ma++, mb++, q++)
+ write_aslong4 = 1;
+ if( count > 1 && tag == TIFFTAG_STRIPBYTECOUNTS )
{
- if (*ma>0xFFFFFFFF)
+ write_aslong4 = WriteAsLong4(tif, TIFFStripSize64(tif));
+ }
+ else if( count > 1 && tag == TIFFTAG_TILEBYTECOUNTS )
+ {
+ write_aslong4 = WriteAsLong4(tif, TIFFTileSize64(tif));
+ }
+ if( write_aslong4 )
+ {
+ /*
+ ** For classic tiff we want to verify everything is in range for LONG
+ ** and convert to long format.
+ */
+
+ uint32* p = _TIFFmalloc(count*sizeof(uint32));
+ uint32* q;
+ uint64* ma;
+ uint32 mb;
+
+ if (p==NULL)
{
- TIFFErrorExt(tif->tif_clientdata,module,
- "Attempt to write value larger than 0xFFFFFFFF in Classic TIFF file.");
- _TIFFfree(p);
+ TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
return(0);
}
- *q= (uint32)(*ma);
+
+ for (q=p, ma=value, mb=0; mb<count; ma++, mb++, q++)
+ {
+ if (*ma>0xFFFFFFFF)
+ {
+ TIFFErrorExt(tif->tif_clientdata,module,
+ "Attempt to write value larger than 0xFFFFFFFF in LONG array.");
+ _TIFFfree(p);
+ return(0);
+ }
+ *q= (uint32)(*ma);
+ }
+
+ o=TIFFWriteDirectoryTagCheckedLongArray(tif,ndir,dir,tag,count,p);
+ _TIFFfree(p);
}
+ else
+ {
+ uint16* p = _TIFFmalloc(count*sizeof(uint16));
+ uint16* q;
+ uint64* ma;
+ uint32 mb;
- o=TIFFWriteDirectoryTagCheckedLongArray(tif,ndir,dir,tag,count,p);
- _TIFFfree(p);
+ if (p==NULL)
+ {
+ TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
+ return(0);
+ }
+
+ for (q=p, ma=value, mb=0; mb<count; ma++, mb++, q++)
+ {
+ if (*ma>0xFFFF)
+ {
+ /* Should not happen normally given the check we did before */
+ TIFFErrorExt(tif->tif_clientdata,module,
+ "Attempt to write value larger than 0xFFFF in SHORT array.");
+ _TIFFfree(p);
+ return(0);
+ }
+ *q= (uint16)(*ma);
+ }
+
+ o=TIFFWriteDirectoryTagCheckedShortArray(tif,ndir,dir,tag,count,p);
+ _TIFFfree(p);
+ }
return(o);
}
@@ -1892,12 +2026,14 @@ TIFFWriteDirectoryTagTransferfunction(TIFF* tif, uint32* ndir, TIFFDirEntry* dir
n=3;
if (n==3)
{
- if (!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16)))
+ if (tif->tif_dir.td_transferfunction[2] == NULL ||
+ !_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16)))
n=2;
}
if (n==2)
{
- if (!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16)))
+ if (tif->tif_dir.td_transferfunction[1] == NULL ||
+ !_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16)))
n=1;
}
if (n==0)
@@ -2427,7 +2563,12 @@ TIFFWriteDirectoryTagData(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag
dir[m].tdir_count=count;
dir[m].tdir_offset.toff_long8 = 0;
if (datalength<=((tif->tif_flags&TIFF_BIGTIFF)?0x8U:0x4U))
- _TIFFmemcpy(&dir[m].tdir_offset,data,datalength);
+ {
+ if( data && datalength )
+ {
+ _TIFFmemcpy(&dir[m].tdir_offset,data,datalength);
+ }
+ }
else
{
uint64 na,nb;
@@ -2820,12 +2961,59 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
}
/* -------------------------------------------------------------------- */
+/* When a dummy tag was written due to TIFFDeferStrileArrayWriting() */
+/* -------------------------------------------------------------------- */
+ if( entry_offset == 0 && entry_count == 0 && entry_type == 0 )
+ {
+ if( tag == TIFFTAG_TILEOFFSETS || tag == TIFFTAG_STRIPOFFSETS )
+ {
+ entry_type = (tif->tif_flags&TIFF_BIGTIFF) ? TIFF_LONG8 : TIFF_LONG;
+ }
+ else
+ {
+ int write_aslong8 = 1;
+ if( count > 1 && tag == TIFFTAG_STRIPBYTECOUNTS )
+ {
+ write_aslong8 = WriteAsLong8(tif, TIFFStripSize64(tif));
+ }
+ else if( count > 1 && tag == TIFFTAG_TILEBYTECOUNTS )
+ {
+ write_aslong8 = WriteAsLong8(tif, TIFFTileSize64(tif));
+ }
+ if( write_aslong8 )
+ {
+ entry_type = TIFF_LONG8;
+ }
+ else
+ {
+ int write_aslong4 = 1;
+ if( count > 1 && tag == TIFFTAG_STRIPBYTECOUNTS )
+ {
+ write_aslong4 = WriteAsLong4(tif, TIFFStripSize64(tif));
+ }
+ else if( count > 1 && tag == TIFFTAG_TILEBYTECOUNTS )
+ {
+ write_aslong4 = WriteAsLong4(tif, TIFFTileSize64(tif));
+ }
+ if( write_aslong4 )
+ {
+ entry_type = TIFF_LONG;
+ }
+ else
+ {
+ entry_type = TIFF_SHORT;
+ }
+ }
+ }
+ }
+
+/* -------------------------------------------------------------------- */
/* What data type do we want to write this as? */
/* -------------------------------------------------------------------- */
if( TIFFDataWidth(in_datatype) == 8 && !(tif->tif_flags&TIFF_BIGTIFF) )
{
if( in_datatype == TIFF_LONG8 )
- datatype = TIFF_LONG;
+ datatype = entry_type == TIFF_SHORT ? TIFF_SHORT : TIFF_LONG;
else if( in_datatype == TIFF_SLONG8 )
datatype = TIFF_SLONG;
else if( in_datatype == TIFF_IFD8 )
@@ -2833,8 +3021,21 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
else
datatype = in_datatype;
}
- else
- datatype = in_datatype;
+ else
+ {
+ if( in_datatype == TIFF_LONG8 &&
+ (entry_type == TIFF_SHORT || entry_type == TIFF_LONG ||
+ entry_type == TIFF_LONG8 ) )
+ datatype = entry_type;
+ else if( in_datatype == TIFF_SLONG8 &&
+ (entry_type == TIFF_SLONG || entry_type == TIFF_SLONG8 ) )
+ datatype = entry_type;
+ else if( in_datatype == TIFF_IFD8 &&
+ (entry_type == TIFF_IFD || entry_type == TIFF_IFD8 ) )
+ datatype = entry_type;
+ else
+ datatype = in_datatype;
+ }
/* -------------------------------------------------------------------- */
/* Prepare buffer of actual data to write. This includes */
@@ -2883,6 +3084,29 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
}
}
}
+ else if( datatype == TIFF_SHORT && in_datatype == TIFF_LONG8 )
+ {
+ tmsize_t i;
+
+ for( i = 0; i < count; i++ )
+ {
+ ((uint16 *) buf_to_write)[i] =
+ (uint16) ((uint64 *) data)[i];
+ if( (uint64) ((uint16 *) buf_to_write)[i] != ((uint64 *) data)[i] )
+ {
+ _TIFFfree( buf_to_write );
+ TIFFErrorExt( tif->tif_clientdata, module,
+ "Value exceeds 16bit range of output type." );
+ return 0;
+ }
+ }
+ }
+ else
+ {
+ TIFFErrorExt( tif->tif_clientdata, module,
+ "Unhandled type conversion." );
+ return 0;
+ }
if( TIFFDataWidth(datatype) > 1 && (tif->tif_flags&TIFF_SWAB) )
{
@@ -2914,6 +3138,23 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
}
}
+ if( (tag == TIFFTAG_TILEOFFSETS || tag == TIFFTAG_STRIPOFFSETS) &&
+ tif->tif_dir.td_stripoffset_entry.tdir_count == 0 &&
+ tif->tif_dir.td_stripoffset_entry.tdir_type == 0 &&
+ tif->tif_dir.td_stripoffset_entry.tdir_offset.toff_long8 == 0 )
+ {
+ tif->tif_dir.td_stripoffset_entry.tdir_type = datatype;
+ tif->tif_dir.td_stripoffset_entry.tdir_count = count;
+ }
+ else if( (tag == TIFFTAG_TILEBYTECOUNTS || tag == TIFFTAG_STRIPBYTECOUNTS) &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_count == 0 &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_type == 0 &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_offset.toff_long8 == 0 )
+ {
+ tif->tif_dir.td_stripbytecount_entry.tdir_type = datatype;
+ tif->tif_dir.td_stripbytecount_entry.tdir_count = count;
+ }
+
/* -------------------------------------------------------------------- */
/* If the tag type, and count match, then we just write it out */
/* over the old values without altering the directory entry at */
@@ -2965,6 +3206,7 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
/* Adjust the directory entry. */
/* -------------------------------------------------------------------- */
entry_type = datatype;
+ entry_count = (uint64)count;
memcpy( direntry_raw + 2, &entry_type, sizeof(uint16) );
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort( (uint16 *) (direntry_raw + 2) );
diff --git a/tiff/libtiff/tif_dumpmode.c b/tiff/libtiff/tif_dumpmode.c
index a6a94c04d..4a0b07f50 100644
--- a/tiff/libtiff/tif_dumpmode.c
+++ b/tiff/libtiff/tif_dumpmode.c
@@ -1,5 +1,3 @@
-/* $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
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_error.c b/tiff/libtiff/tif_error.c
index 47516b4f5..651168f7d 100644
--- a/tiff/libtiff/tif_error.c
+++ b/tiff/libtiff/tif_error.c
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_error.c,v 1.6 2017-07-04 12:54:42 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_extension.c b/tiff/libtiff/tif_extension.c
index 39fab4c7b..87d3cfcbc 100644
--- a/tiff/libtiff/tif_extension.c
+++ b/tiff/libtiff/tif_extension.c
@@ -1,5 +1,3 @@
-/* $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
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_fax3.c b/tiff/libtiff/tif_fax3.c
index 5fd514118..d11c96844 100644
--- a/tiff/libtiff/tif_fax3.c
+++ b/tiff/libtiff/tif_fax3.c
@@ -1,5 +1,3 @@
-/* $Id: tif_fax3.c,v 1.81 2017-06-18 10:31:50 erouault Exp $ */
-
/*
* Copyright (c) 1990-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_fax3.h b/tiff/libtiff/tif_fax3.h
index 8a435059c..abadcd97a 100644
--- a/tiff/libtiff/tif_fax3.h
+++ b/tiff/libtiff/tif_fax3.h
@@ -1,5 +1,3 @@
-/* $Id: tif_fax3.h,v 1.13 2016-12-14 18:36:27 faxguy Exp $ */
-
/*
* Copyright (c) 1990-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_flush.c b/tiff/libtiff/tif_flush.c
index fd14e4cda..f7fa2072a 100644
--- a/tiff/libtiff/tif_flush.c
+++ b/tiff/libtiff/tif_flush.c
@@ -1,5 +1,3 @@
-/* $Id: tif_flush.c,v 1.9 2010-03-31 06:40:10 fwarmerdam Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -47,36 +45,8 @@ TIFFFlush(TIFF* tif)
&& !(tif->tif_flags & TIFF_DIRTYDIRECT)
&& tif->tif_mode == O_RDWR )
{
- uint64 *offsets=NULL, *sizes=NULL;
-
- if( TIFFIsTiled(tif) )
- {
- if( TIFFGetField( tif, TIFFTAG_TILEOFFSETS, &offsets )
- && TIFFGetField( tif, TIFFTAG_TILEBYTECOUNTS, &sizes )
- && _TIFFRewriteField( tif, TIFFTAG_TILEOFFSETS, TIFF_LONG8,
- tif->tif_dir.td_nstrips, offsets )
- && _TIFFRewriteField( tif, TIFFTAG_TILEBYTECOUNTS, TIFF_LONG8,
- tif->tif_dir.td_nstrips, sizes ) )
- {
- tif->tif_flags &= ~TIFF_DIRTYSTRIP;
- tif->tif_flags &= ~TIFF_BEENWRITING;
- return 1;
- }
- }
- else
- {
- if( TIFFGetField( tif, TIFFTAG_STRIPOFFSETS, &offsets )
- && TIFFGetField( tif, TIFFTAG_STRIPBYTECOUNTS, &sizes )
- && _TIFFRewriteField( tif, TIFFTAG_STRIPOFFSETS, TIFF_LONG8,
- tif->tif_dir.td_nstrips, offsets )
- && _TIFFRewriteField( tif, TIFFTAG_STRIPBYTECOUNTS, TIFF_LONG8,
- tif->tif_dir.td_nstrips, sizes ) )
- {
- tif->tif_flags &= ~TIFF_DIRTYSTRIP;
- tif->tif_flags &= ~TIFF_BEENWRITING;
- return 1;
- }
- }
+ if( TIFFForceStrileArrayWriting(tif) )
+ return 1;
}
if ((tif->tif_flags & (TIFF_DIRTYDIRECT|TIFF_DIRTYSTRIP))
@@ -87,6 +57,92 @@ TIFFFlush(TIFF* tif)
}
/*
+ * This is an advanced writing function that must be used in a particular
+ * sequence, and together with TIFFDeferStrileArrayWriting(),
+ * to make its intended effect. Its aim is to force the writing of
+ * the [Strip/Tile][Offsets/ByteCounts] arrays at the end of the file, when
+ * they have not yet been rewritten.
+ *
+ * The typical sequence of calls is:
+ * TIFFOpen()
+ * [ TIFFCreateDirectory(tif) ]
+ * Set fields with calls to TIFFSetField(tif, ...)
+ * TIFFDeferStrileArrayWriting(tif)
+ * TIFFWriteCheck(tif, ...)
+ * TIFFWriteDirectory(tif)
+ * ... potentially create other directories and come back to the above directory
+ * TIFFForceStrileArrayWriting(tif)
+ *
+ * Returns 1 in case of success, 0 otherwise.
+ */
+int TIFFForceStrileArrayWriting(TIFF* tif)
+{
+ static const char module[] = "TIFFForceStrileArrayWriting";
+ const int isTiled = TIFFIsTiled(tif);
+
+ if (tif->tif_mode == O_RDONLY)
+ {
+ TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+ "File opened in read-only mode");
+ return 0;
+ }
+ if( tif->tif_diroff == 0 )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Directory has not yet been written");
+ return 0;
+ }
+ if( (tif->tif_flags & TIFF_DIRTYDIRECT) != 0 )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Directory has changes other than the strile arrays. "
+ "TIFFRewriteDirectory() should be called instead");
+ return 0;
+ }
+
+ if( !(tif->tif_flags & TIFF_DIRTYSTRIP) )
+ {
+ if( !(tif->tif_dir.td_stripoffset_entry.tdir_tag != 0 &&
+ tif->tif_dir.td_stripoffset_entry.tdir_count == 0 &&
+ tif->tif_dir.td_stripoffset_entry.tdir_type == 0 &&
+ tif->tif_dir.td_stripoffset_entry.tdir_offset.toff_long8 == 0 &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_tag != 0 &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_count == 0 &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_type == 0 &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_offset.toff_long8 == 0) )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Function not called together with "
+ "TIFFDeferStrileArrayWriting()");
+ return 0;
+ }
+
+ if (tif->tif_dir.td_stripoffset_p == NULL && !TIFFSetupStrips(tif))
+ return 0;
+ }
+
+ if( _TIFFRewriteField( tif,
+ isTiled ? TIFFTAG_TILEOFFSETS :
+ TIFFTAG_STRIPOFFSETS,
+ TIFF_LONG8,
+ tif->tif_dir.td_nstrips,
+ tif->tif_dir.td_stripoffset_p )
+ && _TIFFRewriteField( tif,
+ isTiled ? TIFFTAG_TILEBYTECOUNTS :
+ TIFFTAG_STRIPBYTECOUNTS,
+ TIFF_LONG8,
+ tif->tif_dir.td_nstrips,
+ tif->tif_dir.td_stripbytecount_p ) )
+ {
+ tif->tif_flags &= ~TIFF_DIRTYSTRIP;
+ tif->tif_flags &= ~TIFF_BEENWRITING;
+ return 1;
+ }
+
+ return 0;
+}
+
+/*
* Flush buffered data to the file.
*
* Frank Warmerdam'2000: I modified this to return 1 if TIFF_BEENWRITING
diff --git a/tiff/libtiff/tif_getimage.c b/tiff/libtiff/tif_getimage.c
index fc554ccab..4da785d3a 100644
--- a/tiff/libtiff/tif_getimage.c
+++ b/tiff/libtiff/tif_getimage.c
@@ -1,5 +1,3 @@
-/* $Id: tif_getimage.c,v 1.114 2017-11-17 20:21:00 erouault Exp $ */
-
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -757,9 +755,8 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
uint32 leftmost_tw;
tilesize = TIFFTileSize(tif);
- bufsize = TIFFSafeMultiply(tmsize_t,alpha?4:3,tilesize);
+ bufsize = _TIFFMultiplySSize(tif, alpha?4:3,tilesize, "gtTileSeparate");
if (bufsize == 0) {
- TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Integer overflow in %s", "gtTileSeparate");
return (0);
}
@@ -952,16 +949,23 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
fromskew = (w < imagewidth ? imagewidth - w : 0);
for (row = 0; row < h; row += nrow)
{
+ uint32 temp;
rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip;
nrow = (row + rowstoread > h ? h - row : rowstoread);
nrowsub = nrow;
if ((nrowsub%subsamplingver)!=0)
nrowsub+=subsamplingver-nrowsub%subsamplingver;
+ temp = (row + img->row_offset)%rowsperstrip + nrowsub;
+ if( scanline > 0 && temp > (size_t)(TIFF_TMSIZE_T_MAX / scanline) )
+ {
+ TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Integer overflow in gtStripContig");
+ return 0;
+ }
if (_TIFFReadEncodedStripAndAllocBuffer(tif,
TIFFComputeStrip(tif,row+img->row_offset, 0),
(void**)(&buf),
maxstripsize,
- ((row + img->row_offset)%rowsperstrip + nrowsub) * scanline)==(tmsize_t)(-1)
+ temp * scanline)==(tmsize_t)(-1)
&& (buf == NULL || img->stoponerr))
{
ret = 0;
@@ -1021,9 +1025,8 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
uint16 colorchannels;
stripsize = TIFFStripSize(tif);
- bufsize = TIFFSafeMultiply(tmsize_t,alpha?4:3,stripsize);
+ bufsize = _TIFFMultiplySSize(tif,alpha?4:3,stripsize, "gtStripSeparate");
if (bufsize == 0) {
- TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Integer overflow in %s", "gtStripSeparate");
return (0);
}
@@ -1055,15 +1058,22 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
fromskew = (w < imagewidth ? imagewidth - w : 0);
for (row = 0; row < h; row += nrow)
{
+ uint32 temp;
rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip;
nrow = (row + rowstoread > h ? h - row : rowstoread);
offset_row = row + img->row_offset;
+ temp = (row + img->row_offset)%rowsperstrip + nrow;
+ if( scanline > 0 && temp > (size_t)(TIFF_TMSIZE_T_MAX / scanline) )
+ {
+ TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Integer overflow in gtStripSeparate");
+ return 0;
+ }
if( buf == NULL )
{
if (_TIFFReadEncodedStripAndAllocBuffer(
tif, TIFFComputeStrip(tif, offset_row, 0),
(void**) &buf, bufsize,
- ((row + img->row_offset)%rowsperstrip + nrow) * scanline)==(tmsize_t)(-1)
+ temp * scanline)==(tmsize_t)(-1)
&& (buf == NULL || img->stoponerr))
{
ret = 0;
@@ -1083,7 +1093,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
}
}
else if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 0),
- p0, ((row + img->row_offset)%rowsperstrip + nrow) * scanline)==(tmsize_t)(-1)
+ p0, temp * scanline)==(tmsize_t)(-1)
&& img->stoponerr)
{
ret = 0;
@@ -1091,7 +1101,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
}
if (colorchannels > 1
&& TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 1),
- p1, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) == (tmsize_t)(-1)
+ p1, temp * scanline) == (tmsize_t)(-1)
&& img->stoponerr)
{
ret = 0;
@@ -1099,7 +1109,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
}
if (colorchannels > 1
&& TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 2),
- p2, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) == (tmsize_t)(-1)
+ p2, temp * scanline) == (tmsize_t)(-1)
&& img->stoponerr)
{
ret = 0;
@@ -1108,7 +1118,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
if (alpha)
{
if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, colorchannels),
- pa, ((row + img->row_offset)%rowsperstrip + nrow) * scanline)==(tmsize_t)(-1)
+ pa, temp * scanline)==(tmsize_t)(-1)
&& img->stoponerr)
{
ret = 0;
@@ -2959,7 +2969,7 @@ TIFFReadRGBATileExt(TIFF* tif, uint32 col, uint32 row, uint32 * raster, int stop
if( !TIFFIsTiled( tif ) )
{
TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif),
- "Can't use TIFFReadRGBATile() with stripped file.");
+ "Can't use TIFFReadRGBATile() with striped file.");
return (0);
}
diff --git a/tiff/libtiff/tif_jbig.c b/tiff/libtiff/tif_jbig.c
index 7a14dd9ab..7ffe8851e 100644
--- a/tiff/libtiff/tif_jbig.c
+++ b/tiff/libtiff/tif_jbig.c
@@ -1,5 +1,3 @@
-/* $Id: tif_jbig.c,v 1.16 2017-06-26 15:20:00 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -53,17 +51,18 @@ static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s)
struct jbg_dec_state decoder;
int decodeStatus = 0;
unsigned char* pImage = NULL;
- (void) size, (void) s;
+ unsigned long decodedSize;
+ (void) s;
if (isFillOrder(tif, tif->tif_dir.td_fillorder))
{
- TIFFReverseBits(tif->tif_rawdata, tif->tif_rawdatasize);
+ TIFFReverseBits(tif->tif_rawcp, tif->tif_rawcc);
}
jbg_dec_init(&decoder);
#if defined(HAVE_JBG_NEWLEN)
- jbg_newlen(tif->tif_rawdata, (size_t)tif->tif_rawdatasize);
+ jbg_newlen(tif->tif_rawcp, (size_t)tif->tif_rawcc);
/*
* I do not check the return status of jbg_newlen because even if this
* function fails it does not necessarily mean that decoding the image
@@ -76,8 +75,8 @@ static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s)
*/
#endif /* HAVE_JBG_NEWLEN */
- decodeStatus = jbg_dec_in(&decoder, (unsigned char*)tif->tif_rawdata,
- (size_t)tif->tif_rawdatasize, NULL);
+ decodeStatus = jbg_dec_in(&decoder, (unsigned char*)tif->tif_rawcp,
+ (size_t)tif->tif_rawcc, NULL);
if (JBG_EOK != decodeStatus)
{
/*
@@ -98,9 +97,28 @@ static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s)
return 0;
}
+ decodedSize = jbg_dec_getsize(&decoder);
+ if( (tmsize_t)decodedSize < size )
+ {
+ TIFFWarningExt(tif->tif_clientdata, "JBIG",
+ "Only decoded %lu bytes, whereas %lu requested",
+ decodedSize, (unsigned long)size);
+ }
+ else if( (tmsize_t)decodedSize > size )
+ {
+ TIFFErrorExt(tif->tif_clientdata, "JBIG",
+ "Decoded %lu bytes, whereas %lu were requested",
+ decodedSize, (unsigned long)size);
+ jbg_dec_free(&decoder);
+ return 0;
+ }
pImage = jbg_dec_getimage(&decoder, 0);
- _TIFFmemcpy(buffer, pImage, jbg_dec_getsize(&decoder));
+ _TIFFmemcpy(buffer, pImage, decodedSize);
jbg_dec_free(&decoder);
+
+ tif->tif_rawcp += tif->tif_rawcc;
+ tif->tif_rawcc = 0;
+
return 1;
}
diff --git a/tiff/libtiff/tif_jpeg.c b/tiff/libtiff/tif_jpeg.c
index 0fbdb3548..93ae2ead1 100644
--- a/tiff/libtiff/tif_jpeg.c
+++ b/tiff/libtiff/tif_jpeg.c
@@ -1,5 +1,3 @@
-/* $Id: tif_jpeg.c,v 1.134 2017-10-17 19:04:47 erouault Exp $ */
-
/*
* Copyright (c) 1994-1997 Sam Leffler
* Copyright (c) 1994-1997 Silicon Graphics, Inc.
@@ -27,9 +25,9 @@
#define WIN32_LEAN_AND_MEAN
#define VC_EXTRALEAN
+#include "tiffiop.h"
#include <stdlib.h>
-#include "tiffiop.h"
#ifdef JPEG_SUPPORT
/*
@@ -76,7 +74,7 @@ int TIFFJPEGIsFullStripRequired_12(TIFF* tif);
"JPEGLib: JPEG parameter struct mismatch: library thinks size is 432,
caller expects 464"
- For such users we wil fix the problem here. See install.doc file from
+ For such users we will fix the problem here. See install.doc file from
the JPEG library distribution for details.
*/
@@ -782,12 +780,9 @@ JPEGFixupTagsSubsampling(TIFF* tif)
*/
static const char module[] = "JPEGFixupTagsSubsampling";
struct JPEGFixupTagsSubsamplingData m;
+ uint64 fileoffset = TIFFGetStrileOffset(tif, 0);
- _TIFFFillStriles( tif );
-
- if( tif->tif_dir.td_stripbytecount == NULL
- || tif->tif_dir.td_stripoffset == NULL
- || tif->tif_dir.td_stripbytecount[0] == 0 )
+ if( fileoffset == 0 )
{
/* Do not even try to check if the first strip/tile does not
yet exist, as occurs when GDAL has created a new NULL file
@@ -806,9 +801,9 @@ JPEGFixupTagsSubsampling(TIFF* tif)
}
m.buffercurrentbyte=NULL;
m.bufferbytesleft=0;
- m.fileoffset=tif->tif_dir.td_stripoffset[0];
+ m.fileoffset=fileoffset;
m.filepositioned=0;
- m.filebytesleft=tif->tif_dir.td_stripbytecount[0];
+ m.filebytesleft=TIFFGetStrileByteCount(tif, 0);
if (!JPEGFixupTagsSubsamplingSec(&m))
TIFFWarningExt(tif->tif_clientdata,module,
"Unable to auto-correct subsampling values, likely corrupt JPEG compressed data in first strip/tile; auto-correcting skipped");
@@ -1568,7 +1563,7 @@ JPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
JSAMPLE *outptr = (JSAMPLE*)tmpbuf + clumpoffset;
#else
JSAMPLE *outptr = (JSAMPLE*)buf + clumpoffset;
- if (cc < (tmsize_t) (clumpoffset + samples_per_clump*(clumps_per_line-1) + hsamp)) {
+ if (cc < (tmsize_t)(clumpoffset + (tmsize_t)samples_per_clump*(clumps_per_line-1) + hsamp)) {
TIFFErrorExt(tif->tif_clientdata, "JPEGDecodeRaw",
"application buffer not large enough for all data, possible subsampling issue");
return 0;
@@ -2128,8 +2123,8 @@ JPEGEncodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
/* data is expected to be supplied in multiples of a clumpline */
/* a clumpline is equivalent to v_sampling desubsampled scanlines */
/* TODO: the following calculation of bytesperclumpline, should substitute calculation of sp->bytesperline, except that it is per v_sampling lines */
- bytesperclumpline = (((sp->cinfo.c.image_width+sp->h_sampling-1)/sp->h_sampling)
- *(sp->h_sampling*sp->v_sampling+2)*sp->cinfo.c.data_precision+7)
+ bytesperclumpline = ((((tmsize_t)sp->cinfo.c.image_width+sp->h_sampling-1)/sp->h_sampling)
+ *((tmsize_t)sp->h_sampling*sp->v_sampling+2)*sp->cinfo.c.data_precision+7)
/8;
nrows = ( cc / bytesperclumpline ) * sp->v_sampling;
diff --git a/tiff/libtiff/tif_luv.c b/tiff/libtiff/tif_luv.c
index 4b25244bf..6fe485884 100644
--- a/tiff/libtiff/tif_luv.c
+++ b/tiff/libtiff/tif_luv.c
@@ -1,5 +1,3 @@
-/* $Id: tif_luv.c,v 1.49 2017-07-24 12:47:30 erouault Exp $ */
-
/*
* Copyright (c) 1997 Greg Ward Larson
* Copyright (c) 1997 Silicon Graphics, Inc.
@@ -215,7 +213,7 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
bp = (unsigned char*) tif->tif_rawcp;
cc = tif->tif_rawcc;
/* get each byte string */
- for (shft = 2*8; (shft -= 8) >= 0; ) {
+ for (shft = 8; shft >= 0; shft -=8) {
for (i = 0; i < npixels && cc > 0; ) {
if (*bp >= 128) { /* run */
if( cc < 2 )
@@ -349,7 +347,7 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
bp = (unsigned char*) tif->tif_rawcp;
cc = tif->tif_rawcc;
/* get each byte string */
- for (shft = 4*8; (shft -= 8) >= 0; ) {
+ for (shft = 24; shft >= 0; shft -=8) {
for (i = 0; i < npixels && cc > 0; ) {
if (*bp >= 128) { /* run */
if( cc < 2 )
@@ -467,7 +465,7 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
/* compress each byte string */
op = tif->tif_rawcp;
occ = tif->tif_rawdatasize - tif->tif_rawcc;
- for (shft = 2*8; (shft -= 8) >= 0; )
+ for (shft = 8; shft >= 0; shft -=8) {
for (i = 0; i < npixels; i += rc) {
if (occ < 4) {
tif->tif_rawcp = op;
@@ -522,6 +520,7 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
} else
rc = 0;
}
+ }
tif->tif_rawcp = op;
tif->tif_rawcc = tif->tif_rawdatasize - occ;
@@ -618,7 +617,7 @@ LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
/* compress each byte string */
op = tif->tif_rawcp;
occ = tif->tif_rawdatasize - tif->tif_rawcc;
- for (shft = 4*8; (shft -= 8) >= 0; )
+ for (shft = 24; shft >= 0; shft -=8) {
for (i = 0; i < npixels; i += rc) {
if (occ < 4) {
tif->tif_rawcp = op;
@@ -673,6 +672,7 @@ LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
} else
rc = 0;
}
+ }
tif->tif_rawcp = op;
tif->tif_rawcc = tif->tif_rawdatasize - occ;
@@ -742,9 +742,14 @@ LogLuvEncodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
#undef exp2 /* Conflict with C'99 function */
#define exp2(x) exp(M_LN2*(x))
-#define itrunc(x,m) ((m)==SGILOGENCODE_NODITHER ? \
- (int)(x) : \
- (int)((x) + rand()*(1./RAND_MAX) - .5))
+static int itrunc(double x, int m)
+{
+ if( m == SGILOGENCODE_NODITHER )
+ return (int)x;
+ /* Silence CoverityScan warning about bad crypto function */
+ /* coverity[dont_call] */
+ return (int)(x + rand()*(1./RAND_MAX) - .5);
+}
#if !LOGLUV_PUBLIC
static
@@ -1264,16 +1269,10 @@ LogL16GuessDataFmt(TIFFDirectory *td)
return (SGILOGDATAFMT_UNKNOWN);
}
-
-#define TIFF_SIZE_T_MAX ((size_t) ~ ((size_t)0))
-#define TIFF_TMSIZE_T_MAX (tmsize_t)(TIFF_SIZE_T_MAX >> 1)
-
static tmsize_t
multiply_ms(tmsize_t m1, tmsize_t m2)
{
- if( m1 == 0 || m2 > TIFF_TMSIZE_T_MAX / m1 )
- return 0;
- return m1 * m2;
+ return _TIFFMultiplySSize(NULL, m1, m2, NULL);
}
static int
@@ -1507,7 +1506,7 @@ LogLuvSetupEncode(TIFF* tif)
switch (td->td_photometric) {
case PHOTOMETRIC_LOGLUV:
if (!LogLuvInitState(tif))
- break;
+ return (0);
if (td->td_compression == COMPRESSION_SGILOG24) {
tif->tif_encoderow = LogLuvEncode24;
switch (sp->user_datafmt) {
@@ -1540,7 +1539,7 @@ LogLuvSetupEncode(TIFF* tif)
break;
case PHOTOMETRIC_LOGL:
if (!LogL16InitState(tif))
- break;
+ return (0);
tif->tif_encoderow = LogL16Encode;
switch (sp->user_datafmt) {
case SGILOGDATAFMT_FLOAT:
@@ -1556,7 +1555,7 @@ LogLuvSetupEncode(TIFF* tif)
TIFFErrorExt(tif->tif_clientdata, module,
"Inappropriate photometric interpretation %d for SGILog compression; %s",
td->td_photometric, "must be either LogLUV or LogL");
- break;
+ return (0);
}
sp->encoder_state = 1;
return (1);
diff --git a/tiff/libtiff/tif_lzma.c b/tiff/libtiff/tif_lzma.c
index 80fc39424..3f6096b62 100644
--- a/tiff/libtiff/tif_lzma.c
+++ b/tiff/libtiff/tif_lzma.c
@@ -1,5 +1,3 @@
-/* $Id: tif_lzma.c,v 1.6 2016-09-17 09:18:59 erouault Exp $ */
-
/*
* Copyright (c) 2010, Andrey Kiselev <dron@ak4719.spb.edu>
*
@@ -249,6 +247,7 @@ LZMAPreEncode(TIFF* tif, uint16 s)
{
static const char module[] = "LZMAPreEncode";
LZMAState *sp = EncoderState(tif);
+ lzma_ret ret;
(void) s;
assert(sp != NULL);
@@ -262,7 +261,13 @@ LZMAPreEncode(TIFF* tif, uint16 s)
"Liblzma cannot deal with buffers this size");
return 0;
}
- return (lzma_stream_encoder(&sp->stream, sp->filters, sp->check) == LZMA_OK);
+ ret = lzma_stream_encoder(&sp->stream, sp->filters, sp->check);
+ if (ret != LZMA_OK) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Error in lzma_stream_encoder(): %s", LZMAStrerror(ret));
+ return 0;
+ }
+ return 1;
}
/*
diff --git a/tiff/libtiff/tif_lzw.c b/tiff/libtiff/tif_lzw.c
index bc8f9c84a..21064f29a 100644
--- a/tiff/libtiff/tif_lzw.c
+++ b/tiff/libtiff/tif_lzw.c
@@ -1,5 +1,3 @@
-/* $Id: tif_lzw.c,v 1.57 2017-07-11 10:54:29 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -135,6 +133,7 @@ typedef struct {
long dec_restart; /* restart count */
#ifdef LZW_CHECKEOS
uint64 dec_bitsleft; /* available bits in raw data */
+ tmsize_t old_tif_rawcc; /* value of tif_rawcc at the end of the previous TIFLZWDecode() call */
#endif
decodeFunc dec_decode; /* regular or backwards compatible */
code_t* dec_codep; /* current recognized code */
@@ -248,6 +247,8 @@ LZWSetupDecode(TIFF* tif)
/*
* Zero-out the unused entries
*/
+ /* Silence false positive */
+ /* coverity[overrun-buffer-arg] */
_TIFFmemset(&sp->dec_codetab[CODE_CLEAR], 0,
(CODE_FIRST - CODE_CLEAR) * sizeof (code_t));
}
@@ -320,6 +321,7 @@ LZWPreDecode(TIFF* tif, uint16 s)
sp->dec_nbitsmask = MAXCODE(BITS_MIN);
#ifdef LZW_CHECKEOS
sp->dec_bitsleft = 0;
+ sp->old_tif_rawcc = 0;
#endif
sp->dec_free_entp = sp->dec_codetab + CODE_FIRST;
/*
@@ -427,7 +429,7 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
bp = (unsigned char *)tif->tif_rawcp;
#ifdef LZW_CHECKEOS
- sp->dec_bitsleft = (((uint64)tif->tif_rawcc) << 3);
+ sp->dec_bitsleft += (((uint64)tif->tif_rawcc - sp->old_tif_rawcc) << 3);
#endif
nbits = sp->lzw_nbits;
nextdata = sp->lzw_nextdata;
@@ -555,6 +557,9 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
tif->tif_rawcc -= (tmsize_t)( (uint8*) bp - tif->tif_rawcp );
tif->tif_rawcp = (uint8*) bp;
+#ifdef LZW_CHECKEOS
+ sp->old_tif_rawcc = tif->tif_rawcc;
+#endif
sp->lzw_nbits = (unsigned short) nbits;
sp->lzw_nextdata = nextdata;
sp->lzw_nextbits = nextbits;
@@ -604,6 +609,7 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
char *tp;
unsigned char *bp;
int code, nbits;
+ int len;
long nextbits, nextdata, nbitsmask;
code_t *codep, *free_entp, *maxcodep, *oldcodep;
@@ -657,7 +663,7 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
bp = (unsigned char *)tif->tif_rawcp;
#ifdef LZW_CHECKEOS
- sp->dec_bitsleft = (((uint64)tif->tif_rawcc) << 3);
+ sp->dec_bitsleft += (((uint64)tif->tif_rawcc - sp->old_tif_rawcc) << 3);
#endif
nbits = sp->lzw_nbits;
nextdata = sp->lzw_nextdata;
@@ -755,13 +761,18 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
} while (--occ);
break;
}
- assert(occ >= codep->length);
- op += codep->length;
- occ -= codep->length;
- tp = op;
+ len = codep->length;
+ tp = op + len;
do {
- *--tp = codep->value;
- } while( (codep = codep->next) != NULL );
+ int t;
+ --tp;
+ t = codep->value;
+ codep = codep->next;
+ *tp = (char)t;
+ } while (codep && tp > op);
+ assert(occ >= len);
+ op += len;
+ occ -= len;
} else {
*op++ = (char)code;
occ--;
@@ -770,6 +781,9 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
tif->tif_rawcc -= (tmsize_t)( (uint8*) bp - tif->tif_rawcp );
tif->tif_rawcp = (uint8*) bp;
+#ifdef LZW_CHECKEOS
+ sp->old_tif_rawcc = tif->tif_rawcc;
+#endif
sp->lzw_nbits = (unsigned short)nbits;
sp->lzw_nextdata = nextdata;
sp->lzw_nextbits = nextbits;
diff --git a/tiff/libtiff/tif_next.c b/tiff/libtiff/tif_next.c
index 08211788a..0ba61aed3 100644
--- a/tiff/libtiff/tif_next.c
+++ b/tiff/libtiff/tif_next.c
@@ -1,5 +1,3 @@
-/* $Id: tif_next.c,v 1.19 2016-09-04 21:32:56 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_ojpeg.c b/tiff/libtiff/tif_ojpeg.c
index 92ed1fa19..bf0d1a2a0 100644
--- a/tiff/libtiff/tif_ojpeg.c
+++ b/tiff/libtiff/tif_ojpeg.c
@@ -1,5 +1,3 @@
-/* $Id: tif_ojpeg.c,v 1.69 2017-04-27 17:29:26 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
images. This file was was created solely in order to read unconverted images
@@ -245,6 +243,7 @@ typedef enum {
typedef struct {
TIFF* tif;
int decoder_ok;
+ int error_in_raw_data_decoding;
#ifndef LIBJPEG_ENCAP_EXTERNAL
JMP_BUF exit_jmpbuf;
#endif
@@ -680,7 +679,7 @@ OJPEGPreDecode(TIFF* tif, uint16 s)
if (OJPEGReadSecondarySos(tif,s)==0)
return(0);
}
- if isTiled(tif)
+ if (isTiled(tif))
m=tif->tif_curtile;
else
m=tif->tif_curstrip;
@@ -744,6 +743,7 @@ OJPEGPreDecodeSkipRaw(TIFF* tif)
}
m-=sp->subsampling_convert_clines-sp->subsampling_convert_state;
sp->subsampling_convert_state=0;
+ sp->error_in_raw_data_decoding=0;
}
while (m>=sp->subsampling_convert_clines)
{
@@ -794,6 +794,10 @@ OJPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
TIFFErrorExt(tif->tif_clientdata,module,"Cannot decode: decoder not correctly initialized");
return 0;
}
+ if( sp->error_in_raw_data_decoding )
+ {
+ return 0;
+ }
if (sp->libjpeg_jpeg_query_style==0)
{
if (OJPEGDecodeRaw(tif,buf,cc)==0)
@@ -833,8 +837,41 @@ OJPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc)
{
if (sp->subsampling_convert_state==0)
{
+ const jpeg_decompress_struct* cinfo = &sp->libjpeg_jpeg_decompress_struct;
+ int width = 0;
+ int last_col_width = 0;
+ int jpeg_bytes;
+ int expected_bytes;
+ int i;
+ if (cinfo->MCUs_per_row == 0)
+ {
+ sp->error_in_raw_data_decoding = 1;
+ return 0;
+ }
+ for (i = 0; i < cinfo->comps_in_scan; ++i)
+ {
+ const jpeg_component_info* info = cinfo->cur_comp_info[i];
+#if JPEG_LIB_VERSION >= 70
+ width += info->MCU_width * info->DCT_h_scaled_size;
+ last_col_width += info->last_col_width * info->DCT_h_scaled_size;
+#else
+ width += info->MCU_width * info->DCT_scaled_size;
+ last_col_width += info->last_col_width * info->DCT_scaled_size;
+#endif
+ }
+ jpeg_bytes = (cinfo->MCUs_per_row - 1) * width + last_col_width;
+ expected_bytes = sp->subsampling_convert_clinelenout * sp->subsampling_ver * sp->subsampling_hor;
+ if (jpeg_bytes != expected_bytes)
+ {
+ TIFFErrorExt(tif->tif_clientdata,module,"Inconsistent number of MCU in codestream");
+ sp->error_in_raw_data_decoding = 1;
+ return(0);
+ }
if (jpeg_read_raw_data_encap(sp,&(sp->libjpeg_jpeg_decompress_struct),sp->subsampling_convert_ycbcrimage,sp->subsampling_ver*8)==0)
+ {
+ sp->error_in_raw_data_decoding = 1;
return(0);
+ }
}
oy=sp->subsampling_convert_ybuf+sp->subsampling_convert_state*sp->subsampling_ver*sp->subsampling_convert_ylinelen;
ocb=sp->subsampling_convert_cbbuf+sp->subsampling_convert_state*sp->subsampling_convert_clinelen;
@@ -992,7 +1029,6 @@ OJPEGSubsamplingCorrect(TIFF* tif)
OJPEGState* sp=(OJPEGState*)tif->tif_data;
uint8 mh;
uint8 mv;
- _TIFFFillStriles( tif );
assert(sp->subsamplingcorrect_done==0);
if ((tif->tif_dir.td_samplesperpixel!=3) || ((tif->tif_dir.td_photometric!=PHOTOMETRIC_YCBCR) &&
@@ -1048,7 +1084,7 @@ OJPEGReadHeaderInfo(TIFF* tif)
assert(sp->readheader_done==0);
sp->image_width=tif->tif_dir.td_imagewidth;
sp->image_length=tif->tif_dir.td_imagelength;
- if isTiled(tif)
+ if (isTiled(tif))
{
sp->strile_width=tif->tif_dir.td_tilewidth;
sp->strile_length=tif->tif_dir.td_tilelength;
@@ -1084,6 +1120,12 @@ OJPEGReadHeaderInfo(TIFF* tif)
}
if (sp->strile_length<sp->image_length)
{
+ if (((sp->subsampling_hor!=1) && (sp->subsampling_hor!=2) && (sp->subsampling_hor!=4)) ||
+ ((sp->subsampling_ver!=1) && (sp->subsampling_ver!=2) && (sp->subsampling_ver!=4)))
+ {
+ TIFFErrorExt(tif->tif_clientdata,module,"Invalid subsampling values");
+ return(0);
+ }
if (sp->strile_length%(sp->subsampling_ver*8)!=0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Incompatible vertical subsampling and image strip/tile length");
@@ -1199,7 +1241,13 @@ OJPEGWriteHeaderInfo(TIFF* tif)
sp->subsampling_convert_ybuflen=sp->subsampling_convert_ylinelen*sp->subsampling_convert_ylines;
sp->subsampling_convert_cbuflen=sp->subsampling_convert_clinelen*sp->subsampling_convert_clines;
sp->subsampling_convert_ycbcrbuflen=sp->subsampling_convert_ybuflen+2*sp->subsampling_convert_cbuflen;
- sp->subsampling_convert_ycbcrbuf=_TIFFmalloc(sp->subsampling_convert_ycbcrbuflen);
+ /* The calloc is not normally necessary, except in some edge/broken cases */
+ /* for example for a tiled image of height 1 with a tile height of 1 and subsampling_hor=subsampling_ver=2 */
+ /* In that case, libjpeg will only fill the 8 first lines of the 16 lines */
+ /* See https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16844 */
+ /* Even if this case is allowed (?), its handling is broken because OJPEGPreDecode() should also likely */
+ /* reset subsampling_convert_state to 0 when changing tile. */
+ sp->subsampling_convert_ycbcrbuf=_TIFFcalloc(1, sp->subsampling_convert_ycbcrbuflen);
if (sp->subsampling_convert_ycbcrbuf==0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
@@ -1225,10 +1273,11 @@ OJPEGWriteHeaderInfo(TIFF* tif)
*m++=sp->subsampling_convert_cbbuf+n*sp->subsampling_convert_clinelen;
for (n=0; n<sp->subsampling_convert_clines; n++)
*m++=sp->subsampling_convert_crbuf+n*sp->subsampling_convert_clinelen;
- sp->subsampling_convert_clinelenout=((sp->strile_width+sp->subsampling_hor-1)/sp->subsampling_hor);
+ sp->subsampling_convert_clinelenout=sp->strile_width/sp->subsampling_hor + ((sp->strile_width % sp->subsampling_hor) != 0 ? 1 : 0);
sp->subsampling_convert_state=0;
+ sp->error_in_raw_data_decoding=0;
sp->bytes_per_line=sp->subsampling_convert_clinelenout*(sp->subsampling_ver*sp->subsampling_hor+2);
- sp->lines_per_strile=((sp->strile_length+sp->subsampling_ver-1)/sp->subsampling_ver);
+ sp->lines_per_strile=sp->strile_length/sp->subsampling_ver + ((sp->strile_length % sp->subsampling_ver) != 0 ? 1 : 0);
sp->subsampling_convert_log=1;
}
}
@@ -1274,7 +1323,9 @@ OJPEGReadHeaderInfoSec(TIFF* tif)
}
else
{
- if ((sp->jpeg_interchange_format_length==0) || (sp->jpeg_interchange_format+sp->jpeg_interchange_format_length>sp->file_size))
+ if ((sp->jpeg_interchange_format_length==0) ||
+ (sp->jpeg_interchange_format > TIFF_UINT64_MAX - sp->jpeg_interchange_format_length) ||
+ (sp->jpeg_interchange_format+sp->jpeg_interchange_format_length>sp->file_size))
sp->jpeg_interchange_format_length=sp->file_size-sp->jpeg_interchange_format;
}
}
@@ -1991,32 +2042,30 @@ OJPEGReadBufferFill(OJPEGState* sp)
sp->in_buffer_source=osibsStrile;
break;
case osibsStrile:
- if (!_TIFFFillStriles( sp->tif )
- || sp->tif->tif_dir.td_stripoffset == NULL
- || sp->tif->tif_dir.td_stripbytecount == NULL)
- return 0;
-
if (sp->in_buffer_next_strile==sp->in_buffer_strile_count)
sp->in_buffer_source=osibsEof;
else
{
- sp->in_buffer_file_pos=sp->tif->tif_dir.td_stripoffset[sp->in_buffer_next_strile];
+ int err = 0;
+ sp->in_buffer_file_pos=TIFFGetStrileOffsetWithErr(sp->tif, sp->in_buffer_next_strile, &err);
+ if( err )
+ return 0;
if (sp->in_buffer_file_pos!=0)
{
+ uint64 bytecount = TIFFGetStrileByteCountWithErr(sp->tif, sp->in_buffer_next_strile, &err);
+ if( err )
+ return 0;
if (sp->in_buffer_file_pos>=sp->file_size)
sp->in_buffer_file_pos=0;
- else if (sp->tif->tif_dir.td_stripbytecount==NULL)
+ else if (bytecount==0)
sp->in_buffer_file_togo=sp->file_size-sp->in_buffer_file_pos;
else
{
- if (sp->tif->tif_dir.td_stripbytecount == 0) {
- TIFFErrorExt(sp->tif->tif_clientdata,sp->tif->tif_name,"Strip byte counts are missing");
- return(0);
- }
- sp->in_buffer_file_togo=sp->tif->tif_dir.td_stripbytecount[sp->in_buffer_next_strile];
+ sp->in_buffer_file_togo=bytecount;
if (sp->in_buffer_file_togo==0)
sp->in_buffer_file_pos=0;
- else if (sp->in_buffer_file_pos+sp->in_buffer_file_togo>sp->file_size)
+ else if (sp->in_buffer_file_pos > TIFF_UINT64_MAX - sp->in_buffer_file_togo ||
+ sp->in_buffer_file_pos+sp->in_buffer_file_togo>sp->file_size)
sp->in_buffer_file_togo=sp->file_size-sp->in_buffer_file_pos;
}
}
diff --git a/tiff/libtiff/tif_open.c b/tiff/libtiff/tif_open.c
index a7279e1ea..3cb53d4e6 100644
--- a/tiff/libtiff/tif_open.c
+++ b/tiff/libtiff/tif_open.c
@@ -1,5 +1,3 @@
-/* $Id: tif_open.c,v 1.48 2016-11-20 22:29:47 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -133,6 +131,7 @@ TIFFClientOpen(
if (!readproc || !writeproc || !seekproc || !closeproc || !sizeproc) {
TIFFErrorExt(clientdata, module,
"One of the client procedures is NULL pointer.");
+ _TIFFfree(tif);
goto bad2;
}
tif->tif_readproc = readproc;
@@ -183,6 +182,8 @@ TIFFClientOpen(
* 'h' read TIFF header only, do not load the first IFD
* '4' ClassicTIFF for creating a file (default)
* '8' BigTIFF for creating a file
+ * 'D' enable use of deferred strip/tile offset/bytecount array loading.
+ * 'O' on-demand loading of values instead of whole array loading (implies D)
*
* The use of the 'l' and 'b' flags is strongly discouraged.
* These flags are provided solely because numerous vendors,
@@ -264,7 +265,22 @@ TIFFClientOpen(
if (m&O_CREAT)
tif->tif_flags |= TIFF_BIGTIFF;
break;
+ case 'D':
+ tif->tif_flags |= TIFF_DEFERSTRILELOAD;
+ break;
+ case 'O':
+ if( m == O_RDONLY )
+ tif->tif_flags |= (TIFF_LAZYSTRILELOAD | TIFF_DEFERSTRILELOAD);
+ break;
}
+
+#ifdef DEFER_STRILE_LOAD
+ /* Compatibility with old DEFER_STRILE_LOAD compilation flag */
+ /* Probably unneeded, since to the best of my knowledge (E. Rouault) */
+ /* GDAL was the only user of this, and will now use the new 'D' flag */
+ tif->tif_flags |= TIFF_DEFERSTRILELOAD;
+#endif
+
/*
* Read in TIFF header.
*/
diff --git a/tiff/libtiff/tif_packbits.c b/tiff/libtiff/tif_packbits.c
index 18904b013..a8f29e875 100644
--- a/tiff/libtiff/tif_packbits.c
+++ b/tiff/libtiff/tif_packbits.c
@@ -1,5 +1,3 @@
-/* $Id: tif_packbits.c,v 1.26 2017-05-14 02:26:07 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_pixarlog.c b/tiff/libtiff/tif_pixarlog.c
index 0ae4f18b0..0ed9f0100 100644
--- a/tiff/libtiff/tif_pixarlog.c
+++ b/tiff/libtiff/tif_pixarlog.c
@@ -1,5 +1,3 @@
-/* $Id: tif_pixarlog.c,v 1.54 2017-07-10 10:40:28 erouault Exp $ */
-
/*
* Copyright (c) 1996-1997 Sam Leffler
* Copyright (c) 1996 Pixar
@@ -636,20 +634,16 @@ PixarLogGuessDataFmt(TIFFDirectory *td)
return guess;
}
-#define TIFF_SIZE_T_MAX ((size_t) ~ ((size_t)0))
-#define TIFF_TMSIZE_T_MAX (tmsize_t)(TIFF_SIZE_T_MAX >> 1)
-
static tmsize_t
multiply_ms(tmsize_t m1, tmsize_t m2)
{
- if( m1 == 0 || m2 > TIFF_TMSIZE_T_MAX / m1 )
- return 0;
- return m1 * m2;
+ return _TIFFMultiplySSize(NULL, m1, m2, NULL);
}
static tmsize_t
add_ms(tmsize_t m1, tmsize_t m2)
{
+ assert(m1 >= 0 && m2 >= 0);
/* if either input is zero, assume overflow already occurred */
if (m1 == 0 || m2 == 0)
return 0;
@@ -819,9 +813,7 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
TIFFErrorExt(tif->tif_clientdata, module,
"Decoding error at scanline %lu, %s",
(unsigned long) tif->tif_row, sp->stream.msg ? sp->stream.msg : "(null)");
- if (inflateSync(&sp->stream) != Z_OK)
- return (0);
- continue;
+ return (0);
}
if (state != Z_OK) {
TIFFErrorExt(tif->tif_clientdata, module, "ZLib error: %s",
@@ -1155,7 +1147,7 @@ PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
llen = sp->stride * td->td_imagewidth;
/* Check against the number of elements (of size uint16) of sp->tbuf */
- if( n > (tmsize_t)(td->td_rowsperstrip * llen) )
+ if( n > ((tmsize_t)td->td_rowsperstrip * llen) )
{
TIFFErrorExt(tif->tif_clientdata, module,
"Too many input bytes provided");
diff --git a/tiff/libtiff/tif_predict.c b/tiff/libtiff/tif_predict.c
index 9ae1f57a6..b775663a7 100644
--- a/tiff/libtiff/tif_predict.c
+++ b/tiff/libtiff/tif_predict.c
@@ -1,5 +1,3 @@
-/* $Id: tif_predict.c,v 1.44 2017-06-18 10:31:50 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_predict.h b/tiff/libtiff/tif_predict.h
index 6c68e21ac..a326b9b8f 100644
--- a/tiff/libtiff/tif_predict.h
+++ b/tiff/libtiff/tif_predict.h
@@ -1,5 +1,3 @@
-/* $Id: tif_predict.h,v 1.9 2016-10-31 17:24:26 erouault Exp $ */
-
/*
* Copyright (c) 1995-1997 Sam Leffler
* Copyright (c) 1995-1997 Silicon Graphics, Inc.
@@ -26,6 +24,10 @@
#ifndef _TIFFPREDICT_
#define _TIFFPREDICT_
+
+#include "tiffio.h"
+#include "tiffiop.h"
+
/*
* ``Library-private'' Support for the Predictor Tag
*/
diff --git a/tiff/libtiff/tif_print.c b/tiff/libtiff/tif_print.c
index 24d4b98a6..a0737941f 100644
--- a/tiff/libtiff/tif_print.c
+++ b/tiff/libtiff/tif_print.c
@@ -1,5 +1,3 @@
-/* $Id: tif_print.c,v 1.65 2016-11-20 22:31:22 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -546,7 +544,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
uint16 i;
fprintf(fd, " %2ld: %5u",
l, td->td_transferfunction[0][l]);
- for (i = 1; i < td->td_samplesperpixel; i++)
+ for (i = 1; i < td->td_samplesperpixel - td->td_extrasamples && i < 3; i++)
fprintf(fd, " %5u",
td->td_transferfunction[i][l]);
fputc('\n', fd);
@@ -654,8 +652,6 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
if (tif->tif_tagmethods.printdir)
(*tif->tif_tagmethods.printdir)(tif, fd, flags);
- _TIFFFillStriles( tif );
-
if ((flags & TIFFPRINT_STRIPS) &&
TIFFFieldSet(tif,FIELD_STRIPOFFSETS)) {
uint32 s;
@@ -667,13 +663,13 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
fprintf(fd, " %3lu: [%8I64u, %8I64u]\n",
(unsigned long) s,
- (unsigned __int64) td->td_stripoffset[s],
- (unsigned __int64) td->td_stripbytecount[s]);
+ (unsigned __int64) TIFFGetStrileOffset(tif, s),
+ (unsigned __int64) TIFFGetStrileByteCount(tif, s));
#else
fprintf(fd, " %3lu: [%8llu, %8llu]\n",
(unsigned long) s,
- (unsigned long long) td->td_stripoffset[s],
- (unsigned long long) td->td_stripbytecount[s]);
+ (unsigned long long) TIFFGetStrileOffset(tif, s),
+ (unsigned long long) TIFFGetStrileByteCount(tif, s));
#endif
}
}
diff --git a/tiff/libtiff/tif_read.c b/tiff/libtiff/tif_read.c
index 2ba985a74..527fadd60 100644
--- a/tiff/libtiff/tif_read.c
+++ b/tiff/libtiff/tif_read.c
@@ -1,5 +1,3 @@
-/* $Id: tif_read.c,v 1.66 2017-11-17 20:21:00 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -31,9 +29,6 @@
#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);
@@ -51,6 +46,8 @@ TIFFReadRawTile1(TIFF* tif, uint32 tile, void* buf, tmsize_t size, const char* m
#define THRESHOLD_MULTIPLIER 10
#define MAX_THRESHOLD (THRESHOLD_MULTIPLIER * THRESHOLD_MULTIPLIER * THRESHOLD_MULTIPLIER * INITIAL_THRESHOLD)
+#define TIFF_INT64_MAX ((((int64)0x7FFFFFFF) << 32) | 0xFFFFFFFF)
+
/* Read 'size' bytes in tif_rawdata buffer starting at offset 'rawdata_offset'
* Returns 1 in case of success, 0 otherwise. */
static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
@@ -58,11 +55,27 @@ static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
int is_strip, uint32 strip_or_tile,
const char* module )
{
-#if SIZEOF_VOIDP == 8 || SIZEOF_SIZE_T == 8
+#if SIZEOF_SIZE_T == 8
tmsize_t threshold = INITIAL_THRESHOLD;
#endif
tmsize_t already_read = 0;
+
+#if SIZEOF_SIZE_T != 8
+ /* On 32 bit processes, if the request is large enough, check against */
+ /* file size */
+ if( size > 1000 * 1000 * 1000 )
+ {
+ uint64 filesize = TIFFGetFileSize(tif);
+ if( (uint64)size >= filesize )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Chunk size requested is larger than file size.");
+ return 0;
+ }
+ }
+#endif
+
/* On 64 bit processes, read first a maximum of 1 MB, then 10 MB, etc */
/* so as to avoid allocating too much memory in case the file is too */
/* short. We could ask for the file size, but this might be */
@@ -73,7 +86,7 @@ static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
{
tmsize_t bytes_read;
tmsize_t to_read = size - already_read;
-#if SIZEOF_VOIDP == 8 || SIZEOF_SIZE_T == 8
+#if SIZEOF_SIZE_T == 8
if( to_read >= threshold && threshold < MAX_THRESHOLD &&
already_read + to_read + rawdata_offset > tif->tif_rawdatasize )
{
@@ -105,6 +118,11 @@ static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
}
tif->tif_rawdata = new_rawdata;
}
+ if( tif->tif_rawdata == NULL )
+ {
+ /* should not happen in practice but helps CoverityScan */
+ return 0;
+ }
bytes_read = TIFFReadFile(tif,
tif->tif_rawdata + rawdata_offset + already_read, to_read);
@@ -172,17 +190,14 @@ TIFFFillStripPartial( TIFF *tif, int strip, tmsize_t read_ahead, int restart )
tmsize_t to_read;
tmsize_t read_ahead_mod;
/* tmsize_t bytecountm; */
-
- if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount)
- return 0;
-
+
/*
* Expand raw data buffer, if needed, to hold data
* strip coming from file (perhaps should set upper
* bound on the size of a buffer we'll use?).
*/
- /* bytecountm=(tmsize_t) td->td_stripbytecount[strip]; */
+ /* bytecountm=(tmsize_t) TIFFGetStrileByteCount(tif, strip); */
/* Not completely sure where the * 2 comes from, but probably for */
/* an exponentional growth strategy of tif_rawdatasize */
@@ -226,7 +241,7 @@ TIFFFillStripPartial( TIFF *tif, int strip, tmsize_t read_ahead, int restart )
/*
** Seek to the point in the file where more data should be read.
*/
- read_offset = td->td_stripoffset[strip]
+ read_offset = TIFFGetStrileOffset(tif, strip)
+ tif->tif_rawdataoff + tif->tif_rawdataloaded;
if (!SeekOK(tif, read_offset)) {
@@ -243,10 +258,10 @@ TIFFFillStripPartial( TIFF *tif, int strip, tmsize_t read_ahead, int restart )
to_read = read_ahead_mod - unused_data;
else
to_read = tif->tif_rawdatasize - unused_data;
- if( (uint64) to_read > td->td_stripbytecount[strip]
+ if( (uint64) to_read > TIFFGetStrileByteCount(tif, strip)
- tif->tif_rawdataoff - tif->tif_rawdataloaded )
{
- to_read = (tmsize_t) td->td_stripbytecount[strip]
+ to_read = (tmsize_t) TIFFGetStrileByteCount(tif, strip)
- tif->tif_rawdataoff - tif->tif_rawdataloaded;
}
@@ -285,7 +300,7 @@ TIFFFillStripPartial( TIFF *tif, int strip, tmsize_t read_ahead, int restart )
/* For JPEG, if there are multiple scans (can generally be known */
/* with the read_ahead used), we need to read the whole strip */
if( tif->tif_dir.td_compression==COMPRESSION_JPEG &&
- (uint64)tif->tif_rawcc < td->td_stripbytecount[strip] )
+ (uint64)tif->tif_rawcc < TIFFGetStrileByteCount(tif, strip) )
{
if( TIFFJPEGIsFullStripRequired(tif) )
{
@@ -344,10 +359,15 @@ TIFFSeek(TIFF* tif, uint32 row, uint16 sample )
* read it a few lines at a time?
*/
#if defined(CHUNKY_STRIP_READ_SUPPORT)
- if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount)
- return 0;
- whole_strip = tif->tif_dir.td_stripbytecount[strip] < 10
+ whole_strip = TIFFGetStrileByteCount(tif, strip) < 10
|| isMapped(tif);
+ if( td->td_compression == COMPRESSION_LERC ||
+ td->td_compression == COMPRESSION_JBIG )
+ {
+ /* Ideally plugins should have a way to declare they don't support
+ * chunk strip */
+ whole_strip = 1;
+ }
#else
whole_strip = 1;
#endif
@@ -392,7 +412,7 @@ TIFFSeek(TIFF* tif, uint32 row, uint16 sample )
else if( !whole_strip )
{
if( ((tif->tif_rawdata + tif->tif_rawdataloaded) - tif->tif_rawcp) < read_ahead
- && (uint64) tif->tif_rawdataoff+tif->tif_rawdataloaded < td->td_stripbytecount[strip] )
+ && (uint64) tif->tif_rawdataoff+tif->tif_rawdataloaded < TIFFGetStrileByteCount(tif, strip) )
{
if( !TIFFFillStripPartial(tif,strip,read_ahead,0) )
return 0;
@@ -589,16 +609,11 @@ static tmsize_t
TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,
const char* module)
{
- TIFFDirectory *td = &tif->tif_dir;
-
- if (!_TIFFFillStriles( tif ))
- return ((tmsize_t)(-1));
-
assert((tif->tif_flags&TIFF_NOREADRAW)==0);
if (!isMapped(tif)) {
tmsize_t cc;
- if (!SeekOK(tif, td->td_stripoffset[strip])) {
+ if (!SeekOK(tif, TIFFGetStrileOffset(tif, strip))) {
TIFFErrorExt(tif->tif_clientdata, module,
"Seek error at scanline %lu, strip %lu",
(unsigned long) tif->tif_row, (unsigned long) strip);
@@ -624,8 +639,8 @@ TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,
} else {
tmsize_t ma = 0;
tmsize_t n;
- if ((td->td_stripoffset[strip] > (uint64)TIFF_TMSIZE_T_MAX)||
- ((ma=(tmsize_t)td->td_stripoffset[strip])>tif->tif_size))
+ if ((TIFFGetStrileOffset(tif, strip) > (uint64)TIFF_TMSIZE_T_MAX)||
+ ((ma=(tmsize_t)TIFFGetStrileOffset(tif, strip))>tif->tif_size))
{
n=0;
}
@@ -669,12 +684,10 @@ static tmsize_t
TIFFReadRawStripOrTile2(TIFF* tif, uint32 strip_or_tile, int is_strip,
tmsize_t size, const char* module)
{
- TIFFDirectory *td = &tif->tif_dir;
-
assert( !isMapped(tif) );
assert((tif->tif_flags&TIFF_NOREADRAW)==0);
- if (!SeekOK(tif, td->td_stripoffset[strip_or_tile])) {
+ if (!SeekOK(tif, TIFFGetStrileOffset(tif, strip_or_tile))) {
if( is_strip )
{
TIFFErrorExt(tif->tif_clientdata, module,
@@ -710,7 +723,7 @@ TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
{
static const char module[] = "TIFFReadRawStrip";
TIFFDirectory *td = &tif->tif_dir;
- uint64 bytecount;
+ uint64 bytecount64;
tmsize_t bytecountm;
if (!TIFFCheckRead(tif, 0))
@@ -728,31 +741,23 @@ TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
"Compression scheme does not support access to raw uncompressed data");
return ((tmsize_t)(-1));
}
- bytecount = td->td_stripbytecount[strip];
- if ((int64)bytecount <= 0) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- TIFFErrorExt(tif->tif_clientdata, module,
- "%I64u: Invalid strip byte count, strip %lu",
- (unsigned __int64) bytecount,
- (unsigned long) strip);
-#else
- TIFFErrorExt(tif->tif_clientdata, module,
- "%llu: Invalid strip byte count, strip %lu",
- (unsigned long long) bytecount,
- (unsigned long) strip);
-#endif
- return ((tmsize_t)(-1));
- }
- bytecountm = (tmsize_t)bytecount;
- if ((uint64)bytecountm!=bytecount) {
- TIFFErrorExt(tif->tif_clientdata, module, "Integer overflow");
+ bytecount64 = TIFFGetStrileByteCount(tif, strip);
+ if (size != (tmsize_t)(-1) && (uint64)size <= bytecount64)
+ bytecountm = size;
+ else
+ bytecountm = _TIFFCastUInt64ToSSize(tif, bytecount64, module);
+ if( bytecountm == 0 ) {
return ((tmsize_t)(-1));
}
- if (size != (tmsize_t)(-1) && size < bytecountm)
- bytecountm = size;
return (TIFFReadRawStrip1(tif, strip, buf, bytecountm, module));
}
+TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
+static uint64 NoSantizeSubUInt64(uint64 a, uint64 b)
+{
+ return a - b;
+}
+
/*
* Read the specified strip and setup for decoding. The data buffer is
* expanded, as necessary, to hold the strip's data.
@@ -763,13 +768,10 @@ TIFFFillStrip(TIFF* tif, uint32 strip)
static const char module[] = "TIFFFillStrip";
TIFFDirectory *td = &tif->tif_dir;
- if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount)
- return 0;
-
if ((tif->tif_flags&TIFF_NOREADRAW)==0)
{
- uint64 bytecount = td->td_stripbytecount[strip];
- if ((int64)bytecount <= 0) {
+ uint64 bytecount = TIFFGetStrileByteCount(tif, strip);
+ if( bytecount == 0 || bytecount > (uint64)TIFF_INT64_MAX ) {
#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
TIFFErrorExt(tif->tif_clientdata, module,
"Invalid strip byte count %I64u, strip %lu",
@@ -796,7 +798,7 @@ TIFFFillStrip(TIFF* tif, uint32 strip)
(bytecount - 4096) / 10 > (uint64)stripsize )
{
uint64 newbytecount = (uint64)stripsize * 10 + 4096;
- if( (int64)newbytecount >= 0 )
+ if( newbytecount == 0 || newbytecount > (uint64)TIFF_INT64_MAX )
{
#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
TIFFWarningExt(tif->tif_clientdata, module,
@@ -821,13 +823,13 @@ TIFFFillStrip(TIFF* tif, uint32 strip)
* We must check for overflow, potentially causing
* an OOB read. Instead of simple
*
- * td->td_stripoffset[strip]+bytecount > tif->tif_size
+ * TIFFGetStrileOffset(tif, strip)+bytecount > tif->tif_size
*
* comparison (which can overflow) we do the following
* two comparisons:
*/
if (bytecount > (uint64)tif->tif_size ||
- td->td_stripoffset[strip] > (uint64)tif->tif_size - bytecount) {
+ TIFFGetStrileOffset(tif, strip) > (uint64)tif->tif_size - bytecount) {
/*
* This error message might seem strange, but
* it's what would happen if a read were done
@@ -839,7 +841,7 @@ TIFFFillStrip(TIFF* tif, uint32 strip)
"Read error on strip %lu; "
"got %I64u bytes, expected %I64u",
(unsigned long) strip,
- (unsigned __int64) tif->tif_size - td->td_stripoffset[strip],
+ (unsigned __int64) NoSantizeSubUInt64(tif->tif_size, TIFFGetStrileOffset(tif, strip)),
(unsigned __int64) bytecount);
#else
TIFFErrorExt(tif->tif_clientdata, module,
@@ -847,7 +849,7 @@ TIFFFillStrip(TIFF* tif, uint32 strip)
"Read error on strip %lu; "
"got %llu bytes, expected %llu",
(unsigned long) strip,
- (unsigned long long) tif->tif_size - td->td_stripoffset[strip],
+ (unsigned long long) NoSantizeSubUInt64(tif->tif_size, TIFFGetStrileOffset(tif, strip)),
(unsigned long long) bytecount);
#endif
tif->tif_curstrip = NOSTRIP;
@@ -876,7 +878,7 @@ TIFFFillStrip(TIFF* tif, uint32 strip)
}
tif->tif_flags &= ~TIFF_MYBUFFER;
tif->tif_rawdatasize = (tmsize_t)bytecount;
- tif->tif_rawdata = tif->tif_base + (tmsize_t)td->td_stripoffset[strip];
+ tif->tif_rawdata = tif->tif_base + (tmsize_t)TIFFGetStrileOffset(tif, strip);
tif->tif_rawdataoff = 0;
tif->tif_rawdataloaded = (tmsize_t) bytecount;
@@ -1091,16 +1093,11 @@ _TIFFReadEncodedTileAndAllocBuffer(TIFF* tif, uint32 tile,
static tmsize_t
TIFFReadRawTile1(TIFF* tif, uint32 tile, void* buf, tmsize_t size, const char* module)
{
- TIFFDirectory *td = &tif->tif_dir;
-
- if (!_TIFFFillStriles( tif ))
- return ((tmsize_t)(-1));
-
assert((tif->tif_flags&TIFF_NOREADRAW)==0);
if (!isMapped(tif)) {
tmsize_t cc;
- if (!SeekOK(tif, td->td_stripoffset[tile])) {
+ if (!SeekOK(tif, TIFFGetStrileOffset(tif, tile))) {
TIFFErrorExt(tif->tif_clientdata, module,
"Seek error at row %lu, col %lu, tile %lu",
(unsigned long) tif->tif_row,
@@ -1130,9 +1127,9 @@ TIFFReadRawTile1(TIFF* tif, uint32 tile, void* buf, tmsize_t size, const char* m
} else {
tmsize_t ma,mb;
tmsize_t n;
- ma=(tmsize_t)td->td_stripoffset[tile];
+ ma=(tmsize_t)TIFFGetStrileOffset(tif, tile);
mb=ma+size;
- if ((td->td_stripoffset[tile] > (uint64)TIFF_TMSIZE_T_MAX)||(ma>tif->tif_size))
+ if ((TIFFGetStrileOffset(tif, 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;
@@ -1188,13 +1185,12 @@ TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size)
"Compression scheme does not support access to raw uncompressed data");
return ((tmsize_t)(-1));
}
- bytecount64 = td->td_stripbytecount[tile];
- if (size != (tmsize_t)(-1) && (uint64)size < bytecount64)
- bytecount64 = (uint64)size;
- bytecountm = (tmsize_t)bytecount64;
- if ((uint64)bytecountm!=bytecount64)
- {
- TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
+ bytecount64 = TIFFGetStrileByteCount(tif, tile);
+ if (size != (tmsize_t)(-1) && (uint64)size <= bytecount64)
+ bytecountm = size;
+ else
+ bytecountm = _TIFFCastUInt64ToSSize(tif, bytecount64, module);
+ if( bytecountm == 0 ) {
return ((tmsize_t)(-1));
}
return (TIFFReadRawTile1(tif, tile, buf, bytecountm, module));
@@ -1210,13 +1206,10 @@ TIFFFillTile(TIFF* tif, uint32 tile)
static const char module[] = "TIFFFillTile";
TIFFDirectory *td = &tif->tif_dir;
- if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount)
- return 0;
-
if ((tif->tif_flags&TIFF_NOREADRAW)==0)
{
- uint64 bytecount = td->td_stripbytecount[tile];
- if ((int64)bytecount <= 0) {
+ uint64 bytecount = TIFFGetStrileByteCount(tif, tile);
+ if( bytecount == 0 || bytecount > (uint64)TIFF_INT64_MAX ) {
#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
TIFFErrorExt(tif->tif_clientdata, module,
"%I64u: Invalid tile byte count, tile %lu",
@@ -1243,7 +1236,7 @@ TIFFFillTile(TIFF* tif, uint32 tile)
(bytecount - 4096) / 10 > (uint64)stripsize )
{
uint64 newbytecount = (uint64)stripsize * 10 + 4096;
- if( (int64)newbytecount >= 0 )
+ if( newbytecount == 0 || newbytecount > (uint64)TIFF_INT64_MAX )
{
#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
TIFFWarningExt(tif->tif_clientdata, module,
@@ -1268,13 +1261,13 @@ TIFFFillTile(TIFF* tif, uint32 tile)
* We must check for overflow, potentially causing
* an OOB read. Instead of simple
*
- * td->td_stripoffset[tile]+bytecount > tif->tif_size
+ * TIFFGetStrileOffset(tif, tile)+bytecount > tif->tif_size
*
* comparison (which can overflow) we do the following
* two comparisons:
*/
if (bytecount > (uint64)tif->tif_size ||
- td->td_stripoffset[tile] > (uint64)tif->tif_size - bytecount) {
+ TIFFGetStrileOffset(tif, tile) > (uint64)tif->tif_size - bytecount) {
tif->tif_curtile = NOTILE;
return (0);
}
@@ -1303,7 +1296,7 @@ TIFFFillTile(TIFF* tif, uint32 tile)
tif->tif_rawdatasize = (tmsize_t)bytecount;
tif->tif_rawdata =
- tif->tif_base + (tmsize_t)td->td_stripoffset[tile];
+ tif->tif_base + (tmsize_t)TIFFGetStrileOffset(tif, tile);
tif->tif_rawdataoff = 0;
tif->tif_rawdataloaded = (tmsize_t) bytecount;
tif->tif_flags |= TIFF_BUFFERMMAP;
@@ -1362,7 +1355,8 @@ TIFFFillTile(TIFF* tif, uint32 tile)
tif->tif_rawdataoff = 0;
tif->tif_rawdataloaded = bytecountm;
- if (!isFillOrder(tif, td->td_fillorder) &&
+ if (tif->tif_rawdata != NULL &&
+ !isFillOrder(tif, td->td_fillorder) &&
(tif->tif_flags & TIFF_NOBITREV) == 0)
TIFFReverseBits(tif->tif_rawdata,
tif->tif_rawdataloaded);
@@ -1429,9 +1423,6 @@ TIFFStartStrip(TIFF* tif, uint32 strip)
{
TIFFDirectory *td = &tif->tif_dir;
- if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount)
- return 0;
-
if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
if (!(*tif->tif_setupdecode)(tif))
return (0);
@@ -1452,7 +1443,7 @@ TIFFStartStrip(TIFF* tif, uint32 strip)
if( tif->tif_rawdataloaded > 0 )
tif->tif_rawcc = tif->tif_rawdataloaded;
else
- tif->tif_rawcc = (tmsize_t)td->td_stripbytecount[strip];
+ tif->tif_rawcc = (tmsize_t)TIFFGetStrileByteCount(tif, strip);
}
return ((*tif->tif_predecode)(tif,
(uint16)(strip / td->td_stripsperimage)));
@@ -1469,9 +1460,6 @@ TIFFStartTile(TIFF* tif, uint32 tile)
TIFFDirectory *td = &tif->tif_dir;
uint32 howmany32;
- if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount)
- return 0;
-
if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
if (!(*tif->tif_setupdecode)(tif))
return (0);
@@ -1502,7 +1490,7 @@ TIFFStartTile(TIFF* tif, uint32 tile)
if( tif->tif_rawdataloaded > 0 )
tif->tif_rawcc = tif->tif_rawdataloaded;
else
- tif->tif_rawcc = (tmsize_t)td->td_stripbytecount[tile];
+ tif->tif_rawcc = (tmsize_t)TIFFGetStrileByteCount(tif, tile);
}
return ((*tif->tif_predecode)(tif,
(uint16)(tile/td->td_stripsperimage)));
@@ -1517,13 +1505,100 @@ TIFFCheckRead(TIFF* tif, int tiles)
}
if (tiles ^ isTiled(tif)) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, tiles ?
- "Can not read tiles from a stripped image" :
+ "Can not read tiles from a striped image" :
"Can not read scanlines from a tiled image");
return (0);
}
return (1);
}
+/* Use the provided input buffer (inbuf, insize) and decompress it into
+ * (outbuf, outsize).
+ * This function replaces the use of TIFFReadEncodedStrip()/TIFFReadEncodedTile()
+ * when the user can provide the buffer for the input data, for example when
+ * he wants to avoid libtiff to read the strile offset/count values from the
+ * [Strip|Tile][Offsets/ByteCounts] array.
+ * inbuf content must be writable (if bit reversal is needed)
+ * Returns 1 in case of success, 0 otherwise.
+ */
+int TIFFReadFromUserBuffer(TIFF* tif, uint32 strile,
+ void* inbuf, tmsize_t insize,
+ void* outbuf, tmsize_t outsize)
+{
+ static const char module[] = "TIFFReadFromUserBuffer";
+ TIFFDirectory *td = &tif->tif_dir;
+ int ret = 1;
+ uint32 old_tif_flags = tif->tif_flags;
+ tmsize_t old_rawdatasize = tif->tif_rawdatasize;
+ void* old_rawdata = tif->tif_rawdata;
+
+ if (tif->tif_mode == O_WRONLY) {
+ TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "File not open for reading");
+ return 0;
+ }
+ if (tif->tif_flags&TIFF_NOREADRAW)
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Compression scheme does not support access to raw uncompressed data");
+ return 0;
+ }
+
+ tif->tif_flags &= ~TIFF_MYBUFFER;
+ tif->tif_flags |= TIFF_BUFFERMMAP;
+ tif->tif_rawdatasize = insize;
+ tif->tif_rawdata = inbuf;
+ tif->tif_rawdataoff = 0;
+ tif->tif_rawdataloaded = insize;
+
+ if (!isFillOrder(tif, td->td_fillorder) &&
+ (tif->tif_flags & TIFF_NOBITREV) == 0)
+ {
+ TIFFReverseBits(inbuf, insize);
+ }
+
+ if( TIFFIsTiled(tif) )
+ {
+ if( !TIFFStartTile(tif, strile) ||
+ !(*tif->tif_decodetile)(tif, (uint8*) outbuf, outsize,
+ (uint16)(strile/td->td_stripsperimage)) )
+ {
+ ret = 0;
+ }
+ }
+ else
+ {
+ uint32 rowsperstrip=td->td_rowsperstrip;
+ uint32 stripsperplane;
+ if (rowsperstrip>td->td_imagelength)
+ rowsperstrip=td->td_imagelength;
+ stripsperplane= TIFFhowmany_32_maxuint_compat(td->td_imagelength, rowsperstrip);
+ if( !TIFFStartStrip(tif, strile) ||
+ !(*tif->tif_decodestrip)(tif, (uint8*) outbuf, outsize,
+ (uint16)(strile/stripsperplane)) )
+ {
+ ret = 0;
+ }
+ }
+ if( ret )
+ {
+ (*tif->tif_postdecode)(tif, (uint8*) outbuf, outsize);
+ }
+
+ if (!isFillOrder(tif, td->td_fillorder) &&
+ (tif->tif_flags & TIFF_NOBITREV) == 0)
+ {
+ TIFFReverseBits(inbuf, insize);
+ }
+
+ tif->tif_flags = old_tif_flags;
+ tif->tif_rawdatasize = old_rawdatasize;
+ tif->tif_rawdata = old_rawdata;
+ tif->tif_rawdataoff = 0;
+ tif->tif_rawdataloaded = 0;
+
+ return ret;
+}
+
void
_TIFFNoPostDecode(TIFF* tif, uint8* buf, tmsize_t cc)
{
diff --git a/tiff/libtiff/tif_stream.cxx b/tiff/libtiff/tif_stream.cxx
index ecca1fd54..7f640a9c0 100644
--- a/tiff/libtiff/tif_stream.cxx
+++ b/tiff/libtiff/tif_stream.cxx
@@ -1,5 +1,3 @@
-/* $Id: tif_stream.cxx,v 1.13 2015-05-28 01:50:22 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1996 Sam Leffler
* Copyright (c) 1991-1996 Silicon Graphics, Inc.
@@ -375,6 +373,9 @@ _tiffStreamOpen(const char* name, const char* mode, void *fd)
_tiffosSizeProc,
_tiffDummyMapProc,
_tiffDummyUnmapProc);
+ if (!tif) {
+ delete data;
+ }
} else {
tiffis_data *data = new tiffis_data;
data->stream = reinterpret_cast<istream *>(fd);
@@ -389,6 +390,9 @@ _tiffStreamOpen(const char* name, const char* mode, void *fd)
_tiffisSizeProc,
_tiffDummyMapProc,
_tiffDummyUnmapProc);
+ if (!tif) {
+ delete data;
+ }
}
return (tif);
diff --git a/tiff/libtiff/tif_strip.c b/tiff/libtiff/tif_strip.c
index 6e9f2ef6d..c08c60a79 100644
--- a/tiff/libtiff/tif_strip.c
+++ b/tiff/libtiff/tif_strip.c
@@ -1,5 +1,3 @@
-/* $Id: tif_strip.c,v 1.38 2016-12-03 11:02:15 erouault Exp $ */
-
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -131,15 +129,8 @@ TIFFVStripSize(TIFF* tif, uint32 nrows)
{
static const char module[] = "TIFFVStripSize";
uint64 m;
- tmsize_t n;
m=TIFFVStripSize64(tif,nrows);
- n=(tmsize_t)m;
- if ((uint64)n!=m)
- {
- TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
- n=0;
- }
- return(n);
+ return _TIFFCastUInt64ToSSize(tif, m, module);
}
/*
@@ -149,8 +140,7 @@ uint64
TIFFRawStripSize64(TIFF* tif, uint32 strip)
{
static const char module[] = "TIFFRawStripSize64";
- TIFFDirectory* td = &tif->tif_dir;
- uint64 bytecount = td->td_stripbytecount[strip];
+ uint64 bytecount = TIFFGetStrileByteCount(tif, strip);
if (bytecount == 0)
{
@@ -213,15 +203,8 @@ TIFFStripSize(TIFF* tif)
{
static const char module[] = "TIFFStripSize";
uint64 m;
- tmsize_t n;
m=TIFFStripSize64(tif);
- n=(tmsize_t)m;
- if ((uint64)n!=m)
- {
- TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
- n=0;
- }
- return(n);
+ return _TIFFCastUInt64ToSSize(tif, m, module);
}
/*
@@ -332,14 +315,8 @@ TIFFScanlineSize(TIFF* tif)
{
static const char module[] = "TIFFScanlineSize";
uint64 m;
- tmsize_t n;
m=TIFFScanlineSize64(tif);
- n=(tmsize_t)m;
- if ((uint64)n!=m) {
- TIFFErrorExt(tif->tif_clientdata,module,"Integer arithmetic overflow");
- n=0;
- }
- return(n);
+ return _TIFFCastUInt64ToSSize(tif, m, module);
}
/*
@@ -368,15 +345,8 @@ TIFFRasterScanlineSize(TIFF* tif)
{
static const char module[] = "TIFFRasterScanlineSize";
uint64 m;
- tmsize_t n;
m=TIFFRasterScanlineSize64(tif);
- n=(tmsize_t)m;
- if ((uint64)n!=m)
- {
- TIFFErrorExt(tif->tif_clientdata,module,"Integer arithmetic overflow");
- n=0;
- }
- return(n);
+ return _TIFFCastUInt64ToSSize(tif, m, module);
}
/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/tiff/libtiff/tif_swab.c b/tiff/libtiff/tif_swab.c
index 4b2e5f16d..b174ba69c 100644
--- a/tiff/libtiff/tif_swab.c
+++ b/tiff/libtiff/tif_swab.c
@@ -1,5 +1,3 @@
-/* $Id: tif_swab.c,v 1.15 2017-06-08 16:39:50 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_thunder.c b/tiff/libtiff/tif_thunder.c
index 183199de7..db6383a81 100644
--- a/tiff/libtiff/tif_thunder.c
+++ b/tiff/libtiff/tif_thunder.c
@@ -1,5 +1,3 @@
-/* $Id: tif_thunder.c,v 1.13 2016-09-04 21:32:56 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -124,17 +122,17 @@ ThunderDecode(TIFF* tif, uint8* op, tmsize_t maxpixels)
break;
case THUNDER_2BITDELTAS: /* 2-bit deltas */
if ((delta = ((n >> 4) & 3)) != DELTA2_SKIP)
- SETPIXEL(op, lastpixel + twobitdeltas[delta]);
+ SETPIXEL(op, (unsigned)((int)lastpixel + twobitdeltas[delta]));
if ((delta = ((n >> 2) & 3)) != DELTA2_SKIP)
- SETPIXEL(op, lastpixel + twobitdeltas[delta]);
+ SETPIXEL(op, (unsigned)((int)lastpixel + twobitdeltas[delta]));
if ((delta = (n & 3)) != DELTA2_SKIP)
- SETPIXEL(op, lastpixel + twobitdeltas[delta]);
+ SETPIXEL(op, (unsigned)((int)lastpixel + twobitdeltas[delta]));
break;
case THUNDER_3BITDELTAS: /* 3-bit deltas */
if ((delta = ((n >> 3) & 7)) != DELTA3_SKIP)
- SETPIXEL(op, lastpixel + threebitdeltas[delta]);
+ SETPIXEL(op, (unsigned)((int)lastpixel + threebitdeltas[delta]));
if ((delta = (n & 7)) != DELTA3_SKIP)
- SETPIXEL(op, lastpixel + threebitdeltas[delta]);
+ SETPIXEL(op, (unsigned)((int)lastpixel + threebitdeltas[delta]));
break;
case THUNDER_RAW: /* raw data */
SETPIXEL(op, n);
diff --git a/tiff/libtiff/tif_tile.c b/tiff/libtiff/tif_tile.c
index 388e168ac..661cc7715 100644
--- a/tiff/libtiff/tif_tile.c
+++ b/tiff/libtiff/tif_tile.c
@@ -1,5 +1,3 @@
-/* $Id: tif_tile.c,v 1.24 2015-06-07 22:35:40 bfriesen Exp $ */
-
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -183,15 +181,8 @@ TIFFTileRowSize(TIFF* tif)
{
static const char module[] = "TIFFTileRowSize";
uint64 m;
- tmsize_t n;
m=TIFFTileRowSize64(tif);
- n=(tmsize_t)m;
- if ((uint64)n!=m)
- {
- TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
- n=0;
- }
- return(n);
+ return _TIFFCastUInt64ToSSize(tif, m, module);
}
/*
@@ -250,15 +241,8 @@ TIFFVTileSize(TIFF* tif, uint32 nrows)
{
static const char module[] = "TIFFVTileSize";
uint64 m;
- tmsize_t n;
m=TIFFVTileSize64(tif,nrows);
- n=(tmsize_t)m;
- if ((uint64)n!=m)
- {
- TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
- n=0;
- }
- return(n);
+ return _TIFFCastUInt64ToSSize(tif, m, module);
}
/*
@@ -274,15 +258,8 @@ TIFFTileSize(TIFF* tif)
{
static const char module[] = "TIFFTileSize";
uint64 m;
- tmsize_t n;
m=TIFFTileSize64(tif);
- n=(tmsize_t)m;
- if ((uint64)n!=m)
- {
- TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
- n=0;
- }
- return(n);
+ return _TIFFCastUInt64ToSSize(tif, m, module);
}
/*
diff --git a/tiff/libtiff/tif_unix.c b/tiff/libtiff/tif_unix.c
index 80c437cfa..874f1feb2 100644
--- a/tiff/libtiff/tif_unix.c
+++ b/tiff/libtiff/tif_unix.c
@@ -1,5 +1,3 @@
-/* $Id: tif_unix.c,v 1.28 2017-01-11 19:02:49 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_version.c b/tiff/libtiff/tif_version.c
index f92c843d8..60875bbf0 100644
--- a/tiff/libtiff/tif_version.c
+++ b/tiff/libtiff/tif_version.c
@@ -1,4 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_version.c,v 1.3 2010-03-10 18:56:49 bfriesen Exp $ */
/*
* Copyright (c) 1992-1997 Sam Leffler
* Copyright (c) 1992-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_warning.c b/tiff/libtiff/tif_warning.c
index dc79f1445..c482785c2 100644
--- a/tiff/libtiff/tif_warning.c
+++ b/tiff/libtiff/tif_warning.c
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_warning.c,v 1.4 2017-07-04 12:54:42 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/libtiff/tif_webp.c b/tiff/libtiff/tif_webp.c
new file mode 100644
index 000000000..22665f2d2
--- /dev/null
+++ b/tiff/libtiff/tif_webp.c
@@ -0,0 +1,695 @@
+/*
+* Copyright (c) 2018, Mapbox
+* Author: <norman.barker at mapbox.com>
+*
+* 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 "tiffiop.h"
+#ifdef WEBP_SUPPORT
+/*
+ * TIFF Library.
+ *
+ * WEBP Compression Support
+ *
+ */
+
+#include "webp/decode.h"
+#include "webp/encode.h"
+
+#include <stdio.h>
+
+#define LSTATE_INIT_DECODE 0x01
+#define LSTATE_INIT_ENCODE 0x02
+/*
+ * State block for each open TIFF
+ * file using WEBP compression/decompression.
+ */
+typedef struct {
+ uint16 nSamples; /* number of samples per pixel */
+
+ int lossless; /* lossy/lossless compression */
+ int quality_level; /* compression level */
+ WebPPicture sPicture; /* WebP Picture */
+ WebPConfig sEncoderConfig; /* WebP encoder config */
+ uint8* pBuffer; /* buffer to hold raw data on encoding */
+ unsigned int buffer_offset; /* current offset into the buffer */
+ unsigned int buffer_size;
+
+ WebPIDecoder* psDecoder; /* WebPIDecoder */
+ WebPDecBuffer sDecBuffer; /* Decoder buffer */
+ int last_y; /* Last row decoded */
+
+ int state; /* state flags */
+
+ TIFFVGetMethod vgetparent; /* super-class method */
+ TIFFVSetMethod vsetparent; /* super-class method */
+} WebPState;
+
+#define LState(tif) ((WebPState*) (tif)->tif_data)
+#define DecoderState(tif) LState(tif)
+#define EncoderState(tif) LState(tif)
+
+static int TWebPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s);
+static int TWebPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s);
+
+static
+int TWebPDatasetWriter(const uint8_t* data, size_t data_size,
+ const WebPPicture* const picture)
+{
+ static const char module[] = "TWebPDatasetWriter";
+ TIFF* tif = (TIFF*)(picture->custom_ptr);
+
+ if ( (tif->tif_rawcc + (tmsize_t)data_size) > tif->tif_rawdatasize ) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Buffer too small by " TIFF_SIZE_FORMAT " bytes.",
+ (size_t) (tif->tif_rawcc + data_size - tif->tif_rawdatasize));
+ return 0;
+ } else {
+ _TIFFmemcpy(tif->tif_rawcp, data, data_size);
+ tif->tif_rawcc += data_size;
+ tif->tif_rawcp += data_size;
+ return 1;
+ }
+}
+
+/*
+ * Encode a chunk of pixels.
+ */
+static int
+TWebPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+{
+ static const char module[] = "TWebPEncode";
+ WebPState *sp = EncoderState(tif);
+ (void) s;
+
+ assert(sp != NULL);
+ assert(sp->state == LSTATE_INIT_ENCODE);
+
+ if( (uint64)sp->buffer_offset +
+ (uint64)cc > sp->buffer_size )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Too many bytes to be written");
+ return 0;
+ }
+
+ memcpy(sp->pBuffer + sp->buffer_offset,
+ bp, cc);
+ sp->buffer_offset += (unsigned)cc;
+
+ return 1;
+
+}
+
+static int
+TWebPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
+{
+ static const char module[] = "WebPDecode";
+ VP8StatusCode status = VP8_STATUS_OK;
+ WebPState *sp = DecoderState(tif);
+ (void) s;
+
+ assert(sp != NULL);
+ assert(sp->state == LSTATE_INIT_DECODE);
+
+ if (occ % sp->sDecBuffer.u.RGBA.stride)
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Fractional scanlines cannot be read");
+ return 0;
+ }
+
+ status = WebPIAppend(sp->psDecoder, tif->tif_rawcp, tif->tif_rawcc);
+
+ if (status != VP8_STATUS_OK && status != VP8_STATUS_SUSPENDED) {
+ if (status == VP8_STATUS_INVALID_PARAM) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Invalid parameter used.");
+ } else if (status == VP8_STATUS_OUT_OF_MEMORY) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Out of memory.");
+ } else {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Unrecognized error.");
+ }
+ return 0;
+ } else {
+ int current_y, stride;
+ uint8_t* buf;
+
+ /* Returns the RGB/A image decoded so far */
+ buf = WebPIDecGetRGB(sp->psDecoder, &current_y, NULL, NULL, &stride);
+
+ if ((buf != NULL) &&
+ (occ <= stride * (current_y - sp->last_y))) {
+ memcpy(op,
+ buf + (sp->last_y * stride),
+ occ);
+
+ tif->tif_rawcp += tif->tif_rawcc;
+ tif->tif_rawcc = 0;
+ sp->last_y += occ / sp->sDecBuffer.u.RGBA.stride;
+ return 1;
+ } else {
+ TIFFErrorExt(tif->tif_clientdata, module, "Unable to decode WebP data.");
+ return 0;
+ }
+ }
+}
+
+static int
+TWebPFixupTags(TIFF* tif)
+{
+ (void) tif;
+ if (tif->tif_dir.td_planarconfig != PLANARCONFIG_CONTIG) {
+ static const char module[] = "TWebPFixupTags";
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "TIFF WEBP requires data to be stored contiguously in RGB e.g. RGBRGBRGB "
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+ "or RGBARGBARGBA"
+#endif
+ );
+ return 0;
+ }
+ return 1;
+}
+
+static int
+TWebPSetupDecode(TIFF* tif)
+{
+ static const char module[] = "WebPSetupDecode";
+ uint16 nBitsPerSample = tif->tif_dir.td_bitspersample;
+ uint16 sampleFormat = tif->tif_dir.td_sampleformat;
+
+ WebPState* sp = DecoderState(tif);
+ assert(sp != NULL);
+
+ sp->nSamples = tif->tif_dir.td_samplesperpixel;
+
+ /* check band count */
+ if ( sp->nSamples != 3
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+ && sp->nSamples != 4
+#endif
+ )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "WEBP driver doesn't support %d bands. Must be 3 (RGB) "
+ #if WEBP_ENCODER_ABI_VERSION >= 0x0100
+ "or 4 (RGBA) "
+ #endif
+ "bands.",
+ sp->nSamples );
+ return 0;
+ }
+
+ /* check bits per sample and data type */
+ if ((nBitsPerSample != 8) && (sampleFormat != 1)) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "WEBP driver requires 8 bit unsigned data");
+ return 0;
+ }
+
+ /* if we were last encoding, terminate this mode */
+ if (sp->state & LSTATE_INIT_ENCODE) {
+ WebPPictureFree(&sp->sPicture);
+ if (sp->pBuffer != NULL) {
+ _TIFFfree(sp->pBuffer);
+ sp->pBuffer = NULL;
+ }
+ sp->buffer_offset = 0;
+ sp->state = 0;
+ }
+
+ sp->state |= LSTATE_INIT_DECODE;
+
+ return 1;
+}
+
+/*
+* Setup state for decoding a strip.
+*/
+static int
+TWebPPreDecode(TIFF* tif, uint16 s)
+{
+ static const char module[] = "TWebPPreDecode";
+ uint32 segment_width, segment_height;
+ WebPState* sp = DecoderState(tif);
+ TIFFDirectory* td = &tif->tif_dir;
+ (void) s;
+ assert(sp != NULL);
+
+ if (isTiled(tif)) {
+ segment_width = td->td_tilewidth;
+ segment_height = td->td_tilelength;
+ } else {
+ segment_width = td->td_imagewidth;
+ segment_height = td->td_imagelength - tif->tif_row;
+ if (segment_height > td->td_rowsperstrip)
+ segment_height = td->td_rowsperstrip;
+ }
+
+ if( (sp->state & LSTATE_INIT_DECODE) == 0 )
+ tif->tif_setupdecode(tif);
+
+ if (sp->psDecoder != NULL) {
+ WebPIDelete(sp->psDecoder);
+ WebPFreeDecBuffer(&sp->sDecBuffer);
+ sp->psDecoder = NULL;
+ }
+
+ sp->last_y = 0;
+
+ WebPInitDecBuffer(&sp->sDecBuffer);
+
+ sp->sDecBuffer.is_external_memory = 0;
+ sp->sDecBuffer.width = segment_width;
+ sp->sDecBuffer.height = segment_height;
+ sp->sDecBuffer.u.RGBA.stride = segment_width * sp->nSamples;
+ sp->sDecBuffer.u.RGBA.size = segment_width * sp->nSamples * segment_height;
+
+ if (sp->nSamples > 3) {
+ sp->sDecBuffer.colorspace = MODE_RGBA;
+ } else {
+ sp->sDecBuffer.colorspace = MODE_RGB;
+ }
+
+ sp->psDecoder = WebPINewDecoder(&sp->sDecBuffer);
+
+ if (sp->psDecoder == NULL) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Unable to allocate WebP decoder.");
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+TWebPSetupEncode(TIFF* tif)
+{
+ static const char module[] = "WebPSetupEncode";
+ uint16 nBitsPerSample = tif->tif_dir.td_bitspersample;
+ uint16 sampleFormat = tif->tif_dir.td_sampleformat;
+
+ WebPState* sp = EncoderState(tif);
+ assert(sp != NULL);
+
+ sp->nSamples = tif->tif_dir.td_samplesperpixel;
+
+ /* check band count */
+ if ( sp->nSamples != 3
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+ && sp->nSamples != 4
+#endif
+ )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "WEBP driver doesn't support %d bands. Must be 3 (RGB) "
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+ "or 4 (RGBA) "
+#endif
+ "bands.",
+ sp->nSamples );
+ return 0;
+ }
+
+ /* check bits per sample and data type */
+ if ((nBitsPerSample != 8) && (sampleFormat != 1)) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "WEBP driver requires 8 bit unsigned data");
+ return 0;
+ }
+
+ if (sp->state & LSTATE_INIT_DECODE) {
+ WebPIDelete(sp->psDecoder);
+ WebPFreeDecBuffer(&sp->sDecBuffer);
+ sp->psDecoder = NULL;
+ sp->last_y = 0;
+ sp->state = 0;
+ }
+
+ sp->state |= LSTATE_INIT_ENCODE;
+
+ if (!WebPPictureInit(&sp->sPicture)) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Error initializing WebP picture.");
+ return 0;
+ }
+
+ if (!WebPConfigInitInternal(&sp->sEncoderConfig, WEBP_PRESET_DEFAULT,
+ sp->quality_level,
+ WEBP_ENCODER_ABI_VERSION)) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Error creating WebP encoder configuration.");
+ return 0;
+ }
+
+ // WebPConfigInitInternal above sets lossless to false
+ #if WEBP_ENCODER_ABI_VERSION >= 0x0100
+ sp->sEncoderConfig.lossless = sp->lossless;
+ if (sp->lossless) {
+ sp->sPicture.use_argb = 1;
+ }
+ #endif
+
+ if (!WebPValidateConfig(&sp->sEncoderConfig)) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Error with WebP encoder configuration.");
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+* Reset encoding state at the start of a strip.
+*/
+static int
+TWebPPreEncode(TIFF* tif, uint16 s)
+{
+ static const char module[] = "TWebPPreEncode";
+ uint32 segment_width, segment_height;
+ WebPState *sp = EncoderState(tif);
+ TIFFDirectory* td = &tif->tif_dir;
+
+ (void) s;
+
+ assert(sp != NULL);
+ if( sp->state != LSTATE_INIT_ENCODE )
+ tif->tif_setupencode(tif);
+
+ /*
+ * Set encoding parameters for this strip/tile.
+ */
+ if (isTiled(tif)) {
+ segment_width = td->td_tilewidth;
+ segment_height = td->td_tilelength;
+ } else {
+ segment_width = td->td_imagewidth;
+ segment_height = td->td_imagelength - tif->tif_row;
+ if (segment_height > td->td_rowsperstrip)
+ segment_height = td->td_rowsperstrip;
+ }
+
+ if( segment_width > 16383 || segment_height > 16383 ) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "WEBP maximum image dimensions are 16383 x 16383.");
+ return 0;
+ }
+
+ /* set up buffer for raw data */
+ /* given above check and that nSamples <= 4, buffer_size is <= 1 GB */
+ sp->buffer_size = segment_width * segment_height * sp->nSamples;
+
+ if (sp->pBuffer != NULL) {
+ _TIFFfree(sp->pBuffer);
+ sp->pBuffer = NULL;
+ }
+
+ sp->pBuffer = _TIFFmalloc(sp->buffer_size);
+ if( !sp->pBuffer) {
+ TIFFErrorExt(tif->tif_clientdata, module, "Cannot allocate buffer");
+ return 0;
+ }
+ sp->buffer_offset = 0;
+
+ sp->sPicture.width = segment_width;
+ sp->sPicture.height = segment_height;
+ sp->sPicture.writer = TWebPDatasetWriter;
+ sp->sPicture.custom_ptr = tif;
+
+ return 1;
+}
+
+/*
+* Finish off an encoded strip by flushing it.
+*/
+static int
+TWebPPostEncode(TIFF* tif)
+{
+ static const char module[] = "WebPPostEncode";
+ int64_t stride;
+ WebPState *sp = EncoderState(tif);
+ assert(sp != NULL);
+
+ assert(sp->state == LSTATE_INIT_ENCODE);
+
+ stride = (int64_t)sp->sPicture.width * sp->nSamples;
+
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+ if (sp->nSamples == 4) {
+ if (!WebPPictureImportRGBA(&sp->sPicture, sp->pBuffer, (int)stride)) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "WebPPictureImportRGBA() failed" );
+ return 0;
+ }
+ }
+ else
+#endif
+ if (!WebPPictureImportRGB(&sp->sPicture, sp->pBuffer, (int)stride)) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "WebPPictureImportRGB() failed");
+ return 0;
+ }
+
+ if (!WebPEncode(&sp->sEncoderConfig, &sp->sPicture)) {
+
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+ const char* pszErrorMsg = NULL;
+ switch(sp->sPicture.error_code) {
+ case VP8_ENC_ERROR_OUT_OF_MEMORY:
+ pszErrorMsg = "Out of memory"; break;
+ case VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY:
+ pszErrorMsg = "Out of memory while flushing bits"; break;
+ case VP8_ENC_ERROR_NULL_PARAMETER:
+ pszErrorMsg = "A pointer parameter is NULL"; break;
+ case VP8_ENC_ERROR_INVALID_CONFIGURATION:
+ pszErrorMsg = "Configuration is invalid"; break;
+ case VP8_ENC_ERROR_BAD_DIMENSION:
+ pszErrorMsg = "Picture has invalid width/height"; break;
+ case VP8_ENC_ERROR_PARTITION0_OVERFLOW:
+ pszErrorMsg = "Partition is bigger than 512k. Try using less "
+ "SEGMENTS, or increase PARTITION_LIMIT value";
+ break;
+ case VP8_ENC_ERROR_PARTITION_OVERFLOW:
+ pszErrorMsg = "Partition is bigger than 16M";
+ break;
+ case VP8_ENC_ERROR_BAD_WRITE:
+ pszErrorMsg = "Error while fludshing bytes"; break;
+ case VP8_ENC_ERROR_FILE_TOO_BIG:
+ pszErrorMsg = "File is bigger than 4G"; break;
+ case VP8_ENC_ERROR_USER_ABORT:
+ pszErrorMsg = "User interrupted";
+ break;
+ default:
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "WebPEncode returned an unknown error code: %d",
+ sp->sPicture.error_code);
+ pszErrorMsg = "Unknown WebP error type.";
+ break;
+ }
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "WebPEncode() failed : %s", pszErrorMsg);
+#else
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Error in WebPEncode()");
+#endif
+ return 0;
+ }
+
+ sp->sPicture.custom_ptr = NULL;
+
+ if (!TIFFFlushData1(tif))
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Error flushing TIFF WebP encoder.");
+ return 0;
+ }
+
+ return 1;
+}
+
+static void
+TWebPCleanup(TIFF* tif)
+{
+ WebPState* sp = LState(tif);
+
+ assert(sp != 0);
+
+ tif->tif_tagmethods.vgetfield = sp->vgetparent;
+ tif->tif_tagmethods.vsetfield = sp->vsetparent;
+
+ if (sp->state & LSTATE_INIT_ENCODE) {
+ WebPPictureFree(&sp->sPicture);
+ }
+
+ if (sp->psDecoder != NULL) {
+ WebPIDelete(sp->psDecoder);
+ WebPFreeDecBuffer(&sp->sDecBuffer);
+ sp->psDecoder = NULL;
+ sp->last_y = 0;
+ }
+
+ if (sp->pBuffer != NULL) {
+ _TIFFfree(sp->pBuffer);
+ sp->pBuffer = NULL;
+ }
+
+ _TIFFfree(tif->tif_data);
+ tif->tif_data = NULL;
+
+ _TIFFSetDefaultCompressionState(tif);
+}
+
+static int
+TWebPVSetField(TIFF* tif, uint32 tag, va_list ap)
+{
+ static const char module[] = "WebPVSetField";
+ WebPState* sp = LState(tif);
+
+ switch (tag) {
+ case TIFFTAG_WEBP_LEVEL:
+ sp->quality_level = (int) va_arg(ap, int);
+ if( sp->quality_level <= 0 ||
+ sp->quality_level > 100.0f ) {
+ TIFFWarningExt(tif->tif_clientdata, module,
+ "WEBP_LEVEL should be between 1 and 100");
+ }
+ return 1;
+ case TIFFTAG_WEBP_LOSSLESS:
+ #if WEBP_ENCODER_ABI_VERSION >= 0x0100
+ sp->lossless = va_arg(ap, int);
+ if (sp->lossless){
+ sp->quality_level = 100.0f;
+ }
+ return 1;
+ #else
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Need to upgrade WEBP driver, this version doesn't support "
+ "lossless compression.");
+ return 0;
+ #endif
+ default:
+ return (*sp->vsetparent)(tif, tag, ap);
+ }
+ /*NOTREACHED*/
+}
+
+static int
+TWebPVGetField(TIFF* tif, uint32 tag, va_list ap)
+{
+ WebPState* sp = LState(tif);
+
+ switch (tag) {
+ case TIFFTAG_WEBP_LEVEL:
+ *va_arg(ap, int*) = sp->quality_level;
+ break;
+ case TIFFTAG_WEBP_LOSSLESS:
+ *va_arg(ap, int*) = sp->lossless;
+ break;
+ default:
+ return (*sp->vgetparent)(tif, tag, ap);
+ }
+ return 1;
+}
+
+static const TIFFField TWebPFields[] = {
+ { TIFFTAG_WEBP_LEVEL, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT,
+ TIFF_SETGET_UNDEFINED,
+ FIELD_PSEUDO, TRUE, FALSE, "WEBP quality", NULL },
+ { TIFFTAG_WEBP_LOSSLESS, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT,
+ TIFF_SETGET_UNDEFINED,
+ FIELD_PSEUDO, TRUE, FALSE, "WEBP lossless/lossy", NULL
+ },
+};
+
+int
+TIFFInitWebP(TIFF* tif, int scheme)
+{
+ static const char module[] = "TIFFInitWebP";
+ WebPState* sp;
+
+ assert( scheme == COMPRESSION_WEBP );
+
+ /*
+ * Merge codec-specific tag information.
+ */
+ if ( !_TIFFMergeFields(tif, TWebPFields, TIFFArrayCount(TWebPFields)) ) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Merging WebP codec-specific tags failed");
+ return 0;
+ }
+
+ /*
+ * Allocate state block so tag methods have storage to record values.
+ */
+ tif->tif_data = (uint8*) _TIFFmalloc(sizeof(WebPState));
+ if (tif->tif_data == NULL)
+ goto bad;
+ sp = LState(tif);
+
+ /*
+ * Override parent get/set field methods.
+ */
+ sp->vgetparent = tif->tif_tagmethods.vgetfield;
+ tif->tif_tagmethods.vgetfield = TWebPVGetField; /* hook for codec tags */
+ sp->vsetparent = tif->tif_tagmethods.vsetfield;
+ tif->tif_tagmethods.vsetfield = TWebPVSetField; /* hook for codec tags */
+
+ /* Default values for codec-specific fields */
+ sp->quality_level = 75.0f; /* default comp. level */
+ sp->lossless = 0; /* default to false */
+ sp->state = 0;
+ sp->nSamples = 0;
+ sp->psDecoder = NULL;
+ sp->last_y = 0;
+
+ sp->buffer_offset = 0;
+ sp->pBuffer = NULL;
+
+ /*
+ * Install codec methods.
+ * Notes:
+ * encoderow is not supported
+ */
+ tif->tif_fixuptags = TWebPFixupTags;
+ tif->tif_setupdecode = TWebPSetupDecode;
+ tif->tif_predecode = TWebPPreDecode;
+ tif->tif_decoderow = TWebPDecode;
+ tif->tif_decodestrip = TWebPDecode;
+ tif->tif_decodetile = TWebPDecode;
+ tif->tif_setupencode = TWebPSetupEncode;
+ tif->tif_preencode = TWebPPreEncode;
+ tif->tif_postencode = TWebPPostEncode;
+ tif->tif_encoderow = TWebPEncode;
+ tif->tif_encodestrip = TWebPEncode;
+ tif->tif_encodetile = TWebPEncode;
+ tif->tif_cleanup = TWebPCleanup;
+
+ return 1;
+bad:
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "No space for WebP state block");
+ return 0;
+}
+
+#endif /* WEBP_SUPPORT */
diff --git a/tiff/libtiff/tif_win32.c b/tiff/libtiff/tif_win32.c
index 090baed87..088880e7c 100644
--- a/tiff/libtiff/tif_win32.c
+++ b/tiff/libtiff/tif_win32.c
@@ -1,5 +1,3 @@
-/* $Id: tif_win32.c,v 1.42 2017-01-11 19:02:49 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -407,60 +405,21 @@ _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c)
static void
Win32WarningHandler(const char* module, const char* fmt, va_list ap)
{
-#ifndef TIF_PLATFORM_CONSOLE
- LPTSTR szTitle;
- LPTSTR szTmp;
- LPCTSTR szTitleText = "%s Warning";
- LPCTSTR szDefaultModule = "LIBTIFF";
- LPCTSTR szTmpModule = (module == NULL) ? szDefaultModule : module;
- SIZE_T nBufSize = (strlen(szTmpModule) +
- strlen(szTitleText) + strlen(fmt) + 256)*sizeof(char);
-
- if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, nBufSize)) == NULL)
- return;
- sprintf(szTitle, szTitleText, szTmpModule);
- szTmp = szTitle + (strlen(szTitle)+2)*sizeof(char);
- vsnprintf(szTmp, nBufSize-(strlen(szTitle)+2)*sizeof(char), fmt, ap);
- MessageBoxA(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONINFORMATION);
- LocalFree(szTitle);
-
- return;
-#else
if (module != NULL)
fprintf(stderr, "%s: ", module);
fprintf(stderr, "Warning, ");
vfprintf(stderr, fmt, ap);
fprintf(stderr, ".\n");
-#endif
}
TIFFErrorHandler _TIFFwarningHandler = Win32WarningHandler;
static void
Win32ErrorHandler(const char* module, const char* fmt, va_list ap)
{
-#ifndef TIF_PLATFORM_CONSOLE
- LPTSTR szTitle;
- LPTSTR szTmp;
- LPCTSTR szTitleText = "%s Error";
- LPCTSTR szDefaultModule = "LIBTIFF";
- LPCTSTR szTmpModule = (module == NULL) ? szDefaultModule : module;
- SIZE_T nBufSize = (strlen(szTmpModule) +
- strlen(szTitleText) + strlen(fmt) + 256)*sizeof(char);
-
- if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, nBufSize)) == NULL)
- return;
- sprintf(szTitle, szTitleText, szTmpModule);
- szTmp = szTitle + (strlen(szTitle)+2)*sizeof(char);
- vsnprintf(szTmp, nBufSize-(strlen(szTitle)+2)*sizeof(char), fmt, ap);
- MessageBoxA(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONEXCLAMATION);
- LocalFree(szTitle);
- return;
-#else
if (module != NULL)
fprintf(stderr, "%s: ", module);
vfprintf(stderr, fmt, ap);
fprintf(stderr, ".\n");
-#endif
}
TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler;
diff --git a/tiff/libtiff/tif_write.c b/tiff/libtiff/tif_write.c
index 4c216ec20..33e803c17 100644
--- a/tiff/libtiff/tif_write.c
+++ b/tiff/libtiff/tif_write.c
@@ -1,5 +1,3 @@
-/* $Id: tif_write.c,v 1.46 2016-12-03 21:57:44 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -130,10 +128,10 @@ TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample)
tif->tif_rawcc = 0;
tif->tif_rawcp = tif->tif_rawdata;
- if( td->td_stripbytecount[strip] > 0 )
+ if( td->td_stripbytecount_p[strip] > 0 )
{
/* if we are writing over existing tiles, zero length */
- td->td_stripbytecount[strip] = 0;
+ td->td_stripbytecount_p[strip] = 0;
/* this forces TIFFAppendToStrip() to do a seek */
tif->tif_curoff = 0;
@@ -178,6 +176,32 @@ TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample)
return (status);
}
+/* Make sure that at the first attempt of rewriting a tile/strip, we will have */
+/* more bytes available in the output buffer than the previous byte count, */
+/* so that TIFFAppendToStrip() will detect the overflow when it is called the first */
+/* time if the new compressed tile is bigger than the older one. (GDAL #4771) */
+static int _TIFFReserveLargeEnoughWriteBuffer(TIFF* tif, uint32 strip_or_tile)
+{
+ TIFFDirectory *td = &tif->tif_dir;
+ if( td->td_stripbytecount_p[strip_or_tile] > 0 )
+ {
+ /* The +1 is to ensure at least one extra bytes */
+ /* The +4 is because the LZW encoder flushes 4 bytes before the limit */
+ uint64 safe_buffer_size = (uint64)(td->td_stripbytecount_p[strip_or_tile] + 1 + 4);
+ if( tif->tif_rawdatasize <= (tmsize_t)safe_buffer_size )
+ {
+ if( !(TIFFWriteBufferSetup(tif, NULL,
+ (tmsize_t)TIFFroundup_64(safe_buffer_size, 1024))) )
+ return 0;
+ }
+
+ /* Force TIFFAppendToStrip() to consider placing data at end
+ of file. */
+ tif->tif_curoff = 0;
+ }
+ return 1;
+}
+
/*
* Encode the supplied data and write it to the
* specified strip.
@@ -224,6 +248,13 @@ TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc)
tif->tif_flags |= TIFF_BUF4WRITE;
tif->tif_curstrip = strip;
+ if( !_TIFFReserveLargeEnoughWriteBuffer(tif, strip) ) {
+ return ((tmsize_t)(-1));
+ }
+
+ tif->tif_rawcc = 0;
+ tif->tif_rawcp = tif->tif_rawdata;
+
if (td->td_stripsperimage == 0) {
TIFFErrorExt(tif->tif_clientdata, module, "Zero strips per image");
return ((tmsize_t) -1);
@@ -236,27 +267,6 @@ TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc)
tif->tif_flags |= TIFF_CODERSETUP;
}
- if( td->td_stripbytecount[strip] > 0 )
- {
- /* Make sure that at the first attempt of rewriting the tile, we will have */
- /* more bytes available in the output buffer than the previous byte count, */
- /* so that TIFFAppendToStrip() will detect the overflow when it is called the first */
- /* time if the new compressed tile is bigger than the older one. (GDAL #4771) */
- if( tif->tif_rawdatasize <= (tmsize_t)td->td_stripbytecount[strip] )
- {
- if( !(TIFFWriteBufferSetup(tif, NULL,
- (tmsize_t)TIFFroundup_64((uint64)(td->td_stripbytecount[strip] + 1), 1024))) )
- return ((tmsize_t)(-1));
- }
-
- /* Force TIFFAppendToStrip() to consider placing data at end
- of file. */
- tif->tif_curoff = 0;
- }
-
- tif->tif_rawcc = 0;
- tif->tif_rawcp = tif->tif_rawdata;
-
tif->tif_flags &= ~TIFF_POSTENCODE;
/* shortcut to avoid an extra memcpy() */
@@ -404,22 +414,8 @@ TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc)
tif->tif_flags |= TIFF_BUF4WRITE;
tif->tif_curtile = tile;
- if( td->td_stripbytecount[tile] > 0 )
- {
- /* Make sure that at the first attempt of rewriting the tile, we will have */
- /* more bytes available in the output buffer than the previous byte count, */
- /* so that TIFFAppendToStrip() will detect the overflow when it is called the first */
- /* time if the new compressed tile is bigger than the older one. (GDAL #4771) */
- if( tif->tif_rawdatasize <= (tmsize_t) td->td_stripbytecount[tile] )
- {
- if( !(TIFFWriteBufferSetup(tif, NULL,
- (tmsize_t)TIFFroundup_64((uint64)(td->td_stripbytecount[tile] + 1), 1024))) )
- return ((tmsize_t)(-1));
- }
-
- /* Force TIFFAppendToStrip() to consider placing data at end
- of file. */
- tif->tif_curoff = 0;
+ if( !_TIFFReserveLargeEnoughWriteBuffer(tif, tile) ) {
+ return ((tmsize_t)(-1));
}
tif->tif_rawcc = 0;
@@ -539,18 +535,20 @@ TIFFSetupStrips(TIFF* tif)
td->td_nstrips = td->td_stripsperimage;
if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
td->td_stripsperimage /= td->td_samplesperpixel;
- td->td_stripoffset = (uint64 *)
- _TIFFmalloc(td->td_nstrips * sizeof (uint64));
- td->td_stripbytecount = (uint64 *)
- _TIFFmalloc(td->td_nstrips * sizeof (uint64));
- if (td->td_stripoffset == NULL || td->td_stripbytecount == NULL)
+ td->td_stripoffset_p = (uint64 *)
+ _TIFFCheckMalloc(tif, td->td_nstrips, sizeof (uint64),
+ "for \"StripOffsets\" array");
+ td->td_stripbytecount_p = (uint64 *)
+ _TIFFCheckMalloc(tif, td->td_nstrips, sizeof (uint64),
+ "for \"StripByteCounts\" array");
+ if (td->td_stripoffset_p == NULL || td->td_stripbytecount_p == NULL)
return (0);
/*
* Place data at the end-of-file
* (by setting offsets to zero).
*/
- _TIFFmemset(td->td_stripoffset, 0, td->td_nstrips*sizeof (uint64));
- _TIFFmemset(td->td_stripbytecount, 0, td->td_nstrips*sizeof (uint64));
+ _TIFFmemset(td->td_stripoffset_p, 0, td->td_nstrips*sizeof (uint64));
+ _TIFFmemset(td->td_stripbytecount_p, 0, td->td_nstrips*sizeof (uint64));
TIFFSetFieldBit(tif, FIELD_STRIPOFFSETS);
TIFFSetFieldBit(tif, FIELD_STRIPBYTECOUNTS);
return (1);
@@ -572,7 +570,7 @@ TIFFWriteCheck(TIFF* tif, int tiles, const char* module)
}
if (tiles ^ isTiled(tif)) {
TIFFErrorExt(tif->tif_clientdata, module, tiles ?
- "Can not write tiles to a stripped image" :
+ "Can not write tiles to a striped image" :
"Can not write scanlines to a tiled image");
return (0);
}
@@ -610,7 +608,7 @@ TIFFWriteCheck(TIFF* tif, int tiles, const char* module)
return (0);
}
}
- if (tif->tif_dir.td_stripoffset == NULL && !TIFFSetupStrips(tif)) {
+ if (tif->tif_dir.td_stripoffset_p == NULL && !TIFFSetupStrips(tif)) {
tif->tif_dir.td_nstrips = 0;
TIFFErrorExt(tif->tif_clientdata, module, "No space for %s arrays",
isTiled(tif) ? "tile" : "strip");
@@ -628,6 +626,20 @@ TIFFWriteCheck(TIFF* tif, int tiles, const char* module)
if (tif->tif_scanlinesize == 0)
return (0);
tif->tif_flags |= TIFF_BEENWRITING;
+
+ if( tif->tif_dir.td_stripoffset_entry.tdir_tag != 0 &&
+ tif->tif_dir.td_stripoffset_entry.tdir_count == 0 &&
+ tif->tif_dir.td_stripoffset_entry.tdir_type == 0 &&
+ tif->tif_dir.td_stripoffset_entry.tdir_offset.toff_long8 == 0 &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_tag != 0 &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_count == 0 &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_type == 0 &&
+ tif->tif_dir.td_stripbytecount_entry.tdir_offset.toff_long8 == 0 &&
+ !(tif->tif_flags & TIFF_DIRTYDIRECT) )
+ {
+ TIFFForceStrileArrayWriting(tif);
+ }
+
return (1);
}
@@ -684,9 +696,9 @@ TIFFGrowStrips(TIFF* tif, uint32 delta, const char* module)
uint64* new_stripbytecount;
assert(td->td_planarconfig == PLANARCONFIG_CONTIG);
- new_stripoffset = (uint64*)_TIFFrealloc(td->td_stripoffset,
+ new_stripoffset = (uint64*)_TIFFrealloc(td->td_stripoffset_p,
(td->td_nstrips + delta) * sizeof (uint64));
- new_stripbytecount = (uint64*)_TIFFrealloc(td->td_stripbytecount,
+ new_stripbytecount = (uint64*)_TIFFrealloc(td->td_stripbytecount_p,
(td->td_nstrips + delta) * sizeof (uint64));
if (new_stripoffset == NULL || new_stripbytecount == NULL) {
if (new_stripoffset)
@@ -697,11 +709,11 @@ TIFFGrowStrips(TIFF* tif, uint32 delta, const char* module)
TIFFErrorExt(tif->tif_clientdata, module, "No space to expand strip arrays");
return (0);
}
- td->td_stripoffset = new_stripoffset;
- td->td_stripbytecount = new_stripbytecount;
- _TIFFmemset(td->td_stripoffset + td->td_nstrips,
+ td->td_stripoffset_p = new_stripoffset;
+ td->td_stripbytecount_p = new_stripbytecount;
+ _TIFFmemset(td->td_stripoffset_p + td->td_nstrips,
0, delta*sizeof (uint64));
- _TIFFmemset(td->td_stripbytecount + td->td_nstrips,
+ _TIFFmemset(td->td_stripbytecount_p + td->td_nstrips,
0, delta*sizeof (uint64));
td->td_nstrips += delta;
tif->tif_flags |= TIFF_DIRTYDIRECT;
@@ -720,12 +732,12 @@ TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc)
uint64 m;
int64 old_byte_count = -1;
- if (td->td_stripoffset[strip] == 0 || tif->tif_curoff == 0) {
+ if (td->td_stripoffset_p[strip] == 0 || tif->tif_curoff == 0) {
assert(td->td_nstrips > 0);
- if( td->td_stripbytecount[strip] != 0
- && td->td_stripoffset[strip] != 0
- && td->td_stripbytecount[strip] >= (uint64) cc )
+ if( td->td_stripbytecount_p[strip] != 0
+ && td->td_stripoffset_p[strip] != 0
+ && td->td_stripbytecount_p[strip] >= (uint64) cc )
{
/*
* There is already tile data on disk, and the new tile
@@ -734,7 +746,7 @@ TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc)
* more data to append to this strip before we are done
* depending on how we are getting called.
*/
- if (!SeekOK(tif, td->td_stripoffset[strip])) {
+ if (!SeekOK(tif, td->td_stripoffset_p[strip])) {
TIFFErrorExt(tif->tif_clientdata, module,
"Seek error at scanline %lu",
(unsigned long)tif->tif_row);
@@ -747,17 +759,17 @@ TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc)
* Seek to end of file, and set that as our location to
* write this strip.
*/
- td->td_stripoffset[strip] = TIFFSeekFile(tif, 0, SEEK_END);
+ td->td_stripoffset_p[strip] = TIFFSeekFile(tif, 0, SEEK_END);
tif->tif_flags |= TIFF_DIRTYSTRIP;
}
- tif->tif_curoff = td->td_stripoffset[strip];
+ tif->tif_curoff = td->td_stripoffset_p[strip];
/*
* We are starting a fresh strip/tile, so set the size to zero.
*/
- old_byte_count = td->td_stripbytecount[strip];
- td->td_stripbytecount[strip] = 0;
+ old_byte_count = td->td_stripbytecount_p[strip];
+ td->td_stripbytecount_p[strip] = 0;
}
m = tif->tif_curoff+cc;
@@ -774,9 +786,9 @@ TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc)
return (0);
}
tif->tif_curoff = m;
- td->td_stripbytecount[strip] += cc;
+ td->td_stripbytecount_p[strip] += cc;
- if( (int64) td->td_stripbytecount[strip] != old_byte_count )
+ if( (int64) td->td_stripbytecount_p[strip] != old_byte_count )
tif->tif_flags |= TIFF_DIRTYSTRIP;
return (1);
diff --git a/tiff/libtiff/tif_zip.c b/tiff/libtiff/tif_zip.c
index 42943fbb1..c75077349 100644
--- a/tiff/libtiff/tif_zip.c
+++ b/tiff/libtiff/tif_zip.c
@@ -1,5 +1,3 @@
-/* $Id: tif_zip.c,v 1.37 2017-05-10 15:21:16 erouault Exp $ */
-
/*
* Copyright (c) 1995-1997 Sam Leffler
* Copyright (c) 1995-1997 Silicon Graphics, Inc.
@@ -126,7 +124,6 @@ ZIPSetupDecode(TIFF* tif)
static int
ZIPPreDecode(TIFF* tif, uint16 s)
{
- static const char module[] = "ZIPPreDecode";
ZIPState* sp = DecoderState(tif);
(void) s;
@@ -140,12 +137,7 @@ ZIPPreDecode(TIFF* tif, uint16 s)
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
appropriately even before we simplify it */
- sp->stream.avail_in = (uInt) tif->tif_rawcc;
- if ((tmsize_t)sp->stream.avail_in != tif->tif_rawcc)
- {
- TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
- return (0);
- }
+ sp->stream.avail_in = (uint64)tif->tif_rawcc < 0xFFFFFFFFU ? (uInt) tif->tif_rawcc : 0xFFFFFFFFU;
return (inflateReset(&sp->stream) == Z_OK);
}
@@ -160,46 +152,43 @@ ZIPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
assert(sp->state == ZSTATE_INIT_DECODE);
sp->stream.next_in = tif->tif_rawcp;
- sp->stream.avail_in = (uInt) tif->tif_rawcc;
sp->stream.next_out = op;
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
appropriately even before we simplify it */
- sp->stream.avail_out = (uInt) occ;
- if ((tmsize_t)sp->stream.avail_out != occ)
- {
- TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
- return (0);
- }
do {
- int state = inflate(&sp->stream, Z_PARTIAL_FLUSH);
+ int state;
+ uInt avail_in_before = (uint64)tif->tif_rawcc <= 0xFFFFFFFFU ? (uInt)tif->tif_rawcc : 0xFFFFFFFFU;
+ uInt avail_out_before = (uint64)occ < 0xFFFFFFFFU ? (uInt) occ : 0xFFFFFFFFU;
+ sp->stream.avail_in = avail_in_before;
+ sp->stream.avail_out = avail_out_before;
+ state = inflate(&sp->stream, Z_PARTIAL_FLUSH);
+ tif->tif_rawcc -= (avail_in_before - sp->stream.avail_in);
+ occ -= (avail_out_before - sp->stream.avail_out);
if (state == Z_STREAM_END)
break;
if (state == Z_DATA_ERROR) {
TIFFErrorExt(tif->tif_clientdata, module,
"Decoding error at scanline %lu, %s",
(unsigned long) tif->tif_row, SAFE_MSG(sp));
- if (inflateSync(&sp->stream) != Z_OK)
- return (0);
- continue;
+ return (0);
}
if (state != Z_OK) {
TIFFErrorExt(tif->tif_clientdata, module,
"ZLib error: %s", SAFE_MSG(sp));
return (0);
}
- } while (sp->stream.avail_out > 0);
- if (sp->stream.avail_out != 0) {
+ } while (occ > 0);
+ if (occ != 0) {
TIFFErrorExt(tif->tif_clientdata, module,
"Not enough data at scanline %lu (short " TIFF_UINT64_FORMAT " bytes)",
- (unsigned long) tif->tif_row, (TIFF_UINT64_T) sp->stream.avail_out);
+ (unsigned long) tif->tif_row, (TIFF_UINT64_T) occ);
return (0);
}
tif->tif_rawcp = sp->stream.next_in;
- tif->tif_rawcc = sp->stream.avail_in;
return (1);
}
@@ -231,7 +220,6 @@ ZIPSetupEncode(TIFF* tif)
static int
ZIPPreEncode(TIFF* tif, uint16 s)
{
- static const char module[] = "ZIPPreEncode";
ZIPState *sp = EncoderState(tif);
(void) s;
@@ -244,12 +232,7 @@ ZIPPreEncode(TIFF* tif, uint16 s)
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
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");
- return (0);
- }
+ sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
return (deflateReset(&sp->stream) == Z_OK);
}
@@ -271,13 +254,9 @@ ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
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
appropriately even before we simplify it */
- sp->stream.avail_in = (uInt) cc;
- if ((tmsize_t)sp->stream.avail_in != cc)
- {
- TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
- return (0);
- }
do {
+ uInt avail_in_before = (uint64)cc <= 0xFFFFFFFFU ? (uInt)cc : 0xFFFFFFFFU;
+ sp->stream.avail_in = avail_in_before;
if (deflate(&sp->stream, Z_NO_FLUSH) != Z_OK) {
TIFFErrorExt(tif->tif_clientdata, module,
"Encoder error: %s",
@@ -288,9 +267,10 @@ ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
tif->tif_rawcc = tif->tif_rawdatasize;
TIFFFlushData1(tif);
sp->stream.next_out = tif->tif_rawdata;
- sp->stream.avail_out = (uInt) tif->tif_rawdatasize; /* this is a safe typecast, as check is made already in ZIPPreEncode */
+ sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
}
- } while (sp->stream.avail_in > 0);
+ cc -= (avail_in_before - sp->stream.avail_in);
+ } while (cc > 0);
return (1);
}
@@ -316,7 +296,7 @@ ZIPPostEncode(TIFF* tif)
tif->tif_rawcc = tif->tif_rawdatasize - sp->stream.avail_out;
TIFFFlushData1(tif);
sp->stream.next_out = tif->tif_rawdata;
- sp->stream.avail_out = (uInt) tif->tif_rawdatasize; /* this is a safe typecast, as check is made already in ZIPPreEncode */
+ sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
}
break;
default:
diff --git a/tiff/libtiff/tif_zstd.c b/tiff/libtiff/tif_zstd.c
new file mode 100644
index 000000000..21c935e2d
--- /dev/null
+++ b/tiff/libtiff/tif_zstd.c
@@ -0,0 +1,440 @@
+/*
+* Copyright (c) 2017, Planet Labs
+* Author: <even.rouault at spatialys.com>
+*
+* 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 "tiffiop.h"
+#ifdef ZSTD_SUPPORT
+/*
+* TIFF Library.
+*
+* ZSTD Compression Support
+*
+*/
+
+#include "tif_predict.h"
+#include "zstd.h"
+
+#include <stdio.h>
+
+/*
+* State block for each open TIFF file using ZSTD compression/decompression.
+*/
+typedef struct {
+ TIFFPredictorState predict;
+ ZSTD_DStream* dstream;
+ ZSTD_CStream* cstream;
+ int compression_level; /* compression level */
+ ZSTD_outBuffer out_buffer;
+ int state; /* state flags */
+#define LSTATE_INIT_DECODE 0x01
+#define LSTATE_INIT_ENCODE 0x02
+
+ TIFFVGetMethod vgetparent; /* super-class method */
+ TIFFVSetMethod vsetparent; /* super-class method */
+} ZSTDState;
+
+#define LState(tif) ((ZSTDState*) (tif)->tif_data)
+#define DecoderState(tif) LState(tif)
+#define EncoderState(tif) LState(tif)
+
+static int ZSTDEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s);
+static int ZSTDDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s);
+
+static int
+ZSTDFixupTags(TIFF* tif)
+{
+ (void) tif;
+ return 1;
+}
+
+static int
+ZSTDSetupDecode(TIFF* tif)
+{
+ ZSTDState* sp = DecoderState(tif);
+
+ assert(sp != NULL);
+
+ /* if we were last encoding, terminate this mode */
+ if (sp->state & LSTATE_INIT_ENCODE) {
+ ZSTD_freeCStream(sp->cstream);
+ sp->cstream = NULL;
+ sp->state = 0;
+ }
+
+ sp->state |= LSTATE_INIT_DECODE;
+ return 1;
+}
+
+/*
+* Setup state for decoding a strip.
+*/
+static int
+ZSTDPreDecode(TIFF* tif, uint16 s)
+{
+ static const char module[] = "ZSTDPreDecode";
+ ZSTDState* sp = DecoderState(tif);
+ size_t zstd_ret;
+
+ (void) s;
+ assert(sp != NULL);
+
+ if( (sp->state & LSTATE_INIT_DECODE) == 0 )
+ tif->tif_setupdecode(tif);
+
+ if( sp->dstream )
+ {
+ ZSTD_freeDStream(sp->dstream);
+ sp->dstream = NULL;
+ }
+
+ sp->dstream = ZSTD_createDStream();
+ if( sp->dstream == NULL ) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Cannot allocate decompression stream");
+ return 0;
+ }
+ zstd_ret = ZSTD_initDStream(sp->dstream);
+ if( ZSTD_isError(zstd_ret) ) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Error in ZSTD_initDStream(): %s",
+ ZSTD_getErrorName(zstd_ret));
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+ZSTDDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
+{
+ static const char module[] = "ZSTDDecode";
+ ZSTDState* sp = DecoderState(tif);
+ ZSTD_inBuffer in_buffer;
+ ZSTD_outBuffer out_buffer;
+ size_t zstd_ret;
+
+ (void) s;
+ assert(sp != NULL);
+ assert(sp->state == LSTATE_INIT_DECODE);
+
+ in_buffer.src = tif->tif_rawcp;
+ in_buffer.size = (size_t) tif->tif_rawcc;
+ in_buffer.pos = 0;
+
+ out_buffer.dst = op;
+ out_buffer.size = (size_t) occ;
+ out_buffer.pos = 0;
+
+ do {
+ zstd_ret = ZSTD_decompressStream(sp->dstream, &out_buffer,
+ &in_buffer);
+ if( ZSTD_isError(zstd_ret) ) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Error in ZSTD_decompressStream(): %s",
+ ZSTD_getErrorName(zstd_ret));
+ return 0;
+ }
+ } while( zstd_ret != 0 &&
+ in_buffer.pos < in_buffer.size &&
+ out_buffer.pos < out_buffer.size );
+
+ if (out_buffer.pos < (size_t)occ) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Not enough data at scanline %lu (short %lu bytes)",
+ (unsigned long) tif->tif_row,
+ (unsigned long) (size_t)occ - out_buffer.pos);
+ return 0;
+ }
+
+ tif->tif_rawcp += in_buffer.pos;
+ tif->tif_rawcc -= in_buffer.pos;
+
+ return 1;
+}
+
+static int
+ZSTDSetupEncode(TIFF* tif)
+{
+ ZSTDState* sp = EncoderState(tif);
+
+ assert(sp != NULL);
+ if (sp->state & LSTATE_INIT_DECODE) {
+ ZSTD_freeDStream(sp->dstream);
+ sp->dstream = NULL;
+ sp->state = 0;
+ }
+
+ sp->state |= LSTATE_INIT_ENCODE;
+ return 1;
+}
+
+/*
+* Reset encoding state at the start of a strip.
+*/
+static int
+ZSTDPreEncode(TIFF* tif, uint16 s)
+{
+ static const char module[] = "ZSTDPreEncode";
+ ZSTDState *sp = EncoderState(tif);
+ size_t zstd_ret;
+
+ (void) s;
+ assert(sp != NULL);
+ if( sp->state != LSTATE_INIT_ENCODE )
+ tif->tif_setupencode(tif);
+
+ if (sp->cstream) {
+ ZSTD_freeCStream(sp->cstream);
+ sp->cstream = NULL;
+ }
+ sp->cstream = ZSTD_createCStream();
+ if( sp->cstream == NULL ) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Cannot allocate compression stream");
+ return 0;
+ }
+
+ zstd_ret = ZSTD_initCStream(sp->cstream, sp->compression_level);
+ if( ZSTD_isError(zstd_ret) ) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Error in ZSTD_initCStream(): %s",
+ ZSTD_getErrorName(zstd_ret));
+ return 0;
+ }
+
+ sp->out_buffer.dst = tif->tif_rawdata;
+ sp->out_buffer.size = (size_t)tif->tif_rawdatasize;
+ sp->out_buffer.pos = 0;
+
+ return 1;
+}
+
+/*
+* Encode a chunk of pixels.
+*/
+static int
+ZSTDEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+{
+ static const char module[] = "ZSTDEncode";
+ ZSTDState *sp = EncoderState(tif);
+ ZSTD_inBuffer in_buffer;
+ size_t zstd_ret;
+
+ assert(sp != NULL);
+ assert(sp->state == LSTATE_INIT_ENCODE);
+
+ (void) s;
+
+ in_buffer.src = bp;
+ in_buffer.size = (size_t)cc;
+ in_buffer.pos = 0;
+
+ do {
+ zstd_ret = ZSTD_compressStream(sp->cstream, &sp->out_buffer,
+ &in_buffer);
+ if( ZSTD_isError(zstd_ret) ) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Error in ZSTD_compressStream(): %s",
+ ZSTD_getErrorName(zstd_ret));
+ return 0;
+ }
+ if( sp->out_buffer.pos == sp->out_buffer.size ) {
+ tif->tif_rawcc = tif->tif_rawdatasize;
+ TIFFFlushData1(tif);
+ sp->out_buffer.dst = tif->tif_rawcp;
+ sp->out_buffer.pos = 0;
+ }
+ } while( in_buffer.pos < in_buffer.size );
+
+ return 1;
+}
+
+/*
+* Finish off an encoded strip by flushing it.
+*/
+static int
+ZSTDPostEncode(TIFF* tif)
+{
+ static const char module[] = "ZSTDPostEncode";
+ ZSTDState *sp = EncoderState(tif);
+ size_t zstd_ret;
+
+ do {
+ zstd_ret = ZSTD_endStream(sp->cstream, &sp->out_buffer);
+ if( ZSTD_isError(zstd_ret) ) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Error in ZSTD_endStream(): %s",
+ ZSTD_getErrorName(zstd_ret));
+ return 0;
+ }
+ if( sp->out_buffer.pos > 0 ) {
+ tif->tif_rawcc = sp->out_buffer.pos;
+ TIFFFlushData1(tif);
+ sp->out_buffer.dst = tif->tif_rawcp;
+ sp->out_buffer.pos = 0;
+ }
+ } while (zstd_ret != 0);
+ return 1;
+}
+
+static void
+ZSTDCleanup(TIFF* tif)
+{
+ ZSTDState* sp = LState(tif);
+
+ assert(sp != 0);
+
+ (void)TIFFPredictorCleanup(tif);
+
+ tif->tif_tagmethods.vgetfield = sp->vgetparent;
+ tif->tif_tagmethods.vsetfield = sp->vsetparent;
+
+ if (sp->dstream) {
+ ZSTD_freeDStream(sp->dstream);
+ sp->dstream = NULL;
+ }
+ if (sp->cstream) {
+ ZSTD_freeCStream(sp->cstream);
+ sp->cstream = NULL;
+ }
+ _TIFFfree(sp);
+ tif->tif_data = NULL;
+
+ _TIFFSetDefaultCompressionState(tif);
+}
+
+static int
+ZSTDVSetField(TIFF* tif, uint32 tag, va_list ap)
+{
+ static const char module[] = "ZSTDVSetField";
+ ZSTDState* sp = LState(tif);
+
+ switch (tag) {
+ case TIFFTAG_ZSTD_LEVEL:
+ sp->compression_level = (int) va_arg(ap, int);
+ if( sp->compression_level <= 0 ||
+ sp->compression_level > ZSTD_maxCLevel() )
+ {
+ TIFFWarningExt(tif->tif_clientdata, module,
+ "ZSTD_LEVEL should be between 1 and %d",
+ ZSTD_maxCLevel());
+ }
+ return 1;
+ default:
+ return (*sp->vsetparent)(tif, tag, ap);
+ }
+ /*NOTREACHED*/
+}
+
+static int
+ZSTDVGetField(TIFF* tif, uint32 tag, va_list ap)
+{
+ ZSTDState* sp = LState(tif);
+
+ switch (tag) {
+ case TIFFTAG_ZSTD_LEVEL:
+ *va_arg(ap, int*) = sp->compression_level;
+ break;
+ default:
+ return (*sp->vgetparent)(tif, tag, ap);
+ }
+ return 1;
+}
+
+static const TIFFField ZSTDFields[] = {
+ { TIFFTAG_ZSTD_LEVEL, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT,
+ TIFF_SETGET_UNDEFINED,
+ FIELD_PSEUDO, TRUE, FALSE, "ZSTD compression_level", NULL },
+};
+
+int
+TIFFInitZSTD(TIFF* tif, int scheme)
+{
+ static const char module[] = "TIFFInitZSTD";
+ ZSTDState* sp;
+
+ assert( scheme == COMPRESSION_ZSTD );
+
+ /*
+ * Merge codec-specific tag information.
+ */
+ if (!_TIFFMergeFields(tif, ZSTDFields, TIFFArrayCount(ZSTDFields))) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Merging ZSTD codec-specific tags failed");
+ return 0;
+ }
+
+ /*
+ * Allocate state block so tag methods have storage to record values.
+ */
+ tif->tif_data = (uint8*) _TIFFmalloc(sizeof(ZSTDState));
+ if (tif->tif_data == NULL)
+ goto bad;
+ sp = LState(tif);
+
+ /*
+ * Override parent get/set field methods.
+ */
+ sp->vgetparent = tif->tif_tagmethods.vgetfield;
+ tif->tif_tagmethods.vgetfield = ZSTDVGetField; /* hook for codec tags */
+ sp->vsetparent = tif->tif_tagmethods.vsetfield;
+ tif->tif_tagmethods.vsetfield = ZSTDVSetField; /* hook for codec tags */
+
+ /* Default values for codec-specific fields */
+ sp->compression_level = 9; /* default comp. level */
+ sp->state = 0;
+ sp->dstream = 0;
+ sp->cstream = 0;
+ sp->out_buffer.dst = NULL;
+ sp->out_buffer.size = 0;
+ sp->out_buffer.pos = 0;
+
+ /*
+ * Install codec methods.
+ */
+ tif->tif_fixuptags = ZSTDFixupTags;
+ tif->tif_setupdecode = ZSTDSetupDecode;
+ tif->tif_predecode = ZSTDPreDecode;
+ tif->tif_decoderow = ZSTDDecode;
+ tif->tif_decodestrip = ZSTDDecode;
+ tif->tif_decodetile = ZSTDDecode;
+ tif->tif_setupencode = ZSTDSetupEncode;
+ tif->tif_preencode = ZSTDPreEncode;
+ tif->tif_postencode = ZSTDPostEncode;
+ tif->tif_encoderow = ZSTDEncode;
+ tif->tif_encodestrip = ZSTDEncode;
+ tif->tif_encodetile = ZSTDEncode;
+ tif->tif_cleanup = ZSTDCleanup;
+ /*
+ * Setup predictor setup.
+ */
+ (void) TIFFPredictorInit(tif);
+ return 1;
+bad:
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "No space for ZSTD state block");
+ return 0;
+}
+#endif /* ZSTD_SUPPORT */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/tiff/libtiff/tiff.h b/tiff/libtiff/tiff.h
index fb39634c4..5b0a0c90f 100644
--- a/tiff/libtiff/tiff.h
+++ b/tiff/libtiff/tiff.h
@@ -1,5 +1,3 @@
-/* $Id: tiff.h,v 1.70 2016-01-23 21:20:34 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -189,7 +187,11 @@ typedef enum {
#define COMPRESSION_SGILOG 34676 /* SGI Log Luminance RLE */
#define COMPRESSION_SGILOG24 34677 /* SGI Log 24-bit packed */
#define COMPRESSION_JP2000 34712 /* Leadtools JPEG2000 */
+#define COMPRESSION_LERC 34887 /* ESRI Lerc codec: https://github.com/Esri/lerc */
+/* compression codes 34887-34889 are reserved for ESRI */
#define COMPRESSION_LZMA 34925 /* LZMA2 */
+#define COMPRESSION_ZSTD 50000 /* ZSTD: WARNING not registered in Adobe-maintained registry */
+#define COMPRESSION_WEBP 50001 /* WEBP: WARNING not registered in Adobe-maintained registry */
#define TIFFTAG_PHOTOMETRIC 262 /* photometric interpretation */
#define PHOTOMETRIC_MINISWHITE 0 /* min value is white */
#define PHOTOMETRIC_MINISBLACK 1 /* min value is black */
@@ -450,6 +452,8 @@ typedef enum {
/* tag 34929 is a private tag registered to FedEx */
#define TIFFTAG_FEDEX_EDR 34929 /* unknown use */
#define TIFFTAG_INTEROPERABILITYIFD 40965 /* Pointer to Interoperability private directory */
+/* tags 50674 to 50677 are reserved for ESRI */
+#define TIFFTAG_LERC_PARAMETERS 50674 /* Stores LERC version and additional compression method */
/* Adobe Digital Negative (DNG) format tags */
#define TIFFTAG_DNGVERSION 50706 /* &DNG version number */
#define TIFFTAG_DNGBACKWARDVERSION 50707 /* &DNG compatibility version */
@@ -603,6 +607,16 @@ typedef enum {
#define TIFFTAG_PERSAMPLE 65563 /* interface for per sample tags */
#define PERSAMPLE_MERGED 0 /* present as a single value */
#define PERSAMPLE_MULTI 1 /* present as multiple values */
+#define TIFFTAG_ZSTD_LEVEL 65564 /* ZSTD compression level */
+#define TIFFTAG_LERC_VERSION 65565 /* LERC version */
+#define LERC_VERSION_2_4 4
+#define TIFFTAG_LERC_ADD_COMPRESSION 65566 /* LERC additional compression */
+#define LERC_ADD_COMPRESSION_NONE 0
+#define LERC_ADD_COMPRESSION_DEFLATE 1
+#define LERC_ADD_COMPRESSION_ZSTD 2
+#define TIFFTAG_LERC_MAXZERROR 65567 /* LERC maximum error */
+#define TIFFTAG_WEBP_LEVEL 65568 /* WebP compression level: WARNING not registered in Adobe-maintained registry */
+#define TIFFTAG_WEBP_LOSSLESS 65569 /* WebP lossless/lossy : WARNING not registered in Adobe-maintained registry */
/*
* EXIF tags
diff --git a/tiff/libtiff/tiffconf.h.cmake.in b/tiff/libtiff/tiffconf.h.cmake.in
index de8a807eb..59542f1e8 100644
--- a/tiff/libtiff/tiffconf.h.cmake.in
+++ b/tiff/libtiff/tiffconf.h.cmake.in
@@ -40,15 +40,6 @@
/* Pointer difference type */
#define TIFF_PTRDIFF_T @TIFF_PTRDIFF_T@
-/* Define to 1 if the system has the type `int16'. */
-#cmakedefine HAVE_INT16 1
-
-/* Define to 1 if the system has the type `int32'. */
-#cmakedefine HAVE_INT32 1
-
-/* Define to 1 if the system has the type `int8'. */
-#cmakedefine HAVE_INT8 1
-
/* Compatibility stuff. */
/* Define as 0 or 1 according to the floating point format suported by the
diff --git a/tiff/libtiff/tiffconf.h.in b/tiff/libtiff/tiffconf.h.in
index 6da9c5a65..5de30c9bb 100644
--- a/tiff/libtiff/tiffconf.h.in
+++ b/tiff/libtiff/tiffconf.h.in
@@ -37,15 +37,6 @@
/* Pointer difference type */
#undef TIFF_PTRDIFF_T
-/* Define to 1 if the system has the type `int16'. */
-#undef HAVE_INT16
-
-/* Define to 1 if the system has the type `int32'. */
-#undef HAVE_INT32
-
-/* Define to 1 if the system has the type `int8'. */
-#undef HAVE_INT8
-
/* Compatibility stuff. */
/* Define as 0 or 1 according to the floating point format suported by the
diff --git a/tiff/libtiff/tiffconf.vc.h b/tiff/libtiff/tiffconf.vc.h
index c8c6c6566..fb37a755f 100644
--- a/tiff/libtiff/tiffconf.vc.h
+++ b/tiff/libtiff/tiffconf.vc.h
@@ -7,15 +7,6 @@
#ifndef _TIFFCONF_
#define _TIFFCONF_
-/* Define to 1 if the system has the type `int16'. */
-/* #undef HAVE_INT16 */
-
-/* Define to 1 if the system has the type `int32'. */
-/* #undef HAVE_INT32 */
-
-/* Define to 1 if the system has the type `int8'. */
-/* #undef HAVE_INT8 */
-
/* The size of a `int', as computed by sizeof. */
#define SIZEOF_INT 4
diff --git a/tiff/libtiff/tiffconf.wince.h b/tiff/libtiff/tiffconf.wince.h
index 2ef3958a0..013b0960d 100644
--- a/tiff/libtiff/tiffconf.wince.h
+++ b/tiff/libtiff/tiffconf.wince.h
@@ -1,5 +1,3 @@
-/* $Id: tiffconf.wince.h,v 1.3 2010-03-10 18:56:49 bfriesen Exp $ */
-
/*
* Windows CE platform tiffconf.wince.h
* Created by Mateusz Loskot (mateusz@loskot.net)
@@ -27,15 +25,6 @@
#ifndef _TIFFCONF_
#define _TIFFCONF_
-/* Define to 1 if the system has the type `int16'. */
-/* #undef HAVE_INT16 */
-
-/* Define to 1 if the system has the type `int32'. */
-/* #undef HAVE_INT32 */
-
-/* Define to 1 if the system has the type `int8'. */
-/* #undef HAVE_INT8 */
-
/* The size of a `int', as computed by sizeof. */
#define SIZEOF_INT 4
diff --git a/tiff/libtiff/tiffio.h b/tiff/libtiff/tiffio.h
index ef61b5c06..198481d53 100644
--- a/tiff/libtiff/tiffio.h
+++ b/tiff/libtiff/tiffio.h
@@ -1,5 +1,3 @@
-/* $Id: tiffio.h,v 1.94 2017-01-11 19:02:49 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -52,7 +50,7 @@ typedef struct tiff TIFF;
* promoted type (i.e. one of int, unsigned int, pointer,
* or double) and because we defined pseudo-tags that are
* outside the range of legal Aldus-assigned tags.
- * NB: tsize_t is int32 and not uint32 because some functions
+ * NB: tsize_t is signed and not unsigned because some functions
* return -1.
* NB: toff_t is not off_t for many reasons; TIFFs max out at
* 32-bit file offsets, and BigTIFF maxes out at 64-bit
@@ -413,6 +411,8 @@ extern int TIFFWriteDirectory(TIFF *);
extern int TIFFWriteCustomDirectory(TIFF *, uint64 *);
extern int TIFFCheckpointDirectory(TIFF *);
extern int TIFFRewriteDirectory(TIFF *);
+extern int TIFFDeferStrileArrayWriting(TIFF *);
+extern int TIFFForceStrileArrayWriting(TIFF* );
#if defined(c_plusplus) || defined(__cplusplus)
extern void TIFFPrintDirectory(TIFF*, FILE*, long = 0);
@@ -470,6 +470,9 @@ extern tmsize_t TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_
extern tmsize_t TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);
extern tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);
extern tmsize_t TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);
+extern int TIFFReadFromUserBuffer(TIFF* tif, uint32 strile,
+ void* inbuf, tmsize_t insize,
+ void* outbuf, tmsize_t outsize);
extern tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);
extern tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);
extern tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);
@@ -490,6 +493,11 @@ extern void TIFFSwabArrayOfDouble(double* dp, tmsize_t n);
extern void TIFFReverseBits(uint8* cp, tmsize_t n);
extern const unsigned char* TIFFGetBitRevTable(int);
+extern uint64 TIFFGetStrileOffset(TIFF *tif, uint32 strile);
+extern uint64 TIFFGetStrileByteCount(TIFF *tif, uint32 strile);
+extern uint64 TIFFGetStrileOffsetWithErr(TIFF *tif, uint32 strile, int *pbErr);
+extern uint64 TIFFGetStrileByteCountWithErr(TIFF *tif, uint32 strile, int *pbErr);
+
#ifdef LOGLUV_PUBLIC
#define U_NEU 0.210526316
#define V_NEU 0.473684211
diff --git a/tiff/libtiff/tiffio.hxx b/tiff/libtiff/tiffio.hxx
index ed994f115..df2cbbceb 100644
--- a/tiff/libtiff/tiffio.hxx
+++ b/tiff/libtiff/tiffio.hxx
@@ -1,5 +1,3 @@
-/* $Id: tiffio.hxx,v 1.3 2010-06-08 18:55:15 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -33,6 +31,7 @@
#include <iostream>
#include "tiff.h"
+#include "tiffio.h"
extern TIFF* TIFFStreamOpen(const char*, std::ostream *);
extern TIFF* TIFFStreamOpen(const char*, std::istream *);
diff --git a/tiff/libtiff/tiffiop.h b/tiff/libtiff/tiffiop.h
index 80d58747d..5da1a51c4 100644
--- a/tiff/libtiff/tiffiop.h
+++ b/tiff/libtiff/tiffiop.h
@@ -1,5 +1,3 @@
-/* $Id: tiffiop.h,v 1.95 2017-09-07 14:02:52 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -90,12 +88,26 @@ extern int snprintf(char* str, size_t size, const char* format, ...);
#endif
#define streq(a,b) (strcmp(a,b) == 0)
+#define strneq(a,b,n) (strncmp(a,b,n) == 0)
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
+#define TIFF_SIZE_T_MAX ((size_t) ~ ((size_t)0))
+#define TIFF_TMSIZE_T_MAX (tmsize_t)(TIFF_SIZE_T_MAX >> 1)
+
+/*
+ * Largest 32-bit unsigned integer value.
+ */
+#define TIFF_UINT32_MAX 0xFFFFFFFFU
+
+/*
+ * Largest 64-bit unsigned integer value.
+ */
+#define TIFF_UINT64_MAX (((uint64)(TIFF_UINT32_MAX)) << 32 | TIFF_UINT32_MAX)
+
typedef struct client_info {
struct client_info *next;
void *data;
@@ -146,6 +158,9 @@ struct tiff {
#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 */
+ #define TIFF_DEFERSTRILELOAD 0x1000000U /* defer strip/tile offset/bytecount array loading. */
+ #define TIFF_LAZYSTRILELOAD 0x2000000U /* lazy/ondemand loading of strip/tile offset/bytecount values. Only used if TIFF_DEFERSTRILELOAD is set and in read-only mode */
+ #define TIFF_CHOPPEDUPARRAYS 0x4000000U /* set when allocChoppedUpStripArrays() has modified strip array */
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 */
@@ -277,7 +292,7 @@ struct tiff {
#define TIFFhowmany8_64(x) (((x)&0x07)?((uint64)(x)>>3)+1:(uint64)(x)>>3)
#define TIFFroundup_64(x, y) (TIFFhowmany_64(x,y)*(y))
-/* Safe multiply which returns zero if there is an integer overflow */
+/* Safe multiply which returns zero if there is an *unsigned* integer overflow. This macro is not safe for *signed* integer types */
#define TIFFSafeMultiply(t,v,m) ((((t)(m) != (t)0) && (((t)(((v)*(m))/(m))) == (t)(v))) ? (t)((v)*(m)) : (t)0)
#define TIFFmax(A,B) ((A)>(B)?(A):(B))
@@ -332,11 +347,15 @@ typedef size_t TIFFIOSize_t;
#define _TIFF_off_t off_t
#endif
-#if __clang_major__ >= 4 || (__clang_major__ == 3 && __clang_minor__ >= 8)
+#if defined(__has_attribute) && defined(__clang__)
+#if __has_attribute(no_sanitize)
#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW __attribute__((no_sanitize("unsigned-integer-overflow")))
#else
#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
#endif
+#else
+#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
+#endif
#if defined(__cplusplus)
@@ -383,12 +402,16 @@ extern TIFFErrorHandlerExt _TIFFerrorHandlerExt;
extern uint32 _TIFFMultiply32(TIFF*, uint32, uint32, const char*);
extern uint64 _TIFFMultiply64(TIFF*, uint64, uint64, const char*);
+extern tmsize_t _TIFFMultiplySSize(TIFF*, tmsize_t, tmsize_t, const char*);
+extern tmsize_t _TIFFCastUInt64ToSSize(TIFF*, uint64, const char*);
extern void* _TIFFCheckMalloc(TIFF*, tmsize_t, tmsize_t, const char*);
extern void* _TIFFCheckRealloc(TIFF*, void*, tmsize_t, tmsize_t, const char*);
extern double _TIFFUInt64ToDouble(uint64);
extern float _TIFFUInt64ToFloat(uint64);
+extern float _TIFFClampDoubleToFloat(double);
+
extern tmsize_t
_TIFFReadEncodedStripAndAllocBuffer(TIFF* tif, uint32 strip,
void **buf, tmsize_t bufsizetoalloc,
@@ -442,6 +465,12 @@ extern int TIFFInitSGILog(TIFF*, int);
#ifdef LZMA_SUPPORT
extern int TIFFInitLZMA(TIFF*, int);
#endif
+#ifdef ZSTD_SUPPORT
+extern int TIFFInitZSTD(TIFF*, int);
+#endif
+#ifdef WEBP_SUPPORT
+extern int TIFFInitWebP(TIFF*, int);
+#endif
#ifdef VMS
extern const TIFFCodec _TIFFBuiltinCODECS[];
#else
diff --git a/tiff/libtiff/tiffvers.h b/tiff/libtiff/tiffvers.h
index 7c415740f..aa3f613e7 100644
--- a/tiff/libtiff/tiffvers.h
+++ b/tiff/libtiff/tiffvers.h
@@ -1,4 +1,4 @@
-#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.9\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
+#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.1.0\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
/*
* This define can be used in code that requires
* compilation-related definitions specific to a
@@ -6,4 +6,4 @@
* version checking should be done based on the
* string returned by TIFFGetVersion.
*/
-#define TIFFLIB_VERSION 20171118
+#define TIFFLIB_VERSION 20191103
diff --git a/tiff/m4/libtool.m4 b/tiff/m4/libtool.m4
index 10ab2844c..a3bc337b7 100644
--- a/tiff/m4/libtool.m4
+++ b/tiff/m4/libtool.m4
@@ -2887,18 +2887,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
dynamic_linker='GNU/Linux ld.so'
;;
-netbsdelf*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -3558,7 +3546,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-netbsd* | netbsdelf*-gnu)
+netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
@@ -4436,7 +4424,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
- netbsd* | netbsdelf*-gnu)
+ netbsd*)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -4948,9 +4936,6 @@ m4_if([$1], [CXX], [
;;
esac
;;
- linux* | k*bsd*-gnu | gnu*)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
@@ -5013,9 +4998,6 @@ dnl Note also adjust exclude_expsyms for C++ above.
openbsd* | bitrig*)
with_gnu_ld=no
;;
- linux* | k*bsd*-gnu | gnu*)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
@@ -5270,7 +5252,7 @@ _LT_EOF
fi
;;
- netbsd* | netbsdelf*-gnu)
+ netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@@ -5791,7 +5773,6 @@ _LT_EOF
if test yes = "$lt_cv_irix_exported_symbol"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
fi
- _LT_TAGVAR(link_all_deplibs, $1)=no
else
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
@@ -5813,7 +5794,7 @@ _LT_EOF
esac
;;
- netbsd* | netbsdelf*-gnu)
+ netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
diff --git a/tiff/man/Makefile.in b/tiff/man/Makefile.in
index 212905b64..f5c9bf0c4 100644
--- a/tiff/man/Makefile.in
+++ b/tiff/man/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -179,7 +179,7 @@ NROFF = nroff
MANS = $(dist_man1_MANS) $(dist_man3_MANS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(dist_man1_MANS) $(dist_man3_MANS) \
- $(srcdir)/Makefile.in $(top_srcdir)/config/mkinstalldirs
+ $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -419,8 +419,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -526,7 +526,10 @@ ctags CTAGS:
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
diff --git a/tiff/man/TIFFClose.3tiff b/tiff/man/TIFFClose.3tiff
index a6a7d82a1..fc64ccc30 100644
--- a/tiff/man/TIFFClose.3tiff
+++ b/tiff/man/TIFFClose.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFDataWidth.3tiff b/tiff/man/TIFFDataWidth.3tiff
index af67777d2..efcd39d73 100644
--- a/tiff/man/TIFFDataWidth.3tiff
+++ b/tiff/man/TIFFDataWidth.3tiff
@@ -1,4 +1,3 @@
-.\" $Id: TIFFDataWidth.3tiff,v 1.4 2016-09-25 20:05:49 bfriesen Exp $
.\"
.\" Copyright (c) 2002, Andrey Kiselev <dron@ak4719.spb.edu>
.\"
diff --git a/tiff/man/TIFFError.3tiff b/tiff/man/TIFFError.3tiff
index 6924c7f43..5d0c2196e 100644
--- a/tiff/man/TIFFError.3tiff
+++ b/tiff/man/TIFFError.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFFieldDataType.3tiff b/tiff/man/TIFFFieldDataType.3tiff
index 4fb1e2cfa..6049f5918 100644
--- a/tiff/man/TIFFFieldDataType.3tiff
+++ b/tiff/man/TIFFFieldDataType.3tiff
@@ -1,4 +1,3 @@
-.\" $Id: TIFFFieldDataType.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
.\"
.\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
.\"
diff --git a/tiff/man/TIFFFieldName.3tiff b/tiff/man/TIFFFieldName.3tiff
index 0f49c3377..47d9ad844 100644
--- a/tiff/man/TIFFFieldName.3tiff
+++ b/tiff/man/TIFFFieldName.3tiff
@@ -1,4 +1,3 @@
-.\" $Id: TIFFFieldName.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
.\"
.\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
.\"
diff --git a/tiff/man/TIFFFieldPassCount.3tiff b/tiff/man/TIFFFieldPassCount.3tiff
index 07324f809..ff14c5202 100644
--- a/tiff/man/TIFFFieldPassCount.3tiff
+++ b/tiff/man/TIFFFieldPassCount.3tiff
@@ -1,4 +1,3 @@
-.\" $Id: TIFFFieldPassCount.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
.\"
.\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
.\"
diff --git a/tiff/man/TIFFFieldReadCount.3tiff b/tiff/man/TIFFFieldReadCount.3tiff
index 88d67fd16..b6a4546c2 100644
--- a/tiff/man/TIFFFieldReadCount.3tiff
+++ b/tiff/man/TIFFFieldReadCount.3tiff
@@ -1,4 +1,3 @@
-.\" $Id: TIFFFieldReadCount.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
.\"
.\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
.\"
diff --git a/tiff/man/TIFFFieldTag.3tiff b/tiff/man/TIFFFieldTag.3tiff
index f94f1be98..3d1e83d0f 100644
--- a/tiff/man/TIFFFieldTag.3tiff
+++ b/tiff/man/TIFFFieldTag.3tiff
@@ -1,4 +1,3 @@
-.\" $Id: TIFFFieldTag.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
.\"
.\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
.\"
diff --git a/tiff/man/TIFFFieldWriteCount.3tiff b/tiff/man/TIFFFieldWriteCount.3tiff
index 68a3b043f..f80290fe4 100644
--- a/tiff/man/TIFFFieldWriteCount.3tiff
+++ b/tiff/man/TIFFFieldWriteCount.3tiff
@@ -1,4 +1,3 @@
-.\" $Id: TIFFFieldWriteCount.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
.\"
.\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
.\"
diff --git a/tiff/man/TIFFFlush.3tiff b/tiff/man/TIFFFlush.3tiff
index 27520da3a..c46a2a3f2 100644
--- a/tiff/man/TIFFFlush.3tiff
+++ b/tiff/man/TIFFFlush.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFGetField.3tiff b/tiff/man/TIFFGetField.3tiff
index 528019e15..c2fd025f6 100644
--- a/tiff/man/TIFFGetField.3tiff
+++ b/tiff/man/TIFFGetField.3tiff
@@ -1,4 +1,3 @@
-.\" $Id: TIFFGetField.3tiff,v 1.8 2017-06-30 17:40:02 erouault Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/man/TIFFOpen.3tiff b/tiff/man/TIFFOpen.3tiff
index f42093138..c6ed28e60 100644
--- a/tiff/man/TIFFOpen.3tiff
+++ b/tiff/man/TIFFOpen.3tiff
@@ -1,4 +1,3 @@
-.\" $Id: TIFFOpen.3tiff,v 1.2 2005-07-01 12:36:22 dron Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -208,6 +207,21 @@ Disable the use of strip chopping when reading images.
Read TIFF header only, do not load the first image directory. That could be
useful in case of the broken first directory. We can open the file and proceed
to the other directories.
+.TP
+.B 4
+ClassicTIFF for creating a file (default)
+.TP
+.B 8
+BigTIFF for creating a file.
+.TP
+.B D
+Enable use of deferred strip/tile offset/bytecount array loading. They will
+be loaded the first time they are accessed to. This loading will be done in
+its entirety unless the O flag is also specified.
+.TP
+.B O
+On-demand loading of values of the strip/tile offset/bytecount arrays, limited
+to the requested strip/tile, instead of whole array loading (implies D)
.SH "BYTE ORDER"
The
.SM TIFF
diff --git a/tiff/man/TIFFPrintDirectory.3tiff b/tiff/man/TIFFPrintDirectory.3tiff
index 437b09e2c..c208f044a 100644
--- a/tiff/man/TIFFPrintDirectory.3tiff
+++ b/tiff/man/TIFFPrintDirectory.3tiff
@@ -1,4 +1,3 @@
-.\" $Id: TIFFPrintDirectory.3tiff,v 1.1 2004-11-11 14:39:16 dron Exp $
.\"
.\" Copyright (c) 1991-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/man/TIFFRGBAImage.3tiff b/tiff/man/TIFFRGBAImage.3tiff
index 86c936806..fe6064fca 100644
--- a/tiff/man/TIFFRGBAImage.3tiff
+++ b/tiff/man/TIFFRGBAImage.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFReadDirectory.3tiff b/tiff/man/TIFFReadDirectory.3tiff
index e13586fd6..c178c42b8 100644
--- a/tiff/man/TIFFReadDirectory.3tiff
+++ b/tiff/man/TIFFReadDirectory.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFReadEncodedStrip.3tiff b/tiff/man/TIFFReadEncodedStrip.3tiff
index afde8e74f..7122946a4 100644
--- a/tiff/man/TIFFReadEncodedStrip.3tiff
+++ b/tiff/man/TIFFReadEncodedStrip.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFReadEncodedTile.3tiff b/tiff/man/TIFFReadEncodedTile.3tiff
index 99d3e4599..6f8d64969 100644
--- a/tiff/man/TIFFReadEncodedTile.3tiff
+++ b/tiff/man/TIFFReadEncodedTile.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFReadRGBAImage.3tiff b/tiff/man/TIFFReadRGBAImage.3tiff
index 7373e2aec..920fc3704 100644
--- a/tiff/man/TIFFReadRGBAImage.3tiff
+++ b/tiff/man/TIFFReadRGBAImage.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFReadRGBAStrip.3tiff b/tiff/man/TIFFReadRGBAStrip.3tiff
index db889a0a9..316041245 100644
--- a/tiff/man/TIFFReadRGBAStrip.3tiff
+++ b/tiff/man/TIFFReadRGBAStrip.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFReadRGBATile.3tiff b/tiff/man/TIFFReadRGBATile.3tiff
index 5cb76553e..5b9b4bf2f 100644
--- a/tiff/man/TIFFReadRGBATile.3tiff
+++ b/tiff/man/TIFFReadRGBATile.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFReadRawStrip.3tiff b/tiff/man/TIFFReadRawStrip.3tiff
index 6fe326b78..6d411df4d 100644
--- a/tiff/man/TIFFReadRawStrip.3tiff
+++ b/tiff/man/TIFFReadRawStrip.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFReadRawTile.3tiff b/tiff/man/TIFFReadRawTile.3tiff
index 2844573e6..9c60888a5 100644
--- a/tiff/man/TIFFReadRawTile.3tiff
+++ b/tiff/man/TIFFReadRawTile.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFReadScanline.3tiff b/tiff/man/TIFFReadScanline.3tiff
index 2d9c85a31..ca4b8368d 100644
--- a/tiff/man/TIFFReadScanline.3tiff
+++ b/tiff/man/TIFFReadScanline.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFReadTile.3tiff b/tiff/man/TIFFReadTile.3tiff
index f1107dc32..cf0f21dc7 100644
--- a/tiff/man/TIFFReadTile.3tiff
+++ b/tiff/man/TIFFReadTile.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFSetDirectory.3tiff b/tiff/man/TIFFSetDirectory.3tiff
index 0f109f66a..734c0155e 100644
--- a/tiff/man/TIFFSetDirectory.3tiff
+++ b/tiff/man/TIFFSetDirectory.3tiff
@@ -1,4 +1,3 @@
-.\" $Id: TIFFSetDirectory.3tiff,v 1.4 2017-06-30 17:40:02 erouault Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/man/TIFFSetField.3tiff b/tiff/man/TIFFSetField.3tiff
index 695a199e7..df2a5ea2e 100644
--- a/tiff/man/TIFFSetField.3tiff
+++ b/tiff/man/TIFFSetField.3tiff
@@ -1,4 +1,3 @@
-.\" $Id: TIFFSetField.3tiff,v 1.7 2017-06-30 17:40:02 erouault Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/man/TIFFWarning.3tiff b/tiff/man/TIFFWarning.3tiff
index 0d302ed8f..9a4d9096f 100644
--- a/tiff/man/TIFFWarning.3tiff
+++ b/tiff/man/TIFFWarning.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFWriteDirectory.3tiff b/tiff/man/TIFFWriteDirectory.3tiff
index 9f0d24922..e7b84b6d7 100644
--- a/tiff/man/TIFFWriteDirectory.3tiff
+++ b/tiff/man/TIFFWriteDirectory.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFWriteEncodedStrip.3tiff b/tiff/man/TIFFWriteEncodedStrip.3tiff
index a31f6e00c..dc410e415 100644
--- a/tiff/man/TIFFWriteEncodedStrip.3tiff
+++ b/tiff/man/TIFFWriteEncodedStrip.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFWriteEncodedTile.3tiff b/tiff/man/TIFFWriteEncodedTile.3tiff
index 476cbbb4b..d94f4d0ed 100644
--- a/tiff/man/TIFFWriteEncodedTile.3tiff
+++ b/tiff/man/TIFFWriteEncodedTile.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFWriteRawStrip.3tiff b/tiff/man/TIFFWriteRawStrip.3tiff
index 8d145a078..784a6e031 100644
--- a/tiff/man/TIFFWriteRawStrip.3tiff
+++ b/tiff/man/TIFFWriteRawStrip.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFWriteRawTile.3tiff b/tiff/man/TIFFWriteRawTile.3tiff
index 78b23ed73..f3334b85b 100644
--- a/tiff/man/TIFFWriteRawTile.3tiff
+++ b/tiff/man/TIFFWriteRawTile.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFWriteScanline.3tiff b/tiff/man/TIFFWriteScanline.3tiff
index a2691b552..a51cec529 100644
--- a/tiff/man/TIFFWriteScanline.3tiff
+++ b/tiff/man/TIFFWriteScanline.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFWriteTile.3tiff b/tiff/man/TIFFWriteTile.3tiff
index 3755fc789..a6700258a 100644
--- a/tiff/man/TIFFWriteTile.3tiff
+++ b/tiff/man/TIFFWriteTile.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFbuffer.3tiff b/tiff/man/TIFFbuffer.3tiff
index edda2dbc0..201117012 100644
--- a/tiff/man/TIFFbuffer.3tiff
+++ b/tiff/man/TIFFbuffer.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFcodec.3tiff b/tiff/man/TIFFcodec.3tiff
index 6c480c497..aa3a8c63f 100644
--- a/tiff/man/TIFFcodec.3tiff
+++ b/tiff/man/TIFFcodec.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFcolor.3tiff b/tiff/man/TIFFcolor.3tiff
index 987ac9d62..1d2bb2b87 100644
--- a/tiff/man/TIFFcolor.3tiff
+++ b/tiff/man/TIFFcolor.3tiff
@@ -1,4 +1,3 @@
-.\" $Id: TIFFcolor.3tiff,v 1.5 2016-09-25 20:05:51 bfriesen Exp $
.\"
.\" Copyright (c) 2003, Andrey Kiselev <dron@ak4719.spb.edu>
.\"
diff --git a/tiff/man/TIFFmemory.3tiff b/tiff/man/TIFFmemory.3tiff
index 6c4412ddc..70a821238 100644
--- a/tiff/man/TIFFmemory.3tiff
+++ b/tiff/man/TIFFmemory.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
@@ -78,7 +77,7 @@ C routines:
.IR memcpy ,
and
.IR memcmp ,
-repsectively.
+respectively.
.SH DIAGNOSTICS
None.
.SH "SEE ALSO"
diff --git a/tiff/man/TIFFquery.3tiff b/tiff/man/TIFFquery.3tiff
index 8bddc889f..4d95f5f45 100644
--- a/tiff/man/TIFFquery.3tiff
+++ b/tiff/man/TIFFquery.3tiff
@@ -1,4 +1,3 @@
-.\" $Id: TIFFquery.3tiff,v 1.1 2004-11-11 14:39:16 dron Exp $
.\"
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -114,7 +113,7 @@ returned if the image data is organized in strips.
.IR TIFFIsByteSwapped
returns a non-zero value if the image data was in a different byte-order than
the host machine. Zero is returned if the TIFF file and local host byte-orders
-are the same. Note that TIFFReadTile(), TIFFReadStrip() and
+are the same. Note that TIFFReadTile(), TIFFReadEncodedStrip() and
TIFFReadScanline() functions already normally perform byte swapping to local
host order if needed.
.PP
diff --git a/tiff/man/TIFFsize.3tiff b/tiff/man/TIFFsize.3tiff
index 4b90a59b5..5fbc6bc99 100644
--- a/tiff/man/TIFFsize.3tiff
+++ b/tiff/man/TIFFsize.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFstrip.3tiff b/tiff/man/TIFFstrip.3tiff
index da59b0efe..eb38318fd 100644
--- a/tiff/man/TIFFstrip.3tiff
+++ b/tiff/man/TIFFstrip.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFswab.3tiff b/tiff/man/TIFFswab.3tiff
index 2294156f7..3d7a47bc0 100644
--- a/tiff/man/TIFFswab.3tiff
+++ b/tiff/man/TIFFswab.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/TIFFtile.3tiff b/tiff/man/TIFFtile.3tiff
index 5bdbe551f..10310a063 100644
--- a/tiff/man/TIFFtile.3tiff
+++ b/tiff/man/TIFFtile.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/fax2ps.1 b/tiff/man/fax2ps.1
index f82e252ba..7aeea4f90 100644
--- a/tiff/man/fax2ps.1
+++ b/tiff/man/fax2ps.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/fax2tiff.1 b/tiff/man/fax2tiff.1
index 7ce4ffe3d..97144c9f5 100644
--- a/tiff/man/fax2tiff.1
+++ b/tiff/man/fax2tiff.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/libtiff.3tiff b/tiff/man/libtiff.3tiff
index 924d17a87..8e9ff35b7 100644
--- a/tiff/man/libtiff.3tiff
+++ b/tiff/man/libtiff.3tiff
@@ -1,4 +1,3 @@
-.\" $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.
@@ -343,7 +342,7 @@ WhitePoint 318 R/W
XPosition 286 R/W
XResolution 282 R/W
YCbCrCoefficients 529 R/W used by TIFFRGBAImage support
-YCbCrPositioning 531 R/W tile/strip size calulcations
+YCbCrPositioning 531 R/W tile/strip size calculations
YCbCrSubsampling 530 R/W
YPosition 286 R/W
YResolution 283 R/W used by Group 3 codec
@@ -355,7 +354,7 @@ tags whose values lie in a range outside the valid range of
.SM TIFF
tags.
These tags are termed
-.I pseud-tags
+.I pseudo-tags
and are used to control various codec-specific functions within the library.
The table below summarizes the defined pseudo-tags.
.sp
@@ -409,7 +408,7 @@ The default value is a pointer to a builtin function that images
packed bilevel data.
.TP
.B TIFFTAG_IPTCNEWSPHOTO
-Tag contaings image metadata per the IPTC newsphoto spec: Headline,
+Tag contains image metadata per the IPTC newsphoto spec: Headline,
captioning, credit, etc... Used by most wire services.
.TP
.B TIFFTAG_PHOTOSHOP
diff --git a/tiff/man/pal2rgb.1 b/tiff/man/pal2rgb.1
index 428f93a80..772b4a7bc 100644
--- a/tiff/man/pal2rgb.1
+++ b/tiff/man/pal2rgb.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/ppm2tiff.1 b/tiff/man/ppm2tiff.1
index 2c940fb3b..12e58e2cb 100644
--- a/tiff/man/ppm2tiff.1
+++ b/tiff/man/ppm2tiff.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/raw2tiff.1 b/tiff/man/raw2tiff.1
index 184a5d10f..f45569d4b 100644
--- a/tiff/man/raw2tiff.1
+++ b/tiff/man/raw2tiff.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/tiff2bw.1 b/tiff/man/tiff2bw.1
index 182ebbec0..4fe9942f2 100644
--- a/tiff/man/tiff2bw.1
+++ b/tiff/man/tiff2bw.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/tiff2pdf.1 b/tiff/man/tiff2pdf.1
index de80599e8..930113326 100644
--- a/tiff/man/tiff2pdf.1
+++ b/tiff/man/tiff2pdf.1
@@ -1,4 +1,3 @@
-.\" $Id: tiff2pdf.1,v 1.8 2016-09-25 20:05:51 bfriesen Exp $
.\"
.\" Copyright (c) 2003 Ross Finlayson
.\"
diff --git a/tiff/man/tiff2ps.1 b/tiff/man/tiff2ps.1
index e3b57ec5f..5e2b9a857 100644
--- a/tiff/man/tiff2ps.1
+++ b/tiff/man/tiff2ps.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/tiff2rgba.1 b/tiff/man/tiff2rgba.1
index f0af0a1ca..d9c9baae8 100644
--- a/tiff/man/tiff2rgba.1
+++ b/tiff/man/tiff2rgba.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/tiffcmp.1 b/tiff/man/tiffcmp.1
index 3d111a4d6..ee83a742e 100644
--- a/tiff/man/tiffcmp.1
+++ b/tiff/man/tiffcmp.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/tiffcp.1 b/tiff/man/tiffcp.1
index fee463952..0545686c2 100644
--- a/tiff/man/tiffcp.1
+++ b/tiff/man/tiffcp.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/tiffcrop.1 b/tiff/man/tiffcrop.1
index 3fa6bb67e..5bd009765 100644
--- a/tiff/man/tiffcrop.1
+++ b/tiff/man/tiffcrop.1
@@ -1,4 +1,3 @@
-.\" $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:
diff --git a/tiff/man/tiffdither.1 b/tiff/man/tiffdither.1
index d5214ceee..56725b2bc 100644
--- a/tiff/man/tiffdither.1
+++ b/tiff/man/tiffdither.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/tiffdump.1 b/tiff/man/tiffdump.1
index a5eeccda7..07b08e3c4 100644
--- a/tiff/man/tiffdump.1
+++ b/tiff/man/tiffdump.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/tiffgt.1 b/tiff/man/tiffgt.1
index 53031018b..6ef6209f9 100644
--- a/tiff/man/tiffgt.1
+++ b/tiff/man/tiffgt.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/tiffinfo.1 b/tiff/man/tiffinfo.1
index 89637bb23..64958a6c0 100644
--- a/tiff/man/tiffinfo.1
+++ b/tiff/man/tiffinfo.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/tiffmedian.1 b/tiff/man/tiffmedian.1
index 428ca9adf..b10ba7989 100644
--- a/tiff/man/tiffmedian.1
+++ b/tiff/man/tiffmedian.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/tiffset.1 b/tiff/man/tiffset.1
index d7c48fa5d..513c75671 100644
--- a/tiff/man/tiffset.1
+++ b/tiff/man/tiffset.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/man/tiffsplit.1 b/tiff/man/tiffsplit.1
index f01b3f466..fe309f423 100644
--- a/tiff/man/tiffsplit.1
+++ b/tiff/man/tiffsplit.1
@@ -1,4 +1,3 @@
-.\" $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.
diff --git a/tiff/nmake.opt b/tiff/nmake.opt
index ec45e779f..ae544670f 100644
--- a/tiff/nmake.opt
+++ b/tiff/nmake.opt
@@ -1,4 +1,3 @@
-# $Id: nmake.opt,v 1.20 2017-10-10 14:39:43 erouault Exp $
#
# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
#
@@ -35,13 +34,6 @@
###### Edit the following lines to choose a feature set you need. #######
#
-#
-# Select WINMODE_CONSOLE to build a library which reports errors to stderr, or
-# WINMODE_WINDOWED to build such that errors are reported via MessageBox().
-#
-WINMODE_CONSOLE = 1
-#WINMODE_WINDOWED = 1
-
#
# Comment out the following lines to disable internal codecs.
#
@@ -160,13 +152,6 @@ DLLNAME = libtiff.dll
# Set the native cpu bit order
EXTRAFLAGS = -DFILLODER_LSB2MSB $(EXTRAFLAGS)
-!IFDEF WINMODE_WINDOWED
-EXTRAFLAGS = -DTIF_PLATFORM_WINDOWED $(EXTRAFLAGS)
-LIBS = user32.lib $(LIBS)
-!ELSE
-EXTRAFLAGS = -DTIF_PLATFORM_CONSOLE $(EXTRAFLAGS)
-!ENDIF
-
# Codec stuff
!IFDEF CCITT_SUPPORT
EXTRAFLAGS = -DCCITT_SUPPORT $(EXTRAFLAGS)
diff --git a/tiff/port/CMakeLists.txt b/tiff/port/CMakeLists.txt
index 8b221d1d0..b7eb3a293 100644
--- a/tiff/port/CMakeLists.txt
+++ b/tiff/port/CMakeLists.txt
@@ -28,6 +28,8 @@ set(port_optional_SOURCES
getopt.c
lfind.c
strcasecmp.c
+ strtol.c
+ strtoll.c
strtoul.c
strtoull.c)
@@ -45,6 +47,12 @@ endif()
if(NOT HAVE_STRCASECMP)
list(APPEND port_USED_FILES strcasecmp.c)
endif()
+if(NOT HAVE_STRTOL)
+ list(APPEND port_USED_FILES strtol.c)
+endif()
+if(NOT HAVE_STRTOLL)
+ list(APPEND port_USED_FILES strtoll.c)
+endif()
if(NOT HAVE_STRTOUL)
list(APPEND port_USED_FILES strtoul.c)
endif()
diff --git a/tiff/port/Makefile.am b/tiff/port/Makefile.am
index 4d6e11d0c..250479fed 100644
--- a/tiff/port/Makefile.am
+++ b/tiff/port/Makefile.am
@@ -27,7 +27,9 @@ EXTRA_DIST = \
CMakeLists.txt \
Makefile.vc \
libport.h \
- snprintf.c
+ snprintf.c \
+ _strtol.h \
+ _strtoul.h
noinst_LTLIBRARIES = libport.la
libport_la_SOURCES = dummy.c libport.h
diff --git a/tiff/port/Makefile.in b/tiff/port/Makefile.in
index 55e09e6ef..72e192b0a 100644
--- a/tiff/port/Makefile.in
+++ b/tiff/port/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -122,7 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -149,7 +149,12 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = $(DEPDIR)/getopt.Plo $(DEPDIR)/lfind.Plo \
+ $(DEPDIR)/snprintf.Plo $(DEPDIR)/strcasecmp.Plo \
+ $(DEPDIR)/strtol.Plo $(DEPDIR)/strtoll.Plo \
+ $(DEPDIR)/strtoul.Plo $(DEPDIR)/strtoull.Plo \
+ ./$(DEPDIR)/dummy.Plo
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -196,8 +201,8 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
- $(top_srcdir)/config/mkinstalldirs getopt.c lfind.c snprintf.c \
- strcasecmp.c strtoul.c strtoull.c
+ getopt.c lfind.c snprintf.c strcasecmp.c strtol.c strtoll.c \
+ strtoul.c strtoull.c
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -351,7 +356,9 @@ EXTRA_DIST = \
CMakeLists.txt \
Makefile.vc \
libport.h \
- snprintf.c
+ snprintf.c \
+ _strtol.h \
+ _strtoul.h
noinst_LTLIBRARIES = libport.la
libport_la_SOURCES = dummy.c libport.h
@@ -377,8 +384,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -410,13 +417,21 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lfind.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/snprintf.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoul.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoull.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lfind.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/snprintf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtol.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoll.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoul.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoull.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -497,7 +512,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -567,7 +585,15 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
- -rm -rf $(DEPDIR) ./$(DEPDIR)
+ -rm -f $(DEPDIR)/getopt.Plo
+ -rm -f $(DEPDIR)/lfind.Plo
+ -rm -f $(DEPDIR)/snprintf.Plo
+ -rm -f $(DEPDIR)/strcasecmp.Plo
+ -rm -f $(DEPDIR)/strtol.Plo
+ -rm -f $(DEPDIR)/strtoll.Plo
+ -rm -f $(DEPDIR)/strtoul.Plo
+ -rm -f $(DEPDIR)/strtoull.Plo
+ -rm -f ./$(DEPDIR)/dummy.Plo
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -613,7 +639,15 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf $(DEPDIR) ./$(DEPDIR)
+ -rm -f $(DEPDIR)/getopt.Plo
+ -rm -f $(DEPDIR)/lfind.Plo
+ -rm -f $(DEPDIR)/snprintf.Plo
+ -rm -f $(DEPDIR)/strcasecmp.Plo
+ -rm -f $(DEPDIR)/strtol.Plo
+ -rm -f $(DEPDIR)/strtoll.Plo
+ -rm -f $(DEPDIR)/strtoul.Plo
+ -rm -f $(DEPDIR)/strtoull.Plo
+ -rm -f ./$(DEPDIR)/dummy.Plo
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -634,16 +668,16 @@ uninstall-am:
.MAKE: install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES 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-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 \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ 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-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
diff --git a/tiff/port/Makefile.vc b/tiff/port/Makefile.vc
index bde480487..992d26966 100644
--- a/tiff/port/Makefile.vc
+++ b/tiff/port/Makefile.vc
@@ -1,4 +1,3 @@
-# $Id: Makefile.vc,v 1.5 2015-08-19 02:31:04 bfriesen Exp $
#
# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
#
diff --git a/tiff/port/_strtol.h b/tiff/port/_strtol.h
new file mode 100644
index 000000000..73a10063a
--- /dev/null
+++ b/tiff/port/_strtol.h
@@ -0,0 +1,160 @@
+/* $NetBSD: _strtol.h,v 1.11 2017/07/06 21:08:44 joerg Exp $ */
+
+/*-
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Original version ID:
+ * NetBSD: src/lib/libc/locale/_wcstol.h,v 1.2 2003/08/07 16:43:03 agc Exp
+ */
+
+#include <assert.h>
+
+/*
+ * function template for strtol, strtoll and strtoimax.
+ *
+ * parameters:
+ * _FUNCNAME : function name
+ * __INT : return type
+ * __INT_MIN : lower limit of the return type
+ * __INT_MAX : upper limit of the return type
+ */
+__INT
+_FUNCNAME(const char *nptr, char **endptr, int base)
+{
+ const char *s;
+ __INT acc, cutoff;
+ unsigned char c;
+ int i, neg, any, cutlim;
+
+ assert(nptr != NULL);
+ /* endptr may be NULL */
+
+ /* check base value */
+ if (base && (base < 2 || base > 36)) {
+ errno = EINVAL;
+ if (endptr != NULL)
+ /* LINTED interface specification */
+ *endptr = (char *)(nptr);
+ return 0;
+ }
+
+ /*
+ * Skip white space and pick up leading +/- sign if any.
+ * If base is 0, allow 0x for hex and 0 for octal, else
+ * assume decimal; if base is already 16, allow 0x.
+ */
+ s = nptr;
+ do {
+ c = *s++;
+ } while (isspace(c));
+ if (c == '-') {
+ neg = 1;
+ c = *s++;
+ } else {
+ neg = 0;
+ if (c == '+')
+ c = *s++;
+ }
+ if ((base == 0 || base == 16) &&
+ c == '0' && (*s == 'x' || *s == 'X') &&
+ ((s[1] >= '0' && s[1] <= '9') ||
+ (s[1] >= 'a' && s[1] <= 'f') ||
+ (s[1] >= 'A' && s[1] <= 'F'))) {
+ c = s[1];
+ s += 2;
+ base = 16;
+ } else if (base == 0)
+ base = (c == '0' ? 8 : 10);
+
+ /*
+ * Compute the cutoff value between legal numbers and illegal
+ * numbers. That is the largest legal value, divided by the
+ * base. An input number that is greater than this value, if
+ * followed by a legal input character, is too big. One that
+ * is equal to this value may be valid or not; the limit
+ * between valid and invalid numbers is then based on the last
+ * digit. For instance, if the range for longs is
+ * [-2147483648..2147483647] and the input base is 10,
+ * cutoff will be set to 214748364 and cutlim to either
+ * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated
+ * a value > 214748364, or equal but the next digit is > 7 (or 8),
+ * the number is too big, and we will return a range error.
+ *
+ * Set any if any `digits' consumed; make it negative to indicate
+ * overflow.
+ */
+ cutoff = (__INT)(neg ? __INT_MIN : __INT_MAX);
+ cutlim = (int)(cutoff % base);
+ cutoff /= base;
+ if (neg) {
+ if (cutlim > 0) {
+ cutlim -= base;
+ cutoff += 1;
+ }
+ cutlim = -cutlim;
+ }
+ for (acc = 0, any = 0;; c = *s++) {
+ if (c >= '0' && c <= '9')
+ i = c - '0';
+ else if (c >= 'a' && c <= 'z')
+ i = (c - 'a') + 10;
+ else if (c >= 'A' && c <= 'Z')
+ i = (c - 'A') + 10;
+ else
+ break;
+ if (i >= base)
+ break;
+ if (any < 0)
+ continue;
+ if (neg) {
+ if (acc < cutoff || (acc == cutoff && i > cutlim)) {
+ acc = __INT_MIN;
+ any = -1;
+ errno = ERANGE;
+ } else {
+ any = 1;
+ acc *= base;
+ acc -= i;
+ }
+ } else {
+ if (acc > cutoff || (acc == cutoff && i > cutlim)) {
+ acc = __INT_MAX;
+ any = -1;
+ errno = ERANGE;
+ } else {
+ any = 1;
+ acc *= base;
+ acc += i;
+ }
+ }
+ }
+ if (endptr != NULL)
+ /* LINTED interface specification */
+ *endptr = (char *)(any ? s - 1 : nptr);
+ return(acc);
+}
diff --git a/tiff/port/_strtoul.h b/tiff/port/_strtoul.h
new file mode 100644
index 000000000..5cb62168b
--- /dev/null
+++ b/tiff/port/_strtoul.h
@@ -0,0 +1,127 @@
+/* $NetBSD: _strtoul.h,v 1.11 2017/07/06 21:08:44 joerg Exp $ */
+
+/*-
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Original version ID:
+ * NetBSD: src/lib/libc/locale/_wcstoul.h,v 1.2 2003/08/07 16:43:03 agc Exp
+ */
+
+#include <assert.h>
+
+/*
+ * function template for strtoul, strtoull and strtoumax.
+ *
+ * parameters:
+ * _FUNCNAME : function name
+ * __UINT : return type
+ * __UINT_MAX : upper limit of the return type
+ */
+__UINT
+_FUNCNAME(const char *nptr, char **endptr, int base)
+{
+ const char *s;
+ __UINT acc, cutoff;
+ unsigned char c;
+ int i, neg, any, cutlim;
+
+ assert(nptr != NULL);
+ /* endptr may be NULL */
+
+ /* check base value */
+ if (base && (base < 2 || base > 36)) {
+ errno = EINVAL;
+ if (endptr != NULL)
+ /* LINTED interface specification */
+ *endptr = (char *)(nptr);
+ return 0;
+ }
+
+ /*
+ * Skip white space and pick up leading +/- sign if any.
+ * If base is 0, allow 0x for hex and 0 for octal, else
+ * assume decimal; if base is already 16, allow 0x.
+ */
+ s = nptr;
+ do {
+ c = *s++;
+ } while (isspace(c));
+ if (c == '-') {
+ neg = 1;
+ c = *s++;
+ } else {
+ neg = 0;
+ if (c == '+')
+ c = *s++;
+ }
+ if ((base == 0 || base == 16) &&
+ c == '0' && (*s == 'x' || *s == 'X') &&
+ ((s[1] >= '0' && s[1] <= '9') ||
+ (s[1] >= 'a' && s[1] <= 'f') ||
+ (s[1] >= 'A' && s[1] <= 'F'))) {
+ c = s[1];
+ s += 2;
+ base = 16;
+ } else if (base == 0)
+ base = (c == '0' ? 8 : 10);
+
+ /*
+ * See strtol for comments as to the logic used.
+ */
+ cutoff = ((__UINT)__UINT_MAX / (__UINT)base);
+ cutlim = (int)((__UINT)__UINT_MAX % (__UINT)base);
+ for (acc = 0, any = 0;; c = *s++) {
+ if (c >= '0' && c <= '9')
+ i = c - '0';
+ else if (c >= 'a' && c <= 'z')
+ i = (c - 'a') + 10;
+ else if (c >= 'A' && c <= 'Z')
+ i = (c - 'A') + 10;
+ else
+ break;
+ if (i >= base)
+ break;
+ if (any < 0)
+ continue;
+ if (acc > cutoff || (acc == cutoff && i > cutlim)) {
+ acc = __UINT_MAX;
+ any = -1;
+ errno = ERANGE;
+ } else {
+ any = 1;
+ acc *= (__UINT)base;
+ acc += i;
+ }
+ }
+ if (neg && any > 0)
+ acc = -acc;
+ if (endptr != NULL)
+ /* LINTED interface specification */
+ *endptr = (char *)(any ? s - 1 : nptr);
+ return(acc);
+}
diff --git a/tiff/port/dummy.c b/tiff/port/dummy.c
index 46f93bccc..346a07ee9 100644
--- a/tiff/port/dummy.c
+++ b/tiff/port/dummy.c
@@ -1,5 +1,3 @@
-/* $Id: dummy.c,v 1.3 2007/03/21 14:54:16 dron Exp $ */
-
/*
* Dummy function, just to be ensure that the library always will be created.
*/
diff --git a/tiff/port/getopt.c b/tiff/port/getopt.c
index 6eff8ee52..c7bdb116d 100644
--- a/tiff/port/getopt.c
+++ b/tiff/port/getopt.c
@@ -1,5 +1,3 @@
-/* $Id: getopt.c,v 1.3 2009-01-22 20:53:07 fwarmerdam Exp $ */
-
/*
* Copyright (c) 1987, 1993, 1994
* The Regents of the University of California. All rights reserved.
diff --git a/tiff/port/lfind.c b/tiff/port/lfind.c
index 64b261ca3..00ab6495c 100644
--- a/tiff/port/lfind.c
+++ b/tiff/port/lfind.c
@@ -1,5 +1,3 @@
-/* $Id: lfind.c,v 1.4 2007/01/15 18:40:39 mloskot Exp $ */
-
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/tiff/port/libport.h b/tiff/port/libport.h
index d9b042151..ff2626382 100644
--- a/tiff/port/libport.h
+++ b/tiff/port/libport.h
@@ -1,5 +1,3 @@
-/* $Id: libport.h,v 1.5 2015-08-19 02:31:04 bfriesen Exp $ */
-
/*
* Copyright (c) 2009 Frank Warmerdam
*
@@ -38,9 +36,18 @@ int strcasecmp(const char *s1, const char *s2);
# define HAVE_GETOPT 1
#endif
-#if 0
+#if HAVE_STRTOL
+long strtol(const char *nptr, char **endptr, int base);
+#endif
+#if HAVE_STRTOLL
+long long strtoll(const char *nptr, char **endptr, int base);
+#endif
+#if HAVE_STRTOUL
unsigned long strtoul(const char *nptr, char **endptr, int base);
#endif
+#if HAVE_STRTOULL
+unsigned long long strtoull(const char *nptr, char **endptr, int base);
+#endif
#if 0
void *
diff --git a/tiff/port/snprintf.c b/tiff/port/snprintf.c
index 1c4ac0878..3542ab759 100644
--- a/tiff/port/snprintf.c
+++ b/tiff/port/snprintf.c
@@ -16,7 +16,11 @@ int _TIFF_vsnprintf_f(char* str, size_t size, const char* format, va_list ap)
int count = -1;
if (size != 0)
+#if _MSC_VER <= 1310
+ count = _vsnprintf(str, size, format, ap);
+#else
count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
+#endif
if (count == -1)
count = _vscprintf(format, ap);
diff --git a/tiff/port/strcasecmp.c b/tiff/port/strcasecmp.c
index de7e42321..65e2b411c 100644
--- a/tiff/port/strcasecmp.c
+++ b/tiff/port/strcasecmp.c
@@ -1,5 +1,3 @@
-/* $Id: strcasecmp.c,v 1.4 2015-06-21 01:09:09 bfriesen Exp $ */
-
/*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/tiff/port/strtol.c b/tiff/port/strtol.c
new file mode 100644
index 000000000..a355dde95
--- /dev/null
+++ b/tiff/port/strtol.c
@@ -0,0 +1,45 @@
+/* $NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2005 The DragonFly Project. All rights reserved.
+ * Copyright (c) 2003 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if 0
+__RCSID("$NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $");
+#endif
+
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+
+#define _FUNCNAME strtol
+#define __INT long
+#define __INT_MIN LONG_MIN
+#define __INT_MAX LONG_MAX
+
+#include "_strtol.h"
diff --git a/tiff/port/strtoll.c b/tiff/port/strtoll.c
new file mode 100644
index 000000000..4784b0984
--- /dev/null
+++ b/tiff/port/strtoll.c
@@ -0,0 +1,44 @@
+/* $NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2005 The DragonFly Project. All rights reserved.
+ * Copyright (c) 2003 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if 0
+__RCSID("$NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $");
+#endif
+
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <stdlib.h>
+
+#define _FUNCNAME strtoll
+#define __INT long long
+#define __INT_MIN LLONG_MIN
+#define __INT_MAX LLONG_MAX
+
+#include "_strtol.h"
diff --git a/tiff/port/strtoul.c b/tiff/port/strtoul.c
index f7a9a1a56..dbd44f162 100644
--- a/tiff/port/strtoul.c
+++ b/tiff/port/strtoul.c
@@ -1,8 +1,9 @@
-/* $Id: strtoul.c,v 1.2 2005/07/07 16:34:06 dron Exp $ */
+/* $NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $ */
-/*
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
+/*-
+ * Copyright (c) 2005 The DragonFly Project. All rights reserved.
+ * Copyright (c) 2003 Citrus Project,
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -12,14 +13,11 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -30,80 +28,17 @@
*/
#if 0
-static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93";
-__RCSID("$NetBSD: strtoul.c,v 1.16 2003/08/07 16:43:45 agc Exp $");
+__RCSID("$NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $");
#endif
+#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
-/*
- * Convert a string to an unsigned long integer.
- *
- * Ignores `locale' stuff. Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-unsigned long
-strtoul(const char *nptr, char **endptr, int base)
-{
- const char *s;
- unsigned long acc, cutoff;
- int c;
- int neg, any, cutlim;
-
- /*
- * See strtol for comments as to the logic used.
- */
- s = nptr;
- do {
- c = (unsigned char) *s++;
- } while (isspace(c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else {
- neg = 0;
- if (c == '+')
- c = *s++;
- }
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
- c = s[1];
- s += 2;
- base = 16;
- }
- if (base == 0)
- base = c == '0' ? 8 : 10;
+#define _FUNCNAME strtoul
+#define __UINT unsigned long int
+#define __UINT_MAX ULONG_MAX
- cutoff = ULONG_MAX / (unsigned long)base;
- cutlim = (int)(ULONG_MAX % (unsigned long)base);
- for (acc = 0, any = 0;; c = (unsigned char) *s++) {
- if (isdigit(c))
- c -= '0';
- else if (isalpha(c))
- c -= isupper(c) ? 'A' - 10 : 'a' - 10;
- else
- break;
- if (c >= base)
- break;
- if (any < 0)
- continue;
- if (acc > cutoff || (acc == cutoff && c > cutlim)) {
- any = -1;
- acc = ULONG_MAX;
- errno = ERANGE;
- } else {
- any = 1;
- acc *= (unsigned long)base;
- acc += c;
- }
- }
- if (neg && any > 0)
- acc = -acc;
- if (endptr != 0)
- /* LINTED interface specification */
- *endptr = (char *)(any ? s - 1 : nptr);
- return (acc);
-}
+#include "_strtoul.h"
diff --git a/tiff/port/strtoull.c b/tiff/port/strtoull.c
index fb7739cc5..91e4ddfb0 100644
--- a/tiff/port/strtoull.c
+++ b/tiff/port/strtoull.c
@@ -1,6 +1,9 @@
+/* $NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $ */
+
/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 2005 The DragonFly Project. All rights reserved.
+ * Copyright (c) 2003 Citrus Project,
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,18 +13,11 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -31,86 +27,18 @@
* SUCH DAMAGE.
*/
-#include <limits.h>
-#include <errno.h>
+#if 0
+__RCSID("$NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $");
+#endif
+
+#include <assert.h>
#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
#include <stdlib.h>
-/*
- * Convert a string to an unsigned long long integer.
- *
- * Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-unsigned long long
-strtoull(const char *nptr, char **endptr, int base)
-{
- const char *s;
- unsigned long long acc;
- char c;
- unsigned long long cutoff;
- int neg, any, cutlim;
-
- /*
- * See strtoq for comments as to the logic used.
- */
- s = nptr;
- do {
- c = *s++;
- } while (isspace((unsigned char)c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else {
- neg = 0;
- if (c == '+')
- c = *s++;
- }
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X') &&
- ((s[1] >= '0' && s[1] <= '9') ||
- (s[1] >= 'A' && s[1] <= 'F') ||
- (s[1] >= 'a' && s[1] <= 'f'))) {
- c = s[1];
- s += 2;
- base = 16;
- }
- if (base == 0)
- base = c == '0' ? 8 : 10;
- acc = any = 0;
- if (base < 2 || base > 36)
- goto noconv;
+#define _FUNCNAME strtoull
+#define __UINT unsigned long long int
+#define __UINT_MAX ULLONG_MAX
- cutoff = ULLONG_MAX / base;
- cutlim = ULLONG_MAX % base;
- for ( ; ; c = *s++) {
- if (c >= '0' && c <= '9')
- c -= '0';
- else if (c >= 'A' && c <= 'Z')
- c -= 'A' - 10;
- else if (c >= 'a' && c <= 'z')
- c -= 'a' - 10;
- else
- break;
- if (c >= base)
- break;
- if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
- any = -1;
- else {
- any = 1;
- acc *= base;
- acc += c;
- }
- }
- if (any < 0) {
- acc = ULLONG_MAX;
- errno = ERANGE;
- } else if (!any) {
-noconv:
- errno = EINVAL;
- } else if (neg)
- acc = -acc;
- if (endptr != NULL)
- *endptr = (char *)(any ? s - 1 : nptr);
- return (acc);
-}
+#include "_strtoul.h"
diff --git a/tiff/test/CMakeLists.txt b/tiff/test/CMakeLists.txt
index 912be19ca..a4216d56d 100644
--- a/tiff/test/CMakeLists.txt
+++ b/tiff/test/CMakeLists.txt
@@ -35,6 +35,7 @@ set(TESTSCRIPTS
ppm2tiff_pbm.sh
ppm2tiff_pgm.sh
ppm2tiff_ppm.sh
+ fax2tiff.sh
tiffcp-g3.sh
tiffcp-g3-1d.sh
tiffcp-g3-1d-fill.sh
@@ -44,6 +45,7 @@ set(TESTSCRIPTS
tiffcp-logluv.sh
tiffcp-thumbnail.sh
tiffcp-lzw-compat.sh
+ tiffcp-lzw-scanline-decode.sh
tiffdump.sh
tiffinfo.sh
tiffcp-split.sh
@@ -120,7 +122,8 @@ set(TIFFIMAGES
images/rgb-3c-16b.tiff
images/rgb-3c-8b.tiff
images/quad-tile.jpg.tiff
- images/quad-lzw-compat.tiff)
+ images/quad-lzw-compat.tiff
+ images/lzw-single-strip.tiff)
set(BMPIMAGES
images/palette-1c-8b.bmp
@@ -149,6 +152,7 @@ set(UNCOMPRESSEDIMAGES
# files which are not currently used by the tests.
set(IMAGES_EXTRA_DIST
images/README.txt
+ images/miniswhite-1c-1b.g3
${BMPIMAGES}
${GIFIMAGES}
${PNMIMAGES}
@@ -184,6 +188,15 @@ endif()
add_executable(custom_dir custom_dir.c)
target_link_libraries(custom_dir tiff port)
+add_executable(defer_strile_loading defer_strile_loading.c)
+target_link_libraries(defer_strile_loading tiff port)
+
+add_executable(defer_strile_writing defer_strile_writing.c)
+target_link_libraries(defer_strile_writing tiff port)
+
+add_executable(testtypes testtypes.c)
+target_link_libraries(testtypes tiff port)
+
set(TEST_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output")
file(MAKE_DIRECTORY "${TEST_OUTPUT}")
@@ -335,6 +348,7 @@ add_convert_test(tiffcp g32d "-c g3:2d" "images/miniswhite-1c-1b.ti
add_convert_test(tiffcp g32dfill "-c g3:2d:fill" "images/miniswhite-1c-1b.tiff" FALSE)
add_convert_test(tiffcp g4 "-c g4" "images/miniswhite-1c-1b.tiff" FALSE)
add_convert_test(tiffcp none "-c none" "images/quad-lzw-compat.tiff" FALSE)
+add_convert_test(tiffcp noner1 "-c none -r 1" "images/lzw-single-strip.tiff" FALSE)
add_convert_test_multi(tiffcp tiffcp "" logluv "-c none" "-c sgilog" ""
"images/logluv-3c-16b.tiff" FALSE)
add_convert_test_multi(tiffcp thumbnail "" thumbnail "g3:1d" "" ""
@@ -380,3 +394,7 @@ add_convert_tests(tiffcrop doubleflip "-F both" TIFFIMAGES TRU
add_convert_tests(tiffcrop extract "-U px -E top -X 60 -Y 60" TIFFIMAGES TRUE)
# Test extracting the first and fourth quarters from the left side.
add_convert_tests(tiffcrop extractz14 "-E left -Z1:4,2:4" TIFFIMAGES TRUE)
+
+# test types
+add_test(NAME "testtypes"
+ COMMAND "testtypes")
diff --git a/tiff/test/Makefile.am b/tiff/test/Makefile.am
index 2052487ca..90c2f3d1e 100644
--- a/tiff/test/Makefile.am
+++ b/tiff/test/Makefile.am
@@ -34,6 +34,7 @@ TESTS_ENVIRONMENT = \
MEMCHECK="$(MEMCHECK)"
EXTRA_DIST = \
+ $(REFFILES) \
$(TESTSCRIPTS) \
$(IMAGES_EXTRA_DIST) \
CMakeLists.txt \
@@ -63,6 +64,7 @@ endif
# Executable programs which need to be built in order to support tests
check_PROGRAMS = \
ascii_tag long_tag short_tag strip_rw rewrite custom_dir \
+ defer_strile_loading defer_strile_writing testtypes \
$(JPEG_DEPENDENT_CHECK_PROG)
# Test scripts to execute
@@ -70,6 +72,7 @@ TESTSCRIPTS = \
ppm2tiff_pbm.sh \
ppm2tiff_pgm.sh \
ppm2tiff_ppm.sh \
+ fax2tiff.sh \
tiffcp-g3.sh \
tiffcp-g3-1d.sh \
tiffcp-g3-1d-fill.sh \
@@ -79,6 +82,7 @@ TESTSCRIPTS = \
tiffcp-logluv.sh \
tiffcp-thumbnail.sh \
tiffcp-lzw-compat.sh \
+ tiffcp-lzw-scanline-decode.sh \
tiffdump.sh \
tiffinfo.sh \
tiffcp-split.sh \
@@ -143,6 +147,14 @@ TESTSCRIPTS = \
tiff2rgba-rgb-3c-8b.sh \
$(JPEG_DEPENDENT_TESTSCRIPTS)
+# This list should contain the references files
+# from the 'refs' subdirectory
+REFFILES = \
+ refs/o-tiff2ps-EPS1.ps \
+ refs/o-tiff2ps-PS1.ps \
+ refs/o-tiff2ps-PS2.ps \
+ refs/o-tiff2ps-PS3.ps
+
# This list should contain all of the TIFF files in the 'images'
# subdirectory which are intended to be used as input images for
# tests. All of these files should use the extension ".tiff".
@@ -158,7 +170,8 @@ TIFFIMAGES = \
images/rgb-3c-16b.tiff \
images/rgb-3c-8b.tiff \
images/quad-tile.jpg.tiff \
- images/quad-lzw-compat.tiff
+ images/quad-lzw-compat.tiff \
+ images/lzw-single-strip.tiff
PNMIMAGES = \
images/minisblack-1c-8b.pgm \
@@ -170,6 +183,7 @@ PNMIMAGES = \
# files which are not currently used by the tests.
IMAGES_EXTRA_DIST = \
images/README.txt \
+ images/miniswhite-1c-1b.g3 \
$(PNMIMAGES) \
$(TIFFIMAGES)
@@ -189,6 +203,10 @@ raw_decode_SOURCES = raw_decode.c
raw_decode_LDADD = $(LIBTIFF)
custom_dir_SOURCES = custom_dir.c
custom_dir_LDADD = $(LIBTIFF)
+defer_strile_loading_SOURCES = defer_strile_loading.c
+defer_strile_loading_LDADD = $(LIBTIFF)
+defer_strile_writing_SOURCES = defer_strile_writing.c
+defer_strile_writing_LDADD = $(LIBTIFF)
AM_CPPFLAGS = -I$(top_srcdir)/libtiff
diff --git a/tiff/test/Makefile.in b/tiff/test/Makefile.in
index 15c0147b1..5a2f0607a 100644
--- a/tiff/test/Makefile.in
+++ b/tiff/test/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -117,7 +117,9 @@ TESTS = $(check_PROGRAMS) $(am__EXEEXT_3)
XFAIL_TESTS =
check_PROGRAMS = ascii_tag$(EXEEXT) long_tag$(EXEEXT) \
short_tag$(EXEEXT) strip_rw$(EXEEXT) rewrite$(EXEEXT) \
- custom_dir$(EXEEXT) $(am__EXEEXT_1)
+ custom_dir$(EXEEXT) defer_strile_loading$(EXEEXT) \
+ defer_strile_writing$(EXEEXT) testtypes$(EXEEXT) \
+ $(am__EXEEXT_1)
subdir = test
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
@@ -128,7 +130,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
$(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -144,6 +146,12 @@ am__v_lt_1 =
am_custom_dir_OBJECTS = custom_dir.$(OBJEXT)
custom_dir_OBJECTS = $(am_custom_dir_OBJECTS)
custom_dir_DEPENDENCIES = $(LIBTIFF)
+am_defer_strile_loading_OBJECTS = defer_strile_loading.$(OBJEXT)
+defer_strile_loading_OBJECTS = $(am_defer_strile_loading_OBJECTS)
+defer_strile_loading_DEPENDENCIES = $(LIBTIFF)
+am_defer_strile_writing_OBJECTS = defer_strile_writing.$(OBJEXT)
+defer_strile_writing_OBJECTS = $(am_defer_strile_writing_OBJECTS)
+defer_strile_writing_DEPENDENCIES = $(LIBTIFF)
am_long_tag_OBJECTS = long_tag.$(OBJEXT) check_tag.$(OBJEXT)
long_tag_OBJECTS = $(am_long_tag_OBJECTS)
long_tag_DEPENDENCIES = $(LIBTIFF)
@@ -160,6 +168,9 @@ am_strip_rw_OBJECTS = strip_rw.$(OBJEXT) strip.$(OBJEXT) \
test_arrays.$(OBJEXT)
strip_rw_OBJECTS = $(am_strip_rw_OBJECTS)
strip_rw_DEPENDENCIES = $(LIBTIFF)
+testtypes_SOURCES = testtypes.c
+testtypes_OBJECTS = testtypes.$(OBJEXT)
+testtypes_LDADD = $(LDADD)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -174,7 +185,15 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/ascii_tag.Po \
+ ./$(DEPDIR)/check_tag.Po ./$(DEPDIR)/custom_dir.Po \
+ ./$(DEPDIR)/defer_strile_loading.Po \
+ ./$(DEPDIR)/defer_strile_writing.Po ./$(DEPDIR)/long_tag.Po \
+ ./$(DEPDIR)/raw_decode.Po ./$(DEPDIR)/rewrite_tag.Po \
+ ./$(DEPDIR)/short_tag.Po ./$(DEPDIR)/strip.Po \
+ ./$(DEPDIR)/strip_rw.Po ./$(DEPDIR)/test_arrays.Po \
+ ./$(DEPDIR)/testtypes.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -195,11 +214,15 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(ascii_tag_SOURCES) $(custom_dir_SOURCES) \
- $(long_tag_SOURCES) $(raw_decode_SOURCES) $(rewrite_SOURCES) \
- $(short_tag_SOURCES) $(strip_rw_SOURCES)
+ $(defer_strile_loading_SOURCES) \
+ $(defer_strile_writing_SOURCES) $(long_tag_SOURCES) \
+ $(raw_decode_SOURCES) $(rewrite_SOURCES) $(short_tag_SOURCES) \
+ $(strip_rw_SOURCES) testtypes.c
DIST_SOURCES = $(ascii_tag_SOURCES) $(custom_dir_SOURCES) \
- $(long_tag_SOURCES) $(raw_decode_SOURCES) $(rewrite_SOURCES) \
- $(short_tag_SOURCES) $(strip_rw_SOURCES)
+ $(defer_strile_loading_SOURCES) \
+ $(defer_strile_writing_SOURCES) $(long_tag_SOURCES) \
+ $(raw_decode_SOURCES) $(rewrite_SOURCES) $(short_tag_SOURCES) \
+ $(strip_rw_SOURCES) testtypes.c
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -411,12 +434,13 @@ RECHECK_LOGS = $(TEST_LOGS)
AM_RECURSIVE_TARGETS = check recheck
@HAVE_JPEG_TRUE@am__EXEEXT_2 = tiff2rgba-quad-tile.jpg.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 \
+ fax2tiff.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 tiffcp-lzw-compat.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 \
+ tiffcp-lzw-scanline-decode.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 \
tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh \
@@ -479,7 +503,6 @@ TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver
TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
$(TEST_LOG_FLAGS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
- $(top_srcdir)/config/mkinstalldirs \
$(top_srcdir)/config/test-driver
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
@@ -640,6 +663,7 @@ TESTS_ENVIRONMENT = \
MEMCHECK="$(MEMCHECK)"
EXTRA_DIST = \
+ $(REFFILES) \
$(TESTSCRIPTS) \
$(IMAGES_EXTRA_DIST) \
CMakeLists.txt \
@@ -663,6 +687,7 @@ TESTSCRIPTS = \
ppm2tiff_pbm.sh \
ppm2tiff_pgm.sh \
ppm2tiff_ppm.sh \
+ fax2tiff.sh \
tiffcp-g3.sh \
tiffcp-g3-1d.sh \
tiffcp-g3-1d-fill.sh \
@@ -672,6 +697,7 @@ TESTSCRIPTS = \
tiffcp-logluv.sh \
tiffcp-thumbnail.sh \
tiffcp-lzw-compat.sh \
+ tiffcp-lzw-scanline-decode.sh \
tiffdump.sh \
tiffinfo.sh \
tiffcp-split.sh \
@@ -737,6 +763,15 @@ TESTSCRIPTS = \
$(JPEG_DEPENDENT_TESTSCRIPTS)
+# This list should contain the references files
+# from the 'refs' subdirectory
+REFFILES = \
+ refs/o-tiff2ps-EPS1.ps \
+ refs/o-tiff2ps-PS1.ps \
+ refs/o-tiff2ps-PS2.ps \
+ refs/o-tiff2ps-PS3.ps
+
+
# This list should contain all of the TIFF files in the 'images'
# subdirectory which are intended to be used as input images for
# tests. All of these files should use the extension ".tiff".
@@ -752,7 +787,8 @@ TIFFIMAGES = \
images/rgb-3c-16b.tiff \
images/rgb-3c-8b.tiff \
images/quad-tile.jpg.tiff \
- images/quad-lzw-compat.tiff
+ images/quad-lzw-compat.tiff \
+ images/lzw-single-strip.tiff
PNMIMAGES = \
images/minisblack-1c-8b.pgm \
@@ -765,6 +801,7 @@ PNMIMAGES = \
# files which are not currently used by the tests.
IMAGES_EXTRA_DIST = \
images/README.txt \
+ images/miniswhite-1c-1b.g3 \
$(PNMIMAGES) \
$(TIFFIMAGES)
@@ -783,6 +820,10 @@ raw_decode_SOURCES = raw_decode.c
raw_decode_LDADD = $(LIBTIFF)
custom_dir_SOURCES = custom_dir.c
custom_dir_LDADD = $(LIBTIFF)
+defer_strile_loading_SOURCES = defer_strile_loading.c
+defer_strile_loading_LDADD = $(LIBTIFF)
+defer_strile_writing_SOURCES = defer_strile_writing.c
+defer_strile_writing_LDADD = $(LIBTIFF)
AM_CPPFLAGS = -I$(top_srcdir)/libtiff
all: all-am
@@ -805,8 +846,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -835,6 +876,14 @@ custom_dir$(EXEEXT): $(custom_dir_OBJECTS) $(custom_dir_DEPENDENCIES) $(EXTRA_cu
@rm -f custom_dir$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(custom_dir_OBJECTS) $(custom_dir_LDADD) $(LIBS)
+defer_strile_loading$(EXEEXT): $(defer_strile_loading_OBJECTS) $(defer_strile_loading_DEPENDENCIES) $(EXTRA_defer_strile_loading_DEPENDENCIES)
+ @rm -f defer_strile_loading$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(defer_strile_loading_OBJECTS) $(defer_strile_loading_LDADD) $(LIBS)
+
+defer_strile_writing$(EXEEXT): $(defer_strile_writing_OBJECTS) $(defer_strile_writing_DEPENDENCIES) $(EXTRA_defer_strile_writing_DEPENDENCIES)
+ @rm -f defer_strile_writing$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(defer_strile_writing_OBJECTS) $(defer_strile_writing_LDADD) $(LIBS)
+
long_tag$(EXEEXT): $(long_tag_OBJECTS) $(long_tag_DEPENDENCIES) $(EXTRA_long_tag_DEPENDENCIES)
@rm -f long_tag$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(long_tag_OBJECTS) $(long_tag_LDADD) $(LIBS)
@@ -855,22 +904,35 @@ strip_rw$(EXEEXT): $(strip_rw_OBJECTS) $(strip_rw_DEPENDENCIES) $(EXTRA_strip_rw
@rm -f strip_rw$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(strip_rw_OBJECTS) $(strip_rw_LDADD) $(LIBS)
+testtypes$(EXEEXT): $(testtypes_OBJECTS) $(testtypes_DEPENDENCIES) $(EXTRA_testtypes_DEPENDENCIES)
+ @rm -f testtypes$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(testtypes_OBJECTS) $(testtypes_LDADD) $(LIBS)
+
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_tag.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_tag.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/custom_dir.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/long_tag.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw_decode.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rewrite_tag.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/short_tag.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strip.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strip_rw.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_arrays.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_tag.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_tag.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/custom_dir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/defer_strile_loading.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/defer_strile_writing.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/long_tag.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw_decode.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rewrite_tag.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/short_tag.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strip.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strip_rw.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_arrays.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testtypes.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -1071,7 +1133,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
fi; \
$$success || exit 1
-check-TESTS:
+check-TESTS: $(check_PROGRAMS)
@list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@@ -1134,6 +1196,27 @@ custom_dir.log: custom_dir$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+defer_strile_loading.log: defer_strile_loading$(EXEEXT)
+ @p='defer_strile_loading$(EXEEXT)'; \
+ b='defer_strile_loading'; \
+ $(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)
+defer_strile_writing.log: defer_strile_writing$(EXEEXT)
+ @p='defer_strile_writing$(EXEEXT)'; \
+ b='defer_strile_writing'; \
+ $(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)
+testtypes.log: testtypes$(EXEEXT)
+ @p='testtypes$(EXEEXT)'; \
+ b='testtypes'; \
+ $(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)
raw_decode.log: raw_decode$(EXEEXT)
@p='raw_decode$(EXEEXT)'; \
b='raw_decode'; \
@@ -1162,6 +1245,13 @@ ppm2tiff_ppm.sh.log: ppm2tiff_ppm.sh
--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)
+fax2tiff.sh.log: fax2tiff.sh
+ @p='fax2tiff.sh'; \
+ b='fax2tiff.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)
tiffcp-g3.sh.log: tiffcp-g3.sh
@p='tiffcp-g3.sh'; \
b='tiffcp-g3.sh'; \
@@ -1225,6 +1315,13 @@ tiffcp-lzw-compat.sh.log: tiffcp-lzw-compat.sh
--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)
+tiffcp-lzw-scanline-decode.sh.log: tiffcp-lzw-scanline-decode.sh
+ @p='tiffcp-lzw-scanline-decode.sh'; \
+ b='tiffcp-lzw-scanline-decode.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)
tiffdump.sh.log: tiffdump.sh
@p='tiffdump.sh'; \
b='tiffdump.sh'; \
@@ -1681,7 +1778,10 @@ tiff2rgba-quad-tile.jpg.sh.log: tiff2rgba-quad-tile.jpg.sh
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -1757,7 +1857,19 @@ clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/ascii_tag.Po
+ -rm -f ./$(DEPDIR)/check_tag.Po
+ -rm -f ./$(DEPDIR)/custom_dir.Po
+ -rm -f ./$(DEPDIR)/defer_strile_loading.Po
+ -rm -f ./$(DEPDIR)/defer_strile_writing.Po
+ -rm -f ./$(DEPDIR)/long_tag.Po
+ -rm -f ./$(DEPDIR)/raw_decode.Po
+ -rm -f ./$(DEPDIR)/rewrite_tag.Po
+ -rm -f ./$(DEPDIR)/short_tag.Po
+ -rm -f ./$(DEPDIR)/strip.Po
+ -rm -f ./$(DEPDIR)/strip_rw.Po
+ -rm -f ./$(DEPDIR)/test_arrays.Po
+ -rm -f ./$(DEPDIR)/testtypes.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -1803,7 +1915,19 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/ascii_tag.Po
+ -rm -f ./$(DEPDIR)/check_tag.Po
+ -rm -f ./$(DEPDIR)/custom_dir.Po
+ -rm -f ./$(DEPDIR)/defer_strile_loading.Po
+ -rm -f ./$(DEPDIR)/defer_strile_writing.Po
+ -rm -f ./$(DEPDIR)/long_tag.Po
+ -rm -f ./$(DEPDIR)/raw_decode.Po
+ -rm -f ./$(DEPDIR)/rewrite_tag.Po
+ -rm -f ./$(DEPDIR)/short_tag.Po
+ -rm -f ./$(DEPDIR)/strip.Po
+ -rm -f ./$(DEPDIR)/strip_rw.Po
+ -rm -f ./$(DEPDIR)/test_arrays.Po
+ -rm -f ./$(DEPDIR)/testtypes.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -1824,16 +1948,16 @@ uninstall-am:
.MAKE: check-am install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
- 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-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 \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \
+ check-am clean 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-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 \
recheck tags tags-am uninstall uninstall-am
diff --git a/tiff/test/ascii_tag.c b/tiff/test/ascii_tag.c
index 6337900ba..9a56d31d9 100644
--- a/tiff/test/ascii_tag.c
+++ b/tiff/test/ascii_tag.c
@@ -1,5 +1,3 @@
-/* $Id: ascii_tag.c,v 1.8 2013-12-17 14:41:57 bfriesen Exp $ */
-
/*
* Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
*
diff --git a/tiff/test/check_tag.c b/tiff/test/check_tag.c
index 43011800c..5750d6839 100644
--- a/tiff/test/check_tag.c
+++ b/tiff/test/check_tag.c
@@ -1,5 +1,3 @@
-/* $Id: check_tag.c,v 1.3 2008/04/15 14:19:37 dron Exp $ */
-
/*
* Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
*
diff --git a/tiff/test/common.sh b/tiff/test/common.sh
index 6b1380dd2..5bebcd374 100644
--- a/tiff/test/common.sh
+++ b/tiff/test/common.sh
@@ -7,6 +7,7 @@ SRCDIR=`cd $SRCDIR && pwd`
TOPSRCDIR=`cd $srcdir/.. && pwd`
TOOLS=`cd ../tools && pwd`
IMAGES="${SRCDIR}/images"
+REFS="${SRCDIR}/refs"
# Aliases for built tools
FAX2PS=${TOOLS}/fax2ps
@@ -41,6 +42,7 @@ IMG_RGB_3C_16B=${IMAGES}/rgb-3c-16b.tiff
IMG_RGB_3C_8B=${IMAGES}/rgb-3c-8b.tiff
IMG_MINISBLACK_2C_8B_ALPHA=${IMAGES}/minisblack-2c-8b-alpha.tiff
IMG_QUAD_LZW_COMPAT=${IMAGES}/quad-lzw-compat.tiff
+IMG_LZW_SINGLE_STROP=${IMAGES}/lzw-single-strip.tiff
IMG_MINISWHITE_1C_1B_PBM=${IMAGES}/miniswhite-1c-1b.pbm
IMG_MINISBLACK_1C_8B_PGM=${IMAGES}/minisblack-1c-8b.pgm
diff --git a/tiff/test/custom_dir.c b/tiff/test/custom_dir.c
index acf55ce5d..3b3ad2794 100644
--- a/tiff/test/custom_dir.c
+++ b/tiff/test/custom_dir.c
@@ -1,5 +1,3 @@
-/* $Id: custom_dir.c,v 1.3 2013-12-17 14:41:58 bfriesen Exp $ */
-
/*
* Copyright (c) 2012, Frank Warmerdam <warmerdam@pobox.com>
*
diff --git a/tiff/test/defer_strile_loading.c b/tiff/test/defer_strile_loading.c
new file mode 100644
index 000000000..b444c01f2
--- /dev/null
+++ b/tiff/test/defer_strile_loading.c
@@ -0,0 +1,311 @@
+/*
+ * Copyright (c) 2019, Even Rouault <even.rouault at spatialys.com>
+ *
+ * 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.
+ */
+
+/*
+ * TIFF Library
+ *
+ * Module to test 'D' and 'O' open flags
+ */
+
+#include "tif_config.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include "tiffio.h"
+#include "tifftest.h"
+
+int test(int classictif, int height, int tiled)
+{
+ const char* filename = "defer_strile_loading.tif";
+ TIFF* tif;
+ int i;
+ int ret = 0;
+ FILE* f;
+
+ (void)ret;
+
+ tif = TIFFOpen(filename, classictif ? "wDO" : "w8DO"); /* O should be ignored in write mode */
+ if(!tif)
+ {
+ fprintf(stderr, "cannot create %s\n", filename);
+ return 1;
+ }
+ ret = TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, 1);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_IMAGELENGTH, height);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
+ assert(ret);
+ if( tiled )
+ {
+ int j;
+ ret = TIFFSetField(tif, TIFFTAG_TILEWIDTH, 16);
+ assert( ret );
+ ret = TIFFSetField(tif, TIFFTAG_TILELENGTH, 16);
+ assert( ret );
+ for( j = 0; j < (height+15) / 16; j++ )
+ {
+ unsigned char tilebuffer[256];
+ memset(tilebuffer, (unsigned char)j, 256);
+ ret = TIFFWriteEncodedTile( tif, j, tilebuffer, 256 );
+ assert(ret == 256);
+ }
+ }
+ else
+ {
+ ret = TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, 1);
+ assert(ret);
+ for( i = 0; i < height; i++ )
+ {
+ unsigned char c = (unsigned char)i;
+ ret = TIFFWriteEncodedStrip( tif, i, &c, 1 );
+ assert(ret == 1);
+
+ if( i == 1 && height > 100000 )
+ i = height - 2;
+ }
+ }
+ TIFFClose(tif);
+
+ f = fopen(filename, "rb");
+ if( !f )
+ return 1;
+
+ for( i = 0; i < 2; i++ )
+ {
+ tif = TIFFOpen(filename, i == 0 ? "rD" : "rO");
+ if(!tif)
+ {
+ fprintf(stderr, "cannot open %s\n", filename);
+ fclose(f);
+ return 1;
+ }
+ if( tiled )
+ {
+ int j;
+ for( j = 0; j < (height+15) / 16; j++ )
+ {
+ int retry;
+ unsigned char expected_c = (unsigned char)j;
+
+ for( retry = 0; retry < 2; retry++ )
+ {
+ unsigned char tilebuffer[256];
+ memset(tilebuffer,0, 256);
+ ret = TIFFReadEncodedTile( tif, j, tilebuffer, 256 );
+ assert(ret == 256);
+ if( tilebuffer[0] != expected_c ||
+ tilebuffer[255] != expected_c )
+ {
+ fprintf(stderr, "unexpected value at tile %d: %d %d\n",
+ j, tilebuffer[0], tilebuffer[255]);
+ TIFFClose(tif);
+ fclose(f);
+ return 1;
+ }
+ }
+
+ {
+ int err = 0;
+ int offset, size;
+ unsigned char inputbuffer[256];
+ unsigned char tilebuffer[256];
+
+ offset = TIFFGetStrileOffsetWithErr(tif, j, &err);
+ assert(offset != 0);
+ assert(err == 0);
+
+ size = TIFFGetStrileByteCountWithErr(tif, j, &err);
+ assert(size == 256);
+ assert(err == 0);
+
+ fseek(f, offset, SEEK_SET);
+ fread(inputbuffer, 256, 1, f);
+
+ memset(tilebuffer,0, 256);
+ ret = TIFFReadFromUserBuffer(tif, j,
+ inputbuffer, 256,
+ tilebuffer, 256 );
+ assert(ret == 1);
+ if( tilebuffer[0] != expected_c ||
+ tilebuffer[255] != expected_c )
+ {
+ fprintf(stderr, "unexpected value at tile %d: %d %d\n",
+ j, tilebuffer[0], tilebuffer[255]);
+ TIFFClose(tif);
+ fclose(f);
+ return 1;
+ }
+ }
+ }
+ }
+ else
+ {
+ int j;
+ for( j = 0; j < height; j++ )
+ {
+ int retry;
+ unsigned char expected_c = (unsigned char)j;
+ for( retry = 0; retry < 2; retry++ )
+ {
+ unsigned char c = 0;
+ ret = TIFFReadEncodedStrip( tif, j, &c, 1 );
+ assert(ret == 1);
+ if( c != expected_c )
+ {
+ fprintf(stderr, "unexpected value at line %d: %d\n",
+ j, c);
+ TIFFClose(tif);
+ fclose(f);
+ return 1;
+ }
+ }
+
+ {
+ int err = 0;
+ int offset, size;
+ unsigned char inputbuffer[1];
+ unsigned char tilebuffer[1];
+
+ offset = TIFFGetStrileOffsetWithErr(tif, j, &err);
+ assert(offset != 0);
+ assert(err == 0);
+
+ size = TIFFGetStrileByteCountWithErr(tif, j, &err);
+ assert(size == 1);
+ assert(err == 0);
+
+ fseek(f, offset, SEEK_SET);
+ fread(inputbuffer, 1, 1, f);
+
+ memset(tilebuffer,0, 1);
+ ret = TIFFReadFromUserBuffer(tif, j,
+ inputbuffer, 1,
+ tilebuffer, 1 );
+ assert(ret == 1);
+ if( tilebuffer[0] != expected_c )
+ {
+ fprintf(stderr, "unexpected value at line %d: %d\n",
+ j, tilebuffer[0]);
+ TIFFClose(tif);
+ fclose(f);
+ return 1;
+ }
+ }
+
+ if( j == 1 && height > 100000 )
+ j = height - 2;
+ }
+
+ if( height > 100000 )
+ {
+ /* Missing strip */
+ int err = 0;
+ ret = TIFFGetStrileOffsetWithErr(tif, 2, &err);
+ assert(ret == 0);
+ assert(err == 0);
+
+ ret = TIFFGetStrileByteCountWithErr(tif, 2, &err);
+ assert(ret == 0);
+ assert(err == 0);
+
+ }
+ }
+
+ {
+ int err = 0;
+ ret = TIFFGetStrileOffsetWithErr(tif, 0xFFFFFFFFU, &err);
+ assert(ret == 0);
+ assert(err == 1);
+
+ ret = TIFFGetStrileByteCountWithErr(tif, 0xFFFFFFFFU, &err);
+ assert(ret == 0);
+ assert(err == 1);
+ }
+
+ {
+ toff_t* offsets = NULL;
+ toff_t* bytecounts = NULL;
+ ret = TIFFGetField( tif,
+ tiled ? TIFFTAG_TILEOFFSETS : TIFFTAG_STRIPOFFSETS, &offsets );
+ assert(ret);
+ assert(offsets);
+ ret = TIFFGetField( tif,
+ tiled ? TIFFTAG_TILEBYTECOUNTS : TIFFTAG_STRIPBYTECOUNTS, &bytecounts );
+ assert(ret);
+ assert(bytecounts);
+ if( tiled )
+ {
+ assert(bytecounts[0] == 256);
+ }
+ else
+ {
+ assert(bytecounts[0] == 1);
+ if( height > 1 && height <= 100000)
+ {
+ assert(offsets[1] == offsets[0] + 1);
+ assert(offsets[height - 1] == offsets[0] + height - 1);
+ }
+ assert(bytecounts[height - 1] == 1);
+ }
+ }
+
+ TIFFClose(tif);
+ }
+ fclose(f);
+
+ unlink(filename);
+ return 0;
+}
+
+int
+main()
+{
+ int is_classic;
+ for( is_classic = 1; is_classic >= 0; is_classic-- )
+ {
+ int tiled;
+ for( tiled = 0; tiled <= 1; tiled ++ )
+ {
+ if( test(is_classic, 1, tiled) )
+ return 1;
+ if( test(is_classic, 8192, tiled) )
+ return 1;
+ }
+ if( test(is_classic, 2000000, 0) )
+ return 1;
+ }
+ return 0;
+}
diff --git a/tiff/test/defer_strile_writing.c b/tiff/test/defer_strile_writing.c
new file mode 100644
index 000000000..4e358567a
--- /dev/null
+++ b/tiff/test/defer_strile_writing.c
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2019, Even Rouault <even.rouault at spatialys.com>
+ *
+ * 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.
+ */
+
+/*
+ * TIFF Library
+ *
+ * Module to test TIFFDeferStrileArrayWriting and TIFFForceStrileArrayWriting
+ */
+
+#include "tif_config.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include "tiffio.h"
+
+int test(const char* mode, int tiled, int height)
+{
+ const char* filename = "defer_strile_writing.tif";
+ TIFF* tif;
+ int i;
+ int ret = 0;
+ (void)ret;
+
+ tif = TIFFOpen(filename, mode);
+ if(!tif)
+ {
+ fprintf(stderr, "cannot create %s\n", filename);
+ return 1;
+ }
+ ret = TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, 1);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_IMAGELENGTH, height);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
+ assert(ret);
+
+ if( tiled )
+ {
+ ret = TIFFSetField(tif, TIFFTAG_TILEWIDTH, 16);
+ assert( ret );
+ ret = TIFFSetField(tif, TIFFTAG_TILELENGTH, 16);
+ assert( ret );
+ }
+ else
+ {
+ ret = TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, 1);
+ assert(ret);
+ }
+
+ ret = TIFFDeferStrileArrayWriting(tif);
+ assert(ret);
+
+ ret = TIFFWriteCheck( tif, tiled, "test" );
+ assert(ret);
+
+ ret = TIFFWriteDirectory( tif );
+ assert(ret);
+
+ /* Create other directory */
+ TIFFFreeDirectory( tif );
+ TIFFCreateDirectory( tif );
+
+ ret = TIFFSetField( tif, TIFFTAG_SUBFILETYPE, FILETYPE_PAGE );
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, 1);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_IMAGELENGTH, 1);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
+ assert(ret);
+ ret = TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, 1);
+ assert(ret);
+
+ ret = TIFFDeferStrileArrayWriting(tif);
+ assert(ret);
+
+ ret = TIFFWriteCheck( tif, 0, "test" );
+ assert(ret);
+
+ ret = TIFFWriteDirectory( tif );
+ assert(ret);
+
+ /* Force writing of strile arrays */
+ ret = TIFFSetDirectory( tif, 0 );
+ assert(ret);
+
+ ret = TIFFForceStrileArrayWriting(tif);
+ assert(ret);
+
+ ret = TIFFSetDirectory( tif, 1 );
+ assert(ret);
+
+ ret = TIFFForceStrileArrayWriting(tif);
+ assert(ret);
+
+ /* Now write data on frist directory */
+ ret = TIFFSetDirectory( tif, 0 );
+ assert(ret);
+
+ if( tiled )
+ {
+ int j;
+ for( j = 0; j < (height+15) / 16; j++ )
+ {
+ unsigned char tilebuffer[256];
+ memset(tilebuffer, (unsigned char)j, 256);
+ ret = TIFFWriteEncodedTile( tif, j, tilebuffer, 256 );
+ assert(ret == 256);
+ }
+ }
+ else
+ {
+ for( i = 0; i < height; i++ )
+ {
+ unsigned char c = (unsigned char)i;
+ ret = TIFFWriteEncodedStrip( tif, i, &c, 1 );
+ assert(ret == 1);
+
+ if( i == 1 && height > 100000 )
+ i = height - 2;
+ }
+ }
+
+ TIFFClose(tif);
+
+ tif = TIFFOpen(filename, "r");
+ if(!tif)
+ {
+ fprintf(stderr, "cannot open %s\n", filename);
+ return 1;
+ }
+ if( tiled )
+ {
+ int j;
+ for( j = 0; j < (height+15) / 16; j++ )
+ {
+ int retry;
+ for( retry = 0; retry < 2; retry++ )
+ {
+ unsigned char tilebuffer[256];
+ unsigned char expected_c = (unsigned char)j;
+ memset(tilebuffer,0, 256);
+ ret = TIFFReadEncodedTile( tif, j, tilebuffer, 256 );
+ assert(ret == 256);
+ if( tilebuffer[0] != expected_c ||
+ tilebuffer[255] != expected_c )
+ {
+ fprintf(stderr, "unexpected value at tile %d: %d %d\n",
+ j, tilebuffer[0], tilebuffer[255]);
+ TIFFClose(tif);
+ return 1;
+ }
+ }
+ }
+ }
+ else
+ {
+ int j;
+ for( j = 0; j < height; j++ )
+ {
+ int retry;
+ for( retry = 0; retry < 2; retry++ )
+ {
+ unsigned char c = 0;
+ unsigned char expected_c = (unsigned char)j;
+ ret = TIFFReadEncodedStrip( tif, j, &c, 1 );
+ assert(ret == 1);
+ if( c != expected_c )
+ {
+ fprintf(stderr, "unexpected value at line %d: %d\n",
+ j, c);
+ TIFFClose(tif);
+ return 1;
+ }
+ }
+ }
+ }
+
+ TIFFClose(tif);
+
+ unlink(filename);
+ return 0;
+}
+
+int
+main()
+{
+ int tiled;
+ for( tiled = 0; tiled <= 1; tiled ++ )
+ {
+ if( test("w", tiled, 1) )
+ return 1;
+ if( test("w", tiled, 10) )
+ return 1;
+ if( test("w8", tiled, 1) )
+ return 1;
+ if( test("wD", tiled, 1) )
+ return 1;
+ }
+ return 0;
+}
diff --git a/tiff/test/fax2tiff.sh b/tiff/test/fax2tiff.sh
new file mode 100755
index 000000000..8806a6478
--- /dev/null
+++ b/tiff/test/fax2tiff.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# Basic sanity check for fax2tiff
+#
+. ${srcdir:-.}/common.sh
+infile="${IMAGES}/miniswhite-1c-1b.g3"
+outfile="o-fax2tiff.tiff"
+rm -f $outfile
+echo "$MEMCHECK ${FAX2TIFF} -M -o $outfile $infile"
+eval $MEMCHECK ${FAX2TIFF} -M -o $outfile $infile
+status=$?
+if [ $status != 0 ] ; then
+ echo "Returned failed status $status!"
+ echo "Output (if any) is in \"${outfile}\"."
+ exit $status
+fi
+f_tiffinfo_validate $outfile
diff --git a/tiff/test/images/README.txt b/tiff/test/images/README.txt
index 17f6292ec..b6447d8ee 100644
--- a/tiff/test/images/README.txt
+++ b/tiff/test/images/README.txt
@@ -27,3 +27,6 @@ PNM files:
minisblack-1c-8b.pgm
miniswhite-1c-1b.pbm
rgb-3c-8b.ppm
+
+G3 Fax files :
+ miniswhite-1c-1b.g3
diff --git a/tiff/test/images/lzw-single-strip.tiff b/tiff/test/images/lzw-single-strip.tiff
new file mode 100644
index 000000000..0ac27c6d8
--- /dev/null
+++ b/tiff/test/images/lzw-single-strip.tiff
Binary files differ
diff --git a/tiff/test/images/miniswhite-1c-1b.g3 b/tiff/test/images/miniswhite-1c-1b.g3
new file mode 100644
index 000000000..9f00ce168
--- /dev/null
+++ b/tiff/test/images/miniswhite-1c-1b.g3
Binary files differ
diff --git a/tiff/test/long_tag.c b/tiff/test/long_tag.c
index ab1440af8..4bfdf8051 100644
--- a/tiff/test/long_tag.c
+++ b/tiff/test/long_tag.c
@@ -1,5 +1,3 @@
-/* $Id: long_tag.c,v 1.5 2013-12-17 14:41:58 bfriesen Exp $ */
-
/*
* Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
*
diff --git a/tiff/test/raw_decode.c b/tiff/test/raw_decode.c
index f81aa059f..a2fca03a8 100644
--- a/tiff/test/raw_decode.c
+++ b/tiff/test/raw_decode.c
@@ -1,5 +1,3 @@
-/* $Id: raw_decode.c,v 1.7 2015-08-16 20:08:21 bfriesen Exp $ */
-
/*
* Copyright (c) 2012, Frank Warmerdam <warmerdam@pobox.com>
*
diff --git a/tiff/test/refs/o-tiff2ps-EPS1.ps b/tiff/test/refs/o-tiff2ps-EPS1.ps
new file mode 100644
index 000000000..9d9da8a28
--- /dev/null
+++ b/tiff/test/refs/o-tiff2ps-EPS1.ps
@@ -0,0 +1,112 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%Creator: tiff2ps
+%%Title: miniswhite-1c-1b.tiff
+%%CreationDate: Tue Apr 2 16:33:00 2019
+%%DocumentData: Clean7Bit
+%%Origin: 0 0
+%%BoundingBox: 0 0 157 151
+%%LanguageLevel: 1
+%%Pages: 1 1
+%%EndComments
+%%Page: 1 1
+gsave
+100 dict begin
+157.000000 151.000000 scale
+%ImageData: 157 151 1 1 0 1 2 "image"
+/scanLine 20 string def
+157 151 1
+[157 0 0 -151 0 151]
+{currentfile scanLine readhexstring pop} bind
+image
+0204153c0bfffffffff1ffffc7e01017ff8057ff5aa2803e1ffffffe0697ffffc7e485
+dfffd77fff48aca4dfd7fffff80003ffffcffe017fffe0c7ff1101250ffbfffff0241b
+ffffffff80fffff37fff29fa48abf7ffffe41221ffffafffe3fffff19fff7ff82200f7
+fdff0040803fff5ffff5ffffe17ffffffe00088bc0070008259fff7ffffdfffff0ffff
+7ffe040003c0001222001fff3ffffffffff15fdfffff084003004104809493fc1dffff
+ffffc1badfffff0fd000010020140009e337ffffffffc3efffffff1abc040400000502
+04c6bfffffefffc36b7ffffe1ffe0c808804009490061bffffffff82fafffffc3dff08
+080000020042a78fffffffff87f7fffffc1fff0c0010428049080c27ffffffff87feff
+fffc7ffd108000e0611090103ffffffffe077dfffffdbffc340003e808020203cfffff
+fffc0bd77fffe0fffc000003e10022008877fffffffc06fdff3fe35ffc780217c02808
+28000ffffffff80f5fff6bc27ff040000fc00100a20103ffffffc007f5ff5ec2ffe082
+200bc480420454a1ffffffe0065fff7fc5ff0010005f1000205a4929ffffffe003d7ff
+5fe7b80008202f029804000000ffffffc003efff37e5fe0010001e0401020240917fff
+ffc004effffffbf80022001f018888a429087fffff8007b7ff5ff3e00080009c002122
+2544015ffff9c01fb7ff7ef7c0100400fc8408000020981ffff0783fe97f77fbc00800
+017e009006560a4547ffd2bffbffff5fd780020000f801041000a00033fccdbb9ffeff
+1ba000500003fa1024a249125025f033effffeffffc000c00042f002860800880540d0
+47ffffffff574001c80003f9803e405054411400a9bfffffff7e0003804003f00a0302
+090114800005efffffff6f0003880007fc0203a040a3522a4017ffffffff5f00034000
+1af980a884120f1f8c000adffffffffff80fc0000ff82810420a27ffa800067fffffff
+fff80f400033fc010a44508fff8e000bfffffffffffc0fc0003ff9809842404fff9e20
+07ffffdff7fffe0d400003ff200220291fff9b401afffffffffffc1fe01359ff089620
+015fffaa001bffffff1ffffa3d703eeeff810b22480fff905006fffffd6ffff81fb078
+adffe40e00412fff85400d7ffff9fffff01d787fedffe08ba8185fff501007ffff925f
+fff03af8e7f7fff13f81401ffe054005ffffc1fffff03ffcf5effff00fa0094754d310
+05fffb07bfff803ffdddfffff00fe0145ea503d00fffff2f5fff003abfdffffff23fd2
+000151a7d81afffe3f7f7f803bbffffffff88fe081a02a23d006fffe7fbf39403ffebf
+fffff23fe408068007d00bfffeffff6bf83f7f7ffffffd1fe01004aa2ff005fffff55f
+46581afde7fffff087f00151008fd0027fffe2ff75f83fdc7bfffff05ff04004600fc0
+097fffc7ff79503677fffffff90ffa0495069f9002b7ffc9bf1e403edb7bfffff94ff0
+0420005f000127f7c3ff1e201764dffffff811440106963f80001ddffc5f0000296bbf
+fffff842920b0200fe0000007fffbf00003681ebfffff8096cffc094fc20001fffff5f
+000001015ffffff88064dfc001f980003ffffff700000200f9fffff0130a0fc29af400
+007fffffff00000003affffff8041403c2297d1800ffffffcf00000003fdfffff000a9
+87e402d01800fffffff720300002bfbffff8299407f005a09800fffffff764000003da
+fffff80001aff020040000ffffffef78c00001fbfffff0002107f020880000ffffffc7
+db000003dffffff0024c87f042100000ffffffd759000003f6fffff0100895f801400d
+00ffffffc7f3000007fffffff0024137f81e781fe0dfffff8f6c000007effffff00001
+fbfc29fc37b0ffffff8748000003feffffe000017efc11de5fe06fffff07d0000007df
+fffff000037bfc13ff9ff07fffff8700000007fffffff0000ffcfe227ffff837ffff1f
+2000000fbbfffff0003dfffe41fffffc1fffffe75000000fffffffe00205fdff647fff
+f816ffffc7a0000007dfffffe06f843dff635fffff03fdff074000000fffffffe1b3e0
+1affe9ff67ff0522ce074000000fffffffc0bfb003ffc9f27ffe0398290700000007f7
+ffff81fff00fffce4077ff04a020470000000fffffff86fff8057ffcc05fff0000000f
+0000000fffffff837ffa0ffff780ffff0000000700000017bfffff0fffff0ffff601ff
+ff000000470000000fffffff09dfc78bffffc22fff0000000700000007ffffff0d5bf0
+eeffff89ffff0000000f0000000fffffff0bfff87eff8f12bfff000000270000000fff
+ffff0feffc27fffd055fff000004070000001f7fffff3fb6d7ffff7907fffe0000000f
+0000001ffffffc3e5d476fc0dd7fffff0000200f0000000ffffffc1ffdbdf5f12bffff
+ff0000015f0000001ffffffc1f97edfff05fffefff0000003f0000000ffffff839febb
+5ffcabbffffe000008bf0000002ffffffc3d56bfb7ff5fffffff000084ff0000001fff
+fff85bdde5fffe29ffffff000000ff0000003fffffe066baaffffebbffffff000012ff
+0000001ffffff02aebf66ffe5dffffff000001ff0000001fffffd057757bffff257fff
+ff00000bff0000002fffffe0ad575f5fffd5ffffff000240ff0000003fffffc05bbcfe
+bfff0a7fffff000003f70000006fffffc02aeb95ffffa5ffffff000093f70000003bff
+ffc0aff99df77f0a7bfffe000423f70000003fffffb0112e733ffe95ddfefe000047c7
+0000007fffffe01bf7eeedff0ab3defe00000b970000005fffff804415a9b775a54fff
+ee000027c70000007fffff8036db4a3fb685ba7ffe00008787000050bffffff0080455
+e6dd5867df6c000015870000007fffff801051a06eba9abfdffe000003070000605fff
+ffc006082bb7ed954976f800000c07000000ffffffc004022a757a252bf7fc00002507
+0000a07effff700568591fe55ada2e9c00000007000000bffffe400a3a24a55a656fff
+bc00000587000000fffffbe000845a5df81ad59af8000020070000009fffffe0004c24
+93c85556edf400000007000000ffffbf8000b25b2dbd1aa57bbc00000007000001ffff
+ffa000491466e0035c5ffc00001407000001bfffffc000248b0bb86497db7000000007
+000000ffffff4000122a35390a26effc000000070000007fffff8000498782e454d579
+7c00000007000001bfffffc000210953ba89495ff400000007000001fbffffc0002892
+a968256ebde800000007000001ffffffc000858581f914dbfb7c00000007000003bfff
+ff00002142649887699dfc00000007000001bfffff00004a80a961296dffe802000007
+000002dfffff00001191489822b757f800000007400001bfffff00001004a9a85576fb
+d8000000077e2007ffffff0000038141500a97afb8000000077658077bffff00000611
+aca951ee79d000000007ffa207effffe0000008a51500c556ff000000007ffc907ffff
+fe0000028141c80467e77000000007ff74065ffffe00000126ac50005cbfe000000007
+ffe80dfffffc0000008155a00017efc000000007fffe075ffffc000002a4aa58012937
+4000000007fffc0efffffc00000003ad50002acd8500000007fffd19dffffc000000a0
+62a000077f8058000007fffa0dfffffc00000084d9a800157501f0000007fffe06bfff
+fc000000216450006dce023f000007fffc06bffff0000000601a400015d801ff500007
+fff009e7fff000000000418000057001ffb28007ffe0037fffe0000000c0a000000240
+07fffe8007fff0011bffe000000010010000007b21ffffe007ffffffffffe000000000
+000000007f82fffffc07ffffffffffc000000000000000007fc1ffffff07ffffffffff
+c900000000000000006c04fffffb07ffffffffffffa0000000000000000c027ffff847
+ffffffffffffffc00000000000000001affffa27fffffffffffffff000000000000000
+04005ffc07fffffffffffffffd0000000000000000000000075fffffffffffffffc000
+000000000000220180ef1ffffffffffffffffe00000000000002000883ff1fffffffff
+ffffffff00001800000000000009ff3fffffffffffffffff0000000001418000003bff
+2fffffffffffffffff00010000027000901207ff7fffffffffffffffff7e00010037f8
+0018000fff7fffffffffffffffffff00a44007fc0030423fff7fffffffffffffffffff
+c043002ffc003000afff
+end
+grestore
+showpage
+%%Trailer
+%%EOF
diff --git a/tiff/test/refs/o-tiff2ps-PS1.ps b/tiff/test/refs/o-tiff2ps-PS1.ps
new file mode 100644
index 000000000..62c3e4bb6
--- /dev/null
+++ b/tiff/test/refs/o-tiff2ps-PS1.ps
@@ -0,0 +1,115 @@
+%!PS-Adobe-3.0
+%%Creator: tiff2ps
+%%Title: miniswhite-1c-1b.tiff
+%%CreationDate: Tue Apr 2 16:33:00 2019
+%%DocumentData: Clean7Bit
+%%Origin: 0 0
+%%BoundingBox: 0 0 157 151
+%%LanguageLevel: 1
+%%Pages: (atend)
+%%EndComments
+%%BeginSetup
+%%EndSetup
+%%Page: 1 1
+gsave
+100 dict begin
+157.000000 151.000000 scale
+%ImageData: 157 151 1 1 0 1 2 "image"
+/scanLine 20 string def
+157 151 1
+[157 0 0 -151 0 151]
+{currentfile scanLine readhexstring pop} bind
+image
+0204153c0bfffffffff1ffffc7e01017ff8057ff5aa2803e1ffffffe0697ffffc7e485
+dfffd77fff48aca4dfd7fffff80003ffffcffe017fffe0c7ff1101250ffbfffff0241b
+ffffffff80fffff37fff29fa48abf7ffffe41221ffffafffe3fffff19fff7ff82200f7
+fdff0040803fff5ffff5ffffe17ffffffe00088bc0070008259fff7ffffdfffff0ffff
+7ffe040003c0001222001fff3ffffffffff15fdfffff084003004104809493fc1dffff
+ffffc1badfffff0fd000010020140009e337ffffffffc3efffffff1abc040400000502
+04c6bfffffefffc36b7ffffe1ffe0c808804009490061bffffffff82fafffffc3dff08
+080000020042a78fffffffff87f7fffffc1fff0c0010428049080c27ffffffff87feff
+fffc7ffd108000e0611090103ffffffffe077dfffffdbffc340003e808020203cfffff
+fffc0bd77fffe0fffc000003e10022008877fffffffc06fdff3fe35ffc780217c02808
+28000ffffffff80f5fff6bc27ff040000fc00100a20103ffffffc007f5ff5ec2ffe082
+200bc480420454a1ffffffe0065fff7fc5ff0010005f1000205a4929ffffffe003d7ff
+5fe7b80008202f029804000000ffffffc003efff37e5fe0010001e0401020240917fff
+ffc004effffffbf80022001f018888a429087fffff8007b7ff5ff3e00080009c002122
+2544015ffff9c01fb7ff7ef7c0100400fc8408000020981ffff0783fe97f77fbc00800
+017e009006560a4547ffd2bffbffff5fd780020000f801041000a00033fccdbb9ffeff
+1ba000500003fa1024a249125025f033effffeffffc000c00042f002860800880540d0
+47ffffffff574001c80003f9803e405054411400a9bfffffff7e0003804003f00a0302
+090114800005efffffff6f0003880007fc0203a040a3522a4017ffffffff5f00034000
+1af980a884120f1f8c000adffffffffff80fc0000ff82810420a27ffa800067fffffff
+fff80f400033fc010a44508fff8e000bfffffffffffc0fc0003ff9809842404fff9e20
+07ffffdff7fffe0d400003ff200220291fff9b401afffffffffffc1fe01359ff089620
+015fffaa001bffffff1ffffa3d703eeeff810b22480fff905006fffffd6ffff81fb078
+adffe40e00412fff85400d7ffff9fffff01d787fedffe08ba8185fff501007ffff925f
+fff03af8e7f7fff13f81401ffe054005ffffc1fffff03ffcf5effff00fa0094754d310
+05fffb07bfff803ffdddfffff00fe0145ea503d00fffff2f5fff003abfdffffff23fd2
+000151a7d81afffe3f7f7f803bbffffffff88fe081a02a23d006fffe7fbf39403ffebf
+fffff23fe408068007d00bfffeffff6bf83f7f7ffffffd1fe01004aa2ff005fffff55f
+46581afde7fffff087f00151008fd0027fffe2ff75f83fdc7bfffff05ff04004600fc0
+097fffc7ff79503677fffffff90ffa0495069f9002b7ffc9bf1e403edb7bfffff94ff0
+0420005f000127f7c3ff1e201764dffffff811440106963f80001ddffc5f0000296bbf
+fffff842920b0200fe0000007fffbf00003681ebfffff8096cffc094fc20001fffff5f
+000001015ffffff88064dfc001f980003ffffff700000200f9fffff0130a0fc29af400
+007fffffff00000003affffff8041403c2297d1800ffffffcf00000003fdfffff000a9
+87e402d01800fffffff720300002bfbffff8299407f005a09800fffffff764000003da
+fffff80001aff020040000ffffffef78c00001fbfffff0002107f020880000ffffffc7
+db000003dffffff0024c87f042100000ffffffd759000003f6fffff0100895f801400d
+00ffffffc7f3000007fffffff0024137f81e781fe0dfffff8f6c000007effffff00001
+fbfc29fc37b0ffffff8748000003feffffe000017efc11de5fe06fffff07d0000007df
+fffff000037bfc13ff9ff07fffff8700000007fffffff0000ffcfe227ffff837ffff1f
+2000000fbbfffff0003dfffe41fffffc1fffffe75000000fffffffe00205fdff647fff
+f816ffffc7a0000007dfffffe06f843dff635fffff03fdff074000000fffffffe1b3e0
+1affe9ff67ff0522ce074000000fffffffc0bfb003ffc9f27ffe0398290700000007f7
+ffff81fff00fffce4077ff04a020470000000fffffff86fff8057ffcc05fff0000000f
+0000000fffffff837ffa0ffff780ffff0000000700000017bfffff0fffff0ffff601ff
+ff000000470000000fffffff09dfc78bffffc22fff0000000700000007ffffff0d5bf0
+eeffff89ffff0000000f0000000fffffff0bfff87eff8f12bfff000000270000000fff
+ffff0feffc27fffd055fff000004070000001f7fffff3fb6d7ffff7907fffe0000000f
+0000001ffffffc3e5d476fc0dd7fffff0000200f0000000ffffffc1ffdbdf5f12bffff
+ff0000015f0000001ffffffc1f97edfff05fffefff0000003f0000000ffffff839febb
+5ffcabbffffe000008bf0000002ffffffc3d56bfb7ff5fffffff000084ff0000001fff
+fff85bdde5fffe29ffffff000000ff0000003fffffe066baaffffebbffffff000012ff
+0000001ffffff02aebf66ffe5dffffff000001ff0000001fffffd057757bffff257fff
+ff00000bff0000002fffffe0ad575f5fffd5ffffff000240ff0000003fffffc05bbcfe
+bfff0a7fffff000003f70000006fffffc02aeb95ffffa5ffffff000093f70000003bff
+ffc0aff99df77f0a7bfffe000423f70000003fffffb0112e733ffe95ddfefe000047c7
+0000007fffffe01bf7eeedff0ab3defe00000b970000005fffff804415a9b775a54fff
+ee000027c70000007fffff8036db4a3fb685ba7ffe00008787000050bffffff0080455
+e6dd5867df6c000015870000007fffff801051a06eba9abfdffe000003070000605fff
+ffc006082bb7ed954976f800000c07000000ffffffc004022a757a252bf7fc00002507
+0000a07effff700568591fe55ada2e9c00000007000000bffffe400a3a24a55a656fff
+bc00000587000000fffffbe000845a5df81ad59af8000020070000009fffffe0004c24
+93c85556edf400000007000000ffffbf8000b25b2dbd1aa57bbc00000007000001ffff
+ffa000491466e0035c5ffc00001407000001bfffffc000248b0bb86497db7000000007
+000000ffffff4000122a35390a26effc000000070000007fffff8000498782e454d579
+7c00000007000001bfffffc000210953ba89495ff400000007000001fbffffc0002892
+a968256ebde800000007000001ffffffc000858581f914dbfb7c00000007000003bfff
+ff00002142649887699dfc00000007000001bfffff00004a80a961296dffe802000007
+000002dfffff00001191489822b757f800000007400001bfffff00001004a9a85576fb
+d8000000077e2007ffffff0000038141500a97afb8000000077658077bffff00000611
+aca951ee79d000000007ffa207effffe0000008a51500c556ff000000007ffc907ffff
+fe0000028141c80467e77000000007ff74065ffffe00000126ac50005cbfe000000007
+ffe80dfffffc0000008155a00017efc000000007fffe075ffffc000002a4aa58012937
+4000000007fffc0efffffc00000003ad50002acd8500000007fffd19dffffc000000a0
+62a000077f8058000007fffa0dfffffc00000084d9a800157501f0000007fffe06bfff
+fc000000216450006dce023f000007fffc06bffff0000000601a400015d801ff500007
+fff009e7fff000000000418000057001ffb28007ffe0037fffe0000000c0a000000240
+07fffe8007fff0011bffe000000010010000007b21ffffe007ffffffffffe000000000
+000000007f82fffffc07ffffffffffc000000000000000007fc1ffffff07ffffffffff
+c900000000000000006c04fffffb07ffffffffffffa0000000000000000c027ffff847
+ffffffffffffffc00000000000000001affffa27fffffffffffffff000000000000000
+04005ffc07fffffffffffffffd0000000000000000000000075fffffffffffffffc000
+000000000000220180ef1ffffffffffffffffe00000000000002000883ff1fffffffff
+ffffffff00001800000000000009ff3fffffffffffffffff0000000001418000003bff
+2fffffffffffffffff00010000027000901207ff7fffffffffffffffff7e00010037f8
+0018000fff7fffffffffffffffffff00a44007fc0030423fff7fffffffffffffffffff
+c043002ffc003000afff
+end
+grestore
+showpage
+%%Trailer
+%%Pages: 1
+%%EOF
diff --git a/tiff/test/refs/o-tiff2ps-PS2.ps b/tiff/test/refs/o-tiff2ps-PS2.ps
new file mode 100644
index 000000000..e7fe4339a
--- /dev/null
+++ b/tiff/test/refs/o-tiff2ps-PS2.ps
@@ -0,0 +1,104 @@
+%!PS-Adobe-3.0
+%%Creator: tiff2ps
+%%Title: miniswhite-1c-1b.tiff
+%%CreationDate: Tue Apr 2 16:33:00 2019
+%%DocumentData: Clean7Bit
+%%Origin: 0 0
+%%BoundingBox: 0 0 157 151
+%%LanguageLevel: 2
+%%Pages: (atend)
+%%EndComments
+%%BeginSetup
+gsave newpath clippath pathbbox grestore
+ 4 2 roll 2 copy translate
+ exch 3 1 roll sub 3 1 roll sub exch
+ currentpagedevice /PageSize get aload pop
+ exch 3 1 roll div 3 1 roll div abs exch abs
+ 2 copy gt { exch } if pop
+ dup 1 lt { dup scale } { pop } ifelse
+%%EndSetup
+%%Page: 1 1
+%%PageOrientation: Landscape
+%%PageBoundingBox: 0 0 157 151
+1 dict begin /PageSize [ 157.000000 151.000000 ] def currentdict end setpagedevice
+<<
+ /Policies <<
+ /PageSize 3
+ >>
+>> setpagedevice
+gsave
+100 dict begin
+157.000000 151.000000 scale
+% PostScript Level 2 only.
+/DeviceGray setcolorspace
+{ % exec
+ /im_stream currentfile /ASCII85Decode filter def
+ <<
+ /ImageType 1
+ /Width 157
+ /Height 151
+ /ImageMatrix [ 157 0 0 -151 0 151 ]
+ /BitsPerComponent 1
+ /Interpolate true
+ /Decode [1 0]
+ /DataSource im_stream
+ >> image
+ im_stream status { im_stream flushfile } if
+}
+exec
+rVPltoDejk!"Ju/3$7VQ!.UpIV-SSehuE`Xq.Ka.3#d/d!%<?t[o6KR-ia5Ps82is0EM0'!$=0#
+mf(r0"98E4gZ/>7!!%KK!"=AXeciN^#QOiDmG7gC:]MI8!"NB:J-Xp1#Qb#+^OO$!TE#<!!$6Xj
+!!3,oF?fR#pY'!TJ,fWN!"T&0J-#QIr'15Kh>cC5^]4?7!"PYE!!)c.r;XM.Iqrj&iW&rY!'Wgo
+!!)LAs8N&Uli6Yua8c2?!'Cem!!)+JqtpEnqYg:O5QCcq!'HKr!!2!Yo7(u]s(cQKj8]/[!.>"N
+!!C(<p\4^frVsQ5Du]k<!-ebL!!D-ZoDe9mJ%#+CfDkmO!-eME!!@`Qmsk?ZT'pUd^]4?7!Vh6H
+!!5CfbQ%JVp\k'g0E;(Q"8"!l!$;1Cs8W!<s5!^!L]@DT"8Muu^`9!LL]-F$fD!nsn,NFg#OnAd
+PWaO-^]3dfrr6:'qu?]s5PPQcTfiAtIGaZYJ%b`[?2ss*+8MQ0J3!]1n,K'Ls50Z]ec5[M+8dMe
+TGU3!pYX?rBD_`/rr<$!5Pu&ma;P*Zn,MADrr)f1DL_]e5Pkul!!EQ,h>cF4GB[9BpOE5DJ+uP7
+TF;qBJ,a$YhVHntrh'5q5N#'4JI"L/qu6bFp](9NBA`b#LVO[UL]fs:s8ITLDu$C*]!q_l5Qh&e
+TI><gs8N?'qsXPls3(R#6sp#qjBqqjs83&hgKh8TYM'N2&-)_2!'gKJs1JsAH2%>_qS+\nzW5&<j
+s83(N_8!1S^?bf"5QCcaJcGXt^\eW8r;H?gl[Ss2&-)\1OT56&s7c]pr*R3DXjt2MzT`=r)s5aH7
+=*s?(i,eqk+92BA!!i!Xs6p9Fn%JDH!*B3rJ,fQL!!i#.s3(TEot.DH!-/&2z!!D^Ts1ehgB>)'a
+!+Fd[!!",I!!2Z*s82lSrSQ2a!+`k+z!!D.$m%sdWC#Ao_!*0'[!!!#W!!U6#_%?Zro\I"G!,o(:
+!!!(^!!hFXLJe*knc->M!.)ENJ,fcR!"\(EJ._i(FB@Xu!3bkd!!$l/!"[$R(^L*O^ja&V!W'S-
+!!#1_!"ZjI$4m1Jn6bn!X"<`9!!N'^!.Vcc+ohTRn/pti>5U&C!!(B=!<:#'+92BN^b,TcY#m(5
+!!0lcJ:GL&!!!!(E$'O9e_DhR!!.U8`kT:i5QCcn^`3%DJ+t\h!!*'"PR#!SJ,fQNi#hFb<R;9Q
+!!!A!\YnNj(]XOHGRseVs)9XiJ,gSiM?gpAKE(u_TF\g7TC>)=J,hP/L9J^T!!!!'n-/](q-\.>
+8,tP5iP32SKE(uVYRgWgs.KDkfEaS>iSWjg+92BHm^rJoBu#5uiZJ>rs8UZ75QCch]l!E?rrN0"
+s*t)7s8U2i'EA+<p6,J@CBNJohuEbMs8W)tTE"rsJ"%QFrW[lP^]4??s8W&t"onW6m.Kj2AIJP<
+J,fQLs8W,s:]LJ#qs4/Ceq3)b!!!!Qs8W,s!WW32s&O@`r@d@6!!!!)hp;?$5X5;Senb$kqHmn8
+!!!!)S,`Nd,ldoMs8Gh*hu!HR!!!!1LHkh<"98E4s5*M]hfo,#!!!!Y,ldoB+92BPrNg_Z^$l"$
+!!!!IVZ6\o#ljr9n+UQ%rkJ%(!!!!Y%0-A&!!!!0rP$>XiJ6>5+92C\PQ1[X&-)\@s8E-'ecWuh
+!!!"D\,ZL+!<<*As8IQOmNJ5FO8o:U0E;(I+92BPs87NPli:E(J,fRos8W,o!!!!0s6p*kh1,J1
+a8c4uhuE`G6i[2ts2"a:^&S-8huE`oYQ+Xl!!!!@rV?QqRt(JDkl:]C?iU0$+92B`OF+hES=fi^
+quQln^]4?'!!!!?9HW?r(''^%qV<n$^]4?'!!!!`5Yq:X2@Y0;r+FUUs8W,o#QOjR!"\Q!0u&ME
+qd86js8W,g!!!"E!!i@N"$`FYs8W,gs8W,g!!!"HJ-GEB#_)gSs8W,os8W,_5QCfR!!)Kg$2so)
+s8W,/s8W,g!!!#m+?4HC!'S[/s8W,os8W,o!!!#iU^n%;!-S>Bs8W,gs8W,g!!!#k!!e&TE:#mj
+s8W,Os8W,g!!!#g&-LPb!rAPis8Vuks8W,WJ,fSb8LOQ=LA1`Ls8W,gs8W,W!!!,;U:?:L,(KXn
+s8V!Gs8W,g!!!,Z!^[5(e,TIKs8W(ks8W,W!!!,ZBG(:UTE#N's8W,7s8W,g!!!8D!CWR_<'UEa
+s8VgYs8W,G!!!,<WB`uSTE"rls8REGs8W,W!!!8"+rUF^ec5[Ms8W*!s8W,7!!"+/78Nsb6i[2e
+s8VHds8W,W!!!P['FBj%U&Y/ns8W&us8W,W!!"[NMM(s0g40/'s8V]ks8W,G!!"*=W1]d`.KBGK
+s8B\4s8W,7!!#6Z6NKFPomd#Bs8W!&s8W+\!!#76'P[UJ=o\O&s8Qm@s8W,;!!#5[#%@jgon3;G
+s81RWs8W,7!!#g_d>YjAC*EZZs8TSgs8W+L!!",%#S@[Loh6M0s8V_)s8W+l!!%M\l;gH5>-Iu=
+s8U_2s8W+L!!%Mj,dkEZH:<>bs8R=gs8T8f!!!Q(ql1MXVjJTjs8VA/s8W+L!!%N;Y$[;[AO%@=
+s8W#ls8S^a!!#7ZpXD_HC:8s(s8V]cs8W*!!!#7\rRHdZg=-B1s8UgJs8QGW!!&)VQ_r[ZV'XN!
+s8W,os8W*a!!0k-`S4RmRZIM:s8Vq?s8W*!!!FDDH_mGAjXOgHs8V!Os8W+,!!",@ZeK:TWi6U=
+s8W,os8W*!!'l&69r-3(j][=)s8W,os8W&u!!$C+[d0>'r1fnes8VE[s8W'`!!#7`gN<'XRqO(.
+s8W,os8W*!!!'e6mFBA!p"9lYs8W,os8W+L!!%NK[Wm3>X"&jVs8W,os8W'`!!#7`hY+$>G.+%O
+s8W,os8W'$!!#7`f54QTg6"]<s8W,os8W&u!!#7`H?t#ElQcUcs8W,os8W!^!!*'!hS#CkGa;e@
+s8W,os8W'`!!*'![=;5Kerg"LrVuoms8W$?!!*'!mV]LHh+4ILs8W,o^]49u!!*'!n,$-eWegj+
+s8W,oJ`$5&!!*'!r-lA`ok7/ls8W,oM5U-%!!*'!q<h0^Xq?CAs8W,o!+#@2!!3-"s)kKJo;[l_
+s8W,o!&jTP!!3-"rI2I>qj84]s8W,o!/pZG!!3-"rn15Rs._h$s8W,o!#P2+!!E9$s*gtTs6("Y
+s8W,o!!2kf!!E9$rEE:"rmo0*s8W,o!!D`k!!E9$s85cus4&lNs8W,o!!;:*!!E9$s'M=(s7h+o
+VuQel!!Von!!E9$s*H(os6>L@&-)\)!!2m\!!E9$s5'6Ks,o,8_#OH0!!E$^!"],0s.ADfs6;!2
+!3cFt!"\c?!"],0s8Tf_s8%fU!)7t<!$D,h!$D7@s$'ljs8B_-!!.TE!"](i!$D7@s6oses8Rc/
+!!",9z!$D7@s8W-!s8RUt!!!,rz!'gM`s8W-!s8RU5!!!#oz!&jlWs8W-!s8S;[!!!/sz!!$C+
+s8W-!s8V]hJ,fhaz!!!!`s8W-!s8W,u:]L[Oz!!!!0s8W-!s8W,rs.BJhz!!!!#s8W-!s8W-!
+s8W,oTE"rlz5QCc`s8W-!h>Vm8huE`Wz!WW3"s8W,ts7^m@huE`Wz!<<)^s8W-!s8Vcm^]4?7
+z!<<*!s8K`^s8U";ci=%Gz!<<&us8A#YDsd<"J,fQLz!.k1Ls2YHFkPt#OJ,fQLz!!*%'^\@p2
+cb7*oJ,fQLz!!#6rs3LlJci6fA~>
+end
+grestore
+showpage
+%%Trailer
+%%Pages: 1
+%%EOF
diff --git a/tiff/test/refs/o-tiff2ps-PS3.ps b/tiff/test/refs/o-tiff2ps-PS3.ps
new file mode 100644
index 000000000..6ec22b9b9
--- /dev/null
+++ b/tiff/test/refs/o-tiff2ps-PS3.ps
@@ -0,0 +1,104 @@
+%!PS-Adobe-3.0
+%%Creator: tiff2ps
+%%Title: miniswhite-1c-1b.tiff
+%%CreationDate: Tue Apr 2 16:33:00 2019
+%%DocumentData: Clean7Bit
+%%Origin: 0 0
+%%BoundingBox: 0 0 157 151
+%%LanguageLevel: 3
+%%Pages: (atend)
+%%EndComments
+%%BeginSetup
+gsave newpath clippath pathbbox grestore
+ 4 2 roll 2 copy translate
+ exch 3 1 roll sub 3 1 roll sub exch
+ currentpagedevice /PageSize get aload pop
+ exch 3 1 roll div 3 1 roll div abs exch abs
+ 2 copy gt { exch } if pop
+ dup 1 lt { dup scale } { pop } ifelse
+%%EndSetup
+%%Page: 1 1
+%%PageOrientation: Landscape
+%%PageBoundingBox: 0 0 157 151
+1 dict begin /PageSize [ 157.000000 151.000000 ] def currentdict end setpagedevice
+<<
+ /Policies <<
+ /PageSize 3
+ >>
+>> setpagedevice
+gsave
+100 dict begin
+157.000000 151.000000 scale
+% PostScript Level 2 only.
+/DeviceGray setcolorspace
+{ % exec
+ /im_stream currentfile /ASCII85Decode filter def
+ <<
+ /ImageType 1
+ /Width 157
+ /Height 151
+ /ImageMatrix [ 157 0 0 -151 0 151 ]
+ /BitsPerComponent 1
+ /Interpolate true
+ /Decode [1 0]
+ /DataSource im_stream
+ >> image
+ im_stream status { im_stream flushfile } if
+}
+exec
+rVPltoDejk!"Ju/3$7VQ!.UpIV-SSehuE`Xq.Ka.3#d/d!%<?t[o6KR-ia5Ps82is0EM0'!$=0#
+mf(r0"98E4gZ/>7!!%KK!"=AXeciN^#QOiDmG7gC:]MI8!"NB:J-Xp1#Qb#+^OO$!TE#<!!$6Xj
+!!3,oF?fR#pY'!TJ,fWN!"T&0J-#QIr'15Kh>cC5^]4?7!"PYE!!)c.r;XM.Iqrj&iW&rY!'Wgo
+!!)LAs8N&Uli6Yua8c2?!'Cem!!)+JqtpEnqYg:O5QCcq!'HKr!!2!Yo7(u]s(cQKj8]/[!.>"N
+!!C(<p\4^frVsQ5Du]k<!-ebL!!D-ZoDe9mJ%#+CfDkmO!-eME!!@`Qmsk?ZT'pUd^]4?7!Vh6H
+!!5CfbQ%JVp\k'g0E;(Q"8"!l!$;1Cs8W!<s5!^!L]@DT"8Muu^`9!LL]-F$fD!nsn,NFg#OnAd
+PWaO-^]3dfrr6:'qu?]s5PPQcTfiAtIGaZYJ%b`[?2ss*+8MQ0J3!]1n,K'Ls50Z]ec5[M+8dMe
+TGU3!pYX?rBD_`/rr<$!5Pu&ma;P*Zn,MADrr)f1DL_]e5Pkul!!EQ,h>cF4GB[9BpOE5DJ+uP7
+TF;qBJ,a$YhVHntrh'5q5N#'4JI"L/qu6bFp](9NBA`b#LVO[UL]fs:s8ITLDu$C*]!q_l5Qh&e
+TI><gs8N?'qsXPls3(R#6sp#qjBqqjs83&hgKh8TYM'N2&-)_2!'gKJs1JsAH2%>_qS+\nzW5&<j
+s83(N_8!1S^?bf"5QCcaJcGXt^\eW8r;H?gl[Ss2&-)\1OT56&s7c]pr*R3DXjt2MzT`=r)s5aH7
+=*s?(i,eqk+92BA!!i!Xs6p9Fn%JDH!*B3rJ,fQL!!i#.s3(TEot.DH!-/&2z!!D^Ts1ehgB>)'a
+!+Fd[!!",I!!2Z*s82lSrSQ2a!+`k+z!!D.$m%sdWC#Ao_!*0'[!!!#W!!U6#_%?Zro\I"G!,o(:
+!!!(^!!hFXLJe*knc->M!.)ENJ,fcR!"\(EJ._i(FB@Xu!3bkd!!$l/!"[$R(^L*O^ja&V!W'S-
+!!#1_!"ZjI$4m1Jn6bn!X"<`9!!N'^!.Vcc+ohTRn/pti>5U&C!!(B=!<:#'+92BN^b,TcY#m(5
+!!0lcJ:GL&!!!!(E$'O9e_DhR!!.U8`kT:i5QCcn^`3%DJ+t\h!!*'"PR#!SJ,fQNi#hFb<R;9Q
+!!!A!\YnNj(]XOHGRseVs)9XiJ,gSiM?gpAKE(u_TF\g7TC>)=J,hP/L9J^T!!!!'n-/](q-\.>
+8,tP5iP32SKE(uVYRgWgs.KDkfEaS>iSWjg+92BHm^rJoBu#5uiZJ>rs8UZ75QCch]l!E?rrN0"
+s*t)7s8U2i'EA+<p6,J@CBNJohuEbMs8W)tTE"rsJ"%QFrW[lP^]4??s8W&t"onW6m.Kj2AIJP<
+J,fQLs8W,s:]LJ#qs4/Ceq3)b!!!!Qs8W,s!WW32s&O@`r@d@6!!!!)hp;?$5X5;Senb$kqHmn8
+!!!!)S,`Nd,ldoMs8Gh*hu!HR!!!!1LHkh<"98E4s5*M]hfo,#!!!!Y,ldoB+92BPrNg_Z^$l"$
+!!!!IVZ6\o#ljr9n+UQ%rkJ%(!!!!Y%0-A&!!!!0rP$>XiJ6>5+92C\PQ1[X&-)\@s8E-'ecWuh
+!!!"D\,ZL+!<<*As8IQOmNJ5FO8o:U0E;(I+92BPs87NPli:E(J,fRos8W,o!!!!0s6p*kh1,J1
+a8c4uhuE`G6i[2ts2"a:^&S-8huE`oYQ+Xl!!!!@rV?QqRt(JDkl:]C?iU0$+92B`OF+hES=fi^
+quQln^]4?'!!!!?9HW?r(''^%qV<n$^]4?'!!!!`5Yq:X2@Y0;r+FUUs8W,o#QOjR!"\Q!0u&ME
+qd86js8W,g!!!"E!!i@N"$`FYs8W,gs8W,g!!!"HJ-GEB#_)gSs8W,os8W,_5QCfR!!)Kg$2so)
+s8W,/s8W,g!!!#m+?4HC!'S[/s8W,os8W,o!!!#iU^n%;!-S>Bs8W,gs8W,g!!!#k!!e&TE:#mj
+s8W,Os8W,g!!!#g&-LPb!rAPis8Vuks8W,WJ,fSb8LOQ=LA1`Ls8W,gs8W,W!!!,;U:?:L,(KXn
+s8V!Gs8W,g!!!,Z!^[5(e,TIKs8W(ks8W,W!!!,ZBG(:UTE#N's8W,7s8W,g!!!8D!CWR_<'UEa
+s8VgYs8W,G!!!,<WB`uSTE"rls8REGs8W,W!!!8"+rUF^ec5[Ms8W*!s8W,7!!"+/78Nsb6i[2e
+s8VHds8W,W!!!P['FBj%U&Y/ns8W&us8W,W!!"[NMM(s0g40/'s8V]ks8W,G!!"*=W1]d`.KBGK
+s8B\4s8W,7!!#6Z6NKFPomd#Bs8W!&s8W+\!!#76'P[UJ=o\O&s8Qm@s8W,;!!#5[#%@jgon3;G
+s81RWs8W,7!!#g_d>YjAC*EZZs8TSgs8W+L!!",%#S@[Loh6M0s8V_)s8W+l!!%M\l;gH5>-Iu=
+s8U_2s8W+L!!%Mj,dkEZH:<>bs8R=gs8T8f!!!Q(ql1MXVjJTjs8VA/s8W+L!!%N;Y$[;[AO%@=
+s8W#ls8S^a!!#7ZpXD_HC:8s(s8V]cs8W*!!!#7\rRHdZg=-B1s8UgJs8QGW!!&)VQ_r[ZV'XN!
+s8W,os8W*a!!0k-`S4RmRZIM:s8Vq?s8W*!!!FDDH_mGAjXOgHs8V!Os8W+,!!",@ZeK:TWi6U=
+s8W,os8W*!!'l&69r-3(j][=)s8W,os8W&u!!$C+[d0>'r1fnes8VE[s8W'`!!#7`gN<'XRqO(.
+s8W,os8W*!!!'e6mFBA!p"9lYs8W,os8W+L!!%NK[Wm3>X"&jVs8W,os8W'`!!#7`hY+$>G.+%O
+s8W,os8W'$!!#7`f54QTg6"]<s8W,os8W&u!!#7`H?t#ElQcUcs8W,os8W!^!!*'!hS#CkGa;e@
+s8W,os8W'`!!*'![=;5Kerg"LrVuoms8W$?!!*'!mV]LHh+4ILs8W,o^]49u!!*'!n,$-eWegj+
+s8W,oJ`$5&!!*'!r-lA`ok7/ls8W,oM5U-%!!*'!q<h0^Xq?CAs8W,o!+#@2!!3-"s)kKJo;[l_
+s8W,o!&jTP!!3-"rI2I>qj84]s8W,o!/pZG!!3-"rn15Rs._h$s8W,o!#P2+!!E9$s*gtTs6("Y
+s8W,o!!2kf!!E9$rEE:"rmo0*s8W,o!!D`k!!E9$s85cus4&lNs8W,o!!;:*!!E9$s'M=(s7h+o
+VuQel!!Von!!E9$s*H(os6>L@&-)\)!!2m\!!E9$s5'6Ks,o,8_#OH0!!E$^!"],0s.ADfs6;!2
+!3cFt!"\c?!"],0s8Tf_s8%fU!)7t<!$D,h!$D7@s$'ljs8B_-!!.TE!"](i!$D7@s6oses8Rc/
+!!",9z!$D7@s8W-!s8RUt!!!,rz!'gM`s8W-!s8RU5!!!#oz!&jlWs8W-!s8S;[!!!/sz!!$C+
+s8W-!s8V]hJ,fhaz!!!!`s8W-!s8W,u:]L[Oz!!!!0s8W-!s8W,rs.BJhz!!!!#s8W-!s8W-!
+s8W,oTE"rlz5QCc`s8W-!h>Vm8huE`Wz!WW3"s8W,ts7^m@huE`Wz!<<)^s8W-!s8Vcm^]4?7
+z!<<*!s8K`^s8U";ci=%Gz!<<&us8A#YDsd<"J,fQLz!.k1Ls2YHFkPt#OJ,fQLz!!*%'^\@p2
+cb7*oJ,fQLz!!#6rs3LlJci6fA~>
+end
+grestore
+showpage
+%%Trailer
+%%Pages: 1
+%%EOF
diff --git a/tiff/test/rewrite_tag.c b/tiff/test/rewrite_tag.c
index 5db3e4ba7..1708b024d 100644
--- a/tiff/test/rewrite_tag.c
+++ b/tiff/test/rewrite_tag.c
@@ -1,5 +1,3 @@
-/* $Id: rewrite_tag.c,v 1.9 2015-08-23 14:23:00 bfriesen Exp $ */
-
/*
* Copyright (c) 2007, Frank Warmerdam <warmerdam@pobox.com>
*
@@ -32,6 +30,7 @@
#include "tif_config.h"
#include <stdio.h>
+#include <stdlib.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
@@ -40,7 +39,6 @@
#include "tiffio.h"
#include "tiffiop.h"
-const uint32 width = 10;
const uint32 length = 40;
const uint32 rows_per_strip = 1;
@@ -51,6 +49,7 @@ int test_packbits()
int i;
unsigned char buf[10] = {0,0,0,0,0,0,0,0,0,0};
+ uint32 width = 10;
int length = 20;
const char *filename = "test_packbits.tif";
@@ -138,17 +137,20 @@ int test_packbits()
/************************************************************************/
/* rewrite_test() */
/************************************************************************/
-int rewrite_test( const char *filename, int length, int bigtiff,
+int rewrite_test( const char *filename, uint32 width, int length, int bigtiff,
uint64 base_value )
{
TIFF *tif;
int i;
- unsigned char buf[10] = {5,6,7,8,9,10,11,12,13,14};
+ unsigned char *buf;
uint64 *rowoffset, *rowbytes;
uint64 *upd_rowoffset;
uint64 *upd_bytecount;
+ buf = calloc(1, width);
+ assert(buf);
+
/* Test whether we can write tags. */
if( bigtiff )
tif = TIFFOpen(filename, "w8");
@@ -157,6 +159,7 @@ int rewrite_test( const char *filename, int length, int bigtiff,
if (!tif) {
fprintf (stderr, "Can't create test TIFF file %s.\n", filename);
+ free(buf);
return 1;
}
@@ -204,6 +207,7 @@ int rewrite_test( const char *filename, int length, int bigtiff,
tif = TIFFOpen(filename, "r+");
if (!tif) {
fprintf (stderr, "Can't open test TIFF file %s.\n", filename);
+ free(buf);
return 1;
}
@@ -221,7 +225,7 @@ int rewrite_test( const char *filename, int length, int bigtiff,
upd_rowoffset = (uint64 *) _TIFFmalloc(sizeof(uint64) * length);
for( i = 0; i < length; i++ )
- upd_rowoffset[i] = base_value + i*10;
+ upd_rowoffset[i] = base_value + i*width;
if( !_TIFFRewriteField( tif, TIFFTAG_STRIPOFFSETS, TIFF_LONG8,
length, upd_rowoffset ) )
@@ -234,7 +238,7 @@ int rewrite_test( const char *filename, int length, int bigtiff,
upd_bytecount = (uint64 *) _TIFFmalloc(sizeof(uint64) * length);
for( i = 0; i < length; i++ )
- upd_bytecount[i] = 100 + i*10;
+ upd_bytecount[i] = 100 + i*width;
if( !_TIFFRewriteField( tif, TIFFTAG_STRIPBYTECOUNTS, TIFF_LONG8,
length, upd_bytecount ) )
@@ -252,6 +256,7 @@ int rewrite_test( const char *filename, int length, int bigtiff,
tif = TIFFOpen(filename, "r");
if (!tif) {
fprintf (stderr, "Can't open test TIFF file %s.\n", filename);
+ free(buf);
return 1;
}
@@ -263,7 +268,7 @@ int rewrite_test( const char *filename, int length, int bigtiff,
for( i = 0; i < length; i++ )
{
- uint64 expect = base_value + i*10;
+ uint64 expect = base_value + i*width;
if( rowoffset[i] != expect )
{
@@ -286,7 +291,7 @@ int rewrite_test( const char *filename, int length, int bigtiff,
for( i = 0; i < length; i++ )
{
- uint64 expect = 100 + i*10;
+ uint64 expect = 100 + i*width;
if( rowbytes[i] != expect )
{
@@ -302,6 +307,7 @@ int rewrite_test( const char *filename, int length, int bigtiff,
}
TIFFClose( tif );
+ free(buf);
/* All tests passed; delete file and exit with success status. */
unlink(filename);
@@ -310,6 +316,7 @@ int rewrite_test( const char *filename, int length, int bigtiff,
failure:
/* Something goes wrong; close file and return unsuccessful status. */
TIFFClose(tif);
+ free(buf);
/* unlink(filename); */
return 1;
@@ -327,16 +334,20 @@ main(void)
failure |= test_packbits();
/* test fairly normal use */
- failure |= rewrite_test( "rewrite1.tif", 10, 0, 100 );
- failure |= rewrite_test( "rewrite2.tif", 10, 1, 100 );
+ failure |= rewrite_test( "rewrite1.tif", 10, 10, 0, 100 );
+ failure |= rewrite_test( "rewrite2.tif", 10, 10, 1, 100 );
/* test case of fitting all in directory entry */
- failure |= rewrite_test( "rewrite3.tif", 1, 0, 100 );
- failure |= rewrite_test( "rewrite4.tif", 1, 1, 100 );
+ failure |= rewrite_test( "rewrite3.tif", 10, 1, 0, 100 );
+ failure |= rewrite_test( "rewrite4.tif", 10, 1, 1, 100 );
/* test with very large values that don't fit in 4bytes (bigtiff only) */
- failure |= rewrite_test( "rewrite5.tif", 1000, 1, 0x6000000000ULL );
- failure |= rewrite_test( "rewrite6.tif", 1, 1, 0x6000000000ULL );
+ failure |= rewrite_test( "rewrite5.tif", 10, 1000, 1, 0x6000000000ULL );
+ failure |= rewrite_test( "rewrite6.tif", 10, 1, 1, 0x6000000000ULL );
+
+ /* StripByteCounts on LONG */
+ failure |= rewrite_test( "rewrite7.tif", 65536, 1, 0, 100 );
+ failure |= rewrite_test( "rewrite8.tif", 65536, 2, 0, 100 );
return failure;
}
diff --git a/tiff/test/short_tag.c b/tiff/test/short_tag.c
index efc7da5b2..75e7f5d5f 100644
--- a/tiff/test/short_tag.c
+++ b/tiff/test/short_tag.c
@@ -1,5 +1,3 @@
-/* $Id: short_tag.c,v 1.9 2013-12-17 14:41:58 bfriesen Exp $ */
-
/*
* Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
*
diff --git a/tiff/test/strip.c b/tiff/test/strip.c
index 59422262a..f2cb77352 100644
--- a/tiff/test/strip.c
+++ b/tiff/test/strip.c
@@ -1,5 +1,3 @@
-/* $Id: strip.c,v 1.5 2013-12-17 14:41:58 bfriesen Exp $ */
-
/*
* Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
*
diff --git a/tiff/test/strip_rw.c b/tiff/test/strip_rw.c
index 5247c0b3f..bcf7d7357 100644
--- a/tiff/test/strip_rw.c
+++ b/tiff/test/strip_rw.c
@@ -1,5 +1,3 @@
-/* $Id: strip_rw.c,v 1.6 2008/03/28 01:42:07 bfriesen Exp $ */
-
/*
* Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
*
diff --git a/tiff/test/test_arrays.c b/tiff/test/test_arrays.c
index 83767662b..226e9d0c8 100644
--- a/tiff/test/test_arrays.c
+++ b/tiff/test/test_arrays.c
@@ -1,5 +1,3 @@
-/* $Id: test_arrays.c,v 1.3 2006/03/23 14:54:02 dron Exp $ */
-
/*
* Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
*
diff --git a/tiff/test/test_arrays.h b/tiff/test/test_arrays.h
index 5131b2310..62e1d33c7 100644
--- a/tiff/test/test_arrays.h
+++ b/tiff/test/test_arrays.h
@@ -1,5 +1,3 @@
-/* $Id: test_arrays.h,v 1.3 2006/03/23 14:54:02 dron Exp $ */
-
/*
* Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
*
diff --git a/tiff/test/testtypes.c b/tiff/test/testtypes.c
new file mode 100644
index 000000000..a36d21e56
--- /dev/null
+++ b/tiff/test/testtypes.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2019, Thomas Bernard <miniupnp@free.fr>
+ *
+ * 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.
+ */
+
+/*
+ * TIFF Library
+ *
+ * Module to test ASCII tags read/write functions.
+ */
+
+#include "tif_config.h"
+
+#include <stdio.h>
+
+#include "tiffio.h"
+
+#define CHECK_TYPE(t, s) \
+ if (sizeof(t) != s) { \
+ fprintf(stderr, "sizeof(" # t ")=%d, it should be %d\n", (int)sizeof(t), (int)s); \
+ return 1; \
+ }
+
+int
+main()
+{
+ CHECK_TYPE(TIFF_INT8_T, 1)
+ CHECK_TYPE(TIFF_INT16_T, 2)
+ CHECK_TYPE(TIFF_INT32_T, 4)
+ CHECK_TYPE(TIFF_INT64_T, 8)
+ CHECK_TYPE(TIFF_UINT8_T, 1)
+ CHECK_TYPE(TIFF_UINT16_T, 2)
+ CHECK_TYPE(TIFF_UINT32_T, 4)
+ CHECK_TYPE(TIFF_UINT64_T, 8)
+ CHECK_TYPE(TIFF_SIZE_T, sizeof(size_t))
+ CHECK_TYPE(TIFF_SSIZE_T, sizeof(size_t))
+ return 0;
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/tiff/test/tiff2ps-EPS1.sh b/tiff/test/tiff2ps-EPS1.sh
index ebe6f04b6..b1dc82e70 100755
--- a/tiff/test/tiff2ps-EPS1.sh
+++ b/tiff/test/tiff2ps-EPS1.sh
@@ -2,5 +2,7 @@
#
# Basic sanity check for tiffps with PostScript Level 1 encapsulated output
#
+PSFILE=o-tiff2ps-EPS1.ps
. ${srcdir:-.}/common.sh
-f_test_stdout "${TIFF2PS} -e -1" "${IMG_MINISWHITE_1C_1B}" "o-tiff2ps-EPS1.ps" \ No newline at end of file
+f_test_stdout "${TIFF2PS} -e -1" "${IMG_MINISWHITE_1C_1B}" "${PSFILE}"
+diff -I '%%\(CreationDate\|Title\):*' -u "${REFS}/${PSFILE}" "${PSFILE}" || exit 1
diff --git a/tiff/test/tiff2ps-PS1.sh b/tiff/test/tiff2ps-PS1.sh
index 659215977..73171b989 100755
--- a/tiff/test/tiff2ps-PS1.sh
+++ b/tiff/test/tiff2ps-PS1.sh
@@ -2,5 +2,7 @@
#
# Basic sanity check for tiffps with PostScript Level 1 output
#
+PSFILE="o-tiff2ps-PS1.ps"
. ${srcdir:-.}/common.sh
-f_test_stdout "${TIFF2PS} -a -p -1" "${IMG_MINISWHITE_1C_1B}" "o-tiff2ps-PS1.ps" \ No newline at end of file
+f_test_stdout "${TIFF2PS} -a -p -1" "${IMG_MINISWHITE_1C_1B}" "${PSFILE}"
+diff -I '%%\(CreationDate\|Title\):*' -u "${REFS}/${PSFILE}" "${PSFILE}" || exit 1
diff --git a/tiff/test/tiff2ps-PS2.sh b/tiff/test/tiff2ps-PS2.sh
index 2a2160697..9d3a521d6 100755
--- a/tiff/test/tiff2ps-PS2.sh
+++ b/tiff/test/tiff2ps-PS2.sh
@@ -2,5 +2,7 @@
#
# Basic sanity check for tiffps with PostScript Level 2 output
#
+PSFILE=o-tiff2ps-PS2.ps
. ${srcdir:-.}/common.sh
-f_test_stdout "${TIFF2PS} -a -p -2" "${IMG_MINISWHITE_1C_1B}" "o-tiff2ps-PS2.ps" \ No newline at end of file
+f_test_stdout "${TIFF2PS} -a -p -2" "${IMG_MINISWHITE_1C_1B}" "${PSFILE}"
+diff -I '%%\(CreationDate\|Title\):*' -u "${REFS}/${PSFILE}" "${PSFILE}" || exit 1
diff --git a/tiff/test/tiff2ps-PS3.sh b/tiff/test/tiff2ps-PS3.sh
index f9f34b668..eb55b9a04 100755
--- a/tiff/test/tiff2ps-PS3.sh
+++ b/tiff/test/tiff2ps-PS3.sh
@@ -2,5 +2,7 @@
#
# Basic sanity check for tiffps with PostScript Level 3 output
#
+PSFILE=o-tiff2ps-PS3.ps
. ${srcdir:-.}/common.sh
-f_test_stdout "${TIFF2PS} -a -p -3" "${IMG_MINISWHITE_1C_1B}" "o-tiff2ps-PS3.ps" \ No newline at end of file
+f_test_stdout "${TIFF2PS} -a -p -3" "${IMG_MINISWHITE_1C_1B}" "${PSFILE}"
+diff -I '%%\(CreationDate\|Title\):*' -u "${REFS}/${PSFILE}" "${PSFILE}" || exit 1
diff --git a/tiff/test/tiffcp-lzw-scanline-decode.sh b/tiff/test/tiffcp-lzw-scanline-decode.sh
new file mode 100755
index 000000000..11654d194
--- /dev/null
+++ b/tiff/test/tiffcp-lzw-scanline-decode.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+# Basic sanity check for tiffcp with LZW decompression
+#
+. ${srcdir:-.}/common.sh
+f_test_convert "${TIFFCP} -c none -r 1" "${IMG_LZW_SINGLE_STROP}" "o-tiffcp-lzw-scanline-decode.tiff" \ No newline at end of file
diff --git a/tiff/test/tifftest.h b/tiff/test/tifftest.h
index 33052064d..391b0f645 100644
--- a/tiff/test/tifftest.h
+++ b/tiff/test/tifftest.h
@@ -1,5 +1,3 @@
-/* $Id: tifftest.h,v 1.1 2008/04/15 14:18:36 dron Exp $ */
-
/*
* Copyright (c) 2008, Andrey Kiselev <dron@ak4719.spb.edu>
*
diff --git a/tiff/tools/CMakeLists.txt b/tiff/tools/CMakeLists.txt
index 331f83c05..886d4549c 100644
--- a/tiff/tools/CMakeLists.txt
+++ b/tiff/tools/CMakeLists.txt
@@ -118,7 +118,7 @@ if(HAVE_OPENGL)
endif()
add_executable(tiffgt tiffgt.c)
- target_link_libraries(tiffgt tiff ${GLUT_LIBRARIES} ${OPENGL_LIBRARIES})
+ target_link_libraries(tiffgt tiff port ${GLUT_LIBRARIES} ${OPENGL_LIBRARIES})
install(TARGETS tiffgt
RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}")
diff --git a/tiff/tools/Makefile.in b/tiff/tools/Makefile.in
index d7d560409..7ec4ed620 100644
--- a/tiff/tools/Makefile.in
+++ b/tiff/tools/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -132,7 +132,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
$(top_builddir)/libtiff/tiffconf.h
CONFIG_CLEAN_FILES =
@@ -226,7 +226,18 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/fax2ps.Po ./$(DEPDIR)/fax2tiff.Po \
+ ./$(DEPDIR)/pal2rgb.Po ./$(DEPDIR)/ppm2tiff.Po \
+ ./$(DEPDIR)/raw2tiff.Po ./$(DEPDIR)/rgb2ycbcr.Po \
+ ./$(DEPDIR)/thumbnail.Po ./$(DEPDIR)/tiff2bw.Po \
+ ./$(DEPDIR)/tiff2pdf.Po ./$(DEPDIR)/tiff2ps.Po \
+ ./$(DEPDIR)/tiff2rgba.Po ./$(DEPDIR)/tiffcmp.Po \
+ ./$(DEPDIR)/tiffcp.Po ./$(DEPDIR)/tiffcrop.Po \
+ ./$(DEPDIR)/tiffdither.Po ./$(DEPDIR)/tiffdump.Po \
+ ./$(DEPDIR)/tiffgt-tiffgt.Po ./$(DEPDIR)/tiffinfo.Po \
+ ./$(DEPDIR)/tiffmedian.Po ./$(DEPDIR)/tiffset.Po \
+ ./$(DEPDIR)/tiffsplit.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -285,8 +296,7 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
- $(top_srcdir)/config/mkinstalldirs
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -508,8 +518,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -669,27 +679,33 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@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)/pal2rgb.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppm2tiff.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)/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)/tiff2ps.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2rgba.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcmp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcrop.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffdither.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffdump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffgt-tiffgt.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffinfo.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)/fax2ps.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax2tiff.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pal2rgb.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppm2tiff.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw2tiff.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rgb2ycbcr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thumbnail.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2bw.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2pdf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2ps.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2rgba.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcrop.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffdither.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffdump.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffgt-tiffgt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffinfo.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffmedian.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffset.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffsplit.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -784,7 +800,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -858,7 +877,27 @@ clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
clean-libtool mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/fax2ps.Po
+ -rm -f ./$(DEPDIR)/fax2tiff.Po
+ -rm -f ./$(DEPDIR)/pal2rgb.Po
+ -rm -f ./$(DEPDIR)/ppm2tiff.Po
+ -rm -f ./$(DEPDIR)/raw2tiff.Po
+ -rm -f ./$(DEPDIR)/rgb2ycbcr.Po
+ -rm -f ./$(DEPDIR)/thumbnail.Po
+ -rm -f ./$(DEPDIR)/tiff2bw.Po
+ -rm -f ./$(DEPDIR)/tiff2pdf.Po
+ -rm -f ./$(DEPDIR)/tiff2ps.Po
+ -rm -f ./$(DEPDIR)/tiff2rgba.Po
+ -rm -f ./$(DEPDIR)/tiffcmp.Po
+ -rm -f ./$(DEPDIR)/tiffcp.Po
+ -rm -f ./$(DEPDIR)/tiffcrop.Po
+ -rm -f ./$(DEPDIR)/tiffdither.Po
+ -rm -f ./$(DEPDIR)/tiffdump.Po
+ -rm -f ./$(DEPDIR)/tiffgt-tiffgt.Po
+ -rm -f ./$(DEPDIR)/tiffinfo.Po
+ -rm -f ./$(DEPDIR)/tiffmedian.Po
+ -rm -f ./$(DEPDIR)/tiffset.Po
+ -rm -f ./$(DEPDIR)/tiffsplit.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -904,7 +943,27 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/fax2ps.Po
+ -rm -f ./$(DEPDIR)/fax2tiff.Po
+ -rm -f ./$(DEPDIR)/pal2rgb.Po
+ -rm -f ./$(DEPDIR)/ppm2tiff.Po
+ -rm -f ./$(DEPDIR)/raw2tiff.Po
+ -rm -f ./$(DEPDIR)/rgb2ycbcr.Po
+ -rm -f ./$(DEPDIR)/thumbnail.Po
+ -rm -f ./$(DEPDIR)/tiff2bw.Po
+ -rm -f ./$(DEPDIR)/tiff2pdf.Po
+ -rm -f ./$(DEPDIR)/tiff2ps.Po
+ -rm -f ./$(DEPDIR)/tiff2rgba.Po
+ -rm -f ./$(DEPDIR)/tiffcmp.Po
+ -rm -f ./$(DEPDIR)/tiffcp.Po
+ -rm -f ./$(DEPDIR)/tiffcrop.Po
+ -rm -f ./$(DEPDIR)/tiffdither.Po
+ -rm -f ./$(DEPDIR)/tiffdump.Po
+ -rm -f ./$(DEPDIR)/tiffgt-tiffgt.Po
+ -rm -f ./$(DEPDIR)/tiffinfo.Po
+ -rm -f ./$(DEPDIR)/tiffmedian.Po
+ -rm -f ./$(DEPDIR)/tiffset.Po
+ -rm -f ./$(DEPDIR)/tiffsplit.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -925,7 +984,7 @@ uninstall-am: uninstall-binPROGRAMS
.MAKE: check-am install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
clean-libtool cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-libtool \
diff --git a/tiff/tools/Makefile.vc b/tiff/tools/Makefile.vc
index 646c76775..453db43e9 100644
--- a/tiff/tools/Makefile.vc
+++ b/tiff/tools/Makefile.vc
@@ -1,4 +1,3 @@
-# $Id: Makefile.vc,v 1.16 2016-06-05 19:54:03 bfriesen Exp $
#
# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
#
diff --git a/tiff/tools/fax2ps.c b/tiff/tools/fax2ps.c
index c49533157..274b29e4f 100644
--- a/tiff/tools/fax2ps.c
+++ b/tiff/tools/fax2ps.c
@@ -1,5 +1,3 @@
-/* $Id: fax2ps.c,v 1.31 2015-09-06 18:24:27 bfriesen Exp $" */
-
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/tools/fax2tiff.c b/tiff/tools/fax2tiff.c
index f23374e0d..212231310 100644
--- a/tiff/tools/fax2tiff.c
+++ b/tiff/tools/fax2tiff.c
@@ -1,5 +1,3 @@
-/* $Id: fax2tiff.c,v 1.28 2017-10-29 18:28:45 bfriesen Exp $ */
-
/*
* Copyright (c) 1990-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -76,14 +74,10 @@ static void usage(void);
Struct to carry client data. Note that it does not appear that the client
data is actually used in this program.
*/
-typedef struct _FAX_Client_Data
+typedef union _FAX_Client_Data
{
-#if defined(_WIN32) && defined(USE_WIN32_FILEIO)
- intptr_t fh; /* Operating system file handle */
-#else
- int fd; /* Integer file descriptor */
-#endif
-
+ thandle_t fh; /* Operating system file handle */
+ int fd; /* Integer file descriptor */
} FAX_Client_Data;
int
@@ -91,7 +85,7 @@ main(int argc, char* argv[])
{
FILE *in;
TIFF *out = NULL;
- FAX_Client_Data client_data;
+ FAX_Client_Data client_data;
TIFFErrorHandler whandler = NULL;
int compression_in = COMPRESSION_CCITTFAX3;
int compression_out = COMPRESSION_CCITTFAX3;
@@ -282,11 +276,11 @@ main(int argc, char* argv[])
continue;
}
#if defined(_WIN32) && defined(USE_WIN32_FILEIO)
- client_data.fh = _get_osfhandle(fileno(in));
+ client_data.fh = (thandle_t)_get_osfhandle(fileno(in));
#else
- client_data.fd = fileno(in);
+ client_data.fd = fileno(in);
#endif
- TIFFSetClientdata(faxTIFF, (thandle_t) &client_data);
+ TIFFSetClientdata(faxTIFF, client_data.fh);
TIFFSetFileName(faxTIFF, (const char*)argv[optind]);
TIFFSetField(out, TIFFTAG_IMAGEWIDTH, xsize);
TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 1);
diff --git a/tiff/tools/pal2rgb.c b/tiff/tools/pal2rgb.c
index 7a5780069..9492f1cf1 100644
--- a/tiff/tools/pal2rgb.c
+++ b/tiff/tools/pal2rgb.c
@@ -1,5 +1,3 @@
-/* $Id: pal2rgb.c,v 1.15 2015-06-21 01:09:10 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -120,12 +118,14 @@ main(int argc, char* argv[])
shortv != PHOTOMETRIC_PALETTE) {
fprintf(stderr, "%s: Expecting a palette image.\n",
argv[optind]);
+ (void) TIFFClose(in);
return (-1);
}
if (!TIFFGetField(in, TIFFTAG_COLORMAP, &rmap, &gmap, &bmap)) {
fprintf(stderr,
"%s: No colormap (not a valid palette image).\n",
argv[optind]);
+ (void) TIFFClose(in);
return (-1);
}
bitspersample = 0;
@@ -133,11 +133,14 @@ main(int argc, char* argv[])
if (bitspersample != 8) {
fprintf(stderr, "%s: Sorry, can only handle 8-bit images.\n",
argv[optind]);
+ (void) TIFFClose(in);
return (-1);
}
out = TIFFOpen(argv[optind+1], "w");
- if (out == NULL)
+ if (out == NULL) {
+ (void) TIFFClose(in);
return (-2);
+ }
cpTags(in, out);
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &imagewidth);
TIFFGetField(in, TIFFTAG_IMAGELENGTH, &imagelength);
@@ -184,8 +187,21 @@ main(int argc, char* argv[])
{ unsigned char *ibuf, *obuf;
register unsigned char* pp;
register uint32 x;
- ibuf = (unsigned char*)_TIFFmalloc(TIFFScanlineSize(in));
- obuf = (unsigned char*)_TIFFmalloc(TIFFScanlineSize(out));
+ tmsize_t tss_in = TIFFScanlineSize(in);
+ tmsize_t tss_out = TIFFScanlineSize(out);
+ if (tss_out / tss_in < 3) {
+ /*
+ * BUG 2750: The following code does not know about chroma
+ * subsampling of JPEG data. It assumes that the output buffer is 3x
+ * the length of the input buffer due to exploding the palette into
+ * RGB tuples. If this assumption is incorrect, it could lead to a
+ * buffer overflow. Go ahead and fail now to prevent that.
+ */
+ fprintf(stderr, "Could not determine correct image size for output. Exiting.\n");
+ return -1;
+ }
+ ibuf = (unsigned char*)_TIFFmalloc(tss_in);
+ obuf = (unsigned char*)_TIFFmalloc(tss_out);
switch (config) {
case PLANARCONFIG_CONTIG:
for (row = 0; row < imagelength; row++) {
@@ -391,7 +407,23 @@ cpTags(TIFF* in, TIFF* out)
{
struct cpTag *p;
for (p = tags; p < &tags[NTAGS]; p++)
- cpTag(in, out, p->tag, p->count, p->type);
+ {
+ if( p->tag == TIFFTAG_GROUP3OPTIONS )
+ {
+ uint16 compression;
+ if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
+ compression != COMPRESSION_CCITTFAX3 )
+ continue;
+ }
+ if( p->tag == TIFFTAG_GROUP4OPTIONS )
+ {
+ uint16 compression;
+ if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
+ compression != COMPRESSION_CCITTFAX4 )
+ continue;
+ }
+ cpTag(in, out, p->tag, p->count, p->type);
+ }
}
#undef NTAGS
diff --git a/tiff/tools/ppm2tiff.c b/tiff/tools/ppm2tiff.c
index 91415e96c..2b2756187 100644
--- a/tiff/tools/ppm2tiff.c
+++ b/tiff/tools/ppm2tiff.c
@@ -1,5 +1,3 @@
-/* $Id: ppm2tiff.c,v 1.19 2015-06-21 01:09:10 bfriesen Exp $ */
-
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -50,7 +48,7 @@
#include "tiffio.h"
#ifndef HAVE_GETOPT
-extern int getopt(int, char**, char*);
+extern int getopt(int argc, char * const argv[], const char *optstring);
#endif
#define streq(a,b) (strcmp(a,b) == 0)
@@ -72,15 +70,16 @@ BadPPM(char* file)
exit(-2);
}
+
+#define TIFF_SIZE_T_MAX ((size_t) ~ ((size_t)0))
+#define TIFF_TMSIZE_T_MAX (tmsize_t)(TIFF_SIZE_T_MAX >> 1)
+
static tmsize_t
multiply_ms(tmsize_t m1, tmsize_t m2)
{
- tmsize_t bytes = m1 * m2;
-
- if (m1 && bytes / m1 != m2)
- bytes = 0;
-
- return bytes;
+ if( m1 == 0 || m2 > TIFF_TMSIZE_T_MAX / m1 )
+ return 0;
+ return m1 * m2;
}
int
@@ -284,6 +283,8 @@ main(int argc, char* argv[])
if (TIFFWriteScanline(out, buf, row, 0) < 0)
break;
}
+ if (in != stdin)
+ fclose(in);
(void) TIFFClose(out);
if (buf)
_TIFFfree(buf);
diff --git a/tiff/tools/raw2tiff.c b/tiff/tools/raw2tiff.c
index 083e9ee73..ab36ff4e6 100644
--- a/tiff/tools/raw2tiff.c
+++ b/tiff/tools/raw2tiff.c
@@ -1,5 +1,4 @@
-/* $Id: raw2tiff.c,v 1.29 2017-01-14 13:12:33 erouault Exp $
- *
+/*
* Project: libtiff tools
* Purpose: Convert raw byte sequences in TIFF images
* Author: Andrey Kiselev, dron@ak4719.spb.edu
@@ -61,7 +60,7 @@
#include "tiffio.h"
#ifndef HAVE_GETOPT
-extern int getopt(int, char**, char*);
+extern int getopt(int argc, char * const argv[], const char *optstring);
#endif
#ifndef O_BINARY
diff --git a/tiff/tools/rgb2ycbcr.c b/tiff/tools/rgb2ycbcr.c
index 7a9d705e6..cf5f956f3 100644
--- a/tiff/tools/rgb2ycbcr.c
+++ b/tiff/tools/rgb2ycbcr.c
@@ -1,5 +1,3 @@
-/* $Id: rgb2ycbcr.c,v 1.17 2016-08-15 21:26:56 erouault Exp $ */
-
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/tools/thumbnail.c b/tiff/tools/thumbnail.c
index ab6a1d28d..169a63698 100644
--- a/tiff/tools/thumbnail.c
+++ b/tiff/tools/thumbnail.c
@@ -1,5 +1,3 @@
-/* $Id: thumbnail.c,v 1.21 2015-06-21 01:09:10 bfriesen Exp $ */
-
/*
* Copyright (c) 1994-1997 Sam Leffler
* Copyright (c) 1994-1997 Silicon Graphics, Inc.
@@ -42,7 +40,7 @@
#include "tiffio.h"
#ifndef HAVE_GETOPT
-extern int getopt(int, char**, char*);
+extern int getopt(int argc, char * const argv[], const char *optstring);
#endif
#define streq(a,b) (strcmp(a,b) == 0)
@@ -527,15 +525,15 @@ setrow(uint8* row, uint32 nrows, const uint8* rows[])
default:
for (i = fw; i > 8; i--)
acc += bits[*src++];
- /* fall thru... */
- case 8: acc += bits[*src++];
- case 7: acc += bits[*src++];
- case 6: acc += bits[*src++];
- case 5: acc += bits[*src++];
- case 4: acc += bits[*src++];
- case 3: acc += bits[*src++];
- case 2: acc += bits[*src++];
- case 1: acc += bits[*src++];
+ /* fall through... */
+ case 8: acc += bits[*src++]; /* fall through */
+ case 7: acc += bits[*src++]; /* fall through */
+ case 6: acc += bits[*src++]; /* fall through */
+ case 5: acc += bits[*src++]; /* fall through */
+ case 4: acc += bits[*src++]; /* fall through */
+ case 3: acc += bits[*src++]; /* fall through */
+ case 2: acc += bits[*src++]; /* fall through */
+ case 1: acc += bits[*src++]; /* fall through */
case 0: break;
}
acc += bits[*src & mask1];
diff --git a/tiff/tools/tiff2bw.c b/tiff/tools/tiff2bw.c
index dad54afa1..dbc697b06 100644
--- a/tiff/tools/tiff2bw.c
+++ b/tiff/tools/tiff2bw.c
@@ -1,5 +1,3 @@
-/* $Id: tiff2bw.c,v 1.21 2017-11-01 13:41:58 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -40,9 +38,7 @@
#endif
#include "tiffio.h"
-
-#define streq(a,b) (strcmp((a),(b)) == 0)
-#define strneq(a,b,n) (strncmp(a,b,n) == 0)
+#include "tiffiop.h"
/* x% weighting -> fraction of full color */
#define PCT(x) (((x)*256+50)/100)
@@ -223,6 +219,11 @@ main(int argc, char* argv[])
TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, thing);
TIFFSetField(out, TIFFTAG_SOFTWARE, "tiff2bw");
outbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
+ if( !outbuf )
+ {
+ fprintf(stderr, "Out of memory\n");
+ goto tiff2bw_error;
+ }
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,
TIFFDefaultStripSize(out, rowsperstrip));
@@ -246,6 +247,11 @@ main(int argc, char* argv[])
#undef CVT
}
inbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
+ if( !inbuf )
+ {
+ fprintf(stderr, "Out of memory\n");
+ goto tiff2bw_error;
+ }
for (row = 0; row < h; row++) {
if (TIFFReadScanline(in, inbuf, row, 0) < 0)
break;
@@ -256,6 +262,11 @@ main(int argc, char* argv[])
break;
case pack(PHOTOMETRIC_RGB, PLANARCONFIG_CONTIG):
inbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
+ if( !inbuf )
+ {
+ fprintf(stderr, "Out of memory\n");
+ goto tiff2bw_error;
+ }
for (row = 0; row < h; row++) {
if (TIFFReadScanline(in, inbuf, row, 0) < 0)
break;
@@ -265,8 +276,16 @@ main(int argc, char* argv[])
}
break;
case pack(PHOTOMETRIC_RGB, PLANARCONFIG_SEPARATE):
+ {
+ tmsize_t inbufsize;
rowsize = TIFFScanlineSize(in);
- inbuf = (unsigned char *)_TIFFmalloc(3*rowsize);
+ inbufsize = TIFFSafeMultiply(tmsize_t, 3, rowsize);
+ inbuf = (unsigned char *)_TIFFmalloc(inbufsize);
+ if( !inbuf )
+ {
+ fprintf(stderr, "Out of memory\n");
+ goto tiff2bw_error;
+ }
for (row = 0; row < h; row++) {
for (s = 0; s < 3; s++)
if (TIFFReadScanline(in,
@@ -278,6 +297,7 @@ main(int argc, char* argv[])
break;
}
break;
+ }
}
#undef pack
if (inbuf)
@@ -452,7 +472,23 @@ cpTags(TIFF* in, TIFF* out)
{
struct cpTag *p;
for (p = tags; p < &tags[NTAGS]; p++)
- cpTag(in, out, p->tag, p->count, p->type);
+ {
+ if( p->tag == TIFFTAG_GROUP3OPTIONS )
+ {
+ uint16 compression;
+ if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
+ compression != COMPRESSION_CCITTFAX3 )
+ continue;
+ }
+ if( p->tag == TIFFTAG_GROUP4OPTIONS )
+ {
+ uint16 compression;
+ if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
+ compression != COMPRESSION_CCITTFAX4 )
+ continue;
+ }
+ cpTag(in, out, p->tag, p->count, p->type);
+ }
}
#undef NTAGS
diff --git a/tiff/tools/tiff2pdf.c b/tiff/tools/tiff2pdf.c
index 454befbd0..779c1662e 100644
--- a/tiff/tools/tiff2pdf.c
+++ b/tiff/tools/tiff2pdf.c
@@ -1,4 +1,4 @@
-/* $Id: tiff2pdf.c,v 1.103 2017-10-29 18:50:41 bfriesen Exp $
+/*
*
* tiff2pdf - converts a TIFF image to a PDF document
*
@@ -54,7 +54,7 @@
#include "tiffio.h"
#ifndef HAVE_GETOPT
-extern int getopt(int, char**, char*);
+extern int getopt(int argc, char * const argv[], const char *optstring);
#endif
#ifndef EXIT_SUCCESS
@@ -68,6 +68,8 @@ extern int getopt(int, char**, char*);
#define PS_UNIT_SIZE 72.0F
+#define TIFF_DIR_MAX 65534
+
/* This type is of PDF color spaces. */
typedef enum {
T2P_CS_BILEVEL = 0x01, /* Bilevel, black and white */
@@ -237,7 +239,7 @@ typedef struct {
float tiff_whitechromaticities[2];
float tiff_primarychromaticities[6];
float tiff_referenceblackwhite[2];
- float* tiff_transferfunction[3];
+ uint16* tiff_transferfunction[3];
int pdf_image_interpolate; /* 0 (default) : do not interpolate,
1 : interpolate */
uint16 tiff_transferfunctioncount;
@@ -1047,8 +1049,18 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
uint16 pagen=0;
uint16 paged=0;
uint16 xuint16=0;
+ uint16 tiff_transferfunctioncount=0;
+ uint16* tiff_transferfunction[3];
directorycount=TIFFNumberOfDirectories(input);
+ if(directorycount > TIFF_DIR_MAX) {
+ TIFFError(
+ TIFF2PDF_MODULE,
+ "TIFF contains too many directories, %s",
+ TIFFFileName(input));
+ t2p->t2p_error = T2P_ERR_ERROR;
+ return;
+ }
t2p->tiff_pages = (T2P_PAGE*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,directorycount,sizeof(T2P_PAGE)));
if(t2p->tiff_pages==NULL){
TIFFError(
@@ -1147,26 +1159,48 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
}
#endif
if (TIFFGetField(input, TIFFTAG_TRANSFERFUNCTION,
- &(t2p->tiff_transferfunction[0]),
- &(t2p->tiff_transferfunction[1]),
- &(t2p->tiff_transferfunction[2]))) {
- if((t2p->tiff_transferfunction[1] != (float*) NULL) &&
- (t2p->tiff_transferfunction[2] != (float*) NULL) &&
- (t2p->tiff_transferfunction[1] !=
- t2p->tiff_transferfunction[0])) {
- t2p->tiff_transferfunctioncount = 3;
- t2p->tiff_pages[i].page_extra += 4;
- t2p->pdf_xrefcount += 4;
- } else {
- t2p->tiff_transferfunctioncount = 1;
- t2p->tiff_pages[i].page_extra += 2;
- t2p->pdf_xrefcount += 2;
- }
- if(t2p->pdf_minorversion < 2)
- t2p->pdf_minorversion = 2;
+ &(tiff_transferfunction[0]),
+ &(tiff_transferfunction[1]),
+ &(tiff_transferfunction[2]))) {
+
+ if((tiff_transferfunction[1] != (uint16*) NULL) &&
+ (tiff_transferfunction[2] != (uint16*) NULL)
+ ) {
+ tiff_transferfunctioncount=3;
+ } else {
+ tiff_transferfunctioncount=1;
+ }
} else {
- t2p->tiff_transferfunctioncount=0;
+ tiff_transferfunctioncount=0;
}
+
+ if (i > 0){
+ if (tiff_transferfunctioncount != t2p->tiff_transferfunctioncount){
+ TIFFError(
+ TIFF2PDF_MODULE,
+ "Different transfer function on page %d",
+ i);
+ t2p->t2p_error = T2P_ERR_ERROR;
+ return;
+ }
+ }
+
+ t2p->tiff_transferfunctioncount = tiff_transferfunctioncount;
+ t2p->tiff_transferfunction[0] = tiff_transferfunction[0];
+ t2p->tiff_transferfunction[1] = tiff_transferfunction[1];
+ t2p->tiff_transferfunction[2] = tiff_transferfunction[2];
+ if(tiff_transferfunctioncount == 3){
+ t2p->tiff_pages[i].page_extra += 4;
+ t2p->pdf_xrefcount += 4;
+ if(t2p->pdf_minorversion < 2)
+ t2p->pdf_minorversion = 2;
+ } else if (tiff_transferfunctioncount == 1){
+ t2p->tiff_pages[i].page_extra += 2;
+ t2p->pdf_xrefcount += 2;
+ if(t2p->pdf_minorversion < 2)
+ t2p->pdf_minorversion = 2;
+ }
+
if( TIFFGetField(
input,
TIFFTAG_ICCPROFILE,
@@ -1258,10 +1292,10 @@ int t2p_cmp_t2p_page(const void* e1, const void* e2){
void t2p_read_tiff_data(T2P* t2p, TIFF* input){
int i=0;
- uint16* r;
- uint16* g;
- uint16* b;
- uint16* a;
+ uint16* r = NULL;
+ uint16* g = NULL;
+ uint16* b = NULL;
+ uint16* a = NULL;
uint16 xuint16;
uint16* xuint16p;
float* xfloatp;
@@ -1488,12 +1522,19 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
t2p->pdf_palettesize=0x0001<<t2p->tiff_bitspersample;
if(!TIFFGetField(input, TIFFTAG_COLORMAP, &r, &g, &b)){
TIFFError(
- TIFF2PDF_MODULE,
- "Palettized image %s has no color map",
+ TIFF2PDF_MODULE,
+ "Palettized image %s has no color map",
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return;
- }
+ }
+ if(r == NULL || g == NULL || b == NULL){
+ TIFFError(
+ TIFF2PDF_MODULE,
+ "Error getting 3 components from color map");
+ t2p->t2p_error = T2P_ERR_ERROR;
+ return;
+ }
if(t2p->pdf_palette != NULL){
_TIFFfree(t2p->pdf_palette);
t2p->pdf_palette=NULL;
@@ -1557,12 +1598,19 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
t2p->pdf_palettesize=0x0001<<t2p->tiff_bitspersample;
if(!TIFFGetField(input, TIFFTAG_COLORMAP, &r, &g, &b, &a)){
TIFFError(
- TIFF2PDF_MODULE,
- "Palettized image %s has no color map",
+ TIFF2PDF_MODULE,
+ "Palettized image %s has no color map",
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return;
- }
+ }
+ if(r == NULL || g == NULL || b == NULL || a == NULL){
+ TIFFError(
+ TIFF2PDF_MODULE,
+ "Error getting 4 components from color map");
+ t2p->t2p_error = T2P_ERR_ERROR;
+ return;
+ }
if(t2p->pdf_palette != NULL){
_TIFFfree(t2p->pdf_palette);
t2p->pdf_palette=NULL;
@@ -1827,10 +1875,9 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
&(t2p->tiff_transferfunction[0]),
&(t2p->tiff_transferfunction[1]),
&(t2p->tiff_transferfunction[2]))) {
- if((t2p->tiff_transferfunction[1] != (float*) NULL) &&
- (t2p->tiff_transferfunction[2] != (float*) NULL) &&
- (t2p->tiff_transferfunction[1] !=
- t2p->tiff_transferfunction[0])) {
+ if((t2p->tiff_transferfunction[1] != (uint16*) NULL) &&
+ (t2p->tiff_transferfunction[2] != (uint16*) NULL)
+ ) {
t2p->tiff_transferfunctioncount=3;
} else {
t2p->tiff_transferfunctioncount=1;
@@ -2987,6 +3034,7 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
"for t2p_readwrite_pdf_image_tile, %s",
(unsigned long) t2p->tiff_datasize,
TIFFFileName(input));
+ _TIFFfree(buffer);
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
}
@@ -3070,19 +3118,26 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
if(t2p->pdf_sample & T2P_SAMPLE_LAB_SIGNED_TO_UNSIGNED){
t2p->tiff_datasize=t2p_sample_lab_signed_to_unsigned(
- (tdata_t)buffer,
+ (tdata_t)buffer,
t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth
*t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength);
}
}
if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile) != 0){
- t2p_tile_collapse_left(
- buffer,
- TIFFTileRowSize(input),
- t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth,
- t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth,
- t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength);
+ if ((uint64)t2p->tiff_datasize < (uint64)TIFFTileRowSize(input) * (uint64)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength) {
+ /* we don't know how to handle PLANARCONFIG_CONTIG, PHOTOMETRIC_YCBCR with 3 samples per pixel */
+ TIFFWarning(
+ TIFF2PDF_MODULE,
+ "Don't know how to collapse tile to the left");
+ } else {
+ t2p_tile_collapse_left(
+ buffer,
+ TIFFTileRowSize(input),
+ t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth,
+ t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth,
+ t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength);
+ }
}
@@ -3713,12 +3768,13 @@ tsize_t
t2p_sample_rgbaa_to_rgb(tdata_t data, uint32 samplecount)
{
uint32 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 the 3 first samples, there is overlap between source 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);
@@ -4217,13 +4273,13 @@ void t2p_pdf_currenttime(T2P* t2p)
currenttime = localtime(&timenow);
snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),
- "D:%.4d%.2d%.2d%.2d%.2d%.2d",
- (currenttime->tm_year + 1900) % 65536,
- (currenttime->tm_mon + 1) % 256,
- (currenttime->tm_mday) % 256,
- (currenttime->tm_hour) % 256,
- (currenttime->tm_min) % 256,
- (currenttime->tm_sec) % 256);
+ "D:%.4u%.2u%.2u%.2u%.2u%.2u",
+ TIFFmin((unsigned) currenttime->tm_year + 1900U,9999U),
+ TIFFmin((unsigned) currenttime->tm_mon + 1U,12U), /* 0-11 + 1 */
+ TIFFmin((unsigned) currenttime->tm_mday,31U), /* 1-31 */
+ TIFFmin((unsigned) currenttime->tm_hour,23U), /* 0-23 */
+ TIFFmin((unsigned) currenttime->tm_min,59U), /* 0-59 */
+ TIFFmin((unsigned) (currenttime->tm_sec),60U)); /* 0-60 */
return;
}
diff --git a/tiff/tools/tiff2ps.c b/tiff/tools/tiff2ps.c
index f1f0b3726..5874aba64 100644
--- a/tiff/tools/tiff2ps.c
+++ b/tiff/tools/tiff2ps.c
@@ -1,5 +1,3 @@
-/* $Id: tiff2ps.c,v 1.56 2017-04-27 15:46:22 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -63,7 +61,7 @@
* if not specified on the command line.
* Add new command line option to specify document creator
* as an alterntive to the string "tiff2ps" following model
- * of patch submitted by Thomas Jarosch for specifiying a
+ * of patch submitted by Thomas Jarosch for specifying a
* document title which is also supported now.
*
* 2009-Feb-11
@@ -73,7 +71,7 @@
* or landscape) if -h or -w is specified. Rotation is in
* degrees counterclockwise since that is how Postscript does
* it. The auto opption rotates the image 90 degrees ccw to
- * produce landscape if that is a better fit than portait.
+ * produce landscape if that is a better fit than portrait.
*
* Cleaned up code in TIFF2PS and broke into smaller functions
* to simplify rotations.
@@ -520,7 +518,7 @@ checkImage(TIFF* tif)
"PhotometricInterpretation=YCbCr");
return (0);
}
- /* fall thru... */
+ /* fall through... */
case PHOTOMETRIC_RGB:
if (alpha && bitspersample != 8) {
TIFFError(filename,
@@ -528,7 +526,7 @@ checkImage(TIFF* tif)
bitspersample);
return (0);
}
- /* fall thru... */
+ /* fall through... */
case PHOTOMETRIC_SEPARATED:
case PHOTOMETRIC_PALETTE:
case PHOTOMETRIC_MINISBLACK:
@@ -552,7 +550,7 @@ checkImage(TIFF* tif)
bitspersample = 8;
break;
case PHOTOMETRIC_CIELAB:
- /* fall thru... */
+ /* fall through... */
default:
TIFFError(filename,
"Can not handle image with PhotometricInterpretation=%d",
@@ -684,8 +682,8 @@ isCCITTCompression(TIFF* tif)
static tsize_t tf_bytesperrow;
static tsize_t ps_bytesperrow;
-static tsize_t tf_rowsperstrip;
-static tsize_t tf_numberstrips;
+static uint32 tf_rowsperstrip;
+static uint32 tf_numberstrips;
static char *hex = "0123456789abcdef";
/*
@@ -1800,7 +1798,7 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
int use_rawdata;
uint32 tile_width, tile_height;
uint16 predictor, minsamplevalue, maxsamplevalue;
- int repeat_count;
+ uint32 repeat_count;
char im_h[64], im_x[64], im_y[64];
char * imageOp = "image";
@@ -1852,7 +1850,7 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
fputs("{ % exec\n", fd);
if (repeat_count > 1)
- fprintf(fd, "%d { %% repeat\n", repeat_count);
+ fprintf(fd, "%u { %% repeat\n", repeat_count);
/*
* Output filter options and image dictionary.
@@ -2266,7 +2264,7 @@ PS_Lvl2page(FILE* fd, TIFF* tif, uint32 w, uint32 h)
if (alpha) {
int adjust, i, j = 0;
int ncomps = samplesperpixel - extrasamples;
- for (i = 0; i < byte_count; i+=samplesperpixel) {
+ for (i = 0; (i + ncomps) < byte_count; i+=samplesperpixel) {
adjust = 255 - buf_data[i + ncomps];
switch (ncomps) {
case 1:
@@ -2446,9 +2444,9 @@ PSDataColorContig(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc)
unsigned char *cp, c;
(void) w;
- if( es <= 0 )
+ if( es < 0 )
{
- TIFFError(filename, "Inconsistent value of es: %d", es);
+ TIFFError(filename, "Inconsistent value of es: %d (samplesperpixel=%u, nc=%d)", es, samplesperpixel, nc);
return;
}
tf_buf = (unsigned char *) _TIFFmalloc(tf_bytesperrow);
@@ -2470,7 +2468,7 @@ PSDataColorContig(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc)
if (alpha) {
int adjust;
cc = 0;
- for (; cc < tf_bytesperrow; cc += samplesperpixel) {
+ for (; (cc + nc) <= tf_bytesperrow; cc += samplesperpixel) {
DOBREAK(breaklen, nc, fd);
/*
* For images with alpha, matte against
@@ -2489,7 +2487,7 @@ PSDataColorContig(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc)
}
} else {
cc = 0;
- for (; cc < tf_bytesperrow; cc += samplesperpixel) {
+ for (; (cc + nc) <= tf_bytesperrow; cc += samplesperpixel) {
DOBREAK(breaklen, nc, fd);
switch (nc) {
case 4: c = *cp++; PUTHEX(c,fd);
@@ -2768,7 +2766,7 @@ PSRawDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h)
bufsize = (uint32) bc[0];
- for ( s = 0; ++s < (tstrip_t)tf_numberstrips; ) {
+ for ( s = 0; ++s < tf_numberstrips; ) {
if ( bc[s] > bufsize )
bufsize = (uint32) bc[s];
}
@@ -2801,7 +2799,7 @@ PSRawDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h)
}
#endif
- for (s = 0; s < (tstrip_t) tf_numberstrips; s++) {
+ for (s = 0; s < tf_numberstrips; s++) {
cc = TIFFReadRawStrip(tif, s, tf_buf, (tmsize_t) bc[s]);
if (cc < 0) {
TIFFError(filename, "Can't read strip");
@@ -2968,10 +2966,10 @@ tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw
for ( ; raw_l > 3; raw_l -= 4 )
{
- val32 = *(++raw_p) << 24;
- val32 += *(++raw_p) << 16;
- val32 += *(++raw_p) << 8;
- val32 += *(++raw_p);
+ val32 = (uint32)*(++raw_p) << 24;
+ val32 += (uint32)*(++raw_p) << 16;
+ val32 += (uint32)*(++raw_p) << 8;
+ val32 += (uint32)*(++raw_p);
if ( val32 == 0 ) /* Special case */
{
diff --git a/tiff/tools/tiff2rgba.c b/tiff/tools/tiff2rgba.c
index 4de96aeca..2eb6f6c40 100644
--- a/tiff/tools/tiff2rgba.c
+++ b/tiff/tools/tiff2rgba.c
@@ -1,5 +1,3 @@
-/* $Id: tiff2rgba.c,v 1.22 2016-08-15 20:06:41 erouault Exp $ */
-
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/tools/tiffcmp.c b/tiff/tools/tiffcmp.c
index 1a008a30c..7b7648834 100644
--- a/tiff/tools/tiffcmp.c
+++ b/tiff/tools/tiffcmp.c
@@ -1,5 +1,3 @@
-/* $Id: tiffcmp.c,v 1.18 2015-06-21 01:09:10 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -42,7 +40,7 @@
#include "tiffio.h"
#ifndef HAVE_GETOPT
-extern int getopt(int, char**, char*);
+extern int getopt(int argc, char * const argv[], const char *optstring);
#endif
static int stopondiff = 1;
@@ -438,7 +436,8 @@ PrintIntDiff(uint32 row, int sample, uint32 pix, uint32 w1, uint32 w2)
{
int32 mask1, mask2, s;
- mask1 = ~((-1) << bitspersample);
+ /* mask1 should have the n lowest bits set, where n == bitspersample */
+ mask1 = ((int32)1 << bitspersample) - 1;
s = (8 - bitspersample);
mask2 = mask1 << s;
for (; mask2 && pix < imagewidth;
diff --git a/tiff/tools/tiffcp.c b/tiff/tools/tiffcp.c
index 489459a7f..84d81488d 100644
--- a/tiff/tools/tiffcp.c
+++ b/tiff/tools/tiffcp.c
@@ -1,5 +1,3 @@
-/* $Id: tiffcp.c,v 1.61 2017-01-11 19:26:14 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -43,6 +41,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include <ctype.h>
@@ -53,7 +52,7 @@
#include "tiffio.h"
#ifndef HAVE_GETOPT
-extern int getopt(int, char**, char*);
+extern int getopt(int argc, char * const argv[], const char *optstring);
#endif
#if defined(VMS)
@@ -391,6 +390,12 @@ processCompressOptions(char* opt)
} else if (strneq(opt, "lzma", 4)) {
processZIPOptions(opt);
defcompression = COMPRESSION_LZMA;
+ } else if (strneq(opt, "zstd", 4)) {
+ processZIPOptions(opt);
+ defcompression = COMPRESSION_ZSTD;
+ } else if (strneq(opt, "webp", 4)) {
+ processZIPOptions(opt);
+ defcompression = COMPRESSION_WEBP;
} else if (strneq(opt, "jbig", 4)) {
defcompression = COMPRESSION_JBIG;
} else if (strneq(opt, "sgilog", 6)) {
@@ -429,6 +434,8 @@ char* stuff[] = {
" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
" -c zip[:opts] compress output with deflate encoding",
" -c lzma[:opts] compress output with LZMA2 encoding",
+" -c zstd[:opts] compress output with ZSTD encoding",
+" -c webp[:opts] compress output with WEBP encoding",
" -c jpeg[:opts] compress output with JPEG encoding",
" -c jbig compress output with ISO JBIG encoding",
" -c packbits compress output with packbits encoding",
@@ -448,7 +455,7 @@ char* stuff[] = {
" 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, Deflate (ZIP) and LZMA2 options:",
+"LZW, Deflate (ZIP), LZMA2, ZSTD and WEBP options:",
" # set predictor value",
" p# set compression level (preset)",
"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing,",
@@ -655,7 +662,7 @@ tiffcp(TIFF* in, TIFF* out)
case ORIENTATION_RIGHTBOT: /* XXX */
TIFFWarning(TIFFFileName(in), "using bottom-left orientation");
orientation = ORIENTATION_BOTLEFT;
- /* fall thru... */
+ /* fall through... */
case ORIENTATION_LEFTBOT: /* XXX */
case ORIENTATION_BOTLEFT:
break;
@@ -664,7 +671,7 @@ tiffcp(TIFF* in, TIFF* out)
default:
TIFFWarning(TIFFFileName(in), "using top-left orientation");
orientation = ORIENTATION_TOPLEFT;
- /* fall thru... */
+ /* fall through... */
case ORIENTATION_LEFTTOP: /* XXX */
case ORIENTATION_TOPLEFT:
break;
@@ -733,6 +740,8 @@ tiffcp(TIFF* in, TIFF* out)
case COMPRESSION_ADOBE_DEFLATE:
case COMPRESSION_DEFLATE:
case COMPRESSION_LZMA:
+ case COMPRESSION_ZSTD:
+ case COMPRESSION_WEBP:
if (predictor != (uint16)-1)
TIFFSetField(out, TIFFTAG_PREDICTOR, predictor);
else
@@ -743,6 +752,15 @@ tiffcp(TIFF* in, TIFF* out)
TIFFSetField(out, TIFFTAG_ZIPQUALITY, preset);
else if (compression == COMPRESSION_LZMA)
TIFFSetField(out, TIFFTAG_LZMAPRESET, preset);
+ else if (compression == COMPRESSION_ZSTD)
+ TIFFSetField(out, TIFFTAG_ZSTD_LEVEL, preset);
+ else if (compression == COMPRESSION_WEBP) {
+ if (preset == 100) {
+ TIFFSetField(out, TIFFTAG_WEBP_LOSSLESS, TRUE);
+ } else {
+ TIFFSetField(out, TIFFTAG_WEBP_LEVEL, preset);
+ }
+ }
}
break;
case COMPRESSION_CCITTFAX3:
@@ -1391,7 +1409,7 @@ DECLAREreadFunc(readSeparateTilesIntoBuffer)
int status = 1;
uint32 imagew = TIFFRasterScanlineSize(in);
uint32 tilew = TIFFTileRowSize(in);
- int iskew = imagew - tilew*spp;
+ int iskew;
tsize_t tilesize = TIFFTileSize(in);
tdata_t tilebuf;
uint8* bufp = (uint8*) buf;
@@ -1399,6 +1417,12 @@ DECLAREreadFunc(readSeparateTilesIntoBuffer)
uint32 row;
uint16 bps = 0, bytes_per_sample;
+ if (spp > (INT_MAX / tilew))
+ {
+ TIFFError(TIFFFileName(in), "Error, cannot handle that much samples per tile row (Tile Width * Samples/Pixel)");
+ return 0;
+ }
+ iskew = imagew - tilew*spp;
tilebuf = _TIFFmalloc(tilesize);
if (tilebuf == 0)
return 0;
diff --git a/tiff/tools/tiffcrop.c b/tiff/tools/tiffcrop.c
index c69177e05..7b3c9e789 100644
--- a/tiff/tools/tiffcrop.c
+++ b/tiff/tools/tiffcrop.c
@@ -1,5 +1,3 @@
-/* $Id: tiffcrop.c,v 1.50 2017-01-11 12:51:59 erouault Exp $ */
-
/* tiffcrop.c -- a port of tiffcp.c extended to include manipulations of
* the image data through additional options listed below
*
@@ -27,7 +25,7 @@
* ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE
* OR PERFORMANCE OF THIS SOFTWARE.
*
- * Some portions of the current code are derived from tiffcp, primarly in
+ * Some portions of the current code are derived from tiffcp, primarily in
* the areas of lowlevel reading and writing of TAGS, scanlines and tiles though
* some of the original functions have been extended to support arbitrary bit
* depths. These functions are presented at the top of this file.
@@ -150,11 +148,6 @@ extern int getopt(int argc, char * const argv[], const char *optstring);
#define TIFF_UINT32_MAX 0xFFFFFFFFU
-#ifndef streq
-#define streq(a,b) (strcmp((a),(b)) == 0)
-#endif
-#define strneq(a,b,n) (strncmp((a),(b),(n)) == 0)
-
#define TRUE 1
#define FALSE 0
@@ -217,6 +210,8 @@ extern int getopt(int argc, char * const argv[], const char *optstring);
#define DUMP_TEXT 1
#define DUMP_RAW 2
+#define TIFF_DIR_MAX 65534
+
/* Offsets into buffer for margins and fixed width and length segments */
struct offset {
uint32 tmargin;
@@ -1685,7 +1680,7 @@ void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32
*defconfig = PLANARCONFIG_CONTIG;
else
{
- TIFFError ("Unkown planar configuration", "%s", optarg);
+ TIFFError ("Unknown planar configuration", "%s", optarg);
TIFFError ("For valid options type", "tiffcrop -h");
exit (-1);
}
@@ -2108,28 +2103,30 @@ void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32
* autoindex is set to non-zero. Update page and file counters
* so TIFFTAG PAGENUM will be correct in image.
*/
-static int
+static int
update_output_file (TIFF **tiffout, char *mode, int autoindex,
char *outname, unsigned int *page)
{
static int findex = 0; /* file sequence indicator */
+ size_t basename_len;
char *sep;
- char filenum[16];
char export_ext[16];
char exportname[PATH_MAX];
if (autoindex && (*tiffout != NULL))
- {
+ {
/* Close any export file that was previously opened */
TIFFClose (*tiffout);
*tiffout = NULL;
}
- strcpy (export_ext, ".tiff");
- memset (exportname, '\0', PATH_MAX);
+ memcpy (export_ext, ".tiff", 6);
+ memset (exportname, '\0', sizeof(exportname));
- /* Leave room for page number portion of the new filename */
- strncpy (exportname, outname, PATH_MAX - 16);
+ /* Leave room for page number portion of the new filename :
+ * hyphen + 6 digits + dot + 4 extension characters + null terminator */
+ #define FILENUM_MAX_LENGTH (1+6+1+4+1)
+ strncpy (exportname, outname, sizeof(exportname) - FILENUM_MAX_LENGTH);
if (*tiffout == NULL) /* This is a new export file */
{
if (autoindex)
@@ -2141,21 +2138,21 @@ update_output_file (TIFF **tiffout, char *mode, int autoindex,
*sep = '\0';
}
else
- strncpy (export_ext, ".tiff", 5);
+ memcpy (export_ext, ".tiff", 5);
export_ext[5] = '\0';
+ basename_len = strlen(exportname);
/* MAX_EXPORT_PAGES limited to 6 digits to prevent string overflow of pathname */
if (findex > MAX_EXPORT_PAGES)
- {
- TIFFError("update_output_file", "Maximum of %d pages per file exceeded", MAX_EXPORT_PAGES);
+ {
+ TIFFError("update_output_file", "Maximum of %d pages per file exceeded", MAX_EXPORT_PAGES);
return 1;
}
- snprintf(filenum, sizeof(filenum), "-%03d%s", findex, export_ext);
- filenum[14] = '\0';
- strncat (exportname, filenum, 15);
+ /* We previously assured that there will be space left */
+ snprintf(exportname + basename_len, sizeof(exportname) - basename_len, "-%03d%.5s", findex, export_ext);
}
- exportname[PATH_MAX - 1] = '\0';
+ exportname[sizeof(exportname) - 1] = '\0';
*tiffout = TIFFOpen(exportname, mode);
if (*tiffout == NULL)
@@ -2163,11 +2160,11 @@ update_output_file (TIFF **tiffout, char *mode, int autoindex,
TIFFError("update_output_file", "Unable to open output file %s", exportname);
return 1;
}
- *page = 0;
+ *page = 0;
return 0;
}
- else
+ else
(*page)++;
return 0;
@@ -2212,8 +2209,9 @@ main(int argc, char* argv[])
unsigned int total_pages = 0;
unsigned int total_images = 0;
unsigned int end_of_input = FALSE;
- int seg, length;
- char temp_filename[PATH_MAX + 1];
+ int seg;
+ size_t length;
+ char temp_filename[PATH_MAX + 16]; /* Extra space keeps the compiler from complaining */
little_endian = *((unsigned char *)&little_endian) & '1';
@@ -2233,7 +2231,7 @@ main(int argc, char* argv[])
pageNum = -1;
else
total_images = 0;
- /* read multiple input files and write to output file(s) */
+ /* Read multiple input files and write to output file(s) */
while (optind < argc - 1)
{
in = TIFFOpen (argv[optind], "r");
@@ -2241,7 +2239,14 @@ main(int argc, char* argv[])
return (-3);
/* If only one input file is specified, we can use directory count */
- total_images = TIFFNumberOfDirectories(in);
+ total_images = TIFFNumberOfDirectories(in);
+ if (total_images > TIFF_DIR_MAX)
+ {
+ TIFFError (TIFFFileName(in), "File contains too many directories");
+ if (out != NULL)
+ (void) TIFFClose(out);
+ return (1);
+ }
if (image_count == 0)
{
dirnum = 0;
@@ -2305,8 +2310,8 @@ main(int argc, char* argv[])
if (dump.infile != NULL)
fclose (dump.infile);
- /* dump.infilename is guaranteed to be NUL termimated and have 20 bytes
- fewer than PATH_MAX */
+ /* dump.infilename is guaranteed to be NUL terminated and have 20 bytes
+ fewer than PATH_MAX */
snprintf(temp_filename, sizeof(temp_filename), "%s-read-%03d.%s",
dump.infilename, dump_images,
(dump.format == DUMP_TEXT) ? "txt" : "raw");
@@ -2324,7 +2329,7 @@ main(int argc, char* argv[])
if (dump.outfile != NULL)
fclose (dump.outfile);
- /* dump.outfilename is guaranteed to be NUL termimated and have 20 bytes
+ /* dump.outfilename is guaranteed to be NUL terminated and have 20 bytes
fewer than PATH_MAX */
snprintf(temp_filename, sizeof(temp_filename), "%s-write-%03d.%s",
dump.outfilename, dump_images,
@@ -6774,12 +6779,12 @@ extractImageSection(struct image_data *image, struct pageseg *section,
#endif
bytebuff1 = bytebuff2 = 0;
- if (shift1 == 0) /* the region is byte and sample alligned */
+ if (shift1 == 0) /* the region is byte and sample aligned */
{
_TIFFmemcpy (sect_buff + dst_offset, src_buff + offset1, full_bytes);
#ifdef DEVELMODE
- TIFFError ("", " Alligned data src offset1: %8d, Dst offset: %8d\n", offset1, dst_offset);
+ TIFFError ("", " Aligned data src offset1: %8d, Dst offset: %8d\n", offset1, dst_offset);
sprintf(&bitarray[18], "\n");
sprintf(&bitarray[19], "\t");
for (j = 20, k = 7; j < 28; j++, k--)
@@ -7722,7 +7727,7 @@ createCroppedImage(struct image_data *image, struct crop_mask *crop,
* original code assumes we are always copying all samples.
* Use of global variables for config, compression and others
* should be replaced by addition to the crop_mask struct (which
- * will be renamed to proc_opts indicating that is controlls
+ * will be renamed to proc_opts indicating that is controls
* user supplied processing options, not just cropping) and
* then passed in as an argument.
*/
@@ -8417,7 +8422,7 @@ rotateImage(uint16 rotation, struct image_data *image, uint32 *img_width,
ibuff = *ibuff_ptr;
switch (rotation)
{
- case 180: if ((bps % 8) == 0) /* byte alligned data */
+ case 180: if ((bps % 8) == 0) /* byte aligned data */
{
src = ibuff;
pix_offset = (spp * bps) / 8;
@@ -9057,8 +9062,9 @@ mirrorImage(uint16 spp, uint16 bps, uint16 mirror, uint32 width, uint32 length,
_TIFFfree(line_buff);
if (mirror == MIRROR_VERT)
break;
+ /* Fall through */
case MIRROR_HORIZ :
- if ((bps % 8) == 0) /* byte alligned data */
+ if ((bps % 8) == 0) /* byte aligned data */
{
for (row = 0; row < length; row++)
{
@@ -9138,7 +9144,6 @@ static int
invertImage(uint16 photometric, uint16 spp, uint16 bps, uint32 width, uint32 length, unsigned char *work_buff)
{
uint32 row, col;
- unsigned char bytebuff1, bytebuff2, bytebuff3, bytebuff4;
unsigned char *src;
uint16 *src_uint16;
uint32 *src_uint32;
@@ -9168,7 +9173,7 @@ invertImage(uint16 photometric, uint16 spp, uint16 bps, uint32 width, uint32 len
for (row = 0; row < length; row++)
for (col = 0; col < width; col++)
{
- *src_uint32 = (uint32)0xFFFFFFFF - *src_uint32;
+ *src_uint32 = ~(*src_uint32);
src_uint32++;
}
break;
@@ -9176,39 +9181,15 @@ invertImage(uint16 photometric, uint16 spp, uint16 bps, uint32 width, uint32 len
for (row = 0; row < length; row++)
for (col = 0; col < width; col++)
{
- *src_uint16 = (uint16)0xFFFF - *src_uint16;
+ *src_uint16 = ~(*src_uint16);
src_uint16++;
}
break;
- case 8: for (row = 0; row < length; row++)
- for (col = 0; col < width; col++)
- {
- *src = (uint8)255 - *src;
- src++;
- }
- break;
- case 4: for (row = 0; row < length; row++)
- for (col = 0; col < width; col++)
- {
- bytebuff1 = 16 - (uint8)(*src & 240 >> 4);
- bytebuff2 = 16 - (*src & 15);
- *src = bytebuff1 << 4 & bytebuff2;
- src++;
- }
- break;
- case 2: for (row = 0; row < length; row++)
- for (col = 0; col < width; col++)
- {
- bytebuff1 = 4 - (uint8)(*src & 192 >> 6);
- bytebuff2 = 4 - (uint8)(*src & 48 >> 4);
- bytebuff3 = 4 - (uint8)(*src & 12 >> 2);
- bytebuff4 = 4 - (uint8)(*src & 3);
- *src = (bytebuff1 << 6) || (bytebuff2 << 4) || (bytebuff3 << 2) || bytebuff4;
- src++;
- }
- break;
+ case 8:
+ case 4:
+ case 2:
case 1: for (row = 0; row < length; row++)
- for (col = 0; col < width; col += 8 /(spp * bps))
+ for (col = 0; col < width; col += 8 / bps)
{
*src = ~(*src);
src++;
diff --git a/tiff/tools/tiffdither.c b/tiff/tools/tiffdither.c
index 247553cdf..3fd7f81a4 100644
--- a/tiff/tools/tiffdither.c
+++ b/tiff/tools/tiffdither.c
@@ -1,5 +1,3 @@
-/* $Id: tiffdither.c,v 1.16 2015-06-21 01:09:11 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/tiff/tools/tiffdump.c b/tiff/tools/tiffdump.c
index 3de0062b9..4cdcda0c1 100644
--- a/tiff/tools/tiffdump.c
+++ b/tiff/tools/tiffdump.c
@@ -1,5 +1,3 @@
-/* $Id: tiffdump.c,v 1.35 2016-11-19 15:42:46 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -53,7 +51,7 @@
#endif
#ifndef HAVE_GETOPT
-extern int getopt(int, char**, char*);
+extern int getopt(int argc, char * const argv[], const char *optstring);
#endif
#include "tiffio.h"
diff --git a/tiff/tools/tiffgt.c b/tiff/tools/tiffgt.c
index 35a23ccf6..2f11b0cab 100644
--- a/tiff/tools/tiffgt.c
+++ b/tiff/tools/tiffgt.c
@@ -1,5 +1,3 @@
-/* $Id: tiffgt.c,v 1.15 2015-09-06 20:42:20 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -29,11 +27,16 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#if HAVE_UNISTD_H
#include <unistd.h>
+#endif
#ifdef HAVE_OPENGL_GL_H
# include <OpenGL/gl.h>
#else
+# ifdef _WIN32
+# include <windows.h>
+# endif
# include <GL/gl.h>
#endif
#ifdef HAVE_GLUT_GLUT_H
@@ -46,7 +49,7 @@
#include "tiffiop.h"
#ifndef HAVE_GETOPT
-extern int getopt(int, char**, char*);
+extern int getopt(int argc, char * const argv[], const char *optstring);
#endif
static uint32 width = 0, height = 0; /* window width & height */
diff --git a/tiff/tools/tiffinfo.c b/tiff/tools/tiffinfo.c
index 4d58055de..049e3a349 100644
--- a/tiff/tools/tiffinfo.c
+++ b/tiff/tools/tiffinfo.c
@@ -1,5 +1,3 @@
-/* $Id: tiffinfo.c,v 1.26 2016-12-03 14:18:49 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -86,7 +84,7 @@ main(int argc, char* argv[])
break;
case 'd':
showdata++;
- /* fall thru... */
+ /* fall through... */
case 'D':
readdata++;
break;
diff --git a/tiff/tools/tiffmedian.c b/tiff/tools/tiffmedian.c
index f0c892e41..bd0d15618 100644
--- a/tiff/tools/tiffmedian.c
+++ b/tiff/tools/tiffmedian.c
@@ -1,5 +1,3 @@
-/* $Id: tiffmedian.c,v 1.13 2015-06-21 01:09:11 bfriesen Exp $ */
-
/*
* Apply median cut on an image.
*
diff --git a/tiff/tools/tiffset.c b/tiff/tools/tiffset.c
index 894c9f1f1..7ecc401bd 100644
--- a/tiff/tools/tiffset.c
+++ b/tiff/tools/tiffset.c
@@ -1,6 +1,4 @@
/******************************************************************************
- * $Id: tiffset.c,v 1.19 2017-10-01 17:38:12 erouault Exp $
- *
* Project: libtiff tools
* Purpose: Mainline for setting metadata in existing TIFF files.
* Author: Frank Warmerdam, warmerdam@pobox.com
@@ -29,6 +27,7 @@
******************************************************************************
*/
+#include "tif_config.h"
#include <stdio.h>
#include <string.h>
@@ -189,6 +188,9 @@ main(int argc, char* argv[])
size = 4;
break;
+ case TIFF_LONG8:
+ case TIFF_SLONG8:
+ case TIFF_IFD8:
case TIFF_DOUBLE:
size = 8;
break;
@@ -225,7 +227,16 @@ main(int argc, char* argv[])
case TIFF_SLONG:
case TIFF_IFD:
for (i = 0; i < wc; i++)
- ((uint32 *)array)[i] = atol(argv[arg_index+i]);
+ ((int32 *)array)[i] = atol(argv[arg_index+i]);
+ break;
+ case TIFF_LONG8:
+ for (i = 0; i < wc; i++)
+ ((uint64 *)array)[i] = strtoll(argv[arg_index+i], (char **)NULL, 10);
+ break;
+ case TIFF_SLONG8:
+ case TIFF_IFD8:
+ for (i = 0; i < wc; i++)
+ ((int64 *)array)[i] = strtoll(argv[arg_index+i], (char **)NULL, 10);
break;
case TIFF_DOUBLE:
for (i = 0; i < wc; i++)
@@ -276,6 +287,12 @@ main(int argc, char* argv[])
ret = TIFFSetField(tiff, TIFFFieldTag(fip),
atol(argv[arg_index++]));
break;
+ case TIFF_LONG8:
+ case TIFF_SLONG8:
+ case TIFF_IFD8:
+ ret = TIFFSetField(tiff, TIFFFieldTag(fip),
+ strtoll(argv[arg_index++], (char **)NULL, 10));
+ break;
case TIFF_DOUBLE:
ret = TIFFSetField(tiff, TIFFFieldTag(fip),
atof(argv[arg_index++]));
diff --git a/tiff/tools/tiffsplit.c b/tiff/tools/tiffsplit.c
index c4fa2478a..c8b7f2ddc 100644
--- a/tiff/tools/tiffsplit.c
+++ b/tiff/tools/tiffsplit.c
@@ -1,5 +1,3 @@
-/* $Id: tiffsplit.c,v 1.23 2015-05-28 13:10:26 bfriesen Exp $ */
-
/*
* Copyright (c) 1992-1997 Sam Leffler
* Copyright (c) 1992-1997 Silicon Graphics, Inc.
@@ -33,7 +31,7 @@
#include "tiffio.h"
#ifndef HAVE_GETOPT
-extern int getopt(int, char**, char*);
+extern int getopt(int argc, char * const argv[], const char *optstring);
#endif
#define CopyField(tag, v) \