Compare commits

..
4712 Commits
Author SHA1 Message Date
Even Rouault 685c73260e Merge branch 'theta682-fix-Oi-GFS' into 'master'
Fix parsing a private tag 0x80a6

Closes #647

See merge request libtiff/libtiff!661
2024-09-22 19:07:14 +00:00
Timothy Lyanguzov 7753fff93e Do not error out on a tag whose tag count value is zero, just issue a warning.
Fix parsing a private tag 0x80a6
2024-09-22 19:07:14 +00:00
Even Rouault 4dbeb487fa Merge branch 'fix_648_ASCII_length_at_WriteDirectorySec_codec_part' into 'master'
Increment string length for ASCII tags in TIFFWriteDirectorySec() for codec...

Closes #648

See merge request libtiff/libtiff!663
2024-09-21 18:23:06 +00:00
Su_Laus 6216805c10 Increment string length for ASCII tags in TIFFWriteDirectorySec() for codec tags defined with FIELD_xxx bits, as it is done for FIELD_CUSTOM tags.
Fixes #648
2024-09-21 19:03:09 +02:00
Even Rouault 9dff73bebc Merge branch '4_7_0_rc2' into 'master'
Fixes for 4.7.0rc2

See merge request libtiff/libtiff!660
2024-09-11 07:41:37 +00:00
Even Rouault 5650dd434b configure.ac: also look for python3.11 2024-09-11 01:30:52 +02:00
Even Rouault db5972e098 Update RELEASE-DATE 2024-09-11 01:17:02 +02:00
Even Rouault 9c97172706 Update ChangeLog for 3.7.0rc2 2024-09-11 01:16:21 +02:00
Even Rouault a60b9d75e9 configure.ac: make a provision to look for up to python 3.16 ...
hopefully we'll have ditched autoconf support at that point...
2024-09-11 01:13:32 +02:00
Even Rouault 94f6f7315b Fix test dependency on tiff2rgba-32BPP that breaks 'make check -jX' 2024-09-11 01:11:21 +02:00
Even Rouault b535e2bf6f test/tiff2ps*.sh scripts: try to use POSIX only diff flags 2024-09-11 01:11:21 +02:00
Even Rouault 95911a1c2c Merge branch 'automake_doc_fix' into 'master'
doc/Makefile.am: make sure that 'doc-html' and 'doc-man' targets have dependencies to avoid them to be rebuilt by successive make

See merge request libtiff/libtiff!657
2024-09-10 22:37:20 +00:00
Even Rouault 3d206dd424 Merge branch '4_7_0_rst_rgb2ycbcr_thumbnail' into 'master'
v4.7.0.rst: clarify that rgb2ycbcr and thumbnail are not installed

See merge request libtiff/libtiff!659
2024-09-10 21:31:15 +00:00
Even Rouault e81febb70f v4.7.0.rst: clarify that rgb2ycbcr and thumbnail are not installed 2024-09-10 22:03:54 +02:00
Even Rouault eba593294d doc/Makefile.am: make sure that 'doc-html' and 'doc-man' targets have dependencies to avoid them to be rebuilt by successive make 2024-09-08 17:00:36 +02:00
Even Rouault 88152bebaf doc/Makefile.am: move rst_sources and EXTRA_DIST variables on top of file 2024-09-08 16:59:48 +02:00
Even Rouault 81b26f034d Merge branch 'index_rst_formatting_issue' into 'master'
index.rst: fix formatting issue

See merge request libtiff/libtiff!656
2024-09-07 14:53:03 +00:00
Even Rouault 5087fe8507 index.rst: fix formatting issue 2024-09-07 16:52:25 +02:00
Even Rouault a664b35b96 Merge branch 'prepare_release_4_7_0' into 'master'
Prepare release 4.7.0

See merge request libtiff/libtiff!654
2024-09-07 14:50:40 +00:00
Even Rouault f8dd26d304 Doc: remove 'Master' terminlogy 2024-09-07 13:19:53 +02:00
Even Rouault d40aa2dba4 v4.7.0.rst: remove mention about autoconf-archive since that change has been reverted 2024-09-07 13:19:53 +02:00
Even Rouault 0d6e6bc228 Revert "autotools: allow pulling in updated macros from autoconf-archive"
This reverts commit c820d16c30.
2024-09-07 13:19:53 +02:00
Even Rouault a55124f960 Revert "HOWTO-RELEASE: document the necessary dependencies for producing dist tarballs"
This reverts commit f1a91e42b3.
2024-09-07 13:19:53 +02:00
Even Rouault ea53869fb6 Revert "configure.ac: fix HAVE_OPENGL determination due to recent changes"
This reverts commit c370e67f7fd9320674544113218b7fbca4f65c2b.
2024-09-07 13:19:53 +02:00
Even Rouault a7cb83ff00 configure.ac: fix HAVE_OPENGL determination due to recent changes 2024-09-07 13:19:53 +02:00
Even Rouault 02230f5642 Update version numbers for 4.7.0 2024-09-07 13:19:53 +02:00
Even Rouault cadfff2e1d Update ChangeLog and create release notes for v4.7.0 2024-09-07 13:19:53 +02:00
Even Rouault eccbe7112e typo fixes 2024-09-06 17:53:58 +02:00
Even Rouault 6589e863d8 Merge branch 'autoconf-archive' into 'master'
autotools: allow pulling in updated macros from autoconf-archive

See merge request libtiff/libtiff!645
2024-09-06 14:58:17 +00:00
Even Rouault 6272852b8d Merge branch 'remove_last_usage_of_get_field_type' into 'master'
Change last usage of get_field_type at TIFFWriteDirectorySec() to set_field_type

See merge request libtiff/libtiff!653
2024-09-06 14:25:09 +00:00
Su_Laus d1487d7be3 Change last usage of get_field_type at TIFFWriteDirectorySec() for codec related tags to set_field_type. 2024-09-05 18:21:06 +02:00
Eli Schwartz f1a91e42b3 HOWTO-RELEASE: document the necessary dependencies for producing dist tarballs 2024-09-03 12:44:16 -04:00
Eli Schwartz 8929277ee7 autogen.sh: actually return failure if any step failed
Previously, it exited with failure if and only if the wget calls failed.
But it is possible for any command to fail, e.g. if the autotools are
broken, misconfigured, or missing dependencies.
2024-09-03 12:44:16 -04:00
Eli Schwartz c820d16c30 autotools: allow pulling in updated macros from autoconf-archive
Instead of inlining a few macros in acinclude.m4 and forgetting about
them, teach aclocal to install the macros to m4/ when autoreconf is run.
They are no longer tracked in one big file, nor tracked at all in git,
but producing dist tarballs will bundle them up just like `configure`
and `Makefile.in`.

Note: previous behavior of AX_CHECK_GL* was to simply ignore support and
proceed, if it was asked for and not found. The updated macros expect to
opt into this by specifying action-if-not-found.

VL_* is obsolete. Upgrade to AX_CFLAGS_WARN_ALL.
2024-09-03 12:44:16 -04:00
Even Rouault 6d616b716d Merge branch 'XZY2RGB' into 'master'
Fixes #644 Index comparison as size_t to avoid overflow in TIFFXYZToRGB

Closes #644

See merge request libtiff/libtiff!649
2024-09-03 12:33:47 +00:00
Nicolas Badoux 1c7b4f59c4 Fixes #644 Index comparison as size_t to avoid overflow in TIFFXYZToRGB 2024-09-03 12:33:47 +00:00
Even Rouault 821e91d79e Merge branch 'ci_werror' into 'master'
CI: build with -Wall -Wextra -Werror

See merge request libtiff/libtiff!652
2024-09-01 10:01:33 +00:00
Even Rouault f00e8166da configure.ac: avoid -Werror passed to CFLAGS to interfere with feature detection 2024-08-30 23:05:39 +02:00
Even Rouault 36cbce4d58 CI: build with -Wall -Wextra -Werror 2024-08-30 22:38:38 +02:00
Roger Leigh f59f4a0d43 Merge branch 'ci-old-update' into 'master'
ci: Update "old" build jobs to use Ubuntu 22.04

See merge request libtiff/libtiff!651
2024-08-30 11:12:33 +00:00
Roger Leigh fa7a5b36a5 ci: Update "old" build jobs to use Ubuntu 22.04 2024-08-30 10:49:14 +01:00
Even Rouault 9d6c745d68 Merge branch 'ci-ubuntu-22.04' into 'master'
ci: Update to use Ubuntu 24.04 CI images

See merge request libtiff/libtiff!650
2024-08-29 23:28:54 +00:00
Roger Leigh 3cdffebd6d ci: Update to use Ubuntu 24.04 CI images 2024-08-29 23:35:19 +01:00
Even Rouault 8e269601ce Merge branch 'uv_encode' into 'master'
Fix #645 by using unsigned int for variable indexing an array in uv_decode() and uv_encode()

Closes #645

See merge request libtiff/libtiff!648
2024-08-28 10:38:26 +00:00
Nicolas Badoux c2789e2dc1 Fix #645 by using unsigned int for variable indexing an array in uv_decode() and uv_encode()
Change `vi` to unsigned int in `uv_decode()` and `uv_encode()` to ensure that upper bound `UV_NVS` cannot be satisfied by a negative value which will overflow when cast to an unsigned value at array access time. This fixes issue #645 where a segmentation fault was caused.
2024-08-28 10:38:26 +00:00
Even Rouault 6360737552 Merge branch 'fix_643_solitary_CustomDirectory_read' into 'master'
Fix #643 by initializing pointer to TIFFSetField() and TIFFGetField() before TIFFReadGPSDirectory

Closes #643

See merge request libtiff/libtiff!647
2024-08-27 21:45:54 +00:00
Su Laus 986f906ed0 Fix #643 by initializing pointer to TIFFSetField() and TIFFGetField() before TIFFReadGPSDirectory
Initialize pointer to TIFFSetField() and TIFFGetField() (i.e. tif-\>tif_tagmethods.vsetfield and tif-\>tif_tagmethods.vgetfield) even if the file is opened with "h" option. This fixes issue #643 where a segmentation fault was caused.
2024-08-27 21:45:54 +00:00
Even Rouault b00d0060ba Merge branch 'tiff_strip' into 'master'
Add non-zero check before division in TIFFComputeStrip

See merge request libtiff/libtiff!646
2024-08-25 15:20:49 +00:00
Nicolas Badoux 27fc7da3f0 Add non-zero check before division in TIFFComputeStrip 2024-08-23 11:46:17 +02:00
Even Rouault 9a19607464 Merge branch 'fix_564' into 'master'
TIFFScanlineSize64(): revert merge request #564

See merge request libtiff/libtiff!644
2024-08-15 21:35:07 +00:00
Even Rouault 8f8916c1d3 TIFFScanlineSize64(): revert merge request #564
https://gitlab.com/libtiff/libtiff/-/merge_requests/564 broke decoding of: "tools/tiffcp -c none in.tif out.tif"
with [in.tif](/uploads/0475a88cf6e66652b030a0a3a0c47313/in.tif)
leading to shift each line of the target image by one extra pixel at each line.
Unfortunately, this cancels what https://gitlab.com/libtiff/libtiff/-/merge_requests/564 tried to fix. I'll let @caolanm propose an alternative fix in a follow-up merge request
2024-08-15 23:34:34 +02:00
Even Rouault de67665367 Merge branch 'coverity_fix_from_MR_634' into 'master'
Fix some Coverity Scan issues introduced by MR 634.

See merge request libtiff/libtiff!643
2024-08-15 20:50:54 +00:00
Su_Laus e5bacb710f Fix some Coverity Scan issues introduced by MR 634. 2024-08-14 21:03:04 +02:00
Even Rouault 9f528cd1d0 Merge branch 'lerc-pkgconfig' into 'master'
libtiff-4.pc: Fix `Requires.private` missing `Lerc`.

See merge request libtiff/libtiff!633
2024-08-11 16:02:39 +00:00
Even Rouault 942e1d5787 Merge branch 'manpage_update_directory_incrementing' into 'master'
Amend manpages for changes in current directory index behaviour.

See merge request libtiff/libtiff!639
2024-08-11 16:01:27 +00:00
Su Laus dbdda56243 Amend manpages for changes in current directory index behaviour. 2024-08-11 16:01:26 +00:00
Even Rouault 6357fdfe72 Merge branch 'tiffcrop_coverity_20240723' into 'master'
Attempt to address tiffcrop Coverity scan issues 1605444, 1605445, and 1605449.

See merge request libtiff/libtiff!642
2024-08-11 16:01:07 +00:00
Lee Howard 8a7a48d7a6 Attempt to address tiffcrop Coverity scan issues 1605444, 1605445, and 1605449. 2024-08-11 16:01:07 +00:00
Even Rouault 05cc3842bc Merge branch 'fix_CurDir_wrong_incrementing' into 'master'
Fix cases where tif_curdir is set incorrectly

See merge request libtiff/libtiff!634
2024-08-11 15:59:39 +00:00
Su Laus 5eb068a4cd Fix cases where tif_curdir is set incorrectly
Fix cases where the current directory number (tif_curdir) is set inconsistently or incorrectly, depending on the previous history.

See additional checks and tests in test/test_directory.c of this MR for intended setting of tif_curdir (i.e. TIFFCurrentDirectory(tif)).
2024-08-11 15:59:39 +00:00
Even Rouault 2653d1f860 Merge branch 'coverity_fixes_tiff2pdf_#2' into 'master'
Try to fix additional Coverity issues in tiff2pdf

See merge request libtiff/libtiff!641
2024-07-12 16:45:44 +00:00
Su Laus 2c020586ef Try to fix additional Coverity issues in tiff2pdf 2024-07-12 16:45:43 +00:00
Even Rouault e847ff922d Merge branch 'fix_autoconf_diff_parameter_crlf' into 'master'
Add parameter for "diff" used in autoconf test scripts to ignore LF and CRLF differences.

See merge request libtiff/libtiff!640
2024-07-10 18:49:08 +00:00
Even Rouault 3688f59a88 Merge branch 'coverity_fixes_tiff2pdf' into 'master'
Fix Coverity issues in tiff2pdf.

See merge request libtiff/libtiff!638
2024-07-09 14:04:31 +00:00
Su Laus 62d76b6942 Fix Coverity issues in tiff2pdf. 2024-07-09 14:04:30 +00:00
Su_Laus 07ad8fc313 Add parameter for "diff" used in autoconf test scripts to ignore LF and CRLF differences. 2024-06-29 22:27:50 +02:00
Even Rouault 7a3fb2deb1 Merge branch 'coverity_fixes_test_thumbnail' into 'master'
Coverity Scan fixes in thumbnail.c and custom_dir_EXIF_231.c

See merge request libtiff/libtiff!637
2024-06-28 13:36:36 +00:00
Su Laus fe77ab2933 Coverity Scan fixes in thumbnail.c and custom_dir_EXIF_231.c 2024-06-28 13:36:35 +00:00
Even Rouault 15a6e537df Merge branch 'coverity_fixes' into 'master'
Try to silence new Coverity Scan false positives

See merge request libtiff/libtiff!636
2024-06-25 21:00:45 +00:00
Even Rouault dd29a569fb Try to silence new Coverity Scan false positives
There are other warnings in tools/ that I'll let others deal with.
2024-06-24 22:27:26 +02:00
Even Rouault b8ac0e1a08 Merge branch 'fix/make' into 'master'
fix: error when running make clean

Closes #630

See merge request libtiff/libtiff!635
2024-06-24 19:19:37 +00:00
Kévin Dunglas e9aeaa60bf fix: error when running make clean 2024-06-24 10:10:21 +02:00
Niklas Hambüchen ea882c3c24 libtiff-4.pc: Fix Requires.private missing Lerc.
It provides a `.pc` file starting from version 4 in:

https://github.com/Esri/lerc/blob/8d6e8251544bbe1379feb0fe0a0934e43ca1a6cd/Lerc.pc.in

libtiff's CMake build system already has support for this,
adding `Lerc` to `Requires.private` if Lerc is >= 4.

In contrast to the CMake build system, autoconf has no good way
to check for checking the Lerc version, we do it unconditionally
there.
2024-06-15 19:22:08 +02:00
Even Rouault 03666cb5fd Merge branch 'rfc02_text__restore_tools' into 'master'
Text for RFC 2: Restoring needed libtiff tools

See merge request libtiff/libtiff!581
2024-06-13 18:24:50 +00:00
Even Rouault 1baa2ae009 Merge branch 'add_some_conversion_test_to_cmake' into 'master'
Port some basic sanity checks from autoconf to cmake.

See merge request libtiff/libtiff!630
2024-06-13 18:24:06 +00:00
Even Rouault 4ff9b5bd57 Merge branch 'tiffcp_coverity_check_malloc_return' into 'master'
tiffcp: Add check for limitMalloc return to fix Coverity CID 1603334

See merge request libtiff/libtiff!632
2024-06-10 20:10:54 +00:00
Su_Laus e59805a542 tiffcp add check for limitMalloc return to fix Coverity CID 1603334 2024-06-10 21:25:51 +02:00
Even Rouault 6507678444 Merge branch 'aim-nara-master-patch-67955' into 'master'
Remove unnecessary `2` in tiffcmp name

See merge request libtiff/libtiff!631
2024-06-07 12:36:04 +00:00
AIM | Nara be023be419 Remove unnecessary 2 in tiffcmp name 2024-06-07 12:36:04 +00:00
Su_Laus 27cb3445f8 Port some basic sanity checks from autoconf to cmake.
Checks are for tiffcp and tiffcrop RGB->YCbCr JPEG conversions (see MR !611 / 'tiffcp_tiffcrop_RGB_YCbCr_tests')
2024-05-30 23:25:18 +02:00
Even Rouault 4e63559f2b Merge branch 'ofz65182' into 'master'
an issue seen in putcontig8bitYCbCr22tile

See merge request libtiff/libtiff!564
2024-05-29 10:08:24 +00:00
Caolán McNamara 706e895071 TIFFScanlineSize64(): fix computation in non-JPEG YCbCr case (#564)
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65182
2024-05-29 10:08:24 +00:00
Even Rouault 23194d8dc1 Merge branch 'fix_375' into 'master'
TIFFRead[Scanline/EncodedStrip/EncodeTile]: 0-initialize output buffer if setupdecode fails ; most codecs: zero-initialize (not-yet-written parts of) output buffer if failure

Closes #375

See merge request libtiff/libtiff!628
2024-05-29 10:03:14 +00:00
Even Rouault 08e11fcab4 Merge branch 'tiff2pdf-planar' into 'master'
Inconsistent PLANARCONFIG value for the input and output TIFF in tiff2pdf.c

See merge request libtiff/libtiff!629
2024-05-29 10:02:56 +00:00
Timothy Lyanguzov f600f4783f Inconsistent PLANARCONFIG value for the input and output TIFF in tiff2pdf.c
Fixed a bug in tiff2pdf.c whereas the PLANARCONFIG for the output TIFF is set to a fixed value of PLANARCONFIG_CONTIG as opposed to match the value of the input TIFF.
This mainly manifest in the heap-buffer-overread due to the difference of sizes in the buffers (between input and output) allocated and read to the size of output buffer.

Reimplementation of !92
2024-05-29 16:06:05 +12:00
Even Rouault 3c73bd4e3f tif_lzma/tif_lzw: add code comments 2024-05-27 23:33:21 +02:00
Even Rouault ffdae44185 ZSTDDecode: zero-initialize (not-yet-written parts of) output buffer if failure 2024-05-26 19:59:57 +02:00
Even Rouault 5a5f71ebed PixarLogDecode: zero-initialize output buffer if failure 2024-05-26 19:58:23 +02:00
Even Rouault 2fc4422e3c PackBitsDecode: zero-initialize (not-yet-written parts of) output buffer if failure 2024-05-26 19:57:08 +02:00
Even Rouault 585b795bd3 JPEGDecode: zero-initialize (not-yet-written parts of) output buffer if failure 2024-05-26 19:55:44 +02:00
Even Rouault b8d67338a4 LERCDecode: zero-initialize output buffer if failure 2024-05-26 19:53:44 +02:00
Even Rouault 0171fffd8b LZMADecode: zero-initialize (not-yet-written parts of) output buffer if failure, and handle repeated calls to decoding same tile/strip if previous failure occured 2024-05-26 19:52:53 +02:00
Even Rouault 0b13e4c54e TWebPDecode: zero-initialize output buffer if failure, and handle repeated calls to decoding same tile/strip if previous failure occured 2024-05-26 19:50:31 +02:00
Even Rouault 5576398153 ThunderDecode: zero-initialize (not-yet-written parts of) output buffer if failure 2024-05-26 19:49:48 +02:00
Even Rouault 5dd28a6d5d OJPEGDecode: zero-initialize output buffer if failure 2024-05-26 19:49:27 +02:00
Even Rouault dcfd41ac4e JBIGDecode: zero-initialize (not-yet-written parts of) output buffer if failure 2024-05-26 19:49:14 +02:00
Even Rouault 60c7dd4b17 ZIPDecode: zero-initialize (not-yet-written parts of) output buffer if failure, and handle repeated calls to decoding same tile/strip if previous failure occured 2024-05-26 19:48:58 +02:00
Even Rouault a455f07aa0 LZWDecode: zero-initialize (not-yet-written parts of) output buffer if failure 2024-05-26 19:48:23 +02:00
Even Rouault 28c38d648b TIFFRead[Scanline/EncodedStrip/EncodeTile]: 0-initialize output buffer if setupdecode fails
Fixes #375
2024-05-26 19:47:19 +02:00
Su_Laus 00a7af3b4c Text for RFC 2: Restoring needed libtiff tools - file added to doc/Makefile.am and rebased. 2024-05-25 21:02:43 +02:00
Su_Laus 969ec37b5d Text for RFC 2: Restoring needed libtiff tools - approved with voting history updated. 2024-05-25 20:59:59 +02:00
Su_Laus e3b387e000 Text for RFC 2: Restoring needed libtiff tools - further amended 2024-05-25 20:59:59 +02:00
Su_Laus c785239cdc Text for RFC 2: Restoring needed libtiff tools - amended 2024-05-25 20:59:58 +02:00
Su_Laus aed77c7271 Text for RFC 2: Restoring needed libtiff tools 2024-05-25 20:59:58 +02:00
Even Rouault 9676263f0a Merge branch 'tiff2pdf_539' into 'master'
fix tiff2pdf issue #539; however, there certainly remain many JPEG-compressed...

See merge request libtiff/libtiff!597
2024-05-23 17:30:44 +00:00
Lee Howard a6db4dba26 tiff2pdf: fix issue with JPEG restart-interval marker when converting from JPEG-compressed files
Fixes #539

however, there certainly remain many JPEG-compressed TIFFs which tiff2pdf will fumble without disabling data passthrough (using the -n option) - I supect that it has to do with the JPEG tables being removed from the JPEG and placed into the TIFF headers - as tiff2pdf would need to put these back into the JPEG instead of just passing the data through to the PDF
2024-05-23 17:30:43 +00:00
Even Rouault d4149c6ea0 Merge branch 'test_fix' into 'master'
test/Makefile.am: make sure that all test images are bundled by make dist even...

See merge request libtiff/libtiff!626
2024-05-22 20:47:26 +00:00
Even Rouault a47d88dfe5 Merge branch 'add_missing_rst_files' into 'master'
doc/Makefile.am: add rfcs/ files in rst_sources variable

See merge request libtiff/libtiff!624
2024-05-22 03:13:52 +00:00
Even Rouault ac0dc61642 test/Makefile.am: make sure that all test images are bundled by make dist even if JPEG or JBIG is not available 2024-05-22 04:38:00 +02:00
Even Rouault e41d6f7f6d Merge branch 'timothyl/32bpp-cmake-test' into 'master'
Add new test to CMake

See merge request libtiff/libtiff!625
2024-05-22 02:37:42 +00:00
Timothy Lyanguzov c8473efc35 Add new test to CMake
See previous merge request libtiff/libtiff!611
2024-05-22 14:20:57 +12:00
Even Rouault deb4fc9dc8 doc/Makefile.am: add rfcs/ files in rst_sources variable 2024-05-22 04:12:08 +02:00
Even Rouault 360f37108f Merge branch 'tiffcp_tiffcrop_RGB_YCbCr_tests' into 'master'
Add some basic sanity checks for tiffcp and tiffcrop RGB->YCbCr JPEG conversions.

See merge request libtiff/libtiff!611
2024-05-22 01:42:18 +00:00
Lee Howard 5d8db4b5af Add some basic sanity checks for tiffcp and tiffcrop RGB->YCbCr JPEG conversions. 2024-05-22 01:42:18 +00:00
Even Rouault 72bd93dd2b Merge branch 'tiffcp_LZW_JBIG_test' into 'master'
Add basic sanity check for tiffcp LZW->JBIG conversion.

See merge request libtiff/libtiff!612
2024-05-21 21:35:45 +00:00
Even Rouault 693d7bc0f5 Merge branch 'tiffcrop_masonwilde_fix' into 'master'
Apply "Fix heap-buffer-overflow in function extractImageSection"

See merge request libtiff/libtiff!613
2024-05-21 21:35:02 +00:00
Lee Howard cffd2852c4 tiffcrop: Apply "Fix heap-buffer-overflow in function extractImageSection"
https://gitlab.com/masonwilde/libtiff/-/commit/848434a81c443f59ec90d41218eba6e48a450a11

authored by zhailiangliang commit 848434a81c443f59ec90d41218eba6e48a450a11

The overflow conditions were previously addressed, but this provides additional error messages.
2024-05-21 21:35:02 +00:00
Even Rouault 845243dbf0 Merge branch 'fix_183_alternative' into 'master'
OJPEG: reset subsampling_convert_state =0 in OJPEGPreDecode (fixes tiff2pdf issue #183)

See merge request libtiff/libtiff!621
2024-05-21 21:33:30 +00:00
Even Rouault 178c3ec53e Merge branch 'thunder-fix' into 'master'
A fix for Thunder RLE

See merge request libtiff/libtiff!623
2024-05-21 21:28:51 +00:00
Timothy Lyanguzov 7dc39d1820 A fix for Thunder RLE
The commit https://gitlab.com/robinwatts/libtiff/-/commit/be0519ca3d222c19008fe160873f3b5c28e6b36b states:

Thunder RLE can fail to decode last run. Bug seen with GhostPDL. Decode of test tif file gives valgrind errors due to the "thunder decode" failing to extract the final run of compressed pixels.

The logic in the decoder, presumably intended to spot overruns of data, is incorrect in that runs that end at the end of a row (npixels == maxpixels) will not be decoded.

Fix this by limiting 'n', the number of pixels to copy. Note that npixels is updated by the 'unlimited' value to ensure the error reporting at the end of the loop still works.
2024-05-21 21:28:51 +00:00
Even Rouault 80b47cbc63 Merge branch 'tiff2ps_fax2tiff_476' into 'master'
fix fax2ps and fax2tiff bugs #476

See merge request libtiff/libtiff!598
2024-05-18 16:17:10 +00:00
Lee Howard 462f1f475f Fix fax2ps and fax2tiff memory leaks.
Fixes #476
2024-05-18 16:17:10 +00:00
Even Rouault f3d5c259a5 Merge branch 'tiff2rgba_469' into 'master'
fix tiff2rgba issue #469

See merge request libtiff/libtiff!600
2024-05-17 17:40:04 +00:00
Even Rouault 0d92971bcb Merge branch 'formatting-fixes' into 'master'
Formatting fixes

See merge request libtiff/libtiff!622
2024-05-17 16:45:38 +00:00
Even Rouault 699c7d4cbd Formatting fixes 2024-05-17 18:45:05 +02:00
Even Rouault fb0adc29d6 Merge branch 'coverity_fixes' into 'master'
3 Coverity Scan fixes in tools & contrib

See merge request libtiff/libtiff!592
2024-05-17 16:35:41 +00:00
Even Rouault 8528b2efcc Merge branch 'tiff2pdf_596' into 'master'
tiff2pdf issue #596

See merge request libtiff/libtiff!594
2024-05-17 16:35:20 +00:00
Even Rouault c798b6d73e Merge branch 'tiffdither_473' into 'master'
fix tiffdither bug #473

See merge request libtiff/libtiff!599
2024-05-17 16:32:27 +00:00
Even Rouault e0523817f3 Merge branch 'fax2tiff_468' into 'master'
fix fax2tiff issue #468

See merge request libtiff/libtiff!601
2024-05-17 16:26:38 +00:00
Even Rouault dee840de72 Merge branch 'tiff2rgba_background' into 'master'
Add background gradient option for tiff2rgba alpha compositing.

See merge request libtiff/libtiff!610
2024-05-17 16:26:07 +00:00
Lee Howard 5da038136c Add background gradient option for tiff2rgba alpha compositing. 2024-05-17 16:26:07 +00:00
Even Rouault 7f785d921a Merge branch 'tiff2pdf_253' into 'master'
Fix tiff2pdf issue #253 - red and blue were being swapped for RGBA decoding

See merge request libtiff/libtiff!603
2024-05-17 16:19:50 +00:00
Even Rouault 5abbbaa014 Merge branch 'fax2tiff_249' into 'master'
Fix fax2tiff issue #249, unreasonable width input

See merge request libtiff/libtiff!604
2024-05-17 16:15:46 +00:00
Even Rouault b72ff5be4e Merge branch 'tiffcp_tiffcrop_228' into 'master'
correct tiffcp and tiffcrop issue #228

See merge request libtiff/libtiff!605
2024-05-17 16:15:01 +00:00
Even Rouault 4d80f0a0c7 OJPEG: reset subsampling_convert_state =0 in OJPEGPreDecode (fixes tiff2pdf issue #183) 2024-05-17 18:06:02 +02:00
Even Rouault bbd0873cff Merge branch 'fax2tiff_191' into 'master'
Fix fax2tiff issue #191 - EOFB interpretation

See merge request libtiff/libtiff!606
2024-05-17 15:52:23 +00:00
Even Rouault de4eb41ff3 Merge branch 'tiff2pdf_98' into 'master'
Fix tiff2pdf documentation issue #98

See merge request libtiff/libtiff!608
2024-05-17 15:26:52 +00:00
Even Rouault 29d7641553 Merge branch 'tiffgt_warning' into 'master'
Avoids a warning regarding fallthrough.

See merge request libtiff/libtiff!609
2024-05-17 15:25:31 +00:00
Even Rouault 1b74e216e7 Merge branch 'tiffcrop_542_550_552' into 'master'
tiffcrop: fixes #542, #550, #552 (buffer overflows, use after free)

See merge request libtiff/libtiff!595
2024-05-17 15:11:10 +00:00
Lee Howard a20298c478 tiffcrop: fixes #542, #550, #552 (buffer overflows, use after free) 2024-05-17 15:11:10 +00:00
Even Rouault 1398819a20 Merge branch 'Fedora_am_version' into 'master'
libtiff-am-version.patch from Fedora stating:

See merge request libtiff/libtiff!617
2024-05-17 14:29:37 +00:00
Even Rouault c0b80d25ec Merge branch 'formatting-fixes' into 'master'
Code formatting fixes

See merge request libtiff/libtiff!620
2024-05-17 13:02:47 +00:00
Even Rouault 8833b848d3 Code formatting fixes
Result of running ``pre-commit run --all``
2024-05-17 15:01:55 +02:00
Even Rouault 9a23b3c4c5 Merge branch 'sphinx_quotes_dashes' into 'master'
Don't let Sphinx inconsistently alter quotes and dashes in rst files.

See merge request libtiff/libtiff!615
2024-05-17 12:57:32 +00:00
Even Rouault c4b8c35a84 Merge branch 'tiffmedian_599' into 'master'
tiffmedian issue #599

See merge request libtiff/libtiff!593
2024-05-17 12:52:30 +00:00
Lee Howard 04118f8a42 tiffmedian: fix memory leaks
Closes #599
2024-05-17 12:52:30 +00:00
Even Rouault 3f84a2b453 Merge branch 'more_spelling_corrections' into 'master'
Typo fixes following...

See merge request libtiff/libtiff!618
2024-05-17 12:49:22 +00:00
Lee Howard 51d00bc6d5 Typo fixes following https://gitlab.com/libtiff/libtiff/-/commit/c95c77350820e19c8e273925bc97259727d19695 2024-05-16 16:43:45 -07:00
Lee Howard dfb4383686 libtiff-am-version.patch from Fedora stating:
Back off the minimum required automake version to 1.11.  There isn't
anything in libtiff currently that actually requires 1.12, and changing
this allows the package to be built on pre-F18 machines for easier testing.
2024-05-16 12:54:47 -07:00
Lee Howard e1fee35139 Don't let Sphinx inconsistently alter quotes and dashes in rst files.
Author: Laszlo Boszormenyi (GCS) <gcs@debian.org>
Bug-Debian: https://bugs.debian.org/1028456
2024-05-16 12:52:32 -07:00
Lee Howard d4253ba1d3 Add basic sanity check for tiffcp LZW->JBIG conversion. 2024-05-16 12:43:09 -07:00
Lee Howard 6c40341116 Avoids a warning regarding fallthrough. 2024-05-16 12:35:48 -07:00
Lee Howard 8825c4b021 Fix tiff2pdf documentation issue #98 2024-05-16 12:33:13 -07:00
Lee Howard dfd5e8fda0 Fix fax2tiff issue #191 - EOFB interpretation 2024-05-16 12:30:04 -07:00
Lee Howard 41bb7c3a85 Update tiffcp.c 2024-05-16 19:26:59 +00:00
Lee Howard dee5bda6c0 Correct tiffcrop output of RGB JPEG and tiffcp/tiffcrop documentation - issue #228 2024-05-16 12:11:14 -07:00
Lee Howard 251395dd28 Fix tiffcp and tiffcrop issue 228 - step 1 2024-05-16 12:11:10 -07:00
Lee Howard 58b32c8ea6 Fix fax2tiff issue #249, unreasonable width input 2024-05-16 12:08:09 -07:00
Lee Howard d753cc15a2 Fix tiff2pdf issue #253 - red and blue were being swapped for RGBA decoding 2024-05-16 12:06:39 -07:00
Lee Howard 928fc695df fix fax2tiff issue #468 2024-05-16 11:39:47 -07:00
Lee Howard 6c778e6b1f fix tiff2rgba issue #469 2024-05-16 11:38:00 -07:00
Lee Howard d7bdca8c4b fix tiffdither bug #473 2024-05-16 11:36:12 -07:00
Lee Howard 99554bc7b7 tiff2pdf issue #596 2024-05-16 10:57:00 -07:00
Even Rouault 2454463357 contrib/addtiffo: validate return of TIFFWriteEncodedXXXX() calls (CID 1024680) 2024-05-16 18:50:46 +02:00
Even Rouault 4b0bbcfacf tiffdump.c: fix wrong printf formattre in error message (CID 1472932) 2024-05-16 18:49:50 +02:00
Even Rouault 6fd7d51025 tiffset.c: avoid false positive Coverity Scan warning on 64-bit builds (CID 1518997) 2024-05-16 18:49:21 +02:00
Even Rouault e924dd999f Merge branch 'master' into 'master'
Fix some Coverity warnings.

See merge request libtiff/libtiff!590
2024-05-16 16:13:28 +00:00
Lee Howard b4ca093e73 Fix some Coverity warnings. 2024-05-16 16:13:28 +00:00
Even Rouault b94c2313ce Merge branch 'revert_tools_removement' into 'master'
Restore tools from archive and unsupported and tiffcp -i option with revert.

See merge request libtiff/libtiff!589
2024-05-13 15:42:26 +00:00
Su_Laus a6cd5e5960 Apply some newer changes to the reverted code and prepare note for 4.7.0. 2024-05-11 17:03:29 +02:00
Su_Laus 1c3ecce849 Revert "Remove -i option (ignore errors) from tiffcp, because almost all fuzzer issues were consequential errors from ignored errors because of the "-i" option."
This reverts commit 280a568ae8.
2024-05-11 16:52:35 +02:00
Su_Laus 9ab54a8580 Revert "Move most TIFF tools to archive and keep some as unsupported (see #580)."
This reverts commit eab89a627f.

# Conflicts:
#	tools/unsupported/CMakeLists.txt
#	tools/unsupported/tif_tools-unsupported_versioninfo.rc
2024-05-11 16:49:55 +02:00
Even Rouault 2af10009a5 Merge branch 'calloc-transposed-args' into 'master'
Fix -Werror=calloc-transposed-args with gcc 14

See merge request libtiff/libtiff!588
2024-05-10 14:40:56 +00:00
Even Rouault 2d1e74dbd1 Fix -Werror=calloc-transposed-args with gcc 14 2024-05-10 15:38:55 +02:00
Even Rouault 20503843ab Merge branch 'EvaluateIFDdatasizeReading_ossfuzz_68327' into 'master'
EvaluateIFDdatasizeReading(): avoid unsigned integer overflow (master only)

See merge request libtiff/libtiff!586
2024-05-09 17:48:51 +00:00
Even Rouault ce1477da0b EvaluateIFDdatasizeReading(): avoid unsigned integer overflow (master only)
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=68327
2024-04-27 12:57:03 +02:00
Even Rouault cf0bdb6729 Merge branch 'ci-appveyor-cygwin-upgrade' into 'master'
appveyor: Upgrade cygwin packages

See merge request libtiff/libtiff!585
2024-04-25 14:59:03 +00:00
Roger Leigh b4acdea3e7 appveyor: Upgrade cygwin packages 2024-04-25 13:40:25 +01:00
Even Rouault 1ae923da26 Merge branch 'libjpeg_turbo_3_0' into 'master'
Change messages/comments refering libjpeg-turbo 2.2 to 3.0

See merge request libtiff/libtiff!584
2024-04-25 11:12:55 +00:00
Even Rouault a56c5a0975 Change messages/comments refering libjpeg-turbo 2.2 to 3.0
libjpeg-turbo 2.2 was actually released as 3.0. Reflect that
2024-04-24 22:42:54 +02:00
Even Rouault b2387f3324 Merge branch 'EvaluateIFDdatasizeReading_unsigned_int_overflow_fix' into 'master'
EvaluateIFDdatasizeReading(): avoid potential unsigned integer overflow on corrupted tag

See merge request libtiff/libtiff!582
2024-04-22 18:10:54 +00:00
Even Rouault 87d39ea1b9 EvaluateIFDdatasizeReading(): avoid potential unsigned integer overflow on corrupted tag 2024-04-22 18:10:54 +00:00
Even Rouault c503d6a65b Merge branch 'tif_dir_logging-627' into 'master'
tif_dir.c: Log source file, line number, and input tif for directory count error.

Closes #627

See merge request libtiff/libtiff!583
2024-04-22 11:14:46 +00:00
Kurt Schwehr 358b1938e1 tif_dir.c: Log source file, line number, and input tif for directory count error. 2024-04-22 11:14:46 +00:00
Even Rouault c5c9e6f077 Merge branch 'fix_readrgbastrip_fpe' into 'master'
Avoiding FPEs (division by zero) in tif_getimage.c

See merge request libtiff/libtiff!580
2024-04-14 10:01:26 +00:00
Zurab Tsinadze 5e9d713ed4 Avoid FPEs (division by zero) in tif_getimage.c 2024-04-09 23:52:40 +02:00
Even Rouault 5ebecad3d4 Merge branch 'appveyor-vs2022' into 'master'
appveyor: Add VS2022 builds

See merge request libtiff/libtiff!579
2024-04-06 20:39:25 +00:00
Roger Leigh 91d24c2585 appveyor: Add VS2022 builds 2024-04-06 20:39:25 +00:00
Roger Leigh a4a26fc753 Merge branch 'appveyor-mingw-fix' into 'master'
appveyor: Use MinGW-w64

See merge request libtiff/libtiff!578
2024-04-04 10:07:54 +00:00
Roger Leigh e217f9d5a0 appveyor: Use MinGW-w64 2024-04-04 10:47:11 +01:00
Even Rouault 4d019acf96 Merge branch 'update_rfc1_status' into 'master'
RFC1: update status to adopted

See merge request libtiff/libtiff!577
2024-04-03 20:24:42 +00:00
Even Rouault a571789645 RFC1: update status to adopted 2024-04-03 21:53:59 +02:00
Even Rouault 6b9cb37577 Merge branch 'rfc1_psc' into 'master'
Doc: add 'RFC 1: Project Steering Committee Guidelines' and a PSC page

See merge request libtiff/libtiff!566
2024-04-03 12:23:37 +00:00
Even Rouault 5a8e565482 Doc: add 'RFC 1: Project Steering Committee Guidelines' and a PSC page 2024-04-03 12:23:37 +00:00
Even Rouault 395a3c881b Merge branch 'fix_coverity_test_directory_expansion' into 'master'
Fix coverity scan issue in test_directory.c

See merge request libtiff/libtiff!576
2024-04-02 20:05:53 +00:00
Su_Laus e79965bbe7 Fix coverity scan issue in test_directory.c 2024-04-02 21:56:21 +02:00
Even Rouault 307afbc66d Merge branch 'typo_fixes' into 'master'
Various typo fixes

See merge request libtiff/libtiff!575
2024-04-02 08:15:44 +00:00
Even Rouault c95c773508 Various typo fixes 2024-04-02 02:21:50 +02:00
Even Rouault cc5f3312a7 Merge branch 'test_directory_expansion_endianness' into 'master'
Enhance test_directory.c with big-endian and little-endian test cases

See merge request libtiff/libtiff!574
2024-03-31 15:23:54 +00:00
Su_Laus c69be56bce Enhance test/test_directory.c with big-endian and little-endian test cases.
Insert testcase into test_directory.c for #618 "Failure in TIFFSetSubDirectory() will break subsequent TIFFSetDirectory() calls".
2024-03-30 19:45:33 +01:00
Even Rouault c662851405 Merge branch 'correct_coverity_issues_from_avoid_IFD_overwriting' into 'master'
Correct some coverity issues from "avoid IFD overwriting"

See merge request libtiff/libtiff!573
2024-03-29 13:01:38 +00:00
Su_Laus e1ab15b90b Correct some coverity issues from "avoid IFD overwriting". 2024-03-29 12:15:21 +01:00
Even Rouault ffb7c45730 Merge branch 'fix_gdal_9548' into 'master'
LERC codec: deal with issues with multi-band PlanarConfig=Contig and NaN values

See merge request libtiff/libtiff!572
2024-03-28 18:43:09 +00:00
Even Rouault f46f73ba1a Merge branch 'avoid_IFD_overwriting_other_data_TIFFWriteDirectory' into 'master'
TIFFWriteDirectory: Avoid overwriting following data if an IFD is enlarged.

See merge request libtiff/libtiff!565
2024-03-26 22:17:05 +00:00
Su Laus 4c809ccf16 TIFFWriteDirectory: Avoid overwriting following data if an IFD is enlarged.
Avoid overwriting other data if an IFD that has already been written is enlarged. If entries are to be changed in an IFD that has already been written to the file, the memory area can be overwritten as long as the IFD data volume has not increased. Otherwise, the IFD must be written to a different location in the file. Up to now, LibTIFF has simply overwritten the IFD and other data areas in the file.

With this MR, the size of the IFD, and location of IFD data, is tracked and checked if the IFD can be safely overwritten or has to be re-written to another location.
2024-03-26 22:17:04 +00:00
Even Rouault e414a9d579 LERC codec: deal with issues with multi-band PlanarConfig=Contig and NaN values
Fixes https://github.com/OSGeo/gdal/issues/9530.
Cf https://github.com/OSGeo/gdal/pull/9548 for the GDAL specific fix.

The LERC codec up-to-now didn't do any special processing when writing a strile
in a multi-band PlanarConfig=Contig file, resulting in corruptions. Now we
generate a mask buffer in that situation. Actually, if the NaN values are not
at the same location accross bands, we need to write one mask-per-band, which
requires liblerc >= 3.0, and in that situation change the LERC blob to
multi-band instead of multi-depth/dim, with liblerc >= 3.0. When all bands have
NaN values at the same location, we generate a single mask, which is compatible
of liblerc < 3.0, but requires at last this version of libtiff to be read. This
is the best solution we come with to fix the issue while having the maximum
backward compatibility.
2024-03-24 18:14:00 +01:00
Even Rouault af3dfc78a4 Merge branch 'harmonize_TIFFheader_swapping' into 'master'
Correct and harmonize swapping of internal 'tif_header' parameters.

See merge request libtiff/libtiff!571
2024-03-24 14:35:42 +00:00
Su Laus 3c8480e3b7 Correct and harmonize swapping of internal 'tif_header' parameters. 2024-03-24 14:35:42 +00:00
Even Rouault bb1ff4f80e Merge branch 'chore/printf-format-specifiers' into 'master'
chore: use correct format specifiers

See merge request libtiff/libtiff!570
2024-03-19 08:37:46 +00:00
Tom 8ce83e402f chore: use correct format specifiers
When building on my Mac, I get the following warnings:

    libtiff/tools/tiffcp.c:154:24: warning: format specifies type 'unsigned short' but the argument has type 'tdir_t' (aka 'unsigned int') [-Wformat]
                    comma, nextImage);
                           ^~~~~~~~~
    libtiff/tools/tiffcp.c:1295:39: warning: format specifies type 'unsigned short' but the argument has type 'tdir_t' (aka 'unsigned int') [-Wformat]
                      TIFFFileName(bias), TIFFCurrentDirectory(bias),
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    libtiff/tools/tiffcp.c:1296:37: warning: format specifies type 'unsigned short' but the argument has type 'tdir_t' (aka 'unsigned int') [-Wformat]
                      TIFFFileName(in), TIFFCurrentDirectory(in));
                                        ^~~~~~~~~~~~~~~~~~~~~~~~
    libtiff/tools/tiffcp.c:1303:37: warning: format specifies type 'unsigned short' but the argument has type 'tdir_t' (aka 'unsigned int') [-Wformat]
                      TIFFFileName(in), TIFFCurrentDirectory(in));
                                        ^~~~~~~~~~~~~~~~~~~~~~~~
    libtiff/tools/tiffsplit.c:174:21: warning: format specifies type 'long long' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                        path_len);
                        ^~~~~~~~

This updates the format specifiers from `PRIu16` to `PRIu32` for `tdir_t`
(which is a `typdef`ed `uint32_t`) and from `TIFF_SSIZE_FORMAT` to
`TIFF_SIZE_FORMAT` for `size_t`, which makes sense given that it's an unsigned
type.
2024-03-19 19:31:54 +11:00
Even Rouault 2005dbb4f8 Merge branch 'fix_628_FPE_at_TIFFhowmany' into 'master'
Avoiding FPE (division by zero) for TIFFhowmany_32() and TIFFhowmany_64()...

Closes #628

See merge request libtiff/libtiff!568
2024-03-16 17:23:51 +00:00
Su_Laus 021a737bfa Avoiding FPE (division by zero) for TIFFhowmany_32() and TIFFhowmany_64() macros by checking for denominator not zero before macros are executed.
Fixes #628.
2024-03-15 15:47:29 +01:00
Even Rouault 025467ab01 Merge branch 'fix_wrong_return_TIFFIsBigTIFF_if_swapping_case' into 'master'
Fix wrong return of TIFFIsBigTIFF() in case byte-swapping is acitve

See merge request libtiff/libtiff!567
2024-03-14 20:35:13 +00:00
Su_Laus 562bfcad1d Fix wrong return of TIFFIsBigTIFF() in case byte-swapping is acitve (i.e. little endian image on a big endian machine). 2024-03-13 19:58:04 +01:00
Even Rouault 1d28fe6380 Merge branch 'master' into 'master'
Setting the TIFFFieldInfo field `set_field_type` should consider `field_writecount` not `field_readcount`

See merge request libtiff/libtiff!544
2024-01-30 20:59:04 +00:00
Timo Stüber cee5e991e5 Setting the TIFFFieldInfo field set_field_type should consider field_writecount not field_readcount
In most of the cases the field_writecount and field_readcount of the TIFFFieldInfo are equal. But they do not have to be the same.

I encountered this issues when using an older release of Pillow. Since they use custom fields for decoding only, they set the readcount value to 0. As the result _TIFFSetGetType can not identify the type correctly and set TIFF_SETGET_UNDEFINED.

Error Message:
```
TIFFLib: _TIFFWriteDirectorySec(): Rational2Double: .set_field_type is not 4 but 1.
```

During the execution of TIFFMergeFieldInfo the fields get_field_type and set_field_type set. I guess the set_field_type should dependent on the field_writecount.
2024-01-30 20:59:04 +00:00
Even Rouault 25bad3798f Merge branch 'avoid_memory_leaks_using_TIFFCreateDirectory' into 'master'
Avoiding memory leaks when using TIFFCreateDirectory()

See merge request libtiff/libtiff!563
2024-01-24 20:54:00 +00:00
Su_Laus 376916d25f Avoiding memory leaks when using TIFFCreateDirectory() by releasing the allocated memory in the tif-structure. 2024-01-24 20:42:34 +01:00
Even Rouault e0f66bf0c2 Merge branch 'WIN32' into 'master'
Use #ifdef _WIN32 to test for Windows, and tiffio.h: remove definition of __WIN32__

See merge request libtiff/libtiff!562
2024-01-10 13:18:19 +00:00
Even Rouault f964953812 test/raw_decode.c: remove likely ifdef tricks related to old compilers or unusual setups 2024-01-08 13:49:02 +01:00
Even Rouault 10fe25bddf tif_jpeg.c/tif_ojpeg.c: remove likely ifdef tricks related to old compilers or unusual setups 2024-01-08 12:20:51 +01:00
Even Rouault 19af4e4ab5 Remove _TIFFUInt64ToFloat() and _TIFFUInt64ToDouble() 2024-01-08 12:20:51 +01:00
Even Rouault 97e9225fa5 Remove support for _MSC_VER < 1500 2024-01-08 12:20:51 +01:00
Even Rouault 651b14ffa9 Use #ifdef _WIN32 to test for Windows, and tiffio.h: remove definition of __WIN32__ 2024-01-07 23:14:24 +01:00
Even Rouault 0c74f424b1 Merge branch 'fix_579_non_terminated_ASCII_deletes_one_byte' into 'master'
Fixed issue with non-terminated ASCII arrays where the last character is overwritten (fixes #579)

Closes #579

See merge request libtiff/libtiff!561
2023-12-20 20:10:09 +00:00
Su_Laus 5fd944398f For non-terminated ASCII arrays, the buffer is first enlarged before a NULL is set at the end to avoid deleting the last character. Fixes #579.
Some editorials in tif_dir.c.
2023-12-20 20:57:40 +01:00
Even Rouault 3705f82b64 Merge branch 'fix_624_check_TIFFCreateAnonField_return' into 'master'
Fix 624: Check return value of _TIFFCreateAnonField()

Closes #624

See merge request libtiff/libtiff!560
2023-12-09 17:04:23 +00:00
Su_Laus 818fb8ce88 Check return value of _TIFFCreateAnonField().
Fixes #624
2023-12-01 20:27:26 +01:00
Even Rouault 9d9c83d279 Merge branch 'TIFFOpenOptionsSetMaxCumulatedMemAlloc' into 'master'
Add TIFFOpenOptionsSetMaxCumulatedMemAlloc()

See merge request libtiff/libtiff!556
2023-11-27 00:07:47 +00:00
Even Rouault f53258e4bb Add TIFFOpenOptionsSetMaxCumulatedMemAlloc()
This function complements ``TIFFOpenOptionsSetMaxSingleMemAlloc()`` to define the maximum cumulated memory allocations in byte, for a given TIFF handle, that libtiff internal memory allocation functions are allowed.
2023-11-27 00:07:46 +00:00
Even Rouault 3dff9205c1 Merge branch 'unity_clang_fixes' into 'master'
Fixes to avoid CLang warnings on unity builds

See merge request libtiff/libtiff!558
2023-11-23 15:55:17 +00:00
Even Rouault 9d62554d07 Fixes to avoid CLang warnings on unity builds 2023-11-23 16:40:01 +01:00
Even Rouault 3375c9aef3 Merge branch 'cmake_UNITY_BUILD' into 'master'
Changes to allow building with cmake -DCMAKE_UNITY_BUILD=ON

See merge request libtiff/libtiff!557
2023-11-22 22:16:59 +00:00
Even Rouault 4e2a38d58a CI: test -DCMAKE_UNITY_BUILD=ON 2023-11-22 21:09:46 +01:00
Even Rouault 2a78a5bcfb Changes to allow building with cmake -DCMAKE_UNITY_BUILD=ON 2023-11-22 21:09:46 +01:00
Even Rouault 67e5cfe29a Merge branch 'manpage_506_TIFFClose_check_with_TIFFFlush' into 'master'
manpage: Note on using TIFFFlush() before TIFFClose()

Closes #506

See merge request libtiff/libtiff!555
2023-11-22 16:21:06 +00:00
Su_Laus 85a286648d manpage: Note on using TIFFFlush() before TIFFClose() to check that the data has been successfully written to the file.
Closes #506
2023-11-16 20:54:00 +01:00
Even Rouault 6791bff9f7 Merge branch 'manpage_621_TIFFOpenOptionsSetMaxSingleMemAlloc' into 'master'
manpage: Update TIFF documentation about TIFFOpenOptions.rst and memory limitting.

Closes #621

See merge request libtiff/libtiff!553
2023-11-11 16:31:27 +00:00
Even Rouault 393bed45bd Merge branch 'rectify_some_shadowed_declarations' into 'master'
Rectify some shadowed declarations and warnings in tools and test modules.

See merge request libtiff/libtiff!552
2023-11-11 16:30:00 +00:00
Even Rouault c7d27f3758 Merge branch 'fix_TIFFRealloc_usage_to_TIFFReallocExt' into 'master'
Change internally used _TIFFRealloc() to _TIFFReallocExt()

See merge request libtiff/libtiff!554
2023-11-11 16:29:18 +00:00
Su_Laus b87fadea8e Change internally used _TIFFRealloc() to _TIFFReallocExt(), which respects the TIFFOpenOptionsSetMaxSingleMemAlloc() limit. 2023-11-11 17:18:53 +01:00
Timothy Lyanguzov 16ab4a205c Fix typo. 2023-11-11 15:25:38 +00:00
Su_Laus 335947359c manpage: Update TIFF documentation about TIFFOpenOptions.rst and TIFFOpenOptionsSetMaxSingleMemAlloc() usage and some other small fixes. 2023-11-09 22:17:26 +01:00
Su_Laus 68d62c65a0 Rectify some shadowed declarations and warnings in tools and test modules. 2023-11-08 20:57:50 +01:00
Even Rouault cf118ec82e Merge branch 'fix_583' into 'master'
tif_fax3.c: error out after a number of times end-of-file has been reached (fixes #583)

Closes #583

See merge request libtiff/libtiff!547
2023-11-04 13:54:25 +00:00
Even Rouault dfacff5a84 Merge branch 'fix_622' into 'master'
TIFFReadRGBAStrip/TIFFReadRGBATile: add more validation of col/row (fixes #622)

Closes #622

See merge request libtiff/libtiff!546
2023-11-04 13:53:15 +00:00
Even Rouault 65feafdf64 Merge branch 'extra_limit_getfilesize' into 'master'
tif_dirread.c: only issue TIFFGetFileSize() for large enough RAM requests

See merge request libtiff/libtiff!551
2023-10-31 20:45:10 +00:00
Even Rouault dbb825a831 tif_dirread.c: only issue TIFFGetFileSize() for large enough RAM requests 2023-10-31 21:30:58 +01:00
Even Rouault ea185ba31a Merge branch 'TIFFFetchDirectory_remove_useless_check' into 'master'
TIFFFetchDirectory(): remove useless allocsize vs filesize check

See merge request libtiff/libtiff!550
2023-10-31 19:28:13 +00:00
Even Rouault de7bfd7d43 TIFFFetchDirectory(): remove useless allocsize vs filesize check
CoverityScan rightly points that the max value for dircount16 * dirsize
is 4096 * 20. That's small enough not to do any check
2023-10-31 20:13:48 +01:00
Even Rouault e7b57edcbf Merge branch 'limit_getfilesize' into 'master'
tif_dirread.c: only issue TIFFGetFileSize() for large enough RAM requests

See merge request libtiff/libtiff!549
2023-10-31 19:03:21 +00:00
Even Rouault 0b02532471 tif_dirread.c: only issue TIFFGetFileSize() for large enough RAM requests
Ammends 5320c9d89c

This fixes a performance regression caught by the GDAL regression test
suite.
2023-10-31 19:47:25 +01:00
Even Rouault ce3d768b4d Merge branch 'tif_dirread-typo' into 'master'
tif_dirread.c: Fix typo: greather -> greater

See merge request libtiff/libtiff!548
2023-10-31 16:24:05 +00:00
Kurt Schwehr 55a8ed454b tif_dirread.c: Fix typo: greather -> greater 2023-10-31 09:14:49 -07:00
Even Rouault 4728ce9b8e Merge branch 'fix_614_check_mem_allocation_vs_filelength' into 'master'
Prevent some out-of-memory attacks

See merge request libtiff/libtiff!545
2023-10-31 15:43:31 +00:00
Su Laus 5320c9d89c Prevent some out-of-memory attacks
Some small fuzzer files fake large amounts of data and provoke out-of-memory situations. For non-compressed data content / tags, out-of-memory can be prevented by comparing with the file size.

At image reading, data size of some tags / data structures (StripByteCounts, StripOffsets, StripArray, TIFF directory) is compared with file size to prevent provoked out-of-memory attacks.

See issue https://gitlab.com/libtiff/libtiff/-/issues/614#note_1602683857
2023-10-31 15:43:29 +00:00
Even Rouault 8d0bf12233 tif_fax3.c: error out after a number of times end-of-file has been reached (fixes #583) 2023-10-31 16:39:43 +01:00
Even Rouault 51558511bd TIFFReadRGBAStrip/TIFFReadRGBATile: add more validation of col/row (fixes #622) 2023-10-31 15:58:41 +01:00
Even Rouault a4db8cd398 Merge branch 'fix_failed_subdirectory_read' into 'master'
#618: ensure absolute seeking is forced independent

See merge request libtiff/libtiff!543
2023-10-30 20:31:09 +00:00
Manuel Massing 95994b65ea #618: ensure absolute seeking is forced independent
of TIFFReadDirectory success.

This fixes TIFFSetDirectory calls for the case where
TIFFReadDirectory was unsuccessful.
2023-10-25 15:35:40 +02:00
Even Rouault 3c7e2aff4f Merge branch 'cmake' into 'master'
CMake: Fix TIFF_INCLUDE_DIRS

See merge request libtiff/libtiff!541
2023-10-17 12:31:39 +00:00
Even Rouault d14d67ef38 Merge branch 'fix_616' into 'master'
tif_lzw.c: avoid warning about misaligned address with UBSAN (fixes #616)

Closes #616

See merge request libtiff/libtiff!542
2023-10-12 11:31:59 +00:00
Even Rouault 5769bfea8c Merge branch 'tiffcp_cancel_ycbcr' into 'master'
tiffcp: replace PHOTOMETRIC_YCBCR with PHOTOMETRIC_RGB when outputing to...

See merge request libtiff/libtiff!540
2023-10-12 11:31:45 +00:00
Even Rouault e1b4eef40f tif_lzw.c: avoid warning about misaligned address with UBSAN (fixes #616)
The branch suppressed by this commit wasn't useful as I've verified that
with -O2 and -O3 and gcc or clang, doing a memcpy() + _byteswap_uint64()
generates exactly the same code as _byteswap_uint64(*ptr).
The warning with UBSAN thus only comes from UBSAN generating special code
to catch the misalignment, but is unlikely to cause any issue in
practice given the above observation.
2023-10-12 12:38:58 +02:00
Julien Schueller f8498e2a9a CMake: Fix TIFF_INCLUDE_DIRS 2023-10-12 09:36:52 +02:00
Even Rouault 86d31b233b tiffcp: preserve TIFFTAG_REFERENCEBLACKWHITE when doing YCbCr JPEG -> YCbCr JPEG 2023-10-08 20:20:14 +02:00
Even Rouault 2cccf6d75b tiffcp: replace PHOTOMETRIC_YCBCR with PHOTOMETRIC_RGB when outputing to compression != JPEG (refs #571) 2023-10-07 00:40:50 +02:00
Even Rouault cfc9269c0a Merge branch 'kmilos-master-patch-42063' into 'master'
CMake: MinGW compilers don't need a .def file for shared library

See merge request libtiff/libtiff!448
2023-10-05 18:32:32 +00:00
Even Rouault efa56cdc07 Merge branch 'kmilos-master-patch-64997' into 'master'
CMake: move libdeflate and Lerc to Requires.private

See merge request libtiff/libtiff!536
2023-10-05 18:30:42 +00:00
Even Rouault 4be388f1a6 Merge branch 'clarify_archive' into 'master'
Doc: clarify unsupported (still in tarball) and archived (only in git) utilities

See merge request libtiff/libtiff!532
2023-10-05 18:27:50 +00:00
Even Rouault 6c4d39c6ed Merge branch 'fix_571_alternative' into 'master'
tiffcp: Setting the correct photometric interpretation for the output image...

Closes #571

See merge request libtiff/libtiff!539
2023-10-05 18:27:20 +00:00
Even Rouault 8c6676d883 tiffcp: do not copy tags YCBCRCOEFFICIENTS, YCBCRSUBSAMPLING, YCBCRPOSITIONING, REFERENCEBLACKWHITE. Only set TIFFTAG_YCBCRSUBSAMPLING when generating YCbCr JPEG 2023-10-04 22:35:50 +02:00
Even Rouault ef4a936e3e tiffcp: Setting the correct photometric interpretation for the output image when converting JPEG-YCBCR to JPEG-RGB images.
Closes #571
2023-10-04 22:35:50 +02:00
Miloš Komarčević 995763a316 CMake: move libdeflate and Lerc to Requires.private 2023-09-28 13:43:29 +02:00
Even Rouault 5e7c59d6a9 Merge branch 'kmilos-windres' into 'master'
CMake: enable resource compilation on all Windows

See merge request libtiff/libtiff!537
2023-09-27 20:29:37 +00:00
Miloš Komarčević 1fb779037d CMake: enable resource compilation on all Windows 2023-09-27 20:29:37 +00:00
Even Rouault 4d0329a453 Merge branch 'fix_608' into 'master'
tif_dirinfo.c: re-enable TIFFTAG_EP_CFAREPEATPATTERNDIM and TIFFTAG_EP_CFAPATTERN tags (fixes #608)

Closes #608

See merge request libtiff/libtiff!534
2023-09-15 10:07:06 +00:00
Even Rouault 49856998c3 tif_dirinfo.c: re-enable TIFFTAG_EP_CFAREPEATPATTERNDIM and TIFFTAG_EP_CFAPATTERN tags (fixes #608) 2023-09-15 10:07:06 +00:00
Even Rouault 668d2c1a52 Merge branch 'fix_606_tiffcp_check_also_input_compression_codec' into 'master'
tiffcp: Fixes #606. Check also codec of input image, not only from output image.

Closes #606

See merge request libtiff/libtiff!533
2023-09-09 15:11:42 +00:00
Su_Laus 1e7d217a32 Check also if codec of input image is available, independently from codec check of output image and return with error if not.
Fixes #606.
2023-09-09 15:45:47 +02:00
Even Rouault f56fbd4528 Doc: clarify unsupported (still in tarball) and archived (only in git) utilities 2023-09-08 14:18:07 +02:00
Even Rouault ed6f7be3ef Merge branch 'update_release_date' into 'master'
Update RELEASE-DATE

See merge request libtiff/libtiff!531
2023-09-08 09:13:29 +00:00
Even Rouault 8b20804fc0 Update RELEASE-DATE 2023-09-08 11:12:35 +02:00
Even Rouault 05b38946b1 Merge branch 'fix_605' into 'master'
autoconf.ac: fix detection of windows.h for mingw (fixes #605)

Closes #605

See merge request libtiff/libtiff!530
2023-09-08 09:11:54 +00:00
Even Rouault 341588333e autoconf.ac: fix detection of windows.h for mingw (fixes #605) 2023-09-07 22:40:59 +02:00
Even Rouault bb33843b63 Merge branch 'prepare_v4_6_0' into 'master'
Prepare for libtiff 4.6.0 release

See merge request libtiff/libtiff!528
2023-09-06 13:07:33 +00:00
Even Rouault f438759105 doc/index.rst: add warning about tools removal 2023-09-05 23:06:24 +02:00
Even Rouault b57c8b03ea Merge branch 'fix_603_readme_doc_reference_update' into 'master'
Update documentation reference within README.md. Fixes #603.

Closes #603

See merge request libtiff/libtiff!529
2023-09-05 16:30:16 +00:00
Su_Laus 32cbd32218 Update documentation reference within README.md. Fixes #603. 2023-09-05 18:13:47 +02:00
Even Rouault 5fd37d37e6 Fix references to mailing list 2023-09-05 18:00:43 +02:00
Even Rouault a4acea370f Prepare for libtiff 4.6.0 release 2023-09-05 15:04:12 +02:00
Even Rouault 5177b6a638 Merge branch 'fix_600' into 'master'
CMake: fix build with -Dstrip-chopping=off (fixes #600)

See merge request libtiff/libtiff!527
2023-09-05 09:57:38 +00:00
Even Rouault 7b3c170189 Merge branch 'georgthegreat-master-patch-87447' into 'master'
Fix using __attribute__ libtiff with clang-for-windows

See merge request libtiff/libtiff!525
2023-09-05 09:44:52 +00:00
Yuriy Chernyshov 36c522699b Fix using __attribute__ libtiff with clang-for-windows 2023-09-05 09:44:52 +00:00
Even Rouault 7d2df16340 Merge branch 'manpage_TIFFField_docu_update' into 'master'
manpages: TiffField functions documentation updated with return behaviour for...

See merge request libtiff/libtiff!526
2023-09-05 09:44:04 +00:00
Even Rouault f71fc35535 CMake: fix build with -Dstrip-chopping=off (fixes #600) 2023-09-05 11:42:19 +02:00
Even Rouault f0c1b25f4a Merge branch 'consistently_update_TIFF-version_from_configure-ac' into 'master'
Update CMake and autoconf scripts to consistently update LibTIFF version...

See merge request libtiff/libtiff!456
2023-09-03 18:11:13 +00:00
Su Laus 432a3b64ad Update CMake and autoconf scripts to consistently update LibTIFF version defines and references in various files when version definition in configure.ac has been changed.
- Move in tiffvers.h from .\libtiff source directory to .\libtiff  build directory.
- Remove unused version information from tif_config.h
- With every CMake build the version defines (e.g. 4.5.1) within tiffvers.h are consistently updated from configure.ac. The version release-date is taken from file RELEASE-DATE.
- The files VERSION and RELEASE-DATE are only updated with a special CMake target build: cmake --build . --target tiff_release.

- For autotools, version information is updated from configure.ac with ./autogen.sh. LIBTIFF_RELEASE_DATE is taken form file RELEASE-DATE.
- ./configure generates tiffvers.h with the cached version information and LIBTIFF_RELEASE_DATE.
- "make release" updates tiffvers.h and VERSION file with cached version info and RELEASE-DATE file and tiffves.h with the current date.
2023-09-03 18:11:13 +00:00
Su_Laus fc733c6a26 manpages: TiffField functions documentation updated with return behaviour for not defined tags and determination of write-/read-count size. 2023-08-28 17:07:53 +02:00
Even Rouault 07f922106b Merge branch 'change_long_to_int32_t_in_two_test_apps' into 'master'
Change "long" to "int32_t" in two test apps, because can be either int32_t or...

See merge request libtiff/libtiff!524
2023-08-22 20:54:15 +00:00
Su_Laus 12140bfdb2 Change "long" to "int32_t" in two test apps, because can be either int32_t or int64_t, depending on compiler and system. 2023-08-21 20:54:37 +02:00
Even Rouault 69eef88fc0 Merge branch 'CI_CMake_static_build' into 'master'
Add static build for CI/CD to run testcases which need private interface functions.

See merge request libtiff/libtiff!521
2023-08-16 13:03:22 +00:00
Even Rouault 4126f6d794 Merge branch 'fix_#597_tiffset_different_signedness' into 'master'
tiffset fix #597: warning: comparison of integer expressions of different signedness.

Closes #597

See merge request libtiff/libtiff!523
2023-08-16 13:02:24 +00:00
Even Rouault 83384f847f Merge branch 'tiffcp_remove_i_option' into 'master'
tiffcp: remove -i option (ignore errors)

See merge request libtiff/libtiff!522
2023-08-16 13:01:57 +00:00
Even Rouault 27b26dfcee Merge branch 'move_tools_to_unsupported_a_archive' into 'master'
Move most TIFF tools to archive and keep some as unsupported (see #580).

See merge request libtiff/libtiff!520
2023-08-16 13:01:04 +00:00
Su Laus eab89a627f Move most TIFF tools to archive and keep some as unsupported (see #580). 2023-08-16 13:01:04 +00:00
Su_Laus ca85b5f760 Add static build for CI/CD to run testcases which need private interface functions. 2023-08-12 16:51:44 +02:00
Su_Laus 91e7bd01d0 tiffset fix #597: warning: comparison of integer expressions of different signedness. 2023-08-12 16:38:23 +02:00
Su_Laus 280a568ae8 Remove -i option (ignore errors) from tiffcp, because almost all fuzzer issues were consequential errors from ignored errors because of the "-i" option. 2023-08-12 15:52:28 +02:00
Even Rouault 3225f137a9 Merge branch 'fix_585_test_write_read_tags_autoconf' into 'master'
Add missing test_write_read_tags.c and test_transferfunction_write_read.c in...

Closes #585

See merge request libtiff/libtiff!519
2023-08-11 11:58:22 +00:00
Even Rouault 4b54117c6d Fix copy paste error. 2023-07-24 19:23:58 +00:00
Su_Laus ce304fe647 Add missing test_write_read_tags.c and test_transferfunction_write_read.c in tarball (fixes #585) and correct „long“ issue.
Don't use "long" because can be int32_t or int64_t, depending on compiler and system.
2023-07-23 11:00:43 +02:00
Even Rouault 1dff4271ad Merge branch 'clang-format-tools' into 'master'
Automatically format with clang-format

See merge request libtiff/libtiff!518
2023-07-20 09:03:53 +00:00
Timothy Lyanguzov ac72178f1a Automatically format with clang-format 2023-07-20 13:30:59 +12:00
Even Rouault 73692ebdf8 Merge branch 'fix_589' into 'master'
TiffConfig.cmake.in: set TIFF_INCLUDE_DIR, TIFF_INCLUDE_DIRS and...

Closes #589

See merge request libtiff/libtiff!514
2023-07-19 22:05:16 +00:00
Even Rouault eabde1635a TiffConfig.cmake.in: set TIFF_INCLUDE_DIR, TIFF_INCLUDE_DIRS and... 2023-07-19 22:05:15 +00:00
Even Rouault 6ac40fefa1 Merge branch 'master-patch-6fc6' into 'master'
raw2tiff: fix integer overflow and bypass of the check (fixes #592)

See merge request libtiff/libtiff!516
2023-07-19 19:40:02 +00:00
Arie Haenel 6e2dac5f90 raw2tiff: fix integer overflow and bypass of the check (fixes #592) 2023-07-19 19:40:01 +00:00
Even Rouault add28aa361 Merge branch 'master-patch-05a4' into 'master'
tiffcp: fix memory corruption (overflow) on hostile images (fixes #591)

See merge request libtiff/libtiff!515
2023-07-19 19:34:25 +00:00
Arie Haenel 4fc16f649f tiffcp: fix memory corruption (overflow) on hostile images (fixes #591) 2023-07-19 19:34:25 +00:00
Even Rouault cb88a5b6bf Merge branch 'fix-numtrunc' into 'master'
fix numtrunc at tiff_dirread.c

See merge request libtiff/libtiff!512
2023-07-17 09:50:42 +00:00
headshog 54eeadb88b TIFFReadDirectoryCheckOrder: avoid integer overflow
When it occurs, it should be harmless in practice though
2023-07-17 09:50:42 +00:00
Even Rouault 74e8d3cf71 Merge branch 'webp_lossless_exact' into 'master'
WebP codec: turn exact mode when creating lossless files to avoid altering...

See merge request libtiff/libtiff!511
2023-07-17 08:46:34 +00:00
Even Rouault 6aeda415e0 WebP codec: turn exact mode when creating lossless files to avoid altering R,G,B values in areas where alpha=0
Fixes https://github.com/OSGeo/gdal/issues/8038
2023-07-11 21:10:56 +02:00
Even Rouault df547d0ee5 Merge branch 'webp_reg_fix' into 'master'
WebP decoder: fix error when reading a 3-band blob in a RGBA image

See merge request libtiff/libtiff!510
2023-07-05 10:51:12 +00:00
Even Rouault 130ef8d657 WebP decoder: fix error when reading a 3-band blob in a RGBA image
Fixes regression of 350ff161c8 (master only)
2023-07-05 12:29:17 +02:00
Even Rouault ccbdbd5258 Merge branch 'appveyor_fix' into 'master'
.appveyor.yml: workaround build error

See merge request libtiff/libtiff!509
2023-06-26 14:31:10 +00:00
Even Rouault 493d328e92 .appveyor.yml: workaround build error 2023-06-26 16:24:05 +02:00
Even Rouault e429387c54 Merge branch 'tif_webp_warning_fixes' into 'master'
tif_webp.c: fix signed vs unsigned comparison warnings (fix previous commit)

See merge request libtiff/libtiff!508
2023-06-26 13:25:39 +00:00
Even Rouault 1bcbc6bcf0 tif_webp.c: fix signed vs unsigned comparison warnings (fix previous commit) 2023-06-26 15:19:40 +02:00
Even Rouault f127333d8c Merge branch 'fix_TransferFunction_writing' into 'master'
Fix TransferFunction writing of only two transfer functions.

See merge request libtiff/libtiff!502
2023-06-26 08:43:59 +00:00
Even Rouault d1028f7a8d Merge branch 'fix_581_582' into 'master'
WebP decoder: validate WebP blob width, height, band count against TIFF parameters

Closes #582 et #581

See merge request libtiff/libtiff!507
2023-06-26 08:43:10 +00:00
Even Rouault 7f7258f25b Merge branch 'warning_cmake_config_file' into 'master'
v4.5.1 release note: add warning about CMake config file being preview

See merge request libtiff/libtiff!506
2023-06-19 11:00:24 +00:00
Even Rouault 350ff161c8 WebP decoder: validate WebP blob width, height, band count against TIFF parameters
to avoid use of uninitialized variable, or decoding corrupted content
without explicit error

Fixes #581, fixes #582
2023-06-17 16:24:56 +02:00
Even Rouault 9812658366 v4.5.1 release note: add warning about CMake config file being preview 2023-06-15 15:55:55 +02:00
Even Rouault df665f6077 Merge branch 'HOWTO-RELEASE-gitlab-release' into 'master'
HOWTO-RELEASE: mention creating a gitlab release

See merge request libtiff/libtiff!505
2023-06-14 16:01:04 +00:00
Even Rouault c2755a3d20 HOWTO-RELEASE: mention creating a gitlab release 2023-06-14 14:43:24 +02:00
Even Rouault 4f34a374b2 Merge branch 'TIFFOpenWExt_O_RDWR' into 'master'
TIFFOpenWExt(): mode r+ in the Windows implementation adjusted to that of Linux

See merge request libtiff/libtiff!504
2023-06-10 20:36:49 +00:00
Even Rouault e97e716e21 TIFFOpenWExt(): mode r+ in the Windows implementation adjusted to that of Linux 2023-06-10 22:35:51 +02:00
Even Rouault 5fc887f552 Merge branch 'fix_ossfuzz_59751' into 'master'
TIFFReadDirectory(): fix crash when reading tag TIFFTAG_EP_BATTERYLEVEL

See merge request libtiff/libtiff!503
2023-06-10 20:32:35 +00:00
Even Rouault 74bcfc74da TIFFReadDirectory(): fix crash when reading tag TIFFTAG_EP_BATTERYLEVEL
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=59751

In 738e0409 (refs #575), we disabled DNG / EP tags, but there was a
special proessing for TIFFTAG_EP_BATTERYLEVEL that must be disabled
since the tag is no longer defined.
2023-06-10 22:29:26 +02:00
Su_Laus 7b1f03c386 Fix TransferFunction writing of only two transfer functions.
The TIFFWriteDirectoryTagTransferfunction() function writes in some cases only two transfer functions, although only exactly one or exactly three transfer functions are allowed.
This then leads to an error when reading.
--> TIFFReadDirectory: Warning, Incorrect count for "TransferFunction"; tag ignored.

This MR corrects the behaviour of TIFFWriteDirectoryTagTransferfunction() accordingly. Furthermore, a possible buffer overflow is avoided.
2023-06-09 17:56:36 +02:00
Even Rouault b36bb2f9be Merge branch 'fix_win_build' into 'master'
Fix Windows build

Closes #578

See merge request libtiff/libtiff!501
2023-06-09 13:43:10 +00:00
Even Rouault 72187a0fb7 cmake/PkgConfig.cmake: avoid CMake error when prefix or suffix is empty 2023-06-09 15:40:17 +02:00
Even Rouault 70f8d926cc Add tif_win32_versioninfo.rc and tif_tools_versioninfo.rc to EXTRA_DIST 2023-06-09 15:39:38 +02:00
Even Rouault 78b1977875 Merge branch 'fix_coverity_build' into 'master'
build/gitlab-ci: fix coverity_build()

See merge request libtiff/libtiff!499
2023-06-09 12:57:34 +00:00
Even Rouault 56aa5d01e6 build/gitlab-ci: fix coverity_build() 2023-06-09 14:55:58 +02:00
Even Rouault 7583f9f3ed Merge branch 'v4.5.1rc1_preparation' into 'master'
Prepare release 4.5.1

See merge request libtiff/libtiff!498
2023-06-09 12:44:50 +00:00
Even Rouault 8e424c701e Prepare for v4.5.1 release 2023-06-09 14:38:34 +02:00
Even Rouault cff0aeba96 Merge remote-tracking branch 'sulaus/Rel_4.5.1_preparation' 2023-06-09 14:14:39 +02:00
Even Rouault 6ac0ab5064 Merge branch 'disable_dng_tags' into 'master'
tif_dirinfo.c: disable DNG 1.2->1.6 tags

Closes #575

See merge request libtiff/libtiff!497
2023-06-09 12:10:18 +00:00
Even Rouault e2ac7e48ac Merge branch 'fix_577' into 'master'
CMake related fixes

Closes #577

See merge request libtiff/libtiff!496
2023-06-09 12:09:43 +00:00
Even Rouault 738e04099b tif_dirinfo.c: disable DNG 1.2->1.6 tags
They were added per b90b20d36d but it has
been found in https://gitlab.com/libtiff/libtiff/-/issues/575 that it
could cause compatibity issues with libtiff users, so this addition
should be defered for a feature release (likely 4.6.0) and not a patch one.

Fixes #575
2023-06-07 22:30:30 +02:00
Timothy Lyanguzov b8d15d9dbe Apply 1 suggestion(s) to 1 file(s) 2023-06-05 23:23:50 +00:00
Even Rouault 97785f8527 CI: add testing of find_package(Tiff CONFIG) 2023-06-05 17:20:37 +02:00
Even Rouault 71c90a51bc CMake: export TiffConfig.cmake and TiffConfigVersion.cmake files 2023-06-05 17:20:37 +02:00
Even Rouault c978a6c3ea libtiff/CMakeLists.txt: fix export of INTERFACE_INCLUDE_DIRECTORIES 2023-06-05 17:20:37 +02:00
Even Rouault 50eab58d6e libtiff/CMakeLists.txt: correctly define TIFF::tiff alias (fixes #577) 2023-06-05 16:18:57 +02:00
Even Rouault 46ea8e2a5c Merge branch 'TIFFField_downgrade_errors_to_warnings' into 'master'
TIFFFieldWithName() and TIFFFieldWithTag() downgrade errors to warnings.

See merge request libtiff/libtiff!495
2023-06-05 14:05:26 +00:00
Su_Laus a693d1f365 TIFFFieldWithName() and TIFFFieldWithTag() downgrade errors to warnings.
see https://gitlab.com/libtiff/libtiff/-/issues/575#note_1407633888
2023-05-28 21:05:49 +02:00
Even Rouault be9785ac6d Merge branch 'bebuch-master-patch-58347' into 'master'
check if upstream lzma (xz) config was used and bind to it if so

See merge request libtiff/libtiff!494
2023-05-25 14:41:50 +00:00
Benjamin Buch c58e47a183 check if upstream lzma (xz) config was used and bind to it if so 2023-05-25 14:41:49 +00:00
Even Rouault 7eb0f8ca76 Merge branch 'upstream-zstd-config' into 'master'
check if upstream zstd config was used and bind to it if so

See merge request libtiff/libtiff!493
2023-05-25 14:40:48 +00:00
Even Rouault be0bac4c88 Merge branch 'cmake_FindDeflate_bugs_see_526' into 'master'
CMake: FindDeflate several errors fixed (see #526)

See merge request libtiff/libtiff!491
2023-05-25 14:40:13 +00:00
Su_Laus b2cdf4292a CMake: FindDeflate several errors (see #526)
There are CMake issues if the library is not included in the environment path and only set with CMake -D option.
- For FindDeflate.cmake, FindJBIG.cmake, FindLERC.cmake, FindWebP.cmake, FindZSTD.cmake:
  Set IMPORTED_LOCATION (without debug or release) if neither <library>_LIBRARY_RELEASE nor <library>_LIBRARY_DEBUG were set.
- FindDeflate.cmake: Correct code to retrieve library version information from libdeflate.h
- FindLERC.cmake version string return added.
2023-05-24 21:49:43 +02:00
Benjamin Buch 211704a9e6 prefer shared over static 2023-05-24 10:20:27 +00:00
Benjamin Buch 527208be70 check if upstream zstd config was used and bind to it if so 2023-05-24 09:37:16 +00:00
Even Rouault 33cda33473 Merge branch 'master' into 'master'
make WebP component name compatible with upstream ConfigWebP.cmake

See merge request libtiff/libtiff!492
2023-05-24 09:07:25 +00:00
Benjamin Buch 86e058e4ed CMake: make WebP component name compatible with upstream ConfigWebP.cmake 2023-05-24 09:07:25 +00:00
Su_Laus 118c5d1082 Prepare release 4.5.1
- Update till 18.05.23 after fix_559_DNG_1.6_passcount_error
2023-05-18 22:45:26 +02:00
Su_Laus c6c80cefa6 Prepare release 4.5.1 2023-05-18 22:45:26 +02:00
Even Rouault e3e23b1dd0 Merge branch 'fix_559_DNG_1.6_passcount_error' into 'master'
Fix #559 DNG 1.6 passcount assertion

Closes #574 et #559

See merge request libtiff/libtiff!489
2023-05-18 20:22:21 +00:00
Even Rouault 95942e5048 Merge branch 'fix_557_TagExtender_for_CustomDirectories_not_possible' into 'master'
manpage: TIFFSetTagExtender() cannot add tags to custom directories. Closes #557.

Closes #557

See merge request libtiff/libtiff!490
2023-05-18 20:21:55 +00:00
Su_Laus 9f0c7bff9b Documentation update: TIFFSetTagExtender() cannot add tags to custom directories.
Closes #557.
2023-05-17 22:50:12 +02:00
Even Rouault a0a18437d6 Merge branch 'fix_558' into 'master'
Hardcode HOST_FILLORDER to FILLORDER_LSB2MSB, and make 'H' flag of TIFFOpen()...

See merge request libtiff/libtiff!488
2023-05-16 17:40:05 +00:00
Su_Laus e8874d75f5 Fix #559 DNG 1.6 passcount assertion
Amend DNG tags definition introduced with MR 482:
- DNG 1.6 tags specified as UTF-8 strings are defined as variable TIFF_BYTE with  passcount=TRUE.
- For all tags with TIFF_SETGET_C32_UINT8 the readcount and writecount were corrected to -3 (TIFF_VARIABLE2).

Testprogram to write and read all tags defined within LibTIFF is introduced.
It also checks for valid passcount flag setting for the defined tags but some special tags are excluded from that check.

Closes #559.
2023-05-16 19:33:40 +02:00
Even Rouault 0dabdfe857 Hardcode HOST_FILLORDER to FILLORDER_LSB2MSB, and make 'H' flag of TIFFOpen() to warn and an alias of FILLORDER_MSB2LSB 2023-05-09 14:47:49 +02:00
Even Rouault 6fd4237b0b tif_lerc.c: use WORDS_BIGENDIAN instead of HOST_BIGENDIAN 2023-05-09 14:47:28 +02:00
Even Rouault cea6047054 Merge branch 'fix_484_TIFFDirectory_32_64_bit' into 'master'
Fix 484 TIFFDirectory td_fieldsset uses unsigned long which can be 32 or 64 bits.

Closes #484

See merge request libtiff/libtiff!471
2023-05-07 11:14:25 +00:00
Even Rouault ba425745d6 Merge branch 'DNG_1.6_EP_tags' into 'master'
Add DNG tags up to version 1.6.0.0 and some TIFF/EP tags and update documentation

See merge request libtiff/libtiff!482
2023-05-07 11:12:20 +00:00
Even Rouault f79d2d5d1e Merge branch 'issue547' into 'master'
do not install libtiff-4.pc when tiff-install is reset

Closes #547

See merge request libtiff/libtiff!481
2023-05-07 11:11:36 +00:00
Even Rouault 7e28cd362b Merge branch 'fix_548' into 'master'
LZWDecode(): avoid crash when trying to read again from a strip whith a...

Closes #548

See merge request libtiff/libtiff!484
2023-05-06 18:47:00 +00:00
Even Rouault 7ead6c42c7 Merge branch 'tiffcrop_fix_553_multi-image-errors' into 'master'
tiffcrop: fix 553 by considering error return of writeSelections()

Closes #553

See merge request libtiff/libtiff!485
2023-05-06 18:46:35 +00:00
Even Rouault e53b14876f Merge branch 'tif_ojpeg_fix-554_FPE' into 'master'
tif_ojpeg.c fix 554 by checking for division by zero

Closes #554

See merge request libtiff/libtiff!486
2023-05-06 18:45:50 +00:00
Su Laus d0c721cad7 tif_ojpeg.c fix 554 by checking for division by zero 2023-05-06 18:45:50 +00:00
Su_Laus b5c7d4c4e0 Consider error return of writeSelections().
Fixes #553
2023-05-05 19:43:46 +02:00
Even Rouault 9be22b639e LZWDecode(): avoid crash when trying to read again from a strip whith a missing end-of-information marker (fixes #548) 2023-04-29 12:20:46 +02:00
Su_Laus b90b20d36d Add DNG tags up to version 1.6.0.0 and some TIFF/EP tags and update documentation
Amend MR !337 'Add support for DNG tags up to version 1.6.0.0 and some TIFF/EP tags' from Sami Liedes:
- Set most tags to OkToChange=1.
- Define BATTERYLEVEL tag as ASCII and convert values of rational variant to ASCII.
- TIFF documentation updated for tags recognized by LibTiff (DNG 1.6 and others).
- TIFF/EP tags added, which are equivalent to EXIF tags. This addresses part of #418 as well.
- Definition of tags reformatted (clang-format off) for better readability of tag comments in tiff.h and tif_dirinfo.c
2023-04-25 20:05:14 +02:00
Roman d2f2dbc392 do not install libtiff-4.pc when tiff-install is reset 2023-04-23 13:49:35 +10:00
Even Rouault 9bd48f0dbd Merge branch 'mymaster1' into 'master'
fix runtime error: applying zero offset to null pointer

See merge request libtiff/libtiff!479
2023-04-21 13:01:34 +00:00
xiaoxiaoafeifei 8c0859a804 countInkNamesString(): fix UndefinedBehaviorSanitizer: applying zero offset to null pointer 2023-04-21 13:01:34 +00:00
Even Rouault 17adf4308c Merge branch 'tif_ovrcache_TIFFSetSubDirectory' into 'master'
tif_ovrcache.c: check TIFFSetSubDirectory() return value (CID 1524573)

See merge request libtiff/libtiff!478
2023-03-26 15:51:21 +00:00
Even Rouault b8b12c44c1 tif_ovrcache.c: check TIFFSetSubDirectory() return value (CID 1524573) 2023-03-26 16:27:40 +02:00
Even Rouault 214fe59954 Merge branch 'even_faster_setdirectory_with_IFDlist' into 'master'
Even faster TIFFSetDirectory() using IFD list.

See merge request libtiff/libtiff!477
2023-03-26 14:09:24 +00:00
Su Laus ada85f3663 Even faster TIFFSetDirectory() using IFD list. 2023-03-26 14:09:24 +00:00
Even Rouault ddd7f04482 Merge branch 'faster-setdirectory_newMR' into 'master'
Optimize relative seeking with TIFFSetDirectory

See merge request libtiff/libtiff!474
2023-03-12 21:05:56 +00:00
Su Laus f0a7bb7bdc Optimize relative seeking with TIFFSetDirectory 2023-03-12 21:05:56 +00:00
Even Rouault 1d5b1181c9 Merge branch 'master' into 'master'
Fix memory leak in tiffcrop.c

See merge request libtiff/libtiff!475
2023-03-11 13:23:49 +00:00
zhailiangliang 881a070194 Fix memory leak in tiffcrop.c 2023-03-08 10:08:09 +08:00
Even Rouault 6bb0f1171a Merge branch 'skip-thumbnail-test' into 'master'
test: avoid running tool tests if not built

Closes #421

See merge request libtiff/libtiff!334
2023-02-23 21:20:14 +00:00
Sam James bda075a7f3 test (cmake): skip script tests if tools aren't built
In Gentoo, we avoid building the tools for multilib (32-bit, x86) builds on
amd64/x86_64 because we only need the library to keep binary applications working.

This causes a test failure in e.g. tiffcp-thumbnail.sh as the 'thumbnail'
binary isn't built. Skip it if unavailable.

Fixes: https://gitlab.com/libtiff/libtiff/-/issues/421
Signed-off-by: Sam James <sam@gentoo.org>
2023-02-22 22:59:11 +00:00
Sam James 223078d722 test (autotools): skip script tests if tools aren't built
In Gentoo, we avoid building the tools for multilib (32-bit, x86) builds on
amd64/x86_64 because we only need the library to keep binary applications working.

This causes a test failure in e.g. tiffcp-thumbnail.sh as the 'thumbnail'
binary isn't built. Skip it if unavailable.

Fixes: https://gitlab.com/libtiff/libtiff/-/issues/421
2023-02-22 22:58:39 +00:00
Even Rouault 61656f9218 Merge branch 'fix_Unlink_first_directory_0' into 'master'
Fix TIFFUnlinkDirectory(0) case and unlink of first directory.

See merge request libtiff/libtiff!460
2023-02-16 22:46:38 +00:00
Even Rouault d1f658afa5 Merge branch 'tif_luv_check_NaN_fix_#530' into 'master'
tif_luv: Check and correct for NaN data in uv_encode().

Closes #530

See merge request libtiff/libtiff!473
2023-02-16 15:18:55 +00:00
Su_Laus b0e1c25dd1 tif_luv: Check and correct for NaN data in uv_encode().
Closes #530

See merge request !473
2023-02-16 15:49:42 +01:00
Even Rouault c861f25cbc Merge branch 'tiffcrop_dont_reuse_input_buffer_fix_527' into 'master'
tiffcrop: Do not reuse input buffer for subsequent images. Fix issue 527

Closes #527

See merge request libtiff/libtiff!472
2023-02-14 20:41:35 +00:00
Su_Laus ec8ef90c1f tiffcrop: Do not reuse input buffer for subsequent images. Fix issue 527
Reuse of read_buff within loadImage() from previous image is quite unsafe, because other functions (like rotateImage() etc.) reallocate that buffer with different size without updating the local prev_readsize value.

Closes #527
2023-02-14 20:43:43 +01:00
Su_Laus aa2cd98b3e Fix 484 TIFFDirectory td_fieldsset uses unsigned long which can be 32 or 64 bits.
Closes #484
2023-02-08 21:36:18 +01:00
Even Rouault feb8db628d Merge branch 'test_ifd_loop_detection_fix_CoverityScan_ln_55' into 'master'
test_ifd_loop_detection: fix Coverity Scan issue CID 1520750: Null pointer...

See merge request libtiff/libtiff!470
2023-02-08 16:05:37 +00:00
Su_Laus 538b8f2935 test_ifd_loop_detection: fix Coverity Scan issue CID 1520750: Null pointer dereferences (NULL_RETURNS) line 55. 2023-02-08 14:14:09 +01:00
Even Rouault c8e1289def Merge branch 'tiffcrop_fix_CoverityScan_line_9676' into 'master'
Fix Coverity Scan issue CID 1520761: Integer handling issues...

See merge request libtiff/libtiff!469
2023-02-06 20:48:42 +00:00
Su_Laus 3f37593175 Fix Coverity Scan issue CID 1520761: Integer handling issues (OVERFLOW_BEFORE_WIDEN) tiffcrop.c: 9676 in rotateImage() 2023-02-06 21:10:30 +01:00
Even Rouault afaabc3e50 Merge branch 'tiffcrop_R270_fix#492' into 'master'
tiffcrop: Amend rotateImage() not to toggle the input (main) image width and...

Closes #519, #518, #499, #495, #494, #493 et #492

See merge request libtiff/libtiff!465
2023-02-05 17:49:05 +00:00
Su_Laus 69818e2f2d tiffcrop: Amend rotateImage() not to toggle the input (main) image width and length parameters when only cropped image sections are rotated.
Remove buffptr from region structure because never used.

Closes #492 #493 #494 #495 #499 #518 #519
2023-02-05 18:18:19 +01:00
Even Rouault 6366e8f776 Merge branch 'tiffcrop_correctly_update_buffersize_after_rotate_fix#520' into 'master'
tiffcrop correctly update buffersize after rotateImage() fix#520

Closes #520

See merge request libtiff/libtiff!467
2023-02-05 16:04:07 +00:00
Even Rouault 33aee1275d Merge branch 'tiffcrop_composite_image_assumption_test_fix#496' into 'master'
tiffcrop: added check for assumption on composite images (fixes #496)

Closes #501, #500, #498, #497 et #496

See merge request libtiff/libtiff!466
2023-02-05 15:53:16 +00:00
Su Laus 82a7fbb1fa tiffcrop: added check for assumption on composite images (fixes #496)
tiffcrop: For composite images with more than one region, the combined_length or combined_width always needs to be equal, respectively. Otherwise, even the first section/region copy action might cause buffer overrun. This is now checked before the first copy action.

Closes #496, #497, #498, #500, #501.
2023-02-05 15:53:15 +00:00
Su_Laus 688012dca2 tiffcrop correctly update buffersize after rotateImage() fix#520 -- enlarge buffsize and check integer overflow within rotateImage(). 2023-02-04 23:24:21 +01:00
Even Rouault ff049e353e Merge branch 'test_subidf_loop' into 'master'
test_ifd_loop_detection: Added test to check loops in SubIFDs that are chained.

See merge request libtiff/libtiff!464
2023-02-04 19:34:11 +00:00
Su Laus 8ef8f7ce21 test_ifd_loop_detection: Added test to check loops in SubIFDs that are chained. 2023-02-04 19:34:11 +00:00
Su_Laus 12ba27949b Fix TIFFUnlinkDirectory(0) case and unlink of first directory.
If directory number 0 is unlinked, then the base offset variables within LibTiff are not updated. As a result, a subsequent TIFFSetDirectory() first goes to the unlinked former directory  number 0.

In addition, the error case for dirn=0 is handled.

This MR fixes that by updating the base offset variables  tif->tif_header.classic.tiff_diroff and tif->tif_header.big.tiff_diroff.
2023-02-04 20:27:14 +01:00
Even Rouault f171d7a2cd Merge branch 'TiffClose_NULL_ptr_dereferencing_fix_515' into 'master'
TIFFClose() avoid NULL pointer dereferencing. fix#515

Closes #515

See merge request libtiff/libtiff!468
2023-02-03 17:46:26 +00:00
Su_Laus d63de61b1e TIFFClose() avoid NULL pointer dereferencing. fix#515
Closes #515
2023-02-03 17:38:55 +01:00
Su_Laus 9c22495e5e tiffcrop correctly update buffersize after rotateImage() fix#520
rotateImage() set up a new buffer and calculates its size individually. Therefore, seg_buffs[] size needs to be updated accordingly. Before this fix, the seg_buffs buffer size was calculated with a different formula than within rotateImage().

Closes #520.
2023-02-03 15:31:31 +01:00
Even Rouault a63e18ca43 Merge branch 'add_windows_DLL_versioninfo' into 'master'
Add versioninfo resource files for DLL and tools compiled with Windows MSVC and MINGW.

See merge request libtiff/libtiff!455
2023-01-25 16:04:51 +00:00
Su Laus e304e5a5cb Add versioninfo resource files for DLL and tools compiled with Windows MSVC and MINGW. 2023-01-25 16:04:50 +00:00
Even Rouault 0f8ae9442a Merge branch 'tif_hash_set_order_include' into 'master'
tif_hash_set.c: include tif_hash_set.h after tif_config.h to let a chance for...

See merge request libtiff/libtiff!462
2023-01-22 12:50:21 +00:00
Even Rouault bc4d708262 tif_hash_set.c: include tif_hash_set.h after tif_config.h to let a chance for GDAL symbol renaming trick 2023-01-22 13:31:46 +01:00
Even Rouault 46832efcb0 Merge branch 'fix_513' into 'master'
Fax3: fix failure to decode some fax3 images (fixes #513)

Closes #513

See merge request libtiff/libtiff!461
2023-01-22 12:26:22 +00:00
Even Rouault 9477634d2a Add test for Fax3 decoding issues (refs #513) 2023-01-21 22:51:55 +01:00
Even Rouault d1b6b9c1b3 Merge branch 'tiffcrop_fix_#488' into 'master'
tiffcrop: Correct simple copy paste error. Fix #488.

Closes #488

See merge request libtiff/libtiff!459
2023-01-21 15:58:10 +00:00
Su Laus 97d65859bc tiffcrop: Correct simple copy paste error. Fix #488. 2023-01-21 15:58:10 +00:00
Even Rouault 8a4f6b587b Fax3: fix failure to decode some fax3 images (fixes #513)
Patch by @jsummers26
2023-01-21 16:55:40 +01:00
Even Rouault 6be14e882f Merge branch 'tiffmedian_fix_#477' into 'master'
tiffmedian: avoid zero num_colors, fixes #477

Closes #477

See merge request libtiff/libtiff!458
2023-01-12 21:42:55 +00:00
Even Rouault c0f0316931 Merge branch 'fax2ps_fixes_#475' into 'master'
fax2ps: fixes #475 buffer overflow in qsort function pcompar.

Closes #475

See merge request libtiff/libtiff!457
2023-01-12 21:41:07 +00:00
Su_Laus 3c774f1903 tiffmedian: avoid zero num_colors, fixes #477 2023-01-12 22:33:46 +01:00
Su_Laus 188e054164 fax2ps: fixes #475 buffer overflow in qsort function pcompar. 2023-01-12 21:51:44 +01:00
Even Rouault 3f8db71882 Merge branch 'fix_241_tiffset_file_size_limit' into 'master'
tiffset: get filesize to allocate only the required memory. Fixes issue #241

Closes #241

See merge request libtiff/libtiff!451
2023-01-09 18:13:18 +00:00
Su Laus 7be6324424 tiffset: get filesize to allocate only the required memory. Fixes issue #241 2023-01-09 18:13:18 +00:00
Even Rouault 9ce5083225 Merge branch '_TIFFCleanupIFDOffsetAndNumberMaps' into 'master'
Add _TIFFCleanupIFDOffsetAndNumberMaps() and call it from TIFFUnlinkDirectory()

See merge request libtiff/libtiff!454
2023-01-09 18:11:33 +00:00
Even Rouault c074eb73d3 Remove use of tif_dirnumber 2023-01-06 15:23:06 +01:00
Even Rouault 47591619e1 TIFFSetSubDirectory(): call _TIFFCleanupIFDOffsetAndNumberMaps() 2023-01-06 15:19:40 +01:00
Even Rouault 1123f312b4 struct tiff: remove unused tif_dirlistoff 2023-01-06 15:18:36 +01:00
Even Rouault e146a61d9d TIFFUnlinkDirectory(): reset tif_dirnumber 2023-01-06 15:17:58 +01:00
Even Rouault 4eea4d5d93 Add _TIFFCleanupIFDOffsetAndNumberMaps() and call it from TIFFUnlinkDirectory() 2023-01-06 00:33:09 +01:00
Even Rouault 9f84326b13 Merge branch 'cmake_in_files_formatting_sensitive' into 'master'
Disable clang-formatting for tif_config.h.cmake.in and tiffconf.h.cmake.in...

See merge request libtiff/libtiff!452
2022-12-29 16:49:27 +00:00
Su_Laus bdaf7c7f4f Disable clang-formatting for tif_config.h.cmake.in and tiffconf.h.cmake.in because sensitive for CMake scripts. - explanation added 2022-12-28 20:21:22 +01:00
Su_Laus e131fde62b Disable clang-formatting for tif_config.h.cmake.in and tiffconf.h.cmake.in because sensitive for CMake scripts. 2022-12-26 17:39:48 +01:00
Even Rouault 3bde37ac83 Merge branch 'manpage_multi-page-TIFF' into 'master'
manpage: Add multi page TIFF and SubIFDs description and read / write example.

See merge request libtiff/libtiff!450
2022-12-19 21:30:42 +00:00
Su Laus dc3369a794 manpage: Add multi page TIFF and SubIFDs description and read / write example. 2022-12-19 21:30:42 +00:00
Even Rouault a34d7ddee2 Merge branch 'TIFFOpen_r+_windows_behaviour' into 'master'
Behavior of TIFFOpen() mode "r+" in the Windows implementation adjusted to that of Linux.

See merge request libtiff/libtiff!449
2022-12-18 20:23:52 +00:00
Su_Laus d46354584f Behavior of TIFFOpen() mode "r+" in the Windows implementation adjusted to that of Linux. 2022-12-16 18:47:55 +01:00
Miloš Komarčević 70645941f9 MinGW compilers don't need a .def file for shared library 2022-12-16 08:26:15 +00:00
Even Rouault 4bcdec3734 Merge branch 'ossfuzz_54343' into 'master'
TIFFSetDirectory: avoid harmless unsigned-integer-overflow

See merge request libtiff/libtiff!447
2022-12-15 21:34:00 +00:00
Even Rouault f1f86eedee TIFFSetDirectory: avoid harmless unsigned-integer-overflow
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54343
2022-12-15 22:15:03 +01:00
Even Rouault 0c16f2d84b Merge branch 'ossfuzz_54311' into 'master'
TIFFWriteDirectorySec(): avoid harmless unsigned-integer-overflow

See merge request libtiff/libtiff!446
2022-12-14 20:12:19 +00:00
Even Rouault c2a28a12c6 TIFFWriteDirectorySec(): avoid harmless unsigned-integer-overflow
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54311
2022-12-14 20:53:41 +01:00
Even Rouault 193c94b30c Merge branch 'hash_set_config' into 'master'
tif_hash_set.c: add a tif_config.h include (mostly for GDAL renaming symbols trick)

See merge request libtiff/libtiff!445
2022-12-13 23:49:42 +00:00
Even Rouault 3cfa4b9b12 tif_hash_set.c: add a tif_config.h include (mostly for GDAL renaming symbols trick) 2022-12-14 00:29:50 +01:00
Even Rouault 38eb7b00cb Merge branch 'fix_type_related_warnings_in_error' into 'master'
TIFFAdvanceDirectory()/TIFFUnlinkDirectory(): fix build warnings/errors on OSX...

See merge request libtiff/libtiff!444
2022-12-13 22:24:39 +00:00
Even Rouault a9de164cfa tiffinfo/tiffgt: more corect casts related to tdir_t changes 2022-12-13 22:56:54 +01:00
Even Rouault 8d5fbea923 TIFFAdvanceDirectory()/TIFFUnlinkDirectory(): fix build warnings/errors on OSX due to uint16_t->tdir_t type change 2022-12-13 22:45:19 +01:00
Even Rouault 06910438d1 Merge branch 'TIFFHashSetInsert_memleak_fix' into 'master'
TIFFHashSetInsert(): fix potential memleak

See merge request libtiff/libtiff!443
2022-12-13 19:04:26 +00:00
Even Rouault a03faa56c5 TIFFHashSetInsert(): fix potential memleak 2022-12-13 19:43:00 +01:00
Even Rouault 393a5ebe49 Merge branch '_TIFFCheckDirNumberAndOffset_use_after_free_fix' into 'master'
_TIFFCheckDirNumberAndOffset(): fix recently introduced use-after-free found by CIFuzz on GDAL

See merge request libtiff/libtiff!442
2022-12-13 17:26:47 +00:00
Even Rouault ff9a315b42 _TIFFCheckDirNumberAndOffset(): fix recently introduced use-after-free found by CIFuzz on GDAL 2022-12-13 18:06:33 +01:00
Even Rouault aec4ed6c3c Merge branch 'update_4_5_0rc2' into 'master'
Changelog: latest updates for 4.5.0rc2

See merge request libtiff/libtiff!441
2022-12-13 16:39:43 +00:00
Even Rouault be62af1f18 Changelog: latest updates for 4.5.0rc2 2022-12-13 17:39:00 +01:00
Even Rouault c4516f9dc7 Merge branch 'tiffinfo_adapt_curdir_tdir_t' into 'master'
tiffinfo: update curdir from uint16_t to tdir_t for more than 64k IFD handling.

See merge request libtiff/libtiff!440
2022-12-13 16:35:26 +00:00
Su_Laus 9103999432 tiffinfo: update curdir from uint16_t to tdir_t for more than 64k IFD handling. 2022-12-13 17:28:01 +01:00
Even Rouault 86993bbeb8 Merge branch '4_5_0rc2' into 'master'
Prepare libtiff v4.5.0rc2

See merge request libtiff/libtiff!439
2022-12-13 16:18:07 +00:00
Even Rouault 6e83cb0ea9 Update v4.5.0rst 2022-12-13 16:37:10 +01:00
Even Rouault 749edaed71 _TIFFCheckDirNumberAndOffset: fix a previous commit 2022-12-13 16:32:52 +01:00
Even Rouault 35f53f7a0b Prepare libtiff v4.5.0rc2 2022-12-13 16:26:51 +01:00
Even Rouault 87e0190d2d Merge branch 'fix_502' into 'master'
Make TIFFSetDirectory(tiff, 65534) work again (fixes #502)

Closes #502

See merge request libtiff/libtiff!436
2022-12-13 15:24:16 +00:00
Even Rouault 565b8923af Add tests for IFD loop detection 2022-12-13 15:19:46 +01:00
Even Rouault 2c0f2ed803 Fix IFD loop detection 2022-12-13 15:14:47 +01:00
Even Rouault 2c1d4b6b01 Use UINT_MAX 2022-12-13 13:14:30 +01:00
Even Rouault a1be870b1f Make TIFF_MAX_DIR_COUNT a autoconf/CMake setting 2022-12-13 13:12:49 +01:00
Even Rouault fa6f622f40 Merge branch 'build-shared-by-default' into 'master'
Restore shared libraries by default

See merge request libtiff/libtiff!437
2022-12-13 12:00:17 +00:00
shaun walbridge 21ad9b4412 CMake: restore shared libraries by default for top-level build 2022-12-13 12:00:17 +00:00
Even Rouault 0530835da4 Add a TIFF_MAX_DIR_COUNT public #define 2022-12-12 21:20:59 +01:00
Even Rouault 8f38557ef6 TIFFCurrentDirectory(), TIFFNumberOfDirectories(), TIFFSetDirectory(), TIFFUnlinkDirectory(): use tdir_t that is now a uint32_t, and raise limit of IFDs to 1048576 2022-12-12 20:35:46 +01:00
Even Rouault 2c015f27ba IFD loop checking: use hashmap to avoid quadratic performance 2022-12-12 19:42:56 +01:00
Even Rouault 1650d657ba Add a hashset/hashmap implementation (ported from GDAL's CPLHashSet) 2022-12-12 19:42:56 +01:00
Even Rouault 490a7df08f Make TIFFSetDirectory(tiff, 65534) work again (fixes #502) 2022-12-12 17:58:17 +01:00
Even Rouault 3da0dddadb Merge branch 'do_not_format_tiffvers_h' into 'master'
Revert formatting of tiffvers.h and add TIFFLIB_MAJOR_VERSION, TIFFLIB_MINOR_VERSION, TIFFLIB_MICRO_VERSION defines

See merge request libtiff/libtiff!434
2022-12-11 13:13:35 +00:00
Even Rouault 07042f1941 Merge branch 'tiffcrop_exclude_some_comment_from_clang-format' into 'master'
tiffcrop: Exclude some comments from clang-format

See merge request libtiff/libtiff!435
2022-12-11 11:22:56 +00:00
Su Laus f37aa3718f tiffcrop: Exclude some comments from clang-format 2022-12-11 11:22:56 +00:00
Even Rouault 23b315d10f tiffvers.h.in: add clang-format off/on 2022-12-11 12:21:56 +01:00
Even Rouault 2e7640c966 tiffvers.h: add TIFFLIB_MAJOR_VERSION, TIFFLIB_MINOR_VERSION, TIFFLIB_MICRO_VERSION defines
Also add a TIFFLIB_AT_LEAST() macro
2022-12-10 16:21:44 +01:00
Even Rouault 234971dfd8 tiffvers.h: revert formatting 2022-12-10 14:20:17 +01:00
Even Rouault ac45771ea4 Exclude reformatting of tiffvers.h which breaks version detection for FindTIFF.cmake 2022-12-10 14:20:06 +01:00
Even Rouault 9e233f6077 Merge branch 'release_4_5_0' into 'master'
Prepare v4.5.0 release

See merge request libtiff/libtiff!433
2022-12-09 15:33:24 +00:00
Even Rouault 59b6cd308a v4.5.0.rst: mention CVE numbers 2022-12-09 16:02:15 +01:00
Even Rouault c83c038d35 Prepare v4.5.0 release 2022-12-09 15:54:08 +01:00
Even Rouault cbb492c279 Merge branch 'reformat' into 'master'
Whole code-base reformatting

See merge request libtiff/libtiff!431
2022-12-08 18:44:45 +00:00
Even Rouault d7e78c1b37 Add .git-blame-ignore-revs 2022-12-08 19:20:35 +01:00
Even Rouault a51efc12b2 tiffcrop: remove version_id and rev_date 2022-12-08 19:20:05 +01:00
pre-commit run by Even Rouault aee0113f5e Reformatting in all other directories using 'pre-commit run' 2022-12-08 19:19:36 +01:00
pre-commit run by Even Rouault dee020782c Reformatting in test/ using 'pre-commit run' 2022-12-08 19:19:21 +01:00
pre-commit run by Even Rouault b0ae5d7071 Reformatting in tools/ using 'pre-commit run' 2022-12-08 19:19:07 +01:00
pre-commit run by Even Rouault 42173d6ace Reformatting in libtiff/ using 'pre-commit run' 2022-12-08 19:18:55 +01:00
Even Rouault 5e6a5fd6fa Add .clang-format, .pre-commit-config.yaml and CONTRIBUTING.md 2022-12-08 19:18:23 +01:00
Even Rouault 2d32ae7305 Remove vim/emacs formatting footers 2022-12-08 19:18:23 +01:00
Even Rouault 1bdbd03fbb Merge branch 'fix_489' into 'master'
TIFFWriteRawStrip(): restore capabilities to append data in the current strip (fixes #489)

Closes #489

See merge request libtiff/libtiff!430
2022-11-29 17:02:09 +00:00
Even Rouault db1d212786 Add test case for scenario of issue #489 2022-11-29 17:23:26 +01:00
Even Rouault 72de8fd00b TIFFWriteRawStrip(): restore capabilities to append data in the current strip (fixes #489)
This fixes a regression of libtiff 4.4.0
2022-11-29 15:00:27 +01:00
Even Rouault e72bfcfa0d Merge branch 'manpage_re-entrant_error_handler' into 'master'
manpage update for re-entrant error handler TIFFErrorExtR(), TIFFOpenExt() and...

See merge request libtiff/libtiff!427
2022-11-28 23:16:00 +00:00
Su Laus a2c551ee06 manpage update for re-entrant error handler TIFFErrorExtR(), TIFFOpenExt() and... 2022-11-28 23:16:00 +00:00
Even Rouault 0be1bf06c7 Merge branch 'tiffcrop_fix_#169' into 'master'
tiffcrop: Add check if (bps != 1) in writeSingleSection() for...

Closes #169

See merge request libtiff/libtiff!429
2022-11-27 20:34:40 +00:00
Su Laus d700853112 tiffcrop: Add check if (bps != 1) in writeSingleSection() for... 2022-11-27 20:34:40 +00:00
Even Rouault 94854a8dbc Merge branch 'TIFFErrorExtR_fix_missing_calls' into 'master'
TIFFErrorExt() was not replaced with TIFFErrorExtR() everywhere in libtiff....

See merge request libtiff/libtiff!428
2022-11-26 21:00:49 +00:00
Su Laus 4331d27569 TIFFErrorExt() was not replaced with TIFFErrorExtR() everywhere in libtiff.... 2022-11-26 21:00:49 +00:00
Even Rouault 70a164524e Merge branch 'tif_jpeg_build_fix' into 'master'
tif_jpeg.c: fix compilation with MSVC (fixes commit 0fd1a81d35)

See merge request libtiff/libtiff!426
2022-11-25 16:11:10 +00:00
Even Rouault ced264e91c tif_jpeg.c: fix compilation with MSVC (fixes commit 0fd1a81d35) 2022-11-25 16:34:26 +01:00
Even Rouault 5109b2bf50 Merge branch 'fix_0fd1a81d3547acb8f5be50bbbc3e44bde01c014b' into 'master'
JPEGEncode(): fix wrong pointer data type with libjpeg-turbo 2.2dev in 12-bit mode

See merge request libtiff/libtiff!425
2022-11-25 11:48:20 +00:00
Even Rouault ba51f97994 JPEGEncode(): fix wrong pointer data type with libjpeg-turbo 2.2dev in 12-bit mode
(fixes commit 0fd1a81d35)
2022-11-25 12:47:11 +01:00
Even Rouault 137e90d14d Merge branch 'libjpegturbo_dual' into 'master'
Add support for libjpeg-turbo 2.2-dev 8/12 bit dual mode

See merge request libtiff/libtiff!422
2022-11-25 11:26:45 +00:00
Even Rouault 0fd1a81d35 Add support for libjpeg-turbo 2.2-dev 8/12 bit dual mode 2022-11-25 11:26:45 +00:00
Even Rouault 38a582016c Merge branch 'windows-fix' into 'master'
libtiff: Fix TIFFOpen* for the Windows platform in tif_unix.c

See merge request libtiff/libtiff!424
2022-11-23 22:56:12 +00:00
Francois Bleibel 166accba60 libtiff: Fix TIFFOpen* for the Windows platform in tif_unix.c
I'm not sure where this change was made, but it must have been in a recent update. TIFFOpenWEx is now TIFFOpenWExt, and _TIFFgetMode takes additional arguments.

Verified: Tested libtiff on a local Windows build.
2022-11-23 14:29:41 -08:00
Even Rouault 0c4a6a72ad Merge branch 'tiffcrop_signed_vs_unsigned' into 'master'
tiffcrop.c: fix warning about signed vs unsigned comparison

See merge request libtiff/libtiff!423
2022-11-23 21:17:09 +00:00
Even Rouault 24d3b2425a tiffcrop.c: fix warning about signed vs unsigned comparison 2022-11-23 21:29:52 +01:00
Even Rouault 9b69732fec Merge branch 'TIFFClientOpenExt_warning_fix' into 'master'
TIFFClientOpenExt(): fix warning on 32-bit platforms (master only)

See merge request libtiff/libtiff!421
2022-11-23 13:32:26 +00:00
Even Rouault 6bcaf4a163 TIFFClientOpenExt(): fix warning on 32-bit platforms (master only) 2022-11-23 14:14:30 +01:00
Even Rouault 8e264807f1 Merge branch 'tiffcp_TIFFOpenOptionsFree_memleak_fix' into 'master'
tiffcp: fix leak of TIFFOpenOptionsAlloc() introduced in latest commit (master only)

See merge request libtiff/libtiff!420
2022-11-23 11:03:03 +00:00
Even Rouault b6480e872a tiffcp: fix leak of TIFFOpenOptionsAlloc() introduced in latest commit (master only)
Fixes Coverity CID 1517032
2022-11-23 11:44:47 +01:00
Even Rouault e920f4fee3 Merge branch 'TIFFOpenOptionsSetMaxSingleMemAlloc' into 'master'
Add TIFFOpenOptionsSetMaxSingleMemAlloc() to define a limit in bytes for a single memory allocation done by libtiff

See merge request libtiff/libtiff!419
2022-11-23 10:30:24 +00:00
Even Rouault ffe0666b8f Emit explicit error message when tif_max_single_mem_alloc is exceeded 2022-11-23 02:10:39 +01:00
Even Rouault 11afc7b734 test_open_options: test TIFFOpenOptionsSetMaxSingleMemAlloc() 2022-11-23 02:09:41 +01:00
Even Rouault 3727ce6fe1 Rename test_error_handlers to test_open_options 2022-11-23 02:09:40 +01:00
Even Rouault 0ad56c292a tiffinfo, tiffcp, tiffcrop, tiffsplit, tiff2rgba, tiff2ps: use TIFFOpenOptionsSetMaxSingleMemAlloc() 2022-11-23 02:09:40 +01:00
Even Rouault 553bb4b207 Convert uses of _TIFFmalloc/realloc/calloc/free to the Ext functions 2022-11-23 02:09:40 +01:00
Even Rouault b88c3f9af2 Add TIFFOpenOptionsSetMaxSingleMemAlloc()
to define a limit in bytes for a single memory allocation done by libtiff.

Also add internal functions used in replacement of the non Ext ones:
void* _TIFFmallocExt(TIFF* tif, tmsize_t s);
void* _TIFFcallocExt(TIFF* tif, tmsize_t nmemb, tmsize_t siz);
void* _TIFFreallocExt(TIFF* tif, void* p, tmsize_t s);
void _TIFFfreeExt(TIFF* tif, void* p);
2022-11-22 18:17:34 +01:00
Even Rouault d95b5b7628 Merge branch 'TIFFOpenEx' into 'master'
Add TIFFOpenExt(), TIFFOpenWExt() and TIFFFdOpenExt() with re-entrant error handlers

See merge request libtiff/libtiff!413
2022-11-21 23:59:12 +00:00
Even Rouault ec18caeb67 Remove TIFFSetErrorHandlerExtR() and TIFFSetWarningHandlerExtR() that were temporarily added in master 2022-11-21 23:23:45 +01:00
Even Rouault 73d34370e1 Add a _TIFFErrorEarly() function to be able to use the re-entrant error handler, even before TIFF* is valid 2022-11-21 23:23:23 +01:00
Even Rouault 21d7dac23f Rework TIFFOpenExt() and similar to use an opaque TIFFOpenOptions* opts argument, with alloc, free and setters 2022-11-21 23:23:23 +01:00
Even Rouault 352c1a7d03 Document TIFFOpenExt, TIFFOpenWExt, TIFFFdOpenExt, TIFFClientOpenExt, TIFFSetErrorHandlerExtR, TIFFSetWarningHandlerExtR 2022-11-21 23:22:43 +01:00
Even Rouault 91e95ee9ae Add TIFFOpenExt(), TIFFOpenWExt() and TIFFFdOpenExt() with re-entrant error handlers
Rename TIFFClientOpenEx() to TIFFClientOpenExt()

Rework signature of the re-entrant error handlers and of
TIFFSetWarningHandlerExt() and TIFFSetErrorHandlerExt()

Use structures that can be extended as extra argument.

Leverages and ammends https://gitlab.com/libtiff/libtiff/-/merge_requests/409
2022-11-21 23:21:13 +01:00
Even Rouault e7e567536b Merge branch 'manpage_fix485_file-descriptor_clientdata' into 'master'
manpage: Correct description of file handle/descriptors tif_fd and tif_clientdata. Closes #485.

Closes #485

See merge request libtiff/libtiff!418
2022-11-21 22:20:18 +00:00
Su Laus 56d05b4c38 manpage: Correct description of file handle/descriptors tif_fd and tif_clientdata. Closes #485. 2022-11-21 22:20:18 +00:00
Even Rouault f29061e600 Merge branch 'manpage_fix440_fix28_TIFFOpen_SubIFD_update' into 'master'
manpage: fix28, fix440, update TIFFOpen and SubIFD

Closes #440 et #28

See merge request libtiff/libtiff!417
2022-11-20 19:39:23 +00:00
Su Laus eee54b38ec manpage: fix28, fix440, update TIFFOpen and SubIFD 2022-11-20 19:39:22 +00:00
Even Rouault a0f7b1ed8a Merge branch 'cmake_tiff_install_warning' into 'master'
CMakeLists.txt: fix warning with -Wdev

See merge request libtiff/libtiff!416
2022-11-17 21:11:13 +00:00
Even Rouault 1e5e7f346b CMakeLists.txt: fix warning with -Wdev
```
CMake Warning (dev) at CMakeLists.txt:62 (option):
  Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
  --help-policy CMP0077" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  For compatibility with older versions of CMake, option is clearing the
  normal variable 'tiff-install'.
This warning is for project developers.  Use -Wno-dev to suppress it.
```
2022-11-13 17:28:00 +01:00
Even Rouault 31d9e9f73d Merge branch 'fix_479' into 'master'
_TIFFReadEncodedTileAndAllocBuffer(): avoid excessive memory allocation on...

See merge request libtiff/libtiff!412
2022-11-12 16:05:12 +00:00
Even Rouault 056dd97f45 Merge branch 'typo_fix' into 'master'
tif_dirread.c: fix typo in comment

See merge request libtiff/libtiff!414
2022-11-12 01:40:24 +00:00
Even Rouault a907281532 tif_dirread.c: fix typo in comment 2022-11-12 02:24:11 +01:00
Even Rouault 876aa5168f _TIFFReadEncodedTileAndAllocBuffer(): avoid excessive memory allocation on broken files (fixes #479) 2022-11-11 12:58:08 +01:00
Even Rouault 9b630b86ba Merge branch 'bugfix/tiff2pdf-stdout' into 'master'
tiff2pdf Don't try to seek into stdout.

See merge request libtiff/libtiff!367
2022-11-10 13:45:08 +00:00
Claus-Justus Heine 1e013463ae tiff2pdf: Don't try to seek into stdout.
Fixes #441
2022-11-10 13:45:08 +00:00
Even Rouault 43c28e3f6a Merge branch 'fix_coverity_1516759' into 'master'
TIFFErrorExtR(): fix Dereference after null check (CID 1516759)

See merge request libtiff/libtiff!411
2022-11-08 15:13:56 +00:00
Even Rouault a05860a087 Merge branch 'fix_ossfuzz_53137' into 'master'
TIFFReadRGBATileExt(): fix (unsigned) integer overflow on strips/tiles > 2 GB

See merge request libtiff/libtiff!410
2022-11-08 14:55:36 +00:00
Even Rouault 4e17d7fbe2 TIFFErrorExtR(): fix Dereference after null check (CID 1516759) 2022-11-08 15:54:59 +01:00
Even Rouault f25d951a1c Merge branch 'no_sprintf' into 'master'
Replace sprintf calls with snprintf

See merge request libtiff/libtiff!408
2022-11-08 14:47:45 +00:00
Mark Mentovai 72e90d07fb Replace sprintf calls with snprintf
This makes it possible to build libtiff without warnings using the macOS
13 SDK. Calls to sprintf are replaced with snprintf, passing appropriate
buffer sizes.

It doesn’t appear that any of the changed uses of sprintf were actually
unsafe, so no behavior change is expected aside from SDK compatibility.

The macOS 13 SDK deprecates sprintf as it’s difficult to use safely. The
deprecation warning message is visible when building C++, but it is not
normally visible when building plain C code due to a quirk in how
sprintf is declared in the SDK. However, the deprecation message is
visible when building plain C under Address Sanitizer
(-fsanitize=address). This discrepancy was discovered at
https://crbug.com/1381706 and reported to Apple with a copy at
https://openradar.appspot.com/FB11761475.

The macOS 13 SDK is packaged in Xcode 14.1, released on 2022-11-01. This
also affects the iOS 16 SDK and other 2022-era Apple OS SDKs packaged in
Xcode 14.0, released on 2022-09-12.

libtiff is visible to the Chromium build via PDFium, and this change is
needed to allow Chromium to move forward to the macOS 13 SDK.

This change is limited to the libtiff directory. Other uses of sprintf
were found in contrib, test, and tools.
2022-11-08 09:44:14 -05:00
Even Rouault c20132c278 Merge branch 'reentrant' into 'master'
Add reentrant error functions

See merge request libtiff/libtiff!409
2022-11-08 14:38:58 +00:00
Even Rouault 227500897d TIFFReadRGBATileExt(): fix (unsigned) integer overflow on strips/tiles > 2 GB
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53137
2022-11-08 15:17:00 +01:00
Laramie Leavitt aa863b5e82 Add reentrant error functions
Prior to this change, libtiff relied on global error handlers,
which is problematic when libtiff used by multiple independent
libraries from within the same process, as they may unwittingly
clobber the error handling, introduce race conditions when setting
handlers, or otherwise have unintended side effects.

This change adds error handlers to the TIFF struct, which are
used preferentially when available. The error handlers are invoked
when the re-entrant error functions are called:

void TIFFErrorExtR(TIFF*, const char* module, const char* fmt, ...)
void TIFFWarningExtR(TIFF*, const char* module, const char* fmt, ...)

The handlers have a similar signature to the existing extended
handlers, additionally returning an int:

int TIFFErrorHandlerExtR(thandle_t, const char*, const char*, va_list)

 thandle_t is the userdata passed to TIFFOpen
 When the handler returns 1, the global handlers are not called.

Custom error/warning handlers may be installed on a per-file
basis by calling the Set functions:

  TIFF* tif = TIFFOpen(...);
  TIFFSetErrorHandlerExtR(tif, MyErrorHandler);
  TIFFSetWarningHandlerExtR(tif, MyWarningHandler);

Additionally, the callsites to TIFFErrorExt and TIFFWarningExt
have been updated to call the reentrant versions.
2022-11-08 15:12:51 +01:00
Even Rouault ec862ac774 Merge branch 'tiffcrop_fix_CoverityScan_tmsize_issue' into 'master'
tiffcrop: should fix some Coverity Scan issues OVERFLOW_BEFORE_WIDEN

See merge request libtiff/libtiff!403
2022-11-08 14:03:05 +00:00
Su Laus bdd7eba876 tiffcrop: should fix some Coverity Scan issues OVERFLOW_BEFORE_WIDEN 2022-11-08 14:03:05 +00:00
Even Rouault ddef030d3d Merge branch 'typo_fix' into 'master'
tif_dirread.c: fix typo in comment

See merge request libtiff/libtiff!407
2022-11-02 11:45:19 +00:00
Even Rouault 36a18e2401 tif_dirread.c: fix typo in comment 2022-11-02 12:28:01 +01:00
Even Rouault a7ac2a4235 Merge branch 'tiffcrop_formatting_fix' into 'master'
tiffcrop: add casts in TIFFError() to fix compiler warnings

See merge request libtiff/libtiff!406
2022-10-23 13:16:16 +00:00
Even Rouault fcbc4798ab Merge branch 'fix_482' into 'master'
CMake: correctly set default value of 'lzma' option when liblzma is detected (fixes #482)

Closes #482

See merge request libtiff/libtiff!404
2022-10-23 12:44:06 +00:00
Even Rouault 6f7c1ce57f tiffcrop: add casts in TIFFError() to fix compiler warnings 2022-10-23 14:40:02 +02:00
Even Rouault 58ad3b5635 CMake: correctly set default value of 'lzma' option when liblzma is detected (fixes #482) 2022-10-23 14:27:28 +02:00
Even Rouault 777080cd1f Merge branch 'fix_480' into 'master'
Fix incorrect printf() formatters introduced in recent commits (fixes #480)

Closes #480

See merge request libtiff/libtiff!401
2022-10-20 10:32:24 +00:00
Even Rouault 226345c23e Fix incorrect printf() formatters introduced in recent commits (fixes #480) 2022-10-19 18:30:54 +02:00
Even Rouault 096a228dba Merge branch 'CLIPPATH_tags_corrected' into 'master'
CLIPPATH tags defined twice but differently and also wrongly (#439) - corrected

Closes #439

See merge request libtiff/libtiff!366
2022-10-13 19:32:02 +00:00
Even Rouault 923d0f34c4 Merge branch 'FIELD_IGNORE_warning-messages' into 'master'
Warning messages for FIELD_IGNORE tags for writing and for TIFF_SETGET_UNDEFINED for reading added. (#438)

Closes #438

See merge request libtiff/libtiff!365
2022-10-13 19:30:59 +00:00
Su Laus 2abc5c6a28 Warning messages for FIELD_IGNORE tags for writing and for TIFF_SETGET_UNDEFINED for reading added. (#438) 2022-10-13 19:30:59 +00:00
Even Rouault caabf73d19 Merge branch 'tag-def_COMPRESSION_corrected' into 'master'
tif_dirinfo.c TIFFTAG_COMPRESSION and _BITSPERSAMPLE definition corrected

See merge request libtiff/libtiff!364
2022-10-13 19:28:29 +00:00
Even Rouault 32c6d09814 Merge branch 'fix_getopt_included_twice' into 'master'
Fix including module getopt.c twice with CMake and HAVE_GETOPT=false

See merge request libtiff/libtiff!381
2022-10-13 19:26:53 +00:00
Even Rouault cccc118091 Merge branch 'tiffcrop_CoverityScan_fix_PRINTF_ARGS' into 'master'
tiffcrop: fix Coverity Scan issues about PRINTF_ARGS.

See merge request libtiff/libtiff!400
2022-10-13 19:26:11 +00:00
Su_Laus ef68c48815 tiffcrop fix Coverity Scan issues about PRINTF_ARGS. 2022-10-13 20:50:58 +02:00
Even Rouault 49e8f80394 Merge branch 'tiffcrop_fix_#450_too-many-mode-options' into 'master'
tiffcrop: fix #450 too many 'mode' options on command line.

Closes #470 et #450

See merge request libtiff/libtiff!384
2022-10-13 15:16:33 +00:00
Su Laus f65c079c28 tiffcrop: fix #450 too many 'mode' options on command line. 2022-10-13 15:16:33 +00:00
Even Rouault cfbb883bf6 Merge branch 'tiffcrop_fix_#435' into 'master'
tiffcrop subroutines require a larger buffer (fixes #271, #381, #386, #388, #389, #435)

Closes #465, #464, #435, #389, #388, #386, #381 et #271

See merge request libtiff/libtiff!382
2022-10-13 14:33:28 +00:00
Su Laus afd7086090 tiffcrop subroutines require a larger buffer (fixes #271, #381, #386, #388, #389, #435) 2022-10-13 14:33:27 +00:00
Even Rouault e813112545 Merge branch 'InkNames_NumberOfInks_handling_revised' into 'master'
Revised handling of TIFFTAG_INKNAMES and related TIFFTAG_NUMBEROFINKS value (fixes #149, #150, #152, #168, #250, #269, #398 and #456)

Closes #474, #463, #387, #456, #398, #269, #250, #168, #152, #150 et #149

See merge request libtiff/libtiff!385
2022-10-12 21:03:31 +00:00
Even Rouault 236b7191f0 Merge branch 'tiffcrop_fix_#411_#413' into 'master'
tiffcrop: disable incompatibility of -Z, -X, -Y, -z options with any PAGE_MODE_x option (fixes #411, #413 and #426)

Closes #426, #413 et #411

See merge request libtiff/libtiff!383
2022-10-12 20:54:01 +00:00
Even Rouault a5c596561a Merge branch 'TIFFAdvanceDirectory_mapped_uio' into 'master'
TIFFAdvanceDirectory(): fix unsigned-integer-overflow in mapped case

See merge request libtiff/libtiff!398
2022-10-10 21:05:51 +00:00
Even Rouault 343118c63c TIFFAdvanceDirectory(): fix unsigned-integer-overflow in mapped case
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52309
2022-10-10 22:25:02 +02:00
Even Rouault 8bfc011991 Merge branch 'tiffinfo_parse_SubIFDs' into 'master'
tiffinfo: Updated to parse through SubIFDs and show their tags.

See merge request libtiff/libtiff!396
2022-10-08 14:52:24 +00:00
Su Laus fa99e8c88d tiffinfo: Updated to parse through SubIFDs and show their tags. 2022-10-08 14:52:24 +00:00
Roger Leigh 47e61f69b3 Merge branch 'master' into 'master'
Moved linking of CMath::CMath into CMath_LIBRARY check

See merge request libtiff/libtiff!397
2022-10-07 13:53:09 +00:00
Frei Herr eed69b50e7 Moved linking of CMath::CMath into CMath_LIBRARY check 2022-10-07 11:26:41 +00:00
Even Rouault f21ecf4a77 Merge branch 'rational_precision2double_coverity-fix' into 'master'
rational_precision2double.c: Fix issue from Coverity Scan.

See merge request libtiff/libtiff!395
2022-10-06 13:06:29 +00:00
Su_Laus 692870df22 rational_precision2double.c: Fix issue from Coverity Scan. 2022-10-06 14:37:38 +02:00
Su_Laus d1d87635f1 Fix including module getopt.c twice with CMake and HAVE_GETOPT=false
The "make-files" for the tools- and test- programmes include the module getopt.c once directly as additional source and then again by including port.lib.
This can be avoided by including getopt.c as source in port.lib within port\CMakeLists.txt not with PUBLIC but with PRIVATE.
2022-10-06 13:41:27 +02:00
Even Rouault d093eb5d96 Merge branch 'fix-455_Improved-IFD-loop-handling' into 'master'
Improved IFD-Loop Handling (fixes #455)

Closes #455

See merge request libtiff/libtiff!386
2022-10-06 10:11:06 +00:00
Su Laus c7caec9a4d Improved IFD-Loop Handling (fixes #455)
IFD infinite looping was not fixed by MR 20 (see #455).
An improved IFD loop handling is proposed.

Basic approach:

- The order in the entire chain must be checked, and not only whether an offset has already been read once.
- To do this, pairs of directory number and offset are stored and checked.
- The offset of a directory number can change.
- TIFFAdvanceDirectory() must also perform an IFD loop check.
- TIFFCheckDirOffset() is replaced by _TIFFCheckDirNumberAndOffset().

Rules for the check:

- If an offset is already in the list, it must have the same IFD number. Otherwise it is an IDF loop.
- If the offset is not in the list and the IFD number is greater than there are list entries, a new list entry is added.
- Otherwise, the offset of the IFD number is updated.

Reference is also made to old bugzilla bug 2772 and MR 20, which did not solve the general issue.
This MR closes #455
2022-10-06 10:11:05 +00:00
Roger Leigh 3a1647ea9c Merge branch 'fix-cmake-subproject' into 'master'
Fix CMake build to be compatible with FetchContent

See merge request libtiff/libtiff!394
2022-10-05 05:39:31 +00:00
Timothy Lyanguzov 7d0ed2ed5e Apply 9 suggestion(s) to 3 file(s) 2022-10-04 16:38:06 +00:00
Jeremy Maitin-Shepard 814a2441e7 Fix CMake build to be compatible with FetchContent
Recent versions of CMake have improved support for including
dependencies, using the FetchContent module, which allows a dependency
to be imported as a subproject and then later found automatically by
calls to `find_package`.

This change makes libtiff's CMake better behaved when used as a
sub-project:

- CMake has a single global namespace for all target names in all
  sub-projects.  This commit renames the following CMake targets:

  - port -> tiff_port
  - mkg3states -> tiff_mkg3states
  - faxtable -> tiff_faxtable
  - release -> tiff_release

- When building TIFF as a sub-project, it is not normally useful to
  create install rules for its targets.  This commit adds a
  `tiff-install` option that controls whether the install rules are
  added and defaults to OFF when libtiff is included as a sub-project.

- Previously, libtiff set `BUILD_SHARED_LIBS` to ON by default.  With
  this commit, that default is only set if libtiff is the top-level
  project.

- When using `find_package(TIFF)`, the targets `TIFF::TIFF` and
  `TIFF::CXX` are defined.  This commit makes libtiff itself define
  those targets as aliases, to allow other cmake projects to use
  either `find_package` or `FetchContent` interchangeably.

- Adds ZSTD_HAVE_DECOMPRESS_STREAM variable which may be set to bypass
  `check_symbol_exists` call.  Fixes
  https://gitlab.com/libtiff/libtiff/-/issues/472.
2022-10-03 15:41:07 -07:00
Even Rouault 99c2808521 Merge branch 'getimage_overflow' into 'master'
Update getimage to support reading large raster images

See merge request libtiff/libtiff!389
2022-09-27 18:54:38 +00:00
Even Rouault 8c23b6fa5c Merge branch 'MinGW-warnings_ipctutil' into 'master'
Fix #458: MinGW Windows 64: warning because 'long' is a 32 bits type in...

Closes #458

See merge request libtiff/libtiff!391
2022-09-26 18:06:11 +00:00
Su Laus 6ac3c7a0b0 Fix #458: MinGW Windows 64: warning because 'long' is a 32 bits type in... 2022-09-26 18:06:11 +00:00
Eric Siegel 993c4885c6 Update getimage to support large raster images 2022-09-15 20:26:34 -07:00
Even Rouault 4c3ddd99b6 Merge branch 'typo_fix' into 'master'
tif_lzw.c: fix typo in code comment

See merge request libtiff/libtiff!387
2022-09-08 16:32:59 +00:00
Even Rouault 300ca7731c tif_lzw.c: fix typo in code comment 2022-09-08 18:15:45 +02:00
Su_Laus f00484b951 Revised handling of TIFFTAG_INKNAMES and related TIFFTAG_NUMBEROFINKS value
In order to solve the buffer overflow issues related to TIFFTAG_INKNAMES and related TIFFTAG_NUMBEROFINKS value, a revised handling of those tags within LibTiff is proposed:

Behaviour for writing:
    `NumberOfInks`  MUST fit to the number of inks in the `InkNames` string.
    `NumberOfInks` is automatically set when `InkNames` is set.
    If `NumberOfInks` is different to the number of inks within `InkNames` string, that will be corrected and a warning is issued.
    If `NumberOfInks` is not equal to samplesperpixel only a warning will be issued.

Behaviour for reading:
    When reading `InkNames` from a TIFF file, the `NumberOfInks` will be set automatically to the number of inks in `InkNames` string.
    If `NumberOfInks` is different to the number of inks within `InkNames` string, that will be corrected and a warning is issued.
    If  `NumberOfInks` is not equal to samplesperpixel only a warning will be issued.

This allows the safe use of the NumberOfInks value to read out the InkNames without buffer overflow

This MR will close the following issues:  #149, #150, #152, #168 (to be checked), #250, #269, #398 and #456.

It also fixes the old bug at http://bugzilla.maptools.org/show_bug.cgi?id=2599, for which the limitation of `NumberOfInks = SPP` was introduced, which is in my opinion not necessary and does not solve the general issue.
2022-08-30 16:56:48 +02:00
Su_Laus 4746f16253 tiffcrop: disable incompatibility of -Z, -X, -Y, -z options with any PAGE_MODE_x option (fixes #411 and #413)
tiffcrop does not support –Z, -z, -X and –Y options together with any other PAGE_MODE_x options like  -H, -V, -P, -J, -K or –S.

Code analysis:

With the options –Z, -z, the crop.selections are set to a value > 0. Within main(), this triggers the call of processCropSelections(), which copies the sections from the read_buff into seg_buffs[].
In the following code in main(), the only supported step, where that seg_buffs are further handled are within an if-clause with  if (page.mode == PAGE_MODE_NONE) .

Execution of the else-clause often leads to buffer-overflows.

Therefore, the above option combination is not supported and will be disabled to prevent those buffer-overflows.

The MR solves issues #411 and #413.
2022-08-25 16:31:26 +02:00
Even Rouault 48d6ece838 Merge branch 'tiffcrop_S-option_mutually_exclusive' into 'master'
tiffcrop:  -S option mutually exclusive (fixes #349, #414, #422, #423, #424)

Closes #424, #423, #422, #414 et #349

See merge request libtiff/libtiff!378
2022-08-21 09:45:03 +00:00
Su_Laus bad48e90b4 tiffcrop -S option: Make decision simpler. 2022-08-20 23:35:26 +02:00
Even Rouault a10572b70d Merge branch 'remove_death_commented_code' into 'master'
Remove dead code from tif_dirread.c, tif_dirwrite.c and tif_getimage.c

See merge request libtiff/libtiff!380
2022-08-20 18:01:33 +00:00
Su Laus 8fc154b6c5 Remove dead code from tif_dirread.c, tif_dirwrite.c and tif_getimage.c 2022-08-20 18:01:33 +00:00
Even Rouault 728e1495e4 Merge branch 'coverity_fixes' into 'master'
Silence Coverity Scan false positive warnings about out-of-bounds access

See merge request libtiff/libtiff!379
2022-08-16 09:14:12 +00:00
Even Rouault c5c9864714 tif_zip.c: silence Coverity Scan false positive warnings about out-of-bounds access (CID 1491190, 1491197, 1491201) 2022-08-16 10:43:47 +02:00
Even Rouault 3b727a6b17 tif_dirread.c: silence Coverity Scan false positive warnings about out-of-bounds access (CID 1491182, 1491186) 2022-08-16 10:40:07 +02:00
Even Rouault ac6ddaf678 Merge branch 'default_tag_values_extended' into 'master'
Presetting of default tag values extended (e.g. PlanarConfig). (fixes #449)

Closes #449

See merge request libtiff/libtiff!377
2022-08-16 07:04:19 +00:00
Su Laus e70dee48f5 Presetting of default tag values extended (e.g. PlanarConfig). (fixes #449) 2022-08-16 07:04:19 +00:00
Su_Laus 8fe3735942 According to Richard Nolde https://gitlab.com/libtiff/libtiff/-/issues/401#note_877637400 the tiffcrop option „-S“ is also mutually exclusive to the other crop options (-X|-Y), -Z and -z.
This is now checked and ends tiffcrop if those arguments are not mutually exclusive.

This MR will fix the following tiffcrop issues: #349, #414, #422, #423, #424
2022-08-15 22:11:03 +02:00
Even Rouault 5b1f85b55c Merge branch 'warning_fix' into 'master'
Fix warning about shadowing

See merge request libtiff/libtiff!376
2022-08-09 21:06:57 +00:00
Even Rouault 5934fd2d88 Fix warning about shadowing 2022-08-09 22:48:25 +02:00
Even Rouault 84218df092 Merge branch 'fix_225' into 'master'
Deal with RichTIFFIPTC tag written with LONG type (fixes #225)

Closes #225

See merge request libtiff/libtiff!374
2022-08-09 20:35:26 +00:00
Even Rouault 9c03a345fe Merge branch 'Writing_IFD8_to_ClassicTIFF_bugfix' into 'master'
Correcting defects reported by Coverity Scan for MR !369

See merge request libtiff/libtiff!375
2022-08-09 19:59:23 +00:00
Su Laus 27a45b790e Correcting defects reported by Coverity Scan for MR !369 2022-08-09 19:59:23 +00:00
Even Rouault ed8b658bf9 Merge branch 'fix_442_Writing_IFD8_to_ClassicTIFF' into 'master'
TIFFSetValue(): Writing IFD8 & LONG8 tags to ClassicTIFF corrected (fixes #442)

Closes #442

See merge request libtiff/libtiff!369
2022-08-09 15:15:57 +00:00
Su Laus af1cf0789a TIFFSetValue(): Writing IFD8 & LONG8 tags to ClassicTIFF corrected (fixes #442) 2022-08-09 15:15:57 +00:00
Even Rouault e6b07b2ef4 Deal with RichTIFFIPTC tag written with LONG type (fixes #225) 2022-08-09 11:16:27 +02:00
Roger Leigh b5d7d508ff Merge branch 'manpage-functions-added' into 'master'
doc: Missing public functions added to TIFF documentation in Sphinx

See merge request libtiff/libtiff!372
2022-08-07 20:52:27 +00:00
Su Laus 644558a24f doc: Missing public functions added to TIFF documentation in Sphinx 2022-08-07 20:52:27 +00:00
Even Rouault 372371501b Merge branch 'tifjpeg_version_check' into 'master'
tif_jpeg.c: allow to pass -DEXPECTED_JPEG_LIB_VERSION=number to do optional...

See merge request libtiff/libtiff!373
2022-07-29 14:38:50 +00:00
Even Rouault fd82c68d18 tif_jpeg.c: allow to pass -DEXPECTED_JPEG_LIB_VERSION=number to do optional compile-time version check 2022-07-29 13:13:34 +02:00
Even Rouault c3f095e6cd Merge branch 'TIFFReadFromUserBuffer_fix' into 'master'
TIFFReadFromUserBuffer(): fix clearing of TIFF_CODERSETUP flag that could...

See merge request libtiff/libtiff!371
2022-07-21 10:42:18 +00:00
Even Rouault c1dfe33a8c TIFFReadFromUserBuffer(): fix clearing of TIFF_CODERSETUP flag that could cause issues with reading JPEG compressed files 2022-07-21 11:25:57 +02:00
Roger Leigh 71d5d20f11 Merge branch 'vs2022-fixes' into 'master'
cmake: Correct duplicate definition of _CRT_SECURE_NO_WARNINGS

Closes #443

See merge request libtiff/libtiff!370
2022-07-20 23:43:53 +00:00
Roger Leigh 7da8c385e0 cmake: Correct duplicate definition of _CRT_SECURE_NO_WARNINGS 2022-07-13 21:29:41 +01:00
Even Rouault 35abe37853 Merge branch 'vs2022-fixes' into 'master'
cmake: Fixes for Visual Studio 2022

See merge request libtiff/libtiff!368
2022-07-13 09:13:36 +00:00
Roger Leigh 42fc3324e1 cmake: Fixes for Visual Studio 2022 2022-07-13 06:56:03 +01:00
Roger Leigh 115e1aea6b Merge branch 'elf-symbol-export' into 'master'
Explicit export of versioned ELF symbols

Closes #437

See merge request libtiff/libtiff!361
2022-07-03 18:34:06 +00:00
Even Rouault 5e60251ea8 Merge branch 'fix_433' into 'master'
_TIFFCheckFieldIsValidForCodec(): return FALSE when passed a codec-specific...

Closes #433

See merge request libtiff/libtiff!363
2022-07-03 17:28:04 +00:00
Su_Laus d4dd5c66d4 CLIPPATH tags defined twice but differently and also wrongly
In tif_dirinfo.c the tags for clippath are wrongly defined and the tag TIFFTAG_XCLIPPATHUNITS is even different twice. Therefore, those tags cannot be written / read correctly and may even lead to buffer overflow.
E.g.: In the case of TIFFSetField(YCLIPPATHUNITS), a 1 byte storage space is allocated because of TIFF_SETGET_UNDEFINED, in which an  int32_t value should be stored because of TIFF_SLONG type definition. Then, an int32_t value is read from that 1 byte storage location.

The current definition is:

{ TIFFTAG_CLIPPATH, -1, -3, TIFF_BYTE, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "ClipPath", NULL },
{ TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_SLONG, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "XClipPathUnits", NULL },
{ TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_SBYTE, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "XClipPathUnits", NULL },
{ TIFFTAG_YCLIPPATHUNITS, 1, 1, TIFF_SLONG, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "YClipPathUnits", NULL },

Whereas the correct definition according to TIFF Specification Supplement 1 (https://www.awaresystems.be/imaging/tiff/specification/TIFFPM6.pdf) should be:

{ TIFFTAG_CLIPPATH, -3, -3, TIFF_BYTE, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "ClipPath", NULL },
{ TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "XClipPathUnits", NULL },
{ TIFFTAG_YCLIPPATHUNITS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "YClipPathUnits", NULL },

Also the set_get_field of the following tag should be corrected from

{ TIFFTAG_INTEROPERABILITYIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "InteroperabilityIFDOffset", NULL },
to
{ TIFFTAG_INTEROPERABILITYIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "InteroperabilityIFDOffset", NULL },

However, if those tags schould not be handled by LibTiff because they are deamed as abandoned or unwanted tags, those tags need to be defined with FIELD_IGNORE instead of FIELD_CUSTOM and keeping set_field_type  = TIFF_SETGET_UNDEFINED
2022-07-01 22:28:16 +02:00
Su_Laus 6e3d33b5c0 In tif_dirinfo.c the definition for TIFFTAG_COMPRESSION has different settings of field_readcount=TIFF_VARIABLE (-1) and field_writecount=1. The tag is defined with Count=1, thus field_readcount is wrong and should also be 1.
Although TIFFTAG_BITSPERSAMPLE is defined with Count:N=SamplesPerPixel, only ONE uint16_t value is passed with TIFFSetField() and TIFFGetField(). However, an array with N=SamplesPerPixel equal values is written into the TIFF file.
Shouldn't field_readcount = field_writecount = 1 then?  The behaviour of TiffLib does not change, because the handling is coded directly.
2022-07-01 21:10:29 +02:00
Even Rouault 275735d035 _TIFFCheckFieldIsValidForCodec(): return FALSE when passed a codec-specific tag and the codec is not configured (fixes #433)
This avoids crashes when querying such tags
2022-06-27 16:09:54 +02:00
Even Rouault 1dbcacd786 Merge branch '16bit_cielab' into 'master'
add basic 16bit-cielab support

See merge request libtiff/libtiff!336
2022-06-27 10:19:39 +00:00
Caolán McNamara f828040e88 Add basic 16bit-cielab support
just a copy of putcontig8bitCIELab that reads 16bit vals but divide l by
257, a and b by 256 before passing to TIFFCIELabToXYZ

motivation: https://bugs.documentfoundation.org/show_bug.cgi?id=131199
the "clavijo16bitlab.tiff" example where tiffinfo says:
```
  Image Width: 2601 Image Length: 3503
  Resolution: 96, 96 pixels/inch
  Bits/Sample: 16
  Compression Scheme: AdobeDeflate
  Photometric Interpretation: CIE L*a*b*
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 3
  Rows/Strip: 1
  Planar Configuration: single image plane
  DateTime: 2020:03:07 10:20:42
```
2022-06-27 10:19:38 +00:00
Roger Leigh eb4087c526 Merge branch 'manpage-fixes' into 'master'
Sphinx documentation fixes

See merge request libtiff/libtiff!362
2022-06-24 15:56:26 +00:00
Roger Leigh 107070b9ab doc: Correct types and cross-references 2022-06-24 15:49:14 +01:00
Roger Leigh 6ab8136187 doc: Correct manual page path 2022-06-24 15:07:40 +01:00
Roger Leigh 38f67894cd build: Make rational2double static only for automake
This copies the same logic as used by CMake.
2022-06-24 12:57:56 +01:00
Roger Leigh dc73ae317e build: Update autoconf version to 4.5.0 and soname to 6.0.0 2022-06-24 11:44:19 +01:00
Roger Leigh 276c34252e build: Update autoconf ld-version-script default 2022-06-24 11:43:59 +01:00
Roger Leigh a6cc522a4c libtiff: Correct version script for changes since v4.4.0 2022-06-24 10:55:13 +01:00
Roger Leigh d3057d8568 libtiff: Update version script documentation 2022-06-24 10:54:52 +01:00
Roger Leigh 23cbc60863 libtiff: Add symbol versioning of all exported symbols 2022-06-24 10:30:19 +01:00
Even Rouault 870fc59cac Merge branch 'webp_mem_improvements' into 'master'
WEBP codec: avoid temporary buffer and memcpy() on whole tile/strip decoding

See merge request libtiff/libtiff!360
2022-06-24 09:28:57 +00:00
Roger Leigh 3791130d21 build: Enable symbol versioning by default 2022-06-24 10:28:17 +01:00
Roger Leigh 3923d24ac2 Merge branch 'sphinx-manpages' into 'master'
doc: Add Sphinx conversion of all manpages

Closes #361

See merge request libtiff/libtiff!356
2022-06-24 08:13:56 +00:00
Roger Leigh 8887c9e936 Merge branch 'remove-wince' into 'master'
Remove obsolete WinCE source file

See merge request libtiff/libtiff!357
2022-06-24 08:11:29 +00:00
Even Rouault e6d7e0b76d WEBP codec: avoid temporary buffer and memcpy() on whole tile/strip decoding 2022-06-23 12:09:08 +02:00
Even Rouault 6c0cbc28e7 Merge branch 'horAcc8_fix' into 'master'
tif_predict.c: make horAcc8() work with icc (ICC) 2021.6.0 20220226 -O2

See merge request libtiff/libtiff!359
2022-06-22 08:00:33 +00:00
Even Rouault 2e78780ea5 tif_predict.c: make horAcc8() work with icc (ICC) 2021.6.0 20220226 -O2
For a reason I don't understand, recent ICC generates wrong code in -O2
mode for the stride = 3 and 4 cases. The modified code is more
straightfoward, so go for it.
2022-06-22 03:16:51 +02:00
Roger Leigh e696b8f92a Merge branch 'ci-restore-old' into 'master'
ci: Restore testing with Ubuntu 20.04

See merge request libtiff/libtiff!358
2022-06-19 10:06:55 +00:00
Roger Leigh be617a9b90 ci: Restore testing with Ubuntu 20.04 2022-06-19 10:50:31 +01:00
Roger Leigh 9bba86183f Remove obsolete WinCE source file 2022-06-19 08:39:27 +01:00
Roger Leigh ad886e10c5 doc: Add missing punctuation 2022-06-19 08:36:19 +01:00
Roger Leigh 9ba52d00ac doc: Remove semicolon from c:function definition 2022-06-19 08:35:24 +01:00
Roger Leigh 73f45cfb3c doc: Remove remaining HTML entities 2022-06-19 08:32:11 +01:00
Roger Leigh 47b55634ec doc: Improve the build page 2022-06-19 08:27:44 +01:00
Roger Leigh 7faec51e2b doc: Add Sphinx conversion of all manpages 2022-06-18 22:54:20 +01:00
Roger Leigh 69f95389ac Merge branch 'dist-html' into 'master'
build: Distribute and install HTML documentation

See merge request libtiff/libtiff!352
2022-06-18 20:35:38 +00:00
Even Rouault 8e9ce05290 Merge branch 'pkgconfig' into 'master'
Adding Requires.private generation

See merge request libtiff/libtiff!355
2022-06-13 17:04:20 +00:00
Yishen Miao 0afda60116 Adding Requires.private generation
Adds Requires.private generation so that pkg-config can correctly find
the dependencies of libtiff.
2022-06-13 09:56:15 -07:00
Roger Leigh 7915e7c6c7 Merge branch 'ci-dist' into 'master'
ci: Archive distribution tar and zip files

See merge request libtiff/libtiff!354
2022-06-11 21:23:52 +00:00
Roger Leigh 0bd28e7c1c ci: Archive distribution tar and zip files 2022-06-11 12:20:13 +01:00
Even Rouault 1c6dbb52f2 Merge branch 'export_TIFFClampDoubleToUInt32' into 'master'
libtiff.def: export _TIFFClampDoubleToUInt32

See merge request libtiff/libtiff!353
2022-06-11 10:22:11 +00:00
Even Rouault c5e6b2fff0 libtiff.def: export _TIFFClampDoubleToUInt32 2022-06-11 12:02:38 +02:00
Even Rouault f3a5e0107f Merge branch 'issue-415+427+428' into 'master'
fix the FPE in tiffcrop (#415, #427, and #428)

Closes #428, #427 et #415

See merge request libtiff/libtiff!346
2022-06-11 09:31:44 +00:00
4ugustus dd1bcc7abb fix the FPE in tiffcrop (#415, #427, and #428) 2022-06-11 09:31:43 +00:00
Roger Leigh 47d0894f13 build: Distribute and install HTML documentation 2022-06-11 10:10:08 +01:00
Even Rouault 033f8b51b8 Merge branch 'tif_jpeg_warning_fix' into 'master'
tif_jpeg.c: fix error message

See merge request libtiff/libtiff!351
2022-06-10 20:11:44 +00:00
Even Rouault c9b9e0d856 tif_jpeg.c: fix error message 2022-06-10 21:45:45 +02:00
Roger Leigh 6aec9314ee Merge branch 'android_libm' into 'master'
Fix dependency on libm on Android

See merge request libtiff/libtiff!350
2022-06-10 06:48:32 +00:00
Matthias Kuhn cd38e31d6e Always link to libm if available 2022-06-09 13:21:13 +02:00
Roger Leigh e990bbfad2 Merge branch 'vasyl5-master-patch-97651' into 'master'
libtoolize: command not found on macOS.

See merge request libtiff/libtiff!289
2022-06-05 16:33:32 +00:00
Roger Leigh 62f90c42fc Merge branch 'rst-docs' into 'master'
Convert HTML documentation to Sphinx RST

See merge request libtiff/libtiff!349
2022-06-05 15:58:02 +00:00
Roger Leigh 7968c365b5 Merge remote-tracking branch 'origin/master' into rst-docs 2022-06-05 16:40:32 +01:00
Roger Leigh 003b7a5cb9 Merge branch 'cmake-xc-faxtable' into 'master'
cmake: Do not build faxtable target when cross-compiling

See merge request libtiff/libtiff!342
2022-06-05 13:45:12 +00:00
Roger Leigh d66540a28f Merge branch 'cmake-disable-options' into 'master'
Add options for disabling tools, tests, contrib and docs

See merge request libtiff/libtiff!343
2022-06-05 13:44:17 +00:00
Roger Leigh da29b078c3 Merge branch 'cmake-msvc-options' into 'master'
cmake: Add MSVC options when building all libraries and executables

See merge request libtiff/libtiff!344
2022-06-05 13:42:31 +00:00
Roger Leigh a812a39cb5 Merge branch 'cmake-win32-libtiffxx-static' into 'master'
cmake: libtiffxx is static on win32

See merge request libtiff/libtiff!338
2022-06-05 13:41:19 +00:00
Roger Leigh 91e878fa1e Merge branch 'licence-file' into 'master'
Rename COPYRIGHT to LICENSE.md

See merge request libtiff/libtiff!345
2022-06-05 12:45:40 +00:00
Roger Leigh fa1d6d787f Rename COPYRIGHT to LICENSE.md 2022-06-05 12:45:40 +00:00
Roger Leigh ab6b92b271 doc: Fix make distcheck 2022-06-05 13:34:32 +01:00
Roger Leigh 67d94e4a19 doc: Update automake configuration 2022-06-05 13:11:23 +01:00
Roger Leigh 661e747ab9 doc: Do not pass srcdir and builddir to sphinx-build 2022-06-05 11:21:00 +01:00
Roger Leigh 4252a61d3f doc: Additional top-level tidying 2022-06-05 11:19:38 +01:00
Roger Leigh ffeff66cf2 doc: Tidy top-level index 2022-06-05 11:08:52 +01:00
Roger Leigh 582455a501 doc: Move bugs to project 2022-06-05 10:39:22 +01:00
Roger Leigh 835319ab8f doc: Move misc to project 2022-06-05 10:16:59 +01:00
Roger Leigh 48d4340963 doc: Move all BigTIFF documentation into specification directory
* Remove the BigTIFF proposal since this has long been completed
* Update the BigTIFF PR to note completion of the work and replace
  present with past tense.
2022-06-05 10:00:45 +01:00
Roger Leigh 16354c94ee doc: Split release history
This permits the newer releases to be included in the top-level
toctree without polluting it with dozens of old releases.
2022-06-05 09:47:40 +01:00
Roger Leigh 28fc6ff780 doc: Correct accents 2022-06-05 09:39:23 +01:00
Roger Leigh f80227b9e7 doc: BigTIFF design markup improvements 2022-06-05 09:33:53 +01:00
Roger Leigh 50904e4381 Add doc/_static 2022-06-05 09:25:02 +01:00
Roger Leigh 963b928845 doc: Move TIFF specification and design notes into subdirectory 2022-06-05 09:24:20 +01:00
Roger Leigh 8088d606a8 doc: Move releases into subdirectory 2022-06-05 08:27:24 +01:00
Roger Leigh 7fae4544fc doc: Mark up TIFF tech note 2 2022-06-05 08:20:55 +01:00
Roger Leigh a15a68df39 doc: Use sphinxdox theme
The sphix_rtd_theme formats complex tables badly.
2022-06-05 07:25:32 +01:00
Roger Leigh 6fcf5fd957 doc: Clean up HTML tags 2022-06-05 07:25:24 +01:00
Roger Leigh 276579611c ci: Install Sphinx manual for use by GitLab pages 2022-06-04 21:53:09 +01:00
Roger Leigh 32f075901f doc: Use sphinx_rtd_theme 2022-06-04 21:52:33 +01:00
Roger Leigh 21ae5bbb02 Convert HTML documentation to Sphinx RST
* Add CMake build logic
* Add Autotools build logic
* Move from html/ to doc/
* Manual pages are still generated HTML for the time being
2022-06-04 20:53:23 +01:00
Roger Leigh 9ba9c66cca git: Ignore common IDE build files 2022-06-04 20:28:52 +01:00
Roger Leigh b2d6198417 Merge branch 'ci-ubuntu-22.04' into 'master'
ci: Update to use Ubuntu 22.04 CI images

Closes #429

See merge request libtiff/libtiff!348
2022-06-04 19:12:47 +00:00
Roger Leigh 560f1b0115 Merge branch 'opengl-option' into 'master'
cmake: Add tiff-opengl option

See merge request libtiff/libtiff!340
2022-06-04 19:07:23 +00:00
Roger Leigh 7643b4c434 tiffdump: Avoid overflow warning when reading 2022-06-04 19:56:51 +01:00
Roger Leigh fa8b983a26 ci: Update to use Ubuntu 22.04 CI images 2022-06-04 18:27:17 +01:00
Even Rouault ce539dc06b Merge branch 'master' into 'master'
Include stdlib.h in tif_lzw.c.

See merge request libtiff/libtiff!347
2022-06-04 01:45:44 +00:00
Brian Ledger dfe8aa027c Merge branch 'master' of https://gitlab.com/libtiff/libtiff 2022-06-03 21:40:54 -04:00
Brian Ledger cbd71793f5 Include stdlib.h in tif_lzw.c.
In `tif_lzw.c`, a call is made to `_byteswap_uint64`. This is declared in `stdlib.h`. `stdlib.h` is not included in `tib_lzw.c`, so a name error may occur.

This change adds `#include stdlib.h` to `tif_lzw.c`, to prevent a name error from occuring when `stdlib.h` is not included.
2022-06-03 21:23:51 -04:00
Roger Leigh 1ab0e2696a Add options for disabling tools, tests, contrib and docs 2022-05-29 22:38:36 +01:00
Roger Leigh f45ed446e9 cmake: Add MSVC options when building all libraries and executables 2022-05-29 22:31:08 +01:00
Roger Leigh fa3806c158 cmake: Do not build faxtable target when cross-compiling 2022-05-29 20:57:20 +01:00
Roger Leigh ef984ef786 cmake: Use add_compile_definitions and add_compile_options
It seems that some CMake versions can't export targets using PRIVATE
linking, even though the private target is never used.
2022-05-29 20:55:39 +01:00
Roger Leigh 88727514f0 Merge remote-tracking branch 'origin/master' into cmake-msvc-options 2022-05-29 20:07:29 +01:00
Roger Leigh 03620e4c31 Merge remote-tracking branch 'origin/master' into cmake-win32-libtiffxx-static 2022-05-29 20:07:00 +01:00
Roger Leigh 182bd6716c Merge branch 'ci-x64' into 'master'
ci: Remove arm64 temporarily

See merge request libtiff/libtiff!341
2022-05-29 18:53:16 +00:00
Roger Leigh c3f0b90df5 ci: Remove arm64 temporarily 2022-05-29 19:38:01 +01:00
Roger Leigh b63e40603b autoconf: Add --disable-opengl option 2022-05-29 12:05:27 +01:00
Roger Leigh 36c8177fe8 cmake: Add tiff-opengl option 2022-05-29 11:36:14 +01:00
Roger Leigh 2582c406b0 cmake: Add MSVC options when building all libraries and executables 2022-05-29 11:33:49 +01:00
Roger Leigh 0e58c40f80 cmake: libtiffxx is static on win32 2022-05-29 11:24:56 +01:00
Even Rouault 19db1d316b html/Makefile.am: add v4.4.0.html to docfiles 2022-05-22 11:01:54 +02:00
Even Rouault cbe3e496a9 Update HOWTO-RELEASE with .tar.xz 2022-05-20 18:35:49 +02:00
Even Rouault b6a17e567f Prepare for release 4.4.0 2022-05-20 18:15:09 +02:00
Even Rouault b92d4ad071 Merge branch 'pkgconf_abs_path' into 'master'
Handle absolute paths in pkg-config file

See merge request libtiff/libtiff!333
2022-05-16 13:27:42 +00:00
Miloš Komarčević 9dec6a620d Handle absolute paths in pkg-config file 2022-05-16 15:13:34 +02:00
Even Rouault d52594d132 Merge branch 'fix-tests-with-ro-source-dir' into 'master'
cmake: allow running the tests with a read-only source directory

See merge request libtiff/libtiff!332
2022-05-15 08:57:03 +00:00
Alex Richardson edc9177227 cmake: allow running the tests with a read-only source directory
Prior to this commit CTest would invoke all simple_tests tests with the
current working directory set to the source directory. However, some of
the tests (e.g. rewrite) will output files to the current working
directory and will therefore fail when run with a read-only source
directory. This can happen e.g. when testing a cross-compiled version of
libtiff where the sources are mounted read-only in the virtual machine.

Simply changing the working directory to CMAKE_CURRENT_BINARY_DIR allows
all but raw_decode to pass. The raw_decode test looks for files in the
source directory, and uses the `srcdir` environment variable to find, so
we also have to add a set_tests_properties() call to specify that env var.
2022-05-15 00:16:19 +00:00
Even Rouault eaee379e97 Merge branch 'tiffcrop_pipeline_error' into 'master'
tiffcrop: Fixes complain of pipeline "cmake-ninja-arm64"  about abs() on...

See merge request libtiff/libtiff!331
2022-05-14 21:20:07 +00:00
Su Laus 4988eb8cfb tiffcrop: Fixes complain of pipeline "cmake-ninja-arm64" about abs() on... 2022-05-14 21:20:06 +00:00
Even Rouault 9da3849a51 Merge branch 'TIFFField_SetGetSize_CountSize' into 'master'
Public functions TIFFFieldSetGetSize() and TIFFieldSetGetCountSize() added.

See merge request libtiff/libtiff!284
2022-05-14 19:32:11 +00:00
Su Laus 11f3f27960 Public functions TIFFFieldSetGetSize() and TIFFieldSetGetCountSize() added. 2022-05-14 19:32:11 +00:00
Even Rouault 9a9ccadd73 Merge branch 'jondo-master-patch-87274' into 'master'
Replace add_compile_definitions for CMake versions before 3.12 (#238)

See merge request libtiff/libtiff!330
2022-05-13 14:45:55 +00:00
Robert Pollak 0d8a20920e Replace add_compile_definitions for CMake versions before 3.12 (#238) 2022-05-13 14:34:47 +00:00
Even Rouault 0aa7c0b26d Merge branch 'master' into 'master'
Remove incorrect assert.

See merge request libtiff/libtiff!329
2022-05-13 12:32:17 +00:00
Ben Laurie 2fee05b7bb Remove incorrect assert. 2022-05-13 12:32:17 +00:00
Even Rouault 07144deccc Merge branch 'Fix_Issue#330' into 'master'
tiffcrop: Fix issue #330 and some more from 320 to 349

Closes #330

See merge request libtiff/libtiff!298
2022-05-10 20:03:18 +00:00
Su Laus e319508023 tiffcrop: Fix issue #330 and some more from 320 to 349 2022-05-10 20:03:17 +00:00
Even Rouault 1f2bf6e955 test_signed_tags.c: fix CID 1504376 2022-05-10 15:59:00 +02:00
Even Rouault 31811f3b56 Merge branch 'fix_#29_tiffcp_orientationTag' into 'master'
tiffcp: Fix incomprehensible setting of orientation tag (fixes #29)

Closes #29

See merge request libtiff/libtiff!327
2022-05-10 13:41:08 +00:00
Even Rouault ba5f6797d5 Merge branch 'palette-8bit' into 'master'
tiff2pdf: handle 8-bit palette colormap

See merge request libtiff/libtiff!328
2022-05-10 13:40:05 +00:00
Jay Berkenbilt 574611ca5d tiff2pdf: handle 8-bit palette colormap
If all the colors in a palette are in the range [0, 255], treat the
palette as an 8-bit colormap. This workaround already exists elsewhere
in the software including in tiff2ps.
2022-05-09 13:31:00 -04:00
Even Rouault 06df57a54d Merge branch 'fix_#40_ReadSignedTags' into 'master'
Reading of signed tags added (fixes #40)

Closes #40

See merge request libtiff/libtiff!326
2022-05-08 19:55:54 +00:00
Su Laus f536b00b64 Reading of signed tags added (fixes #40) 2022-05-08 19:55:53 +00:00
Even Rouault 29b5947f34 Fix typos in comments 2022-05-08 21:02:02 +02:00
Even Rouault c1ae29f9eb Merge branch 'fix_400' into 'master'
tiffcp: avoid buffer overflow in "mode" string (fixes #400)

Closes #400

See merge request libtiff/libtiff!323
2022-05-08 17:59:21 +00:00
Even Rouault 7f11676b13 Merge branch 'CheckForBigTiff' into 'master'
TIFFIsBigTiff()  function added.

See merge request libtiff/libtiff!325
2022-05-08 17:57:41 +00:00
Su Laus bfb7d2291f TIFFIsBigTiff() function added. 2022-05-08 17:57:40 +00:00
Su_Laus 1f133d1b3f tiffcp: Fix incomprehensible setting of orientation tag (fixes #29) 2022-05-01 20:36:52 +02:00
Even Rouault 9752dae8fe Merge branch 'fix_#8_FreeAnonTag' into 'master'
extra flag for anonymous (unknown) tags (fixes #8)

Closes #400 et #8

See merge request libtiff/libtiff!324
2022-04-23 14:00:48 +00:00
Even Rouault b4e79bfa0c tif_lzw.c: fix potential out-of-bounds error when trying to read in the same tile/strip after an error has occured (fixes #410) 2022-04-22 18:58:52 +02:00
Su_Laus 97574866cb extra flag for anonymous (unknown) tags (fixes #8) 2022-04-06 15:27:30 +02:00
Su_Laus fb1db38495 tiffcp: avoid buffer overflow in "mode" string (fixes #400) 2022-04-02 22:33:31 +02:00
Even Rouault b51bb15712 avoid hang in TIFFRewriteDirectory() if a classic file > 4 GB is attempted to be created
Fixes https://github.com/OSGeo/gdal/issues/5479
2022-03-21 18:03:20 +01:00
Even Rouault e1980072c9 Merge branch 'Correct_tag_auto-registration_description' into 'master'
Correct reading description for anonymous tag auto-registration in addingtags.html (closes 353)

Closes #353

See merge request libtiff/libtiff!320
2022-03-18 23:03:56 +00:00
Su Laus 2f549e3615 Correct reading description for anonymous tag auto-registration in addingtags.html (closes 353) 2022-03-18 23:03:56 +00:00
Even Rouault 9624660561 tif_lzw.c: avoid harmless unsigned-integer-overflow (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45741) 2022-03-18 20:53:51 +01:00
Even Rouault 47a209ef9e Merge branch 'fix_396' into 'master'
tiffcp: do not try to fetch compressor-specific tags when not appropriate (fixes #396)

Closes #396

See merge request libtiff/libtiff!316
2022-03-17 21:27:55 +00:00
Even Rouault 5ed23e763e Merge branch 'Fix_cmake_warnings' into 'master'
Fix some CMake warnings

See merge request libtiff/libtiff!319
2022-03-17 21:27:40 +00:00
Su Laus 970bcd46b8 Fix some CMake warnings 2022-03-17 21:27:40 +00:00
Even Rouault ef0edff7f7 Merge branch 'lzw_decode_improvements' into 'master'
LZWDecode(): major speed improvements

See merge request libtiff/libtiff!318
2022-03-17 13:53:19 +00:00
Even Rouault 3079627ea0 LZWDecode(): major speed improvements
This mostly comes from dealing specifically with codes that expand to
2, 3 and 4 bytes or more to avoid branches, and dealing with longer
repeated sequences (e.g. lots of bytes to 0).

With the following bench.c, execution time is 32% faster on a 8000x8000
4 bands uint16 predictor=2 image that has a 1.6x compression ratio. with
gcc 9.4.0, on x86_64

bench.c:
```
 #include "tiffio.h"
 #include <stdlib.h>
 #include <stdint.h>

int main(int argc, char* argv[])
{
    if( argc != 2 )
    {
        fprintf(stderr, "Usage: ./bench my.tif\n");
        exit(1);
    }
    TIFF* tif = TIFFOpen(argv[1], "r");
    if( tif == NULL )
    {
        fprintf(stderr, "Cannot open %s\n", argv[1]);
        exit(1);
    }
    if( !TIFFIsTiled(tif) )
    {
        fprintf(stderr, "Only tiled image supported\n");
        exit(1);
    }
    int tilesize = (int)TIFFTileSize(tif);
    char* c = malloc(tilesize);
    if( c == NULL )
    {
        fprintf(stderr, "Out of memory\n");
        exit(1);
    }
    const uint32_t numtiles = TIFFNumberOfTiles(tif);
    //int numloops = 4 * (int)(1e9 / ((double)tilesize * numtiles));
    //printf("Number of loops: %d\n", numloops);
    int numloops = 1;
    for(int i =0; i< numloops; i++)
    {
        for(uint32_t tileindex = 0; tileindex < numtiles; tileindex++ )
        {
            TIFFReadEncodedTile(tif, tileindex, c, tilesize);
        }
    }
    free(c);
    TIFFClose(tif);
    return 0;
}
```
2022-03-16 13:56:52 +01:00
Even Rouault a2aa4074e9 LZWDecode(): modest speed improvement: fetch input data by chunks of the largest natural integer of the architecture 2022-03-16 13:56:52 +01:00
Even Rouault 4d42d57265 Merge branch 'kmilos-master-patch-45885' into 'master'
Correct fix for the pkgconf file relative paths

See merge request libtiff/libtiff!317
2022-03-14 10:53:08 +00:00
Even Rouault 189d657792 tif_lzw.c: make LZW_CHECKEOS non-optional 2022-03-10 12:15:45 +01:00
Even Rouault cb0ffc6328 tiffsplit.c: fix compiler warning on 32-bit 2022-03-10 11:51:13 +01:00
Miloš Komarčević 3172b1ddac Correct fix for the pkgconf file relative paths 2022-03-10 10:06:16 +00:00
Even Rouault 408976c44e Merge branch 'issue-278' into 'master'
fix heap buffer overflow in tiffcp (#278)

Closes #278

See merge request libtiff/libtiff!311
2022-03-10 08:48:00 +00:00
4ugustus 88d79a45a3 fix heap buffer overflow in tiffcp (#278) 2022-03-10 08:48:00 +00:00
Even Rouault 9c920e367d tiffcp: do not try to fetch compressor-specific tags when not appropriate (fixes #396) 2022-03-09 18:02:01 +01:00
Even Rouault 6df920f8e7 Merge branch 'i_am_a_unsympathetic_person' into 'master'
index.html: make it clear that I'm a unsympathetic person

See merge request libtiff/libtiff!315
2022-03-09 15:47:16 +00:00
Even Rouault b6e49c9e4b index.html: make it clear that I'm a unsympathetic person 2022-03-09 15:07:10 +01:00
Even Rouault c6b0ee9f4b Merge branch 'Fix_Issue#395' into 'master'
tiffcrop: fix issue #395: generation of strange section images.

Closes #395

See merge request libtiff/libtiff!312
2022-03-08 20:49:50 +00:00
Su Laus d1e3b382f1 tiffcrop: fix issue #395: generation of strange section images. 2022-03-08 20:49:47 +00:00
Even Rouault 46dc8fcd4d Merge branch 'Fix_Issue#380' into 'master'
tiffcrop: fix issue #380 and #382 heap buffer overflow in extractImageSection

Closes #382 et #380

See merge request libtiff/libtiff!307
2022-03-08 17:02:44 +00:00
Su Laus 232282fd8f tiffcrop: fix issue #380 and #382 heap buffer overflow in extractImageSection 2022-03-08 17:02:44 +00:00
Even Rouault f2b656e2e6 Merge branch 'issue-392' into 'master'
add checks for return value of limitMalloc (#392)

Closes #392

See merge request libtiff/libtiff!314
2022-03-08 16:56:17 +00:00
Even Rouault f8d0f9aa1b Merge branch 'issue-393' into 'master'
fix the FPE in tiffcrop (#393)

Closes #393

See merge request libtiff/libtiff!310
2022-03-08 16:22:04 +00:00
4ugustus 32ea0722ee fix the FPE in tiffcrop (#393) 2022-03-08 16:22:04 +00:00
Even Rouault 7877e9c4c0 Merge branch 'kmilos-master-patch-56785' into 'master'
Fix pkgconf file relative paths

Closes #394

See merge request libtiff/libtiff!309
2022-03-08 16:20:56 +00:00
Augustus 40b00cfb32 add checks for return value of limitMalloc (#392) 2022-03-07 18:24:20 +08:00
Miloš Komarčević 0fafae5979 Fix pkgconf file relative paths 2022-03-02 19:00:00 +00:00
Even Rouault 5e18004500 Merge branch 'fix_385' into 'master'
tif_jbig.c: fix crash when reading a file with multiple IFD in memory-mapped...

Closes #385

See merge request libtiff/libtiff!306
2022-02-25 10:38:31 +00:00
Even Rouault a1c933dabd tif_jbig.c: fix crash when reading a file with multiple IFD in memory-mapped mode and when bit reversal is needed (fixes #385) 2022-02-24 22:26:02 +01:00
Even Rouault 4ab6a5e651 Merge branch 'string_size_limit' into 'master'
_TIFFVSetField(): when passing a string without explicit length, check that...

See merge request libtiff/libtiff!304
2022-02-24 20:30:47 +00:00
Even Rouault 790ee59d38 Merge branch 'TIFFClientOpen_cleanup' into 'master'
TIFFClientOpen(): remove useless initializations of tif_rawcc and tif_flags...

See merge request libtiff/libtiff!303
2022-02-24 20:30:36 +00:00
Even Rouault 573e025277 Remove extra word in comment 2022-02-20 14:47:49 +01:00
Even Rouault 273983be9a TIFFPrintDirectory(): avoid potential multi-threading issue when reading the DotRange tag
The severity of the issue would be low (mix of values displayed) and the
time window where that would occur would be short.
2022-02-20 14:39:44 +01:00
Even Rouault 9aeb9f836a Constify signature of _TIFFsetXXXXArray() functions, and remove unused _TIFFsetString() 2022-02-20 13:46:23 +01:00
Even Rouault 183076faa6 _TIFFVSetField(): when passing a string without explicit length, check that the length doesn't except the 1 << 31 maximum bytes we support 2022-02-20 13:44:58 +01:00
Even Rouault 01c68b6ce0 tiffsplit.c: fix use after free introduced in master per commit 8ed97f4015 (related to #290) 2022-02-19 17:31:55 +01:00
Even Rouault 317a2b5c06 Merge branch 'Fix_Issue#284' into 'master'
tiff2ps: In limitMalloc() check for negative size (fixes #284)

Closes #284

See merge request libtiff/libtiff!300
2022-02-19 16:11:13 +00:00
Su Laus 0e3184840a tiff2ps: In limitMalloc() check for negative size (fixes #284) 2022-02-19 16:11:13 +00:00
Even Rouault 55018c3df8 Merge branch 'fix_288' into 'master'
tiffinfo: limit more memory allocations using -M switch (fixes #288)

Closes #288

See merge request libtiff/libtiff!299
2022-02-19 16:10:44 +00:00
Even Rouault 0ede1566aa Merge branch 'Fix_Issue#290' into 'master'
tiffsplit: limitMalloc() and getopt() introduced and more error messages. (fixes #290)

Closes #290

See merge request libtiff/libtiff!301
2022-02-19 16:10:16 +00:00
Su Laus 8ed97f4015 tiffsplit: limitMalloc() and getopt() introduced and more error messages. (fixes #290) 2022-02-19 16:10:16 +00:00
Even Rouault a8ca160837 Merge branch 'Fix_Issue#273_#275' into 'master'
tiffcrop: buffsize check  formula in loadImage() amended  (fixes #273,#275)

Closes #275 et #273

See merge request libtiff/libtiff!302
2022-02-19 16:08:15 +00:00
Su Laus aac006e579 tiffcrop: buffsize check formula in loadImage() amended (fixes #273,#275) 2022-02-19 16:08:15 +00:00
Even Rouault 47a5279c0a TIFFClientOpen(): remove useless initializations of tif_rawcc and tif_flags after TIFFReadDirectory()
Those initializations date back to the initial commit of libtiff, but I
strongly suspect there are no longer needed those days.
Setting tif_rawcc to (tmsize_t)-1 is weird. AFAICS, nowhere else in the library
-1 is used as a special markeri for that field. Immediately after TIFFReadDirectory()
returns it is set to 0, and this is the value used in tif_read.c/tif_write.c to
reset it.
And setting the TIFF_BUFFERSETUP bit of tif_flags is even more
suspicious as the only place where it is set otherwise is in
TIFFWriteBufferSetup(). I suspect this bogus setting of the flag was the
reason for commit dbf2339a1 where BUFFERCHECK() in addition to checking
the bit also checked the tif_rawdata against nullptr.

If setting those 2 fields was needed, it would mean that TIFFClientOpen() with the
'h' hint to disable automatic TIFFReadDirectory() would be broken,
because someone issuing a manual TIFFReadDirectory() couldn't set them,
as being private members.

The libtiff test suite is happy with that change, and the GDAL one too.
2022-02-19 16:48:26 +01:00
Even Rouault 6fc45de759 TIFFFetchNormalTag(): speed optimization when reading a (very large) nul-terminated ASCII tag 2022-02-19 16:12:08 +01:00
Even Rouault cef46abf54 TIFFWriteDirectoryTagData(): turn assertion on data length into a runtime check
For example, the assertion could actually be triggered when writing an
ASCII tag with more than 1 << 31 bytes.
2022-02-19 15:10:28 +01:00
Even Rouault a95b799f65 TIFFFetchNormalTag(): avoid calling memcpy() with a null source pointer and size of zero (fixes #383) 2022-02-17 15:28:43 +01:00
Roger Leigh 14756b2c8d Merge branch 'tl/fix-cpack' into 'master'
Fix packaging with CPack

See merge request libtiff/libtiff!292
2022-02-15 06:38:47 +00:00
Even Rouault 7b47aa4151 tiffinfo: limit more memory allocations using -M switch (fixes #288) 2022-02-11 14:43:33 +01:00
Even Rouault 180882b4db tif_dirwrite.c: take into account COMPRESSION_JXL 2022-02-11 13:29:14 +01:00
Even Rouault f9e12f146a Merge branch 'predictor_2_64bit' into 'master'
Predictor 2 (horizontal differenciation): support 64-bit

See merge request libtiff/libtiff!296
2022-02-11 12:22:34 +00:00
Even Rouault 0194d4ff51 Merge branch 'Fix_Issue#365' into 'master'
tiff2pdf: Fixes issues #365, #258 and #257 related to initializing 't2p->pdf_compressionquality'.

Closes #257, #258 et #365

See merge request libtiff/libtiff!297
2022-02-10 20:39:43 +00:00
Su Laus 55514cd825 tiff2pdf: Fixes issues #365, #258 and #257 related to initializing 't2p->pdf_compressionquality'. 2022-02-10 20:39:43 +00:00
Even Rouault b0456acbba Predictor 2 (horizontal differenciation): support 64-bit
There's no reason not to support 64-bit. The TIFF 6 specification
doesn't say anything about that (and even mention 4-bit, which we don't
support)
2022-02-09 22:52:52 +01:00
Even Rouault d46af879bc Merge branch 'Fix_Issue#352' into 'master'
tiffcrop.c: Fix issue #352 heap-buffer-overflow by correcting uint32_t underflow.

Closes #352

See merge request libtiff/libtiff!294
2022-02-09 21:31:30 +00:00
Su Laus 07d79fcac2 tiffcrop.c: Fix issue #352 heap-buffer-overflow by correcting uint32_t underflow. 2022-02-09 21:31:29 +00:00
Even Rouault a1dafbf307 Merge branch 'custom_dir_EXIF_Coverity_fixes' into 'master'
Fix Coverity Scan report issues for custom_dir_EXIF_231.c and test_directory.c

See merge request libtiff/libtiff!295
2022-02-08 20:15:37 +00:00
Su Laus d0b4f24a62 Fix Coverity Scan report issues for custom_dir_EXIF_231.c and test_directory.c 2022-02-08 20:15:37 +00:00
Roger Leigh 4002ca1cc7 Merge branch 'cmake-test' into 'master'
Correct CMake testing

Closes #317

See merge request libtiff/libtiff!291
2022-02-06 12:28:02 +00:00
Even Rouault 1adf4fa889 LogLuvEncode32(): avoid undefined behaviour of left shift on a signed integer 2022-02-06 13:09:12 +01:00
Even Rouault eecb0712f4 TIFFFetchStripThing(): avoid calling memcpy() with a null source pointer and size of zero (fixes #362) 2022-02-06 13:08:38 +01:00
Even Rouault 561599c99f TIFFReadDirectory(): avoid calling memcpy() with a null source pointer and size of zero (fixes #362) 2022-02-05 20:36:41 +01:00
Even Rouault 3cab27c250 Merge branch 'Jamaika1-master-patch-68264' into 'master'
Added stdlib.h

See merge request libtiff/libtiff!293
2022-01-29 10:12:50 +00:00
Jamaika c01a752905 tif_win32.c: include stdlib.h 2022-01-29 10:12:50 +00:00
Timothy Lyanguzov 3a898a8161 Fix packaging with CPack
Replace all CMAKE_INSTALL_FULL_<DIR> with CMAKE_INSTALL_<DIR> to allow CPack setting CMAKE_INSTALL_PREFIX

Signed-off-by: Timothy Lyanguzov <timothy.lyanguzov@sap.com>
2022-01-28 15:35:21 +13:00
Even Rouault 49396659cd Merge branch 'master' into 'master'
Fix the global-buffer-overflow in tiffset

See merge request libtiff/libtiff!287
2022-01-25 16:25:28 +00:00
4ugustus 03047a2695 tiffset: fix global-buffer-overflow for ASCII tags where count is required (fixes #355) 2022-01-25 16:25:28 +00:00
Roger Leigh 707178a7e1 Merge branch 'autogen' into 'master'
Fix autogen.sh permissions issues during mv

See merge request libtiff/libtiff!290
2022-01-23 14:07:08 +00:00
Roger Leigh 6e6c4e26dc Correct CMake testing
* Use functions rather than macros to avoid problems with variables in
  conditions (since macro arguments are not variables)
* Conditionally add to file lists and test program lists based upon the
  configuration options (e.g. JPEG and old-JPEG availability)
* Sync tests, files and option usage with current automake usage
2022-01-23 09:59:47 +00:00
Timothy Lyanguzov 7d5ad29ed0 Apply 1 suggestion(s) to 1 file(s) 2022-01-20 22:20:11 +00:00
Will Cohen 2f5abb1dff autogen.sh: mv -f for config.sub and config.guess 2022-01-19 17:21:25 -05:00
Vasyl Sokolyk db2622a63b libtoolize: command not found on macOS.
Typically need to use glibtool and glibtoolize, since libtool already exists on OS X as a binary

More details you can read here here https://stackoverflow.com/questions/15448582/installed-libtool-but-libtoolize-not-found/15448876
2022-01-19 13:17:38 +00:00
Even Rouault 8a481db9b5 TIFFYCbCrToRGBInit(): avoid Integer-overflow in gdal_TIFFYCbCrToRGBInit. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43559 2022-01-12 18:18:15 +01:00
Even Rouault 85531e1272 Merge branch 'fix_TIFFFillStrip_wrong_check' into 'master'
Fix sanity check in TIFFFillStrip()/TIFFFillStrile()

See merge request libtiff/libtiff!288
2022-01-10 21:17:19 +00:00
Even Rouault 8e9e8597f5 TIFFFillStrip()/TIFFFillStrile(): remove useless test 2022-01-10 21:58:50 +01:00
Even Rouault 0620a8f44a Fix sanity check in TIFFFillStrip()/TIFFFillStrile()
A sanity check comparing the compressed vs uncompressed file that was
originally written 'correctly' but relied on undefined behaviour was
changed in 1b5e3b6a23 in an incorrect way.
Fix that. Credits to @burn for spotting this in
https://gitlab.com/libtiff/libtiff/-/issues/343#note_806089714
2022-01-10 18:56:51 +01:00
Even Rouault cd57b554aa Merge branch 'Fix_FieldName_NULL' into 'master'
Fix Issue #354 Segmentation Fault due to field_name=NULL

See merge request libtiff/libtiff!285
2021-12-29 18:43:34 +00:00
Even Rouault 115ee5251e Merge branch 'mingw-static' into 'master'
build: Fix static library imports in mingw

See merge request libtiff/libtiff!286
2021-12-29 14:06:47 +00:00
Biswapriyo Nath 0784472a58 build: Fix static library imports in mingw
This defines LERC_STATIC while creating libtiff static library
in Win32 platform in presence of lerc library. Otherwise, the
static library import lerc APIs with dllimport attribute and
thus linked with shared lerc library.
2021-12-29 18:40:37 +05:30
Su_Laus b55cfc746a Fix Issue #354 Segmentation Fault due to field_name=NULL 2021-12-28 15:25:48 +01:00
Even Rouault 7947900689 Merge branch 'fix_342' into 'master'
TIFFGetField(TIFFTAG_STRIPBYTECOUNTS/TIFFTAG_STRIPOFFSETS): return error if...

Closes #342

See merge request libtiff/libtiff!283
2021-12-17 22:24:23 +00:00
Even Rouault 77ea50bba0 TIFFGetField(TIFFTAG_STRIPBYTECOUNTS/TIFFTAG_STRIPOFFSETS): return error if returned pointer is NULL (fixes #342) 2021-12-16 23:58:42 +01:00
Even Rouault e533f45709 tiff2pdf: validate TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc) return (fixes #342) 2021-12-16 23:57:49 +01:00
Even Rouault bd72135a4e Merge branch 'master' into 'master'
fix raw2tiff floating point exception(fixes #338)

Closes #338

See merge request libtiff/libtiff!282
2021-12-16 22:16:14 +00:00
t.feng f278db3eed raw2tiff: check that band number if not zero to avoid floating point exception(fixes #338) 2021-12-16 22:16:14 +00:00
Even Rouault 1d1299a670 Merge branch 'fix_337' into 'master'
OJPEG: avoid assertion when using TIFFReadScanline() (fixes #337)

Closes #337

See merge request libtiff/libtiff!280
2021-12-14 14:36:01 +00:00
Even Rouault 072cbbebbb OJPEG: avoid assertion when using TIFFReadScanline() (fixes #337)
Note: my analyis of the issue would be that the use of the scanline API
is currently propably broken with OJPEG.
2021-12-13 12:15:00 +01:00
Even Rouault 693e150703 JPEG 12bit: make it easier for GDAL's RENAME_INTERNAL_LIBTIFF_SYMBOLS mode 2021-12-10 17:37:28 +01:00
Even Rouault 5b665f42a6 tif_lzw.c: other warning fixes 2021-12-09 12:43:13 +01:00
Even Rouault 5b83eb1162 tif_lzw.c: fix warnings of previous commit 2021-12-09 12:40:06 +01:00
Even Rouault 75a2921377 Merge branch 'lzw_2gb_windows' into 'master'
LZW codec: fix support for strips/tiles > 2 GB on Windows

See merge request libtiff/libtiff!279
2021-12-09 11:06:24 +00:00
Even Rouault b967dd4705 LZW codec: fix support for strips/tiles > 2 GB on Windows 2021-12-08 22:58:32 +01:00
Even Rouault 40efdc35c5 Merge branch 'fix_287' into 'master'
tiffinfo: add a -M switch to define the maximum heap allocation, and default...

Closes #287

See merge request libtiff/libtiff!278
2021-12-06 23:05:26 +00:00
Even Rouault 87f580f390 Merge branch 'fix_319' into 'master'
TIFFReadDirectory: fix OJPEG hack (fixes #319)

Closes #319

See merge request libtiff/libtiff!277
2021-12-06 14:42:35 +00:00
Even Rouault 8244c2d5fa Merge branch 'fix_309' into 'master'
TIFFAppendToStrip(): fix rewrite-in-place logic (fixes #309)

Closes #309

See merge request libtiff/libtiff!276
2021-12-06 14:42:17 +00:00
Even Rouault 2f0187098d Merge branch 'b1' into 'master'
Fix resource leak on error path

See merge request libtiff/libtiff!263
2021-12-05 14:13:07 +00:00
bonniegong 5d17d4cc2a rast2tiff: Fix resource leak on error path 2021-12-05 14:13:07 +00:00
Even Rouault b09f7e744e Merge branch 'tiffsplit-leak' into 'master'
tiffsplit.c: Fix memleak before exit

See merge request libtiff/libtiff!270
2021-12-05 14:12:14 +00:00
Even Rouault e01a3de226 tiffinfo: add a -M switch to define the maximum heap allocation, and default it to 256 MiB (fixes #287) 2021-12-05 15:10:12 +01:00
Even Rouault 2d5fc85647 tiffinfo: fix read of invalid pointer in TIFFReadRawDataTiled() (fixes #295) 2021-12-05 14:50:17 +01:00
Even Rouault 87881e0936 TIFFReadDirectory: fix OJPEG hack (fixes #319)
to avoid having the size of the strip arrays inconsistent with the
number of strips returned by TIFFNumberOfStrips(), which may cause
out-ouf-bounds array read afterwards.

One of the OJPEG hack that alters SamplesPerPixel may influence the
number of strips. Hence compute tif_dir.td_nstrips only afterwards.
2021-12-05 14:37:46 +01:00
Even Rouault 4d1cac8aac TIFFAppendToStrip(): fix rewrite-in-place logic (fixes #309)
Properly reset tif_curoff when writing strips/tiles
2021-12-04 13:58:48 +01:00
Even Rouault d2f1c16662 TIFFReInitJPEG_12(): avoid warning about unused variable in -DNDEBUG 2021-12-03 14:27:10 +01:00
Even Rouault 27f399af36 Merge branch 'fix_316' into 'master'
TIFFReadCustomDirectory(): avoid crash when reading SubjectDistance tag on a non EXIF directory

Closes #316

See merge request libtiff/libtiff!273
2021-12-01 13:51:13 +00:00
Even Rouault 35bc092078 Merge branch 'VisualStudio_warnings_suppress' into 'master'
Suppress unnecessary warnings in Visual Studio in AppVeyor test.

See merge request libtiff/libtiff!234
2021-12-01 13:50:51 +00:00
Even Rouault 6ffbd01d4c TIFFReadCustomDirectory(): avoid crash when reading SubjectDistance tag on a non EXIF directory
Fixes #316

The Valgrind trace was
```
TIFFReadCustomDirectory: Warning, Unknown field with tag 37382 (0x9206) encountered.
==3277355== Invalid read of size 1
==3277355==    at 0x4842B60: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3277355==    by 0x48BB799: _TIFFmemcpy (tif_unix.c:346)
==3277355==    by 0x485B3CB: _TIFFVSetField (tif_dir.c:647)
==3277355==    by 0x485C125: TIFFVSetField (tif_dir.c:890)
==3277355==    by 0x485BEDC: TIFFSetField (tif_dir.c:834)
==3277355==    by 0x486DA9A: TIFFFetchSubjectDistance (tif_dirread.c:5826)
==3277355==    by 0x4869E35: TIFFReadCustomDirectory (tif_dirread.c:4530)
==3277355==    by 0x4869F0A: TIFFReadGPSDirectory (tif_dirread.c:4564)
==3277355==    by 0x10AA7A: main (tiffinfo.c:171)
==3277355==  Address 0x3fc856aaaaaaaaab is not stack'd, malloc'd or (recently) free'd
==3277355==
```
2021-11-30 22:17:51 +01:00
Even Rouault 73dbd42c57 Merge branch 'add-null-check' into 'master'
Added missing null check.

See merge request libtiff/libtiff!274
2021-11-29 15:49:35 +00:00
Dirk Lemstra 4434975b67 Added missing null check. 2021-11-28 10:37:16 +01:00
Even Rouault 80b003420d tif_print.c: remove duplicated if() in previous commit 2021-11-26 17:48:18 +01:00
Even Rouault 31e3e93974 Merge branch 'GPS_Print_BugFix' into 'master'
Fix Segmentation fault printing GPS directory if Altitude tag is present (tif_print.c/tiffinfo.c)

See merge request libtiff/libtiff!272
2021-11-26 15:02:36 +00:00
Su Laus 7db4f2b622 Fix Segmentation fault printing GPS directory if Altitude tag is present (tif_print.c/tiffinfo.c) 2021-11-26 15:02:35 +00:00
Even Rouault 29219a5bd1 Merge branch 'cmake_tiffconf' into 'master'
Fix STRIPCHOP_DEFAULT value in CMake builds

See merge request libtiff/libtiff!271
2021-11-01 21:10:51 +00:00
Even Rouault 10921ed8bd Fix STRIPCHOP_DEFAULT value in CMake builds
CMake builds erroneously used value 1 instead of TIFF_STRIPCHOP, which
resulted in strip chopping not being enabled by default.
2021-11-01 21:52:24 +01:00
Even Rouault 8514e640c5 tif_jpeg.c: typo fix 2021-10-26 11:22:23 +02:00
Han Han 66eaeed859 tiffsplit.c: Fix memleak before exit
Details of the memleak:
$ valgrind --leak-check=full tiffsplit id:001763,sync:fuzzer07,src:001641,+cov

==2090657==
==2090657== HEAP SUMMARY:
==2090657==     in use at exit: 13,517 bytes in 17 blocks
==2090657==   total heap usage: 41 allocs, 24 frees, 29,351 bytes allocated
==2090657==
==2090657== 2,473 (1,249 direct, 1,224 indirect) bytes in 1 blocks are definitely lost in loss record 10 of 13
==2090657==    at 0x484086F: malloc (vg_replace_malloc.c:381)
==2090657==    by 0x48BF35C: TIFFClientOpen (tif_open.c:118)
==2090657==    by 0x48CF058: TIFFFdOpen (tif_unix.c:209)
==2090657==    by 0x48CF0C4: TIFFOpen (tif_unix.c:248)
==2090657==    by 0x10954C: main (tiffsplit.c:91)
==2090657==
==2090657== 11,044 (1,300 direct, 9,744 indirect) bytes in 1 blocks are definitely lost in loss record 13 of 13
==2090657==    at 0x484086F: malloc (vg_replace_malloc.c:381)
==2090657==    by 0x48BF35C: TIFFClientOpen (tif_open.c:118)
==2090657==    by 0x48CF058: TIFFFdOpen (tif_unix.c:209)
==2090657==    by 0x48CF0C4: TIFFOpen (tif_unix.c:248)
==2090657==    by 0x1093D9: main (tiffsplit.c:75)
==2090657==
==2090657== LEAK SUMMARY:
==2090657==    definitely lost: 2,549 bytes in 2 blocks
==2090657==    indirectly lost: 10,968 bytes in 15 blocks
==2090657==      possibly lost: 0 bytes in 0 blocks
==2090657==    still reachable: 0 bytes in 0 blocks
==2090657==         suppressed: 0 bytes in 0 blocks
==2090657==
==2090657== For lists of detected and suppressed errors, rerun with: -s
==2090657== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)

Signed-off-by: Han Han <hanhanzhiyeqianke@gmail.com>
2021-10-24 13:56:02 +08:00
Even Rouault b256d4049c tif_webp.c: add explicit cast to please MSVC verbose warnings 2021-10-20 16:04:26 +02:00
Even Rouault 71bb3c7ef2 tif_webp.c: white space fixing 2021-10-20 16:04:26 +02:00
Even Rouault 1e45791e6b Merge branch 'work/amyspark/psd-blobs' into 'master'
Enable writing Photoshop blobs

See merge request libtiff/libtiff!269
2021-10-04 09:28:08 +00:00
L. E. Segovia 4a506173db Enable writing Photoshop blobs 2021-10-04 01:55:11 +00:00
Even Rouault 07b73cfd6f Merge branch 'remove_packbits_hack' into 'master'
PackBitsDecode: remove hack for when char is unsigned.

See merge request libtiff/libtiff!267
2021-09-29 09:32:34 +00:00
Even Rouault 7fca729778 PackBitsDecode: remove hack for when char is unsigned.
The function has a hack for platforms where char is unsigned. This is
better replaced by making bp a int8_t* pointer, which is guaranteed to
be signed.
2021-09-28 22:52:13 +02:00
Even Rouault fc3e3a202d tiffcrop.c: remove useless 'set but not read' variables 2021-09-27 18:42:33 +02:00
Even Rouault be9e2ccc8f Merge branch 'fix_gdal_4538' into 'master'
TIFFAppendToStrip(): fix rewrite-in-place logic

See merge request libtiff/libtiff!266
2021-09-23 21:04:00 +00:00
Even Rouault 59135f73dd TIFFAppendToStrip(): fix rewrite-in-place logic
reproducable in particular with packbits compression.

Fixes https://github.com/OSGeo/gdal/issues/4538
2021-09-23 21:29:09 +02:00
Even Rouault 8546f7ee99 tif_lzw.c: silence compiler warning about set but not used variable with recent clang 2021-09-17 16:49:56 +02:00
Even Rouault 4006c5de0f Merge branch 'fix_cygwin' into 'master'
Fix build warnings on cygwin about 'argument 1 of type 'float[3]' with...

See merge request libtiff/libtiff!265
2021-09-07 15:01:34 +00:00
Even Rouault 99b03a5d50 test/rational_precision2double.c: add missing curly braces to fix -Werror=misleading-indentation 2021-09-06 00:00:46 +02:00
Even Rouault 70e29c3964 Fix build warnings on cygwin about 'argument 1 of type 'float[3]' with mismatched bound [-Werror=array-parameter=]' 2021-09-05 23:38:05 +02:00
Even Rouault df9e31335c Merge branch 'rewrite-fix' into 'master'
Fix TIFFRewriteDirectory discarding directories after the rewritten one

See merge request libtiff/libtiff!264
2021-09-05 21:12:56 +00:00
Facundo Tuesca 620ea7ba4e tif_dirwrite.c: Fix TIFFRewriteDirectory discarding directories
This fixes a bug caused by the `tif_lastdiroff` optimization when
rewriting directories.

Rewriting the Nth directory temporarily zeroes the pointer to it
(located in the N-1th directory) and relies on `TIFFLinkDirectory`
traversing the whole directory list to find the zeroed pointer and
linking the rewritten directory to it. Since `TIFFLinkDirectory` skips
the traversal when `tif_lastdiroff` is set, this change unsets it
to force the full traversal when rewriting a directory.

A test to catch this particular issue is also added.
2021-09-05 22:38:15 +02:00
Even Rouault 788c5f24fa test_directory.c: fix compiler warnings 2021-09-01 18:54:17 +02:00
Even Rouault 8f2a2068ba Merge branch 'multipage-optimization' into 'master'
Keep track of last directory to improve performance for large multi-page files

See merge request libtiff/libtiff!262
2021-09-01 16:14:33 +00:00
Facundo Tuesca baf74f6459 Add field to keep track of last written directory
This adds a new `tif_lastdiroff` field to the TIFF data structure
and uses it to store the offset of the last written directory.

Appending a new directory required traversing the whole file
to find the last directory. By keeping track of its offset in this
new field, the search is no longer necessary.

Since this offset is only stored in-memory, the first directory
append after opening a file will have to transverse the whole
directory list. Subsequent calls will have access to the last
offset, avoiding the transversal.
2021-08-28 20:46:34 +02:00
Even Rouault c67e182128 tif_jpeg.c: fix memory leak on error code path for JPEG 12 bit (CID 1086702) 2021-08-13 15:10:52 +02:00
Even Rouault f3ec24beba Merge branch 'jpeg12' into 'master'
Enable JPEG 12bit support with a libjpeg that has a different ABI than the one for 8bit support

See merge request libtiff/libtiff!261
2021-07-29 16:17:19 +00:00
Even Rouault f20419d53e Reformat tif_jpeg.c and tif_jpeg_12.c with clang-format-10 2021-07-28 16:41:57 +02:00
Even Rouault 7e55299e01 Enable JPEG 12bit support with a libjpeg that has a different ABI than the one for 8bit support
See https://github.com/OSGeo/gdal/pull/4139 for more details

Note: this hasn't been tested for standalone libtiff builds.
2021-07-27 17:01:19 +02:00
Even Rouault fb61aee88a Merge branch 'wip/export-targets' into 'master'
Export tiff targets

See merge request libtiff/libtiff!258
2021-07-09 10:08:21 +00:00
Even Rouault 21fae83bc9 Merge branch 'pkgconfig' into 'master'
Add version and requirements to pc file

See merge request libtiff/libtiff!256
2021-07-09 10:06:55 +00:00
Kai Pastor 2c496078ad Fix version in libtiff-4.pc.in, and CMake build: Add requirements to pc file 2021-07-09 10:06:55 +00:00
Even Rouault c67e8a31e7 Merge branch 'cmake' into 'master'
Fix build issues with CMake 3.10

See merge request libtiff/libtiff!260
2021-07-09 09:51:36 +00:00
Kai Pastor 44651431bf Fix reconfiguration with cmake 2021-07-04 15:08:41 +02:00
Kai Pastor 26104814fa Fix build with CMake 3.10 2021-07-04 15:08:41 +02:00
Milian Wolff e39a31332b Export tiff targets
Fixes build when including libtiff as a cmake subproject into
another project and then installing a target from there which
depends on tiff. For example we could end up with:

```
CMake Error in 3rdParty/diplib/CMakeLists.txt:
  export called with target "DIP" which requires target "tiff" that is not in
  any export set.
```
2021-06-28 14:19:49 +02:00
Even Rouault c145a6c149 Merge branch 'libjpeg9d_support_simplification' into 'master'
tif_jpeg.c: simplify libjpeg 9d support (refs #266)

See merge request libtiff/libtiff!257
2021-06-21 10:09:17 +00:00
Even Rouault 4c5d8688b6 tif_jpeg.c: simplify libjpeg 9d support (refs #266)
Credits to Guido Vollbeding for the suggestion
2021-06-20 23:02:17 +02:00
Even Rouault 13bf0c4d84 Merge branch 'jpeg_in_tiff_jpeg_9d' into 'master'
tif_jpeg.c: workaround bug of libjpeg 9d that defers Huffman table creation

Closes #266

See merge request libtiff/libtiff!255
2021-06-15 15:27:37 +00:00
Even Rouault c253d546f1 Merge branch 'jpeg_disable_progressive_with_mozjpeg' into 'master'
tif_jpeg.c: do not emit progressive scans with mozjpeg and force optimize_coding

See merge request libtiff/libtiff!254
2021-06-15 15:27:30 +00:00
Even Rouault e494de4846 tif_jpeg.c: with mozjpeg, disable emission of Huffman tables in JpegTables tag, and use optimize_coding 2021-06-12 00:44:47 +02:00
Even Rouault 1a432d0769 tif_jpeg.c: workaround bug of libjpeg 9d that defers Huffman table creation
Fixes #266

libjpeg-9d no longer creates default Huffman tables in
jpeg_set_defaults(), which make their emission in the JpegTables tag no
longer possible. Workaround that by borrowing code from libjpeg to
manually create them when they are not initialized.
2021-06-10 15:27:47 +02:00
Even Rouault 6438425ae9 tif_jpeg.c: do not emit progressive scans with mozjpeg
Relates to #266

- On writing, explicitly disable progressive scans, which is normally
  not enabled, except with mozjpeg.
- On reading, emit a warning when encountering progressive scans.
2021-06-10 14:12:18 +02:00
Even Rouault 1eb58f0a65 Merge branch 'fix-263' into 'master'
Fix memory leak in tiff2pdf

See merge request libtiff/libtiff!249
2021-06-10 09:32:10 +00:00
Even Rouault 695c013443 Merge branch 'diizzyy-master-patch-20521' into 'master'
html: Add missing pages when using CMake

See merge request libtiff/libtiff!242
2021-06-09 21:44:25 +00:00
Daniel E 8de0adcc0f html: Add missing pages when using CMake 2021-06-09 21:44:25 +00:00
Even Rouault 2a7f438d0c Merge branch 'ci-reenable-cygwin' into 'master'
ci: Re-enable cygwin builds

See merge request libtiff/libtiff!252
2021-06-06 22:16:55 +00:00
Roger Leigh 843e229e66 ci: Re-enable cygwin builds 2021-06-06 22:23:39 +01:00
Even Rouault 0ec9547b3a Merge branch 'ci-arm64' into 'master'
ci: Add arm64 build

See merge request libtiff/libtiff!251
2021-06-06 21:12:29 +00:00
Roger Leigh 1765e0a21d ci: Add arm64 build 2021-06-06 21:20:29 +01:00
Even Rouault 4ecf751f88 _TIFFRewriteField(): fix when writing a IFD with a single tile that is a sparse one, on big endian hosts 2021-06-05 01:14:47 +02:00
Timothy Lyanguzov 0bb2247ec4 Fix memory leak in tiff2pdf 2021-06-02 16:23:47 +12:00
Even Rouault 5d039cf47c Merge branch 'lzw_cleanup' into 'master'
tif_lzw.c: cleanup, no functional change

See merge request libtiff/libtiff!248
2021-05-31 22:12:08 +00:00
Even Rouault de7617aeae tif_lzw.c: cleanup, no functional change 2021-05-31 23:56:45 +02:00
Even Rouault a236809524 Merge branch 'appveyor_disable_cygwin' into 'master'
.appveyor.yml: disable cygwin configs for now as they are broken

See merge request libtiff/libtiff!247
2021-05-22 15:20:35 +00:00
Even Rouault 31ab0c5f28 Merge branch 'zstd_reuse_objects' into 'master'
ZSTD codec: reuse compressor/decompressor objects

See merge request libtiff/libtiff!246
2021-05-22 15:10:59 +00:00
Even Rouault b45dd781d0 .appveyor.yml: disable cygwin configs for now as they are broken 2021-05-22 17:06:24 +02:00
Even Rouault 879e2dfe1d ZSTD codec: reuse compressor/decompressor objects
No need to recreate them each time in the PreEncode/Decode functions.
They can be reused if already existing.
2021-05-22 16:58:42 +02:00
Even Rouault fd5581c66d Merge branch 'adobedeflate-fix' into 'master'
Fix all remaining uses of legacy Deflate compression id and warn on use

See merge request libtiff/libtiff!245
2021-05-08 16:39:16 +00:00
David Ryskalczyk f0f68dc542 Fix all remaining uses of legacy Deflate compression id and warn on use 2021-05-08 16:39:15 +00:00
Even Rouault 9525747f20 Merge branch 'improve_tiffinfo_tiffdump_for_gdal_tags' into 'master'
tiffinfo/tiffdump: improve output for GDAL tags

See merge request libtiff/libtiff!244
2021-05-06 13:19:42 +00:00
Even Rouault 52bbf49bd1 Merge branch 'issue-252' into 'master'
Prevent adding root directory to include list

Closes #252 et #218

See merge request libtiff/libtiff!243
2021-05-03 16:20:39 +00:00
Even Rouault 8928349270 tiffinfo/tiffdump: improve output for GDAL tags 2021-05-03 18:19:33 +02:00
Timothy Lyanguzov b25618f6fc Prevent adding root directory to include list
there is a file VERSION in the root directory which clashes with C++20 standard header <version>
"config.h" file is created in "config" subdirectory to prevent adding "-I.." to generated Makefile

closes #218, #252
2021-04-29 13:14:18 +12:00
Laszlo Boszormenyi (GCS) 4f31670964 fix TIFFReadRawStrip man and HTML page typo
From https://github.com/conda-forge/libtiff-feedstock/blob/master/recipe/patches/fix_TIFFReadRawStrip_man_page_typo.patch
2021-04-23 20:50:43 +02:00
Even Rouault 14996dabf6 HOWTO-RELEASE: update 2021-04-20 14:01:57 +02:00
Even Rouault 00052b1476 Merge branch 'lerc_zstd_deflate' into 'master'
Make LERC_SUPPORT conditional on ZLIB_SUPPORT. Make display of lerc options in tiffcp depend on actual zstd support.

See merge request libtiff/libtiff!239
2021-04-18 16:51:00 +00:00
Miguel Medalha 8de5ee57be Make LERC_SUPPORT conditional on ZLIB_SUPPORT. Make display of lerc options in tiffcp depend on actual zstd support. 2021-04-18 16:50:59 +00:00
Even Rouault 0be27041a3 Merge branch 'vtorri_xz' into 'master'
automatic creation of xz archive when running make distcheck

See merge request libtiff/libtiff!238
2021-04-16 22:00:26 +00:00
Even Rouault d8ae5539cc iptcutil.c: fix bug in EOF comparison, spotted on NetBSD 9 earmv7hf-el 2021-04-16 19:16:02 +02:00
Vincent Torri bb104b32b5 automatic creation of xz archive when running make distcheck 2021-04-16 14:32:15 +02:00
Even Rouault d21dcc67d0 Prepare for v4.3.0 release 2021-04-16 12:54:59 +02:00
Even Rouault 01bb92c8f9 Merge branch 'libjpeg12_cmake' into 'master'
libtiff/tif_config.h.cmake.in: surround LIBJPEG_12_PATH by double quotes

See merge request libtiff/libtiff!237
2021-04-14 22:50:16 +00:00
Even Rouault 6070c107f7 libtiff/tif_config.h.cmake.in: surround LIBJPEG_12_PATH by double quotes 2021-04-15 00:22:38 +02:00
Even Rouault 6a73a8b342 Merge branch 'lerc_api_change' into 'master'
tif_lerc.c: cope with API breakage in liblerc master

See merge request libtiff/libtiff!236
2021-04-14 20:37:50 +00:00
Even Rouault 0e34bb284f tif_lerc.c: cope with API breakage in liblerc master 2021-04-14 21:24:19 +02:00
Even Rouault bdb8047259 libtiff: remove remaining #ifdef WIN32 and use PRI formatting 2021-04-08 23:54:17 +02:00
Su_Laus 33562f3e49 Suppress unnecessary warnings in Visual Studio in AppVeyor test.
Define for MSVC the defines:
    _CRT_SECURE_NO_WARNINGS)  - disable deprecation warnings
    _CRT_NONSTDC_NO_WARNINGS) - suppress deprecation warning for MSVC POSIX names
2021-03-19 17:04:36 +01:00
Even Rouault 77eadad261 Merge branch 'kmilos-master-patch-73187' into 'master'
tiffcp: Remove LZW help text, preset not supported

See merge request libtiff/libtiff!229
2021-03-10 12:40:38 +00:00
Miloš Komarčević 8afde1fe84 tiffcp: Remove LZW help text, preset not supported 2021-03-10 13:09:11 +01:00
Even Rouault 120aa39697 Merge branch 'feature/lerc' into 'master'
Add LERC Compression Plugin (closes: #213)

Closes #213

See merge request libtiff/libtiff!228
2021-03-10 10:56:38 +00:00
Even Rouault 3d13f7b56a Merge branch 'cmake-fixes' into 'master'
CMake fixes

Closes #246 et #245

See merge request libtiff/libtiff!232
2021-03-10 10:54:04 +00:00
Roger Leigh 1d9e329cb6 cmake: Correct FindCMath 2021-03-09 08:05:06 +00:00
Roger Leigh a1b84a8f27 cmake: Correct ZSTD_USABLE typo 2021-03-09 07:58:32 +00:00
Roger Leigh c2c406064d Merge branch 'cmake-find-lib-prefixes' into 'master'
cmake: Correct find lib prefixes for Deflate and JBIG

See merge request libtiff/libtiff!231
2021-03-07 21:17:54 +00:00
Roger Leigh d6f09d6b52 cmake: FindJBIG uses lib prefix on Windows 2021-03-07 19:15:41 +00:00
Roger Leigh 2652cb8262 cmake: FindDeflate uses lib prefix on Windows 2021-03-07 19:13:12 +00:00
Even Rouault 63b83709d6 TWebPDecode(): avoid potential overflow on multiplication (CID 1472928) 2021-03-07 19:39:07 +01:00
Even Rouault 86a82328f5 TIFFReadDirEntryArrayWithLimit(): avoid false positive from Coverity Scan regarding out-of-bounds access (CID 1472927) 2021-03-07 19:38:09 +01:00
Even Rouault 1c7e305081 tif_dirwrite.c: avoid setting a variable that is not read afterwards 2021-03-07 19:10:33 +01:00
Even Rouault 0c3512a02d Merge branch 'coverity-fixes' into 'master'
Coverity fixes (high impact)

See merge request libtiff/libtiff!227
2021-03-07 14:40:23 +00:00
Roger Leigh 40855b428c Fix high-impact Coverity issues (resource leaks).
The issues are in the tests and tiffcrop, not the core library. Real issues, but not high risk.

Use to test if Coverity integration is performing properly on merge.
2021-03-07 14:40:23 +00:00
Even Rouault 61b12bdc26 Merge branch 'fix_tif_fax3_encoder_regression' into 'master'
tif_fax3.c: fix master regression in encoder

See merge request libtiff/libtiff!230
2021-03-07 14:33:22 +00:00
Even Rouault fe27ae2779 tif_fax3.c: fix master regression in encoder
Fix issue introduced in 39a74eede0

Spotted by gdal's tiff_write_76 test
2021-03-07 15:00:14 +01:00
Antonio Valentino 45d2249058 Add LERC support in CMake 2021-03-07 10:03:01 +01:00
Antonio Valentino 6a3992931c Add LERC support in configure.ac and Makefile.am 2021-03-07 09:51:36 +01:00
Antonio Valentino 370aa61124 Add LERC support to tiffcp 2021-03-07 09:50:58 +01:00
Antonio Valentino 2dfd645719 Add LERC plugin
The lerc plugin code has been copyed form GDAL.
2021-03-07 09:50:57 +01:00
Roger Leigh 0ddfdebc6e Merge branch 'display_tool_purpose' into 'master'
TIFF tools: insert a line of text summarizing each tool's purpose

See merge request libtiff/libtiff!214
2021-03-06 20:51:47 +00:00
Even Rouault bfc15c355d Merge branch 'cmake-update' into 'master'
CMake updates

See merge request libtiff/libtiff!224
2021-03-06 19:36:44 +00:00
Even Rouault aab7d6ffeb tiff.h: typo fix in comment 2021-03-06 17:06:50 +01:00
Roger Leigh 24364dde3b Merge branch 'remove-travis' into 'master'
ci: Remove unused Travis-CI support

See merge request libtiff/libtiff!226
2021-02-15 21:20:25 +00:00
Roger Leigh 5d33c0d9ac ci: Remove unused Travis-CI support 2021-02-14 13:37:47 +00:00
Roger Leigh 1a86c973a3 Merge branch 'ci-coverity' into 'master'
Enable Coverity static analysis with CI pipeline

See merge request libtiff/libtiff!225
2021-02-14 11:23:38 +00:00
Roger Leigh cace39b620 ci: Add Coverity static analysis job 2021-02-13 23:01:28 +00:00
Roger Leigh c00363281b ci: Use custom libtiff CI image 2021-02-13 23:01:28 +00:00
Roger Leigh 8278afd1f7 cmake: Add release target 2021-02-13 12:24:53 +00:00
Roger Leigh 7648f778dd cmake: Remove empty contrib files 2021-02-13 12:24:53 +00:00
Roger Leigh b7f80a731b cmake: Tidy toplevel 2021-02-13 12:24:53 +00:00
Roger Leigh b436455f6d cmake: Move pkg-config support to PkgConfig.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh be1103f0e7 cmake: Move library feature options to CXXLibraryFeatures.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh 86c3e00422 cmake: Move C++ support to CXXLibrary.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh e38198a10f cmake: Add FindCMath to handle libm linking portably 2021-02-13 12:24:53 +00:00
Roger Leigh 91d61df8c3 cmake: Tidy unused includes 2021-02-13 12:24:53 +00:00
Roger Leigh 29b566f34c cmake: Rename release date to build date 2021-02-13 12:24:53 +00:00
Roger Leigh 11a0cc16c3 cmake: Compute timestamp portably 2021-02-13 12:24:53 +00:00
Roger Leigh a661596252 cmake: Remove remaining uses of report_values() 2021-02-13 12:24:53 +00:00
Roger Leigh 0f29278758 cmake: Move JPEG12 checks to JPEGCodec.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh 5d7bf92ec2 cmake: Move OpenGL checks to OpenGLChecks.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh 6d2c3f00e8 cmake: Move OpenGL checks to OpenGLChecks.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh a1ee3b8510 cmake: Move WebP codec support to WebPCodec.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh 6f509b0cd7 cmake: Use imported targets for WebP 2021-02-13 12:24:53 +00:00
Roger Leigh 2da1c03be2 cmake: Add FindWebP 2021-02-13 12:24:53 +00:00
Roger Leigh ae1582dc1c cmake: Move ZSTD codec support to ZSTDCodec.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh f4d0b3e558 cmake: Use imported targets for ZSTD 2021-02-13 12:24:53 +00:00
Roger Leigh 70d31a5822 cmake: Add FindZSTD 2021-02-13 12:24:53 +00:00
Roger Leigh f68091056b cmake: Move LZMA codec support to LZMACodec.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh a2f094f0ab cmake: Use imported targets for LibLZMA 2021-02-13 12:24:53 +00:00
Roger Leigh 9951804e1e cmake: Move JBIG codec support to JBIGCodec.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh 5dcada3352 cmake: Use imported targets for JBIG 2021-02-13 12:24:53 +00:00
Roger Leigh 23eac07cf5 cmake: Add FindJBIG 2021-02-13 12:24:53 +00:00
Roger Leigh 87469353ca cmake: Move PixarLog codec support to PixarLogCodec.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh b0f2bc2de1 cmake: Report system name in configuration report 2021-02-13 12:24:53 +00:00
Roger Leigh 91b49f26f8 cmake: Move JPEG codec support to JPEGCodec.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh 86519ea01f cmake: Use imported targets for JPEG 2021-02-13 12:24:53 +00:00
Roger Leigh e90d230fc3 cmake: Move Deflate codec support to DeflateCodec.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh ffdad3129f cmake: Use imported targets for ZLIB and Deflate 2021-02-13 12:24:53 +00:00
Roger Leigh 06b107bdba cmake: Add FindDeflate 2021-02-13 12:24:53 +00:00
Roger Leigh 289672aa83 cmake: Move symbol checks to SymbolChecks.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh 2c8e8c84a6 cmake: Move include checks to IncludeChecks.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh 874bbd0456 cmake: Move all autotools logic to separate files 2021-02-13 12:24:53 +00:00
Roger Leigh 953cc62060 cmake: Move internal codec options to InternalCodecs.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh 0b72a039cb cmake: Move LFS check to LargeFileSupport.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh 4738634f02 cmake: Move Win32 IO feature to WindowsIOFeature.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh fc96f83a0f cmake: Move processor capability checks to ProcessorChecks.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh 59b4132af6 cmake: Move type size checks to TypeSizeChecks.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh 6d4c815ddf cmake: Move linker checks to LinkerChecks.cmake 2021-02-13 12:24:53 +00:00
Roger Leigh af6cca4c0a cmake: Move warning options to CompilerChecks 2021-02-13 12:24:53 +00:00
Roger Leigh 8a14a6fc9e cmake: Move version introspection to AutotoolsVersion.cmake 2021-02-13 12:24:52 +00:00
Roger Leigh f4ecba55d4 cmake: Move compiler checks to CompilerChecks.cmake 2021-02-13 11:58:18 +00:00
Roger Leigh c1b809113b cmake: Split into helper scripts 2021-02-13 11:58:18 +00:00
Roger Leigh cbbed3fb3f cmake: Use target_sources 2021-02-08 19:54:10 +00:00
Roger Leigh 419d7dd1c9 libport: Adjust header and library to only define and link if required
* Make libport an OBJECT library when in use, otherwise a dummy
  INTERFACE library
* libport.h will work if getopt is present or not present.  If
  present, will fall back to <unistd.h>, else will define
  symbols
* Add generated libport_config.h to define HAVE_GETOPT and HAVE_UNISTD_H
* dummy.c no longer needed with CMake
* libtiff/libtiffxx no longer link with libport
2021-02-08 19:54:08 +00:00
Roger Leigh 00b09f225c cmake: Remove unnecessary extra_dist usage
Only makes sense in the context of Automake.  Was carried over
for reference while porting, but is not needed.
2021-02-08 19:52:23 +00:00
Roger Leigh a28689d5d5 cmake: Update minimum version and policy version to 3.9 2021-02-08 19:51:58 +00:00
Roger Leigh fbd04d991b Merge branch 'remove-nmake' into 'master'
Remove NMake build support

See merge request libtiff/libtiff!223
2021-02-08 19:08:05 +00:00
Roger Leigh d0eac62704 Remove NMake build support
The functionality provided by the NMake build is now completely
superseded by the CMake build.
2021-02-08 18:49:07 +00:00
Even Rouault e79670aa50 Merge branch 'warning-fixes' into 'master'
Warning fixes

See merge request libtiff/libtiff!222
2021-02-08 14:53:25 +00:00
Miguel Medalha 7ca4b2fed3 Update tiffsplit.c 2021-02-07 11:56:54 +00:00
Miguel Medalha 1f872637bc Reinsert summary line lost after conflicting merge. 2021-02-07 11:53:32 +00:00
Miguel Medalha 5be9c12a02 Merge branch 'master' into 'display_tool_purpose'
# Conflicts:
#   tools/tiffsplit.c
2021-02-07 11:40:36 +00:00
Roger Leigh 91f9730fec ci: Enable fatal warnings with -Werror for AppVeyor/GCC 2021-02-06 14:00:40 +00:00
Roger Leigh f8ec97f576 ci: Enable fatal warnings with -Werror for GitLab CI 2021-02-06 14:00:40 +00:00
Roger Leigh 2dacf7c34c tif_zstd.c: Remove unused variable warning 2021-02-06 14:00:40 +00:00
Roger Leigh 40a226befd custom_dir_EXIF_231: Remove case statement fallthrough 2021-02-06 14:00:40 +00:00
Roger Leigh 2655fed363 custom_dir_EXIF_231: Correct use of strncpy 2021-02-06 14:00:40 +00:00
Roger Leigh 9ae8cb5a8e Correct include order 2021-02-06 13:40:32 +00:00
Roger Leigh 0e40776b33 Eliminate implict fallthrough usage
Use simple loops in place of manual loop unrolling.  Rely on
the compiler optimiser to unroll loops when appropriate.
2021-02-06 13:40:32 +00:00
Roger Leigh a9eba2fb70 Suppress potential unused variable warning 2021-02-06 13:40:32 +00:00
Roger Leigh 145eb81dc8 Suppress warnings or avoid case statement fallthrough 2021-02-06 13:40:32 +00:00
Roger Leigh 913d8f4cad Merge branch 'c99-ssize_t-fixes' into 'master'
C99 ssize_t fixes

Closes #239

See merge request libtiff/libtiff!219
2021-02-05 20:28:11 +00:00
Even Rouault efe3a84f4a Merge branch 'tiffsplit-too-many-args' into 'master'
tiffsplit.c: exit with EXIT_FAILURE if there are extra args on the command line

See merge request libtiff/libtiff!209
2021-02-05 17:08:37 +00:00
Roger Leigh ce494741c3 Add additional TIFF_SSIZE_FORMAT uses 2021-02-05 00:01:13 +00:00
Roger Leigh 7b0da6ca60 NMake fixes for size type formatting 2021-02-04 18:09:49 +00:00
Roger Leigh 39fa8a04ee Add TIFF_SIZE_FORMAT for portable use of %z
MinGW64 does support %z, but it issues a compiler warning.
2021-02-04 18:09:03 +00:00
Roger Leigh c5820961e6 Align Autoconf tif_config.h and CMake tif_config.cmake.in 2021-02-04 18:08:31 +00:00
Roger Leigh d7afc8c14f Use TIFF_SSIZE_FORMAT for formatting tmsize_t 2021-02-04 18:07:45 +00:00
Even Rouault d7c68ae450 Merge branch 'remove-lcc' into 'master'
Remove Makefile.lcc

See merge request libtiff/libtiff!221
2021-02-04 13:51:06 +00:00
Even Rouault 8c025928c5 Merge branch 'remove-scons' into 'master'
Remove SCons build

See merge request libtiff/libtiff!220
2021-02-04 13:50:43 +00:00
Even Rouault 4b48baef4c Merge branch 'c99-snprintf' into 'master'
Use C99 snprintf

See merge request libtiff/libtiff!217
2021-02-03 22:29:32 +00:00
Roger Leigh a3a43d5324 Merge branch 'tiff2ps-const' into 'master'
tiff2ps.c: string literals must be const char *, not char *

See merge request libtiff/libtiff!202
2021-02-03 21:19:06 +00:00
Roger Leigh 66a01d2c29 Remove SCons build
Unmaintained for 16 years.
2021-02-03 21:17:55 +00:00
Roger Leigh d56798f63c Merge branch 'codec_summary' into 'master'
Modify 'CMakeLists.txt' to produce a meaningful summary of external codecs

See merge request libtiff/libtiff!192
2021-02-03 20:45:27 +00:00
Roger Leigh 931cf1f236 Remove Makefile.lcc
Unmaintained for 22 years.
2021-02-03 20:43:12 +00:00
Roger Leigh 643480de3e Merge branch 'ci-32-bit' into 'master'
ci: Build 32- and 64-bit MSVC variants

See merge request libtiff/libtiff!218
2021-02-01 23:06:01 +00:00
Roger Leigh fd6306a13a ci: Build 32- and 64-bit MSVC variants 2021-02-01 22:13:22 +00:00
Roger Leigh ceff22ee3b Use C99 snprintf 2021-02-01 22:07:47 +00:00
Even Rouault ff1299bb4a Merge branch 'c99-strtol' into 'master'
Use C99 strtol, strtoul, strtoll and strtoull

See merge request libtiff/libtiff!216
2021-02-01 09:44:05 +00:00
Even Rouault 026cb78507 Merge branch 'c99-inline' into 'master'
Use C99 inline

See merge request libtiff/libtiff!215
2021-01-31 22:51:31 +00:00
Roger Leigh a8d63da69e Use C99 strtol, strtoul, strtoll and strtoull 2021-01-31 21:13:48 +00:00
Roger Leigh 1cc7a7e153 tif_fax3: Use C99 inline 2021-01-31 20:50:00 +00:00
Roger Leigh 7e92132f9e Remove inline feature tests and defines
Available as a standard feature with C99.
2021-01-31 20:44:08 +00:00
Miguel Medalha 5b5c58d78f Update raw2tiff.c (remove duplicate description of tool) 2021-01-30 19:58:20 +00:00
Roger Leigh 8ac5d3bb77 Merge branch 'c99-format-strings' into 'master'
C99 format strings

See merge request libtiff/libtiff!211
2021-01-30 15:19:45 +00:00
Miguel Medalha 708a02660e Update tiffdither.c (2 tabs caused slight misalignment of lines in usage info output) 2021-01-28 23:00:08 +00:00
Miguel Medalha 08bced7786 Update ppm2tiff.c (slight misalignment of lines in usage info output) 2021-01-28 22:54:26 +00:00
Miguel Medalha 612bb08926 Update tiffset.c (small misalignment of lines in usage info output) 2021-01-28 22:47:58 +00:00
Medalha 7a8d7d93aa Display tool purpose 2021-01-28 20:02:17 +00:00
Thomas Bernard 303bd9bb00 tiff2ps.c: string literals must be const char *, not char * 2021-01-28 15:35:40 +01:00
Roger Leigh 352cb5a4fb libtiff: Use PRI format flags and remove unnecessary casts 2021-01-28 08:26:50 +00:00
Roger Leigh e6ce256e8e ascii_tag: Use PRI format flags and remove unnecessary casts 2021-01-27 22:00:36 +00:00
Roger Leigh 01717f8f2b check_tag: Use PRI format flags and remove unnecessary casts 2021-01-27 22:00:36 +00:00
Roger Leigh 22bef56e70 custom_dir_EXIF_231: Use PRI format flags and remove unnecessary casts 2021-01-27 22:00:36 +00:00
Roger Leigh f1afb21dea short_tag: Use PRI format flags and remove unnecessary casts 2021-01-27 22:00:36 +00:00
Roger Leigh 899fe9f001 strip_rw: Use PRI format flags and remove unnecessary casts 2021-01-27 22:00:36 +00:00
Roger Leigh 13b354a947 fax2tiff: Use PRI format flags and remove unnecessary casts 2021-01-27 22:00:36 +00:00
Roger Leigh 40169efdcd ppm2tiff: Correct format strings 2021-01-27 22:00:36 +00:00
Roger Leigh f5702e3c40 raw2tiff: Use PRI format flags and remove unnecessary casts 2021-01-27 22:00:35 +00:00
Roger Leigh a1af022279 rgb2ycbcr: Use PRI format flags and remove unnecessary casts 2021-01-27 22:00:35 +00:00
Roger Leigh cdb2a6cb63 tiff2pdf: Use PRI format flags and remove unnecessary casts 2021-01-27 22:00:35 +00:00
Roger Leigh 354a64775c tiff2ps: Use PRI format flags and remove unnecessary casts 2021-01-27 22:00:35 +00:00
Roger Leigh 992e5d91b7 tiff2rgba: Use PRI format flags and remove unnecessary casts 2021-01-27 22:00:35 +00:00
Roger Leigh 0bfaab632c tiffcmp: Use PRI format flags and remove unnecessary casts 2021-01-27 22:00:31 +00:00
Roger Leigh 33bb51419d tiffcp: Use PRI format flags and remove unnecessary casts 2021-01-27 21:57:49 +00:00
Roger Leigh b60203814d tiffcrop: Use PRI format flags and remove unnecessary casts 2021-01-27 21:57:49 +00:00
Roger Leigh 35ab2b89ca tiffinfo: Use PRI format flags and remove unnecessary casts 2021-01-27 21:57:49 +00:00
Roger Leigh e4d9f06eff tiffdump: Use PRI format flags and remove unnecessary casts 2021-01-27 21:57:49 +00:00
Even Rouault 2dc8664864 Merge branch 'c99-require-stdtypes' into 'master'
Use standard C99 integer types

See merge request libtiff/libtiff!205
2021-01-27 21:54:47 +00:00
Even Rouault 52b895fb04 Merge branch 'reserve_COMPRESSION_JXL' into 'master'
tiff.h: reserve COMPRESSION_JXL=50002 for JPEGXL

See merge request libtiff/libtiff!210
2021-01-26 15:25:48 +00:00
Even Rouault 8cfa8f97a0 tiff.h: reserve COMPRESSION_JXL=50002 for JPEGXL 2021-01-22 18:02:31 +01:00
Kurt Schwehr 70acf12c36 tiffsplit.c: exit with EXIT_FAILURE if there are extra args on the command line
e.g. tiffsplit in.tif a_prefix_ junk
2021-01-22 06:20:24 -08:00
Roger Leigh 41e3efcc2e Add and enable TIFF_DISABLE_DEPRECATED for internal use 2021-01-22 08:49:05 +00:00
Roger Leigh ddb8756f10 Add typedef deprecations for GCC/Clang and MSVC 2021-01-21 23:14:15 +00:00
Roger Leigh 39a74eede0 Use standard C99 integer types 2021-01-21 23:14:13 +00:00
Even Rouault af604f119a Merge branch 'ubuntu-zstd-wepb' into 'master'
gitlab-ci : use libzstd-dev and libwebp-dev ubuntu packages

See merge request libtiff/libtiff!208
2021-01-20 20:56:10 +00:00
Thomas Bernard 8d0d6f8780 gitlab-ci : use libzstd-dev and libwebp-dev ubuntu packages
should replace !206
2021-01-20 20:23:12 +01:00
Even Rouault d0c68fe726 Merge branch 'issue-232' into 'master'
tiff2ps: exit the loop in case of error

Closes #232

See merge request libtiff/libtiff!201
2021-01-20 18:52:56 +00:00
Even Rouault d091d535af Merge branch 'tiffsplit-exit-status' into 'master'
tiffsplit: Exit with EXIT_FAILURE if unable to open the input file.

See merge request libtiff/libtiff!207
2021-01-20 18:50:32 +00:00
Even Rouault 7d58f8909a Merge branch 'config-cleanup' into 'master'
Remove HAVE_INTTYPES_H, HAVE_LFIND & lfind, HAVE_SEARCH_H & include <search.h>

See merge request libtiff/libtiff!203
2021-01-20 18:49:17 +00:00
Kurt Schwehr 90c6fbc265 tiffsplit: Exit with EXIT_FAILURE if unable to open the input file. 2021-01-18 23:44:54 -08:00
Even Rouault 9555b10d8c Merge branch 'tiffcmp' into 'master'
tiffcmp: fix comparaison with pixels that are fractional number of bytes

Closes #53

See merge request libtiff/libtiff!141
2021-01-18 21:58:26 +00:00
Kurt Schwehr e06e47bf7a CMakeLists.txt: Remove search for lfind 2021-01-15 13:11:27 -08:00
Kurt Schwehr e8ef83ee05 Remove HAVE_INTTYPES_H, HAVE_LFIND & lfind, HAVE_SEARCH_H & include <search.h>
- HAVE_INTTYPES_H is replaced with TIFF_HAVE_INTTYPES_H
- tif_dirinfo.c has a static td_lfind
2021-01-15 13:02:18 -08:00
Thomas Bernard 3739202651 tiffcmp: fix comparaison with pixels that are fractional number of bytes
For exemple : 4bits per sample + 3 samples per pixel => 1.5 bytes per pixel
2021-01-15 21:08:23 +01:00
Thomas Bernard 9b58f43457 tiff2ps: exit the loop in case of error
fixes #232
2021-01-15 20:50:10 +01:00
Even Rouault 7a20316754 Merge branch 'rm-strcasecmp' into 'master'
Remove port/strcasecmp.c as strcasecmp is not currently used in libtiff.

Closes #235

See merge request libtiff/libtiff!199
2021-01-15 15:49:58 +00:00
Even Rouault 65c9cf6cf9 Merge branch 'std-int-types' into 'master'
Use standard C99 integer types

See merge request libtiff/libtiff!185
2021-01-15 15:49:11 +00:00
Kurt Schwehr 89d1689fc7 Remove port/strcasecmp.c as strcasecmp is not currently used in libtiff.
Fixes #235
2021-01-12 16:32:27 -08:00
Miguel Medalha b286beb6e9 Update CMakeLists.txt. Delete unnecessary line from libdeflate codec support section 2021-01-10 18:45:26 +00:00
Roger Leigh 066e0952fb Merge branch 'include_libport' into 'master'
tiff tools and libtiff/mkg3states: include 'libport.h', remove local definition of 'getopt()'

See merge request libtiff/libtiff!198
2021-01-10 11:28:08 +00:00
Miguel Medalha 5877156688 Update CMakeLists.txt. Cleanup of indentation space. Removal of leading '/' from webp include dir. 2021-01-09 17:19:57 +00:00
miguel 33c3f7726b cmake: Use target_include_directories correctly 2021-01-09 08:47:21 +00:00
Roger Leigh 0ebb6860be cmake: Use target_include_directories correctly 2021-01-09 08:27:24 +00:00
Roger Leigh 9e301c277b cmake: Drop unnecessary TOOL_INCLUDES 2021-01-09 08:08:49 +00:00
Roger Leigh ec5e1524de cmake: Use target_include_directories correctly 2021-01-07 21:47:41 +00:00
miguel 71c033cca3 tiff tools and libtiff/mkg3states: include 'libport.h', remove local definition of 'getopt()' 2021-01-07 16:37:25 +00:00
Miguel Medalha d63700e51e Update CMakeLists.txt 2021-01-07 13:49:59 +00:00
miguel 3517708d20 tiff tools: include 'libport.h', remove local definition of 'getopt()' 2021-01-07 11:35:10 +00:00
Roger Leigh b81c574213 Remove conditional use of <string.h> 2021-01-06 09:27:55 +00:00
Roger Leigh c0e0099392 cmake: Drop dlfcn.h check 2021-01-06 09:25:36 +00:00
Roger Leigh b09bbeb1fb cmake: Remove duplicate line 2021-01-06 09:25:36 +00:00
Roger Leigh 08118b51ac Use stdint.h types when available 2021-01-06 09:25:36 +00:00
Olivier Paquet 17d2aa03b8 Merge branch 'iptcutil' into 'master'
contrib/iptcutil.c: set '#ifdef _WIN32' (was '#ifdef WIN32', which failed at build time)

See merge request libtiff/libtiff!197
2021-01-05 19:57:54 +00:00
miguel f2bfeb92b7 tiff tools: include 'libport.h', remove local definition of 'getopt()' 2021-01-05 19:40:55 +00:00
miguel 7eac42cc2b contrib/iptcutil.c - set '#ifdef _WIN32' (was '#ifdef WIN32', which failed at build time) 2021-01-05 19:30:07 +00:00
Even Rouault dcd410f637 tools/CMakeLists.txt: add comment about rgb2ycbcr and thumbnail not to be installed 2021-01-04 11:02:04 +01:00
Even Rouault b45b59bd26 Merge branch 'revert-5331ed49' into 'master'
Revert "Merge branch 'install_targets' into 'master'"

See merge request libtiff/libtiff!196
2021-01-04 09:59:05 +00:00
Even Rouault 68810ae523 Merge branch 'drop-wince' into 'master'
Remove non-functional WinCE support

See merge request libtiff/libtiff!188
2021-01-04 09:54:32 +00:00
Even Rouault d84ef79d2a Merge branch 'drop-vms' into 'master'
Remove non-functional VMS support

See merge request libtiff/libtiff!187
2021-01-04 09:53:47 +00:00
Even Rouault 9e09fdf701 Revert "Merge branch 'install_targets' into 'master'"
This reverts merge request !193
2021-01-03 19:19:12 +00:00
Even Rouault 19a0a71725 Merge branch 'tiffcp_b_parameter' into 'master'
tiffcp: Remove unnecessary reference to compression from usage info for -b parameter

See merge request libtiff/libtiff!189
2021-01-03 18:07:56 +00:00
Even Rouault 21a9ca82c8 Merge branch 'cmake-faxtable' into 'master'
cmake: Add faxtable target

See merge request libtiff/libtiff!186
2021-01-03 17:57:07 +00:00
Roger Leigh 5331ed496e Merge branch 'install_targets' into 'master'
Update 'CMakeLists.txt' from 'tools'.

See merge request libtiff/libtiff!193
2021-01-03 14:48:39 +00:00
Miguel Medalha 24ad10622f Update 'CMakeLists.txt' from 'tools'. 2021-01-03 14:35:36 +00:00
Miguel Medalha 11ac3ac250 Update CMakeLists.txt 2021-01-03 14:03:34 +00:00
Roger Leigh 784f647b89 Merge branch 'usage_info' into 'master'
thumbnail: Rename constant variable 'stuff' to 'usage_info'

See merge request libtiff/libtiff!190
2021-01-03 11:49:14 +00:00
Miguel Medalha 9efd970d63 Modified 'CMakeLists.txt' to produce a meaningful summary of external
codecs support.
2021-01-03 05:44:21 +00:00
Miguel Medalha b5e3173710 Removed unnecessary reference to compression from usage info for -b parameter 2021-01-03 05:32:18 +00:00
Miguel Medalha a7d8a38031 Constant variable 'stuff' renamed to 'usage_info' for consistency with the other tools 2021-01-03 05:27:52 +00:00
Roger Leigh b95b329590 Remove non-functional VMS support 2021-01-02 22:56:41 +00:00
Roger Leigh 09735b1659 Remove non-functional WinCE support 2021-01-02 22:55:04 +00:00
Roger Leigh 5c9316d51f Merge branch 'codespell' into 'master'
Fix spelling mistakes.

See merge request libtiff/libtiff!183
2021-01-02 22:47:26 +00:00
Kurt Schwehr f7e86122ac ChangeLog: Remove extraneous character from prior commit - 00fe7828 2021-01-02 14:42:09 -08:00
Roger Leigh 290ef04b73 Merge branch 'codespell-custom_dir_EXIF_231' into 'master'
custom_dir_EXIF_231.c: dos2unix and codespell

See merge request libtiff/libtiff!184
2021-01-02 22:41:23 +00:00
Roger Leigh ec3849d140 mkg3states: Sync generator with current generated file content 2021-01-01 22:24:01 +00:00
Roger Leigh d730cb33db cmake: Add faxtable and mkg3states targets 2021-01-01 22:24:01 +00:00
Kurt Schwehr fa9266f3c7 custom_dir_EXIF_231.c: dos2unix and codespell
additonal, Varable, greather, alwasy
2020-12-31 10:27:53 -08:00
Kurt Schwehr 31ee09864c Fix spelling mistakes.
Found with:

codespell --version
1.17.1
2020-12-31 10:18:04 -08:00
Even Rouault f2bc2e9d6b Merge branch 'remove-some-vms-ifdef' into 'master'
Remove "ifdef VMS" that are no longer necessary.

See merge request libtiff/libtiff!181
2020-12-29 15:22:18 +00:00
Kurt Schwehr 66a9f0f8e0 Remove "ifdef VMS" that are no longer necessary.
Both sides of the if are now the same.
2020-12-29 06:57:29 -08:00
Bob Friesenhahn b10bf3ab80 _TIFFBuiltinCODECS should be const 2020-12-29 07:59:44 -06:00
Even Rouault bee76f0a83 Merge branch 'issue-202' into 'master'
tiff2pdf.c: check that tiff_datasize fits in a signed tsize_t

Closes #202

See merge request libtiff/libtiff!166
2020-12-28 22:53:07 +00:00
Even Rouault ad2fbbd041 Merge branch 'w_report-when-libdeflate-is-found' into 'master'
CMakeLists.txt: Report when libdeflate is found

See merge request libtiff/libtiff!175
2020-12-28 22:52:01 +00:00
Bob Friesenhahn aef996e49e Declare gpsFields as static const 2020-12-28 08:35:19 -06:00
Bob Friesenhahn 0763ef4d4e Merge branch 'tools-reduce-initialized-data' into 'master'
Reduce initialized data by making more data const and simplifying usage() implementation.

See merge request libtiff/libtiff!180
2020-12-28 14:07:41 +00:00
Bob Friesenhahn f2435ace6c Reduce initialized data by making more data const and simplifying usage() implementation. 2020-12-28 07:48:18 -06:00
Bob Friesenhahn ec8bddedf0 Merge branch 'master' into 'master'
tiff tools: display of compression methods is now conditional instead of hard-coded

See merge request libtiff/libtiff!176
2020-12-27 15:01:07 +00:00
Bob Friesenhahn 9abe3ed320 Merge branch 'build' into 'master'
Fix wrong URL for fetching config.guess and config.sub

See merge request libtiff/libtiff!177
2020-12-27 14:22:02 +00:00
Chocobo1 66eb5c7cd0 Fix wrong URL for fetching config.guess and config.sub 2020-12-26 23:54:00 +08:00
miguel ceead1d923 tiff tools: made display of compression methods and their parameters conditional on their actual availability 2020-12-25 05:09:00 +00:00
Bob Friesenhahn 97049062b9 autogen.sh now updates config.guess and config.sub from master gnulib version. 2020-12-19 17:33:40 -06:00
Bob Friesenhahn bbc1312c12 Add a https://libtiff.gitlab.io/libtiff/ link 2020-12-19 13:34:59 -06:00
Bob Friesenhahn 4c7b6c2ebd Remove stray character in URL area. 2020-12-19 13:25:51 -06:00
Bob Friesenhahn 4862b0d7bc Changes for 4.2.0 release 2020-12-19 12:44:58 -06:00
Bob Friesenhahn 25934c94fc Changes for 4.2.0 release 2020-12-19 12:37:12 -06:00
Lemures Lemniscati 1dfa427359 CMakeLists.txt: Report when libdeflate is found 2020-12-13 07:03:03 +09:00
Even Rouault 7ec02eaa81 Merge branch 'w_adjust-deflate_names' into 'master'
Set 'deflate' to DEFLATE_NAMES, instead of 'libdeflate'

See merge request libtiff/libtiff!174
2020-12-12 21:56:16 +00:00
Lemures Lemniscati dd38d7cb1b Set 'deflate' to DEFLATE_NAMES, instead of 'libdeflate'
'lib' will be automatically added as a prefix while doing find_library()
2020-12-13 06:30:46 +09:00
Even Rouault 9a935c7e23 DoubleToRational(): avoid casting NaN to uint32 (fixes #227) 2020-12-12 15:31:05 +01:00
Even Rouault 39d6c91ffd Merge branch 'fix_221' into 'master'
tiffio.h: do not define __attribute__ but defines TIFF_ATTRIBUTE instead (fixes #221)

Closes #221

See merge request libtiff/libtiff!173
2020-12-12 14:27:39 +00:00
Even Rouault a12d22b7b3 tiffio.h: do not define __attribute__ but defines TIFF_ATTRIBUTE instead (fixes #221) 2020-12-12 15:03:38 +01:00
Even Rouault f13cf46b6e TIFFReadDirEntryArrayWithLimit(): properly read from offline tag value when we clamp the number of strips to 1.
Fixes regression of commit 7057734d98 on reading
a file with StripByteCounts with 1 element (broken) and StripOffsets with
896 elements, and where StripOffsets[0] is correct

$ tiffdump foo.tif
Magic: 0x4949 <little-endian> Version: 0x2a <ClassicTIFF>
Directory 0: offset 25725448 (0x1888a08) next 0 (0)
SubFileType (254) LONG (4) 1<0>
ImageWidth (256) LONG (4) 1<640>
ImageLength (257) LONG (4) 1<20098>
BitsPerSample (258) SHORT (3) 1<16>
Photometric (262) SHORT (3) 1<1>
SamplesPerPixel (277) SHORT (3) 1<1>
ResolutionUnit (296) SHORT (3) 1<2>
StripByteCounts (279) LONG (4) 1<1806>
StripOffsets (273) LONG (4) 896<8 648 1288 1928 2568 3208 3848 4488 5128 5768 6408 7048 7688 8328 8968 9608 10248 10888 11528 12168 12808 13448 14088 14728 ...>
2020-12-08 16:13:55 +01:00
Even Rouault 4ca3e42517 tif_jpeg.c: avoid potential harmless unsigned integer overflow on data->fileoffset in JPEGFixupTagsSubsamplingSkip() by validating earlier. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28200 2020-12-02 10:09:16 +01:00
Thomas Bernard a5d20b39b9 tiff2pdf.c: check that tiff_datasize fits in a signed tsize_t
add t2p_set_tiff_datasize() to check for integer overflow

fixes #202
2020-12-01 00:25:52 +01:00
Even Rouault 0f013e5b5a Merge branch 'Jamaika1-master-patch-47839' into 'master'
Change ULARGE_INTEGER to LARGE_INTEGER

See merge request libtiff/libtiff!170
2020-11-27 22:52:10 +00:00
Even Rouault fd07f243d3 Merge branch 'Jamaika1-master-patch-46397' into 'master'
Added stdint.h

See merge request libtiff/libtiff!171
2020-11-27 22:49:43 +00:00
Jamaika fb84e7396b Added stdint.h 2020-11-27 22:22:04 +00:00
Jamaika cf89688896 ```
tif_win32.c: In function '_tiffSizeProc':
tif_win32.c:159:23: warning: passing argument 2 of 'GetFileSizeEx' from incompatible pointer type [-Wincompatible-pointer-types]
  159 |  if (GetFileSizeEx(fd,&m))
      |                       ^~
      |                       |
      |                       ULARGE_INTEGER *
In file included from c:\msys1021\x86_64-w64-mingw32\include\winbase.h:18,
                 from c:\msys1021\x86_64-w64-mingw32\include\windows.h:70,
                 from tif_win32.c:32:
c:\msys1021\x86_64-w64-mingw32\include\fileapi.h:78:73: note: expected 'PLARGE_INTEGER' {aka 'LARGE_INTEGER *'} but argument is of type 'ULARGE_INTEGER *'
   78 |   WINBASEAPI WINBOOL WINAPI GetFileSizeEx (HANDLE hFile, PLARGE_INTEGER lpFileSize);
      |                                                          ~~~~~~~~~~~~~~~^~~~~~~~~~
```
2020-11-27 22:02:04 +00:00
Even Rouault 9dce07a777 Merge branch 'issue-113' into 'master'
tiffcrop: fix buffer overrun in extractContigSamples24bits()

Closes #113

See merge request libtiff/libtiff!169
2020-11-21 17:35:18 +00:00
Even Rouault 59e38422f1 Merge branch 'issue-156' into 'master'
tiff2pdf: Check output size before writing

Closes #156

See merge request libtiff/libtiff!168
2020-11-21 17:33:59 +00:00
Even Rouault b53b6d9abb Merge branch 'issue-201' into 'master'
tiff2pdf: enforce memory limit for tiled pictures too

Closes #201

See merge request libtiff/libtiff!167
2020-11-21 17:33:08 +00:00
Even Rouault b5a935d96b Merge branch 'issue-207' into 'master'
enforce (configurable) memory limit in tiff2rgba

Closes #209 et #207

See merge request libtiff/libtiff!165
2020-11-20 22:04:34 +00:00
Even Rouault 69c6b52663 tif_lzw.c: avoid false positive -Wnull-dereference of mingw32 gcc 7.3 2020-11-20 14:12:38 +01:00
Thomas Bernard 916c1a4f8b tiffcrop: fix buffer overrun in extractContigSamples24bits()
fixes #113
2020-11-18 01:47:11 +01:00
Thomas Bernard 6605513d24 tiff2pdf: Check output size before writing
fixes #156
2020-11-18 01:22:04 +01:00
Thomas Bernard 9c927442d3 tiff2pdf: enforce memory limit for tiled pictures too
fixes #201
2020-11-18 00:35:48 +01:00
Thomas Bernard e9e504193e tiff2rgba.1: -M option 2020-11-15 17:08:42 +01:00
Thomas Bernard 98a254f5b9 enforce (configurable) memory limit in tiff2rgba
fixes #207
fixes #209
2020-11-15 17:02:51 +01:00
Even Rouault dadd8c7dce Merge branch 'issue-220' into 'master'
tiff2pdf.c: properly calculate datasize when saving to JPEG YCbCr

Closes #220

See merge request libtiff/libtiff!159
2020-11-14 12:53:01 +00:00
Thomas Bernard 7be2e452dd tiff2pdf.c: properly calculate datasize when saving to JPEG YCbCr
fixes #220
2020-11-14 12:53:01 +00:00
Even Rouault bf84e70665 Merge branch 'issue-204' into 'master'
avoid buffer overflow while writing jpeg end of file marker

Closes #204

See merge request libtiff/libtiff!161
2020-11-14 12:51:06 +00:00
Even Rouault 7ade760d79 Merge branch 'issue-193' into 'master'
fix buffer overflow in tiff2ps.c

Closes #193

See merge request libtiff/libtiff!162
2020-11-14 12:50:05 +00:00
Even Rouault 026c2bce9f Merge branch 'skal65535-master-patch-91082' into 'master'
More overflow fixes for large widths

See merge request libtiff/libtiff!164
2020-11-14 12:44:43 +00:00
skal 2105b200df More overflow fixes for large width
Also: use INT_MAX instead of hard-coded constants.
2020-11-14 08:57:59 +00:00
Even Rouault d40507b815 Merge branch 'skal65535-master-patch-56655' into 'master'
Fix potential overflow in gtStripContig()

See merge request libtiff/libtiff!163
2020-11-12 15:52:56 +00:00
Even Rouault d167fbb6af Merge branch 'issue-211' into 'master'
check for tile width overflow

Closes #211

See merge request libtiff/libtiff!160
2020-11-12 15:52:43 +00:00
skal ce70d17ee6 Fix potential overflow in gtStripContig()
(w + w) might not fit in int32 if too large.
2020-11-12 15:41:14 +00:00
Thomas Bernard b7cc4f7ef1 tiff2ps.c: fix buffer overread
fixes #193
2020-11-10 03:00:27 +01:00
Thomas Bernard 19ff8a6e97 fix undefined behaviour (int shifted too much to the left) 2020-11-10 03:00:12 +01:00
Thomas Bernard a61c255236 avoid buffer overflow while writing jpeg end of file marker
fixes #204
2020-11-10 02:35:53 +01:00
Thomas Bernard c8d613ef49 gtTileContig(): check Tile width for overflow
fixes #211
2020-11-10 02:10:31 +01:00
Thomas Bernard 712fe9f5b9 fix warning messages (v32 is unsigned) 2020-11-10 01:53:56 +01:00
Even Rouault 2e822691d7 TIFFStartStrip(): avoid potential crash in WebP codec when using scanline access on corrupted files. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26650 2020-10-26 11:32:42 +01:00
Even Rouault b0469e8157 tif_webp.c: validate tile/strip dimension to avoid unsigned integer overflow in RGBA.size computation 2020-10-20 13:47:16 +02:00
Even Rouault 8aec9c8d29 tif_zip.c: fix typo in comment 2020-10-19 14:25:40 +02:00
Even Rouault 3550db1ad2 tiff.h: remove irrelevant warning about webp related pseudo-tags not being registered: they are purely internal libtiff concepts 2020-10-16 15:23:56 +02:00
Even Rouault 0047ca708b Merge branch 'libdeflate' into 'master'
Add support for building against libdeflate for faster Zip/Deflate compression/decompression

See merge request libtiff/libtiff!158
2020-10-16 13:22:06 +00:00
Even Rouault b9fa1f6e4a test: add testdeflatelaststripextradata.sh 2020-10-16 13:40:11 +02:00
Even Rouault 3a2de853a9 Add support for optional building against libdeflate for faster Zip/Deflate compression/decompression.
So we can have 2 kind of builds with the Zip/Deflate codec:
- zlib only
- zlib + libdeflate

Speed improvements in the 35%-50% range can be expected when libdeflate is used.
Compression level up to 12 is now supported (capped to 9 when zlib is used).
Still requires zlib for situations where libdeflate cannot be used (that
is for scanline access, since libdeflate has no streaming mode)

Pseudo-tag TIFFTAG_DEFLATE_SUBCODEC=DEFLATE_SUBCODEC_ZLIB/DEFLATE_SUBCODEC_LIBDEFLATE
is added to control which subcodec (zlib or libdeflate) should be used (it defaults
of course to libdeflate, when it is available).
This is mostly aimed at being used on the writing side, to be able to reproduce
output of previous libtiff versions at a binary level, in situations where this would
be really needed. Or as a safety belt in case there would be unforeseen issues
with using libdeflate.
It can be used to know when libdeflate is available at runtime (DEFLATE_SUBCODEC_LIBDEFLATE
will be the default value in that situation).

Of course, deflate codestreams produced by libdeflate can be read by zlib, and vice-versa.
2020-10-16 13:40:10 +02:00
Even Rouault ac64d74bdf tif_webp.c: fix compiler warnings with MSVC 2020-10-14 14:39:50 +02:00
Even Rouault e2801db6fd Merge branch 'various_fixes' into 'master'
Fix compiler warnings about unused variables when assert() expands to nothing

See merge request libtiff/libtiff!157
2020-10-12 19:18:40 +00:00
Even Rouault 4c4965a9df .gitignore: add entries for new files in test/ 2020-10-12 20:20:38 +02:00
Even Rouault c4aa76401b Fix compiler warnings about unused variables when assert() expands to nothing 2020-10-12 19:45:51 +02:00
Roger Leigh 3279b00500 Merge branch '215-cygwin-appveyor-fail' into 'master'
Update Appveyor CI build to build with VS2019 image

Closes #215

See merge request libtiff/libtiff!154
2020-10-09 18:05:25 +00:00
Roger Leigh 7f8f6991da wip 2020-10-09 18:10:56 +01:00
Roger Leigh 42b6225641 wip 2020-10-09 17:58:44 +01:00
Roger Leigh aeddabed84 wip 2020-10-09 17:00:46 +01:00
Roger Leigh 7d8b5e3695 wip 2020-10-09 16:47:38 +01:00
Roger Leigh 9911889a25 wip 2020-10-09 16:19:58 +01:00
Roger Leigh 4d1e1bc362 wip 2020-10-09 15:49:47 +01:00
Roger Leigh e61c593494 Merge branch 'TIFF-217_m_lib_path' into 'master'
cmake: Do not use absolute libm path

Closes #217

See merge request libtiff/libtiff!156
2020-10-09 09:21:55 +00:00
Roger Leigh 7c9ca61785 cmake: Do not use absolute libm path 2020-10-09 08:32:44 +01:00
Even Rouault a4cae3b8a3 tif_fax3.h: restore systematic calls to CLEANUP_RUNS()
now that SETVALUE() no longer cause overflows.
Those were removed per b351db8be1 and
3440ac2164.

As SETVALUE() now returns an error, this allow the decoder to exit.

Otherwise, the assert(x == lastx) in _TIFFFax3fillruns() can trigger.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26201
2020-10-08 12:20:52 +02:00
Even Rouault 4ee4a69bbb Merge branch 'check_TIFFFlushData1' into 'master'
FAX/JPEG/LZMA/PixarLog/ZIP/ZSTD codecs: make sure to check TIFFFlushData1() return value

See merge request libtiff/libtiff!155
2020-10-06 09:57:51 +00:00
Even Rouault 8c4c297a48 Merge branch 'shared-memory' into 'master'
Set the --shared-memory linker flag for Emscripten builds

See merge request libtiff/libtiff!153
2020-10-04 09:51:13 +00:00
Even Rouault ca70b5e702 tiff2rgba.c: fix -Wold-style-declaration warning 2020-10-03 18:16:27 +02:00
Even Rouault ff1022ac06 FAX/JPEG/LZMA/PixarLog/ZIP/ZSTD codecs: make sure to check TIFFFlushData1() return value 2020-10-03 18:12:04 +02:00
Even Rouault 9febb7599a tif_fax3.h: extra buffer overflow checks. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25934 2020-09-26 23:02:19 +02:00
Roger Leigh 6d078fe1f8 wip 2020-09-25 17:14:58 +01:00
Roger Leigh e8863893b0 wip 2020-09-25 10:47:23 +01:00
Roger Leigh 5123e29287 wip 2020-09-25 10:12:02 +01:00
Roger Leigh 3b522bf470 wip 2020-09-25 09:57:15 +01:00
Roger Leigh 5d0476eb0b wip 2020-09-25 09:43:43 +01:00
Roger Leigh 9555de026e wip 2020-09-25 09:33:47 +01:00
Roger Leigh 04b299927f Update AppVeyor image 2020-09-25 09:10:07 +01:00
Roger Leigh f846cd6452 test-appveyor 2020-09-25 09:01:47 +01:00
Attila Oláh 2b9abce31b Also pass --shared-memory to raw_decode.
This is needed when building for Emscripten with *both* WEBP and JPEG
support.
2020-09-24 17:24:12 +00:00
Attila Oláh 433e052356 Set the --shared-memory linker flag for Emscripten builds.
This is only needed when building with WEBP support, which uses atomics,
therefore the linker needs the --shared-memory flag. The flag cannot be
added globally because not all executables link against libwebp.
2020-09-24 16:22:25 +00:00
Even Rouault c8f0a16f4a tif_fax3.h: return error when a buffer overflow occurs. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25552 and https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25849 2020-09-22 18:27:44 +02:00
Even Rouault 57d487aa1c Merge branch 'fix-float-compare' into 'master'
Fix comparison for max negative float value.

See merge request libtiff/libtiff!152
2020-09-11 09:41:47 +00:00
Dirk Lemstra c0e310bc3f Fix comparison for max negative float value. 2020-09-11 10:41:11 +02:00
Even Rouault 7b840002c1 Fax3PreDecode(): reset curruns and refruns state variables
to avoid out-of-bounds write triggered by GDAL when repeatedly
reading a corrupt strip.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25493
2020-09-07 23:51:23 +02:00
Thomas Bernard 1373f8dacb Merge branch 'issue-17' into 'master'
normalize tools behaviour regarding -h

Closes #17

See merge request libtiff/libtiff!115
2020-06-06 20:32:09 +00:00
Even Rouault 8a58319106 TWebPSetupEncode(): fix logic problem (and instead of or) in test that checks input is 8bit unsigned data 2020-05-31 21:18:21 +02:00
Even Rouault 6b3b189d5b TIFFGetConfiguredCODECs(): fix to avoid wrong structure to be returned for registered (ie non built-in) codecs 2020-05-13 00:56:14 +02:00
Even Rouault 2a597b76cc Merge branch 'zstd-webp-update' into 'master'
gitlab-ci: use latest zstd and webp versions

See merge request libtiff/libtiff!148
2020-05-09 12:15:38 +00:00
Even Rouault 4c750d0238 Merge branch 'deprecated' into 'master'
ojpeg: s/Depreciated/Deprecated/

See merge request libtiff/libtiff!149
2020-05-09 12:13:27 +00:00
Aaron Boxer 0c2445854f ojpeg: s/Depreciated/Deprecated/ 2020-05-09 08:00:43 -04:00
Even Rouault 5fb3593eba Fix typos 2020-04-28 00:49:54 +02:00
Even Rouault 8405704ebb tif_jpeg.c: avoid potential division in previous fix (master only) 2020-04-27 13:20:55 +02:00
Thomas Bernard 312105b4a1 gitlab-ci: use latest zstd and webp versions 2020-04-26 22:32:35 +02:00
Even Rouault c96a0232b7 tiff.h: fixes to use ASCII only characters (master only) 2020-04-26 22:30:14 +02:00
Thomas Bernard aea167005f tiffsplit: use EXIT_SUCCESS / EXIT_FAILURE 2020-04-26 22:15:09 +02:00
Thomas Bernard 2fa1ce2f55 tiffset: print usage on stdout when -h is used
also use EXIT_FAILURE / EXIT_SUCCESS
see #17
2020-04-26 22:15:09 +02:00
Thomas Bernard 9bf9cd3926 tiffmedian: shopw usage on stdout when -h is used
aslo use EXIT_SUCCESS/EXIT_FAILURE
see #17
2020-04-26 22:15:09 +02:00
Thomas Bernard 1c614e2686 tiffinfo: print usage on stdout when -h is used
also use EXIT_FAILURE / EXIT_SUCCESS
see #17
2020-04-26 22:15:09 +02:00
Thomas Bernard 46c8624972 raw2tiff: print usage to stdout when -h is used
see #17
2020-04-26 22:15:08 +02:00
Thomas Bernard ee6cf2f59d tiff2pdf: print usage on stdout when -h is used
see #17
2020-04-26 22:15:08 +02:00
Thomas Bernard 2c6e8805ba tiffgt: output usage on stdout with -h
also use EXIT_SUCCESS / EXIT_FAILURE
2020-04-26 22:15:08 +02:00
Thomas Bernard eb6806dd64 tiffdump: use EXIT_FAILURE / EXIT_SUCCESS
see #17
2020-04-26 22:15:08 +02:00
Thomas Bernard 68564877c7 tiffdither: print usage on stdout when -h is used
see #17
2020-04-26 22:15:08 +02:00
Thomas Bernard 08b99340ee tiffcrop: -h / -v prints usage/version to stdout
also uses the standard C EXIT_SUCCESS / EXIT_FAILURE
macros

see #17
2020-04-26 22:15:05 +02:00
Thomas Bernard 2b2b1fd8fe tiffcp: output usage to stdout when using -h
also use EXIT_FAILURE / EXIT_SUCCESS
see #17
2020-04-26 22:13:28 +02:00
Thomas Bernard 5e0eb5bbf4 tiffcmp: match exit status for posix cmp and diff tools 2020-04-26 22:11:36 +02:00
Thomas Bernard 02875964eb tiff2rgba: output usage to stdout when using -h
also uses std C EXIT_FAILURE / EXIT_SUCCESS
see #17
2020-04-26 22:11:36 +02:00
Thomas Bernard 05993b6408 tiff2ps: sue EXIT_FAILURE / EXIT_SUCCESS
see #17
2020-04-26 22:11:36 +02:00
Thomas Bernard ff18e43223 tiff2bw: output usage on stdout when using -h
also uses EXIT_SUCCESS / EXIT_FAILURE
see #17
2020-04-26 22:11:35 +02:00
Thomas Bernard da2995eecf thumbnail: use EXIT_FAILURE / EXIT_SUCCESS
the -h option was already used so it cannot be used for help/usage
see #17
2020-04-26 22:11:35 +02:00
Thomas Bernard aa4409eda5 rgb2ycbcr: use EXIT_FAILURE / EXIT_SUCCESS
the -h option was already used so it cannot be used for help/usage
see #17
2020-04-26 22:11:35 +02:00
Thomas Bernard 113a07e9f3 ppm2tiff: output usage to stdout when using -h option
also uses std C EXIT_SUCCESS / EXIT_FAILURE
see #17
2020-04-26 22:11:35 +02:00
Thomas Bernard 3ac0c950c6 pal2rgb: output usage to stdout when -h is used
see #17
2020-04-26 22:11:35 +02:00
Thomas Bernard 04e7c51f4e fax2tiff.c: print usage on stdout when using -h option
see #17
2020-04-26 22:11:35 +02:00
Thomas Bernard 0aed3363cf fax2ps: output usage to stdout when using -h option
also use EXIT_SUCCESS, EXIT_FAILURE from C standard
2020-04-26 22:11:34 +02:00
Even Rouault b683c37524 Merge branch 'jpeg_multiscan_dos_logic' into 'master'
tif_jpeg.c: revise logic to detect potential excessive memory usage when...

See merge request libtiff/libtiff!147
2020-04-25 10:25:43 +00:00
Even Rouault 400ae6f2b1 Merge branch 'issue-176' into 'master'
tiff2pdf: get rid of uninitialized memory content

Closes #176

See merge request libtiff/libtiff!143
2020-04-24 19:16:06 +00:00
Even Rouault daed3c04ab tif_jpeg.c: revise logic to detect potential excessive memory usage when decoding multiscan JPEG compressed images 2020-04-24 20:29:06 +02:00
Thomas Bernard f840b0d2ba tiff2pdf: test the return code of TIFFReadRawStrip() and TIFFReadRawTile() 2020-04-19 23:39:59 +02:00
Thomas Bernard 8fed45347e tiff2pdf.c: fix some whitespace problems in source 2020-04-19 20:55:05 +02:00
Thomas Bernard bb1ab756d6 tiff2pdf: get rid of uninitialized memory content
fixes #176
2020-04-19 20:55:05 +02:00
Even Rouault 1b4708f67f Merge branch 'issue-18' into 'master'
tiffset: pass size for TIFFTAG_INKNAMES

Closes #18

See merge request libtiff/libtiff!146
2020-04-19 18:32:25 +00:00
Olivier Paquet 4a91774d5d Merge branch 'issue-80' into 'master'
tiffinfo: fix dump of Tiled images

Closes #80

See merge request libtiff/libtiff!144
2020-04-18 14:05:15 +00:00
Even Rouault c51400048e Fix wrong file size checks for memory-mapped BigTIFF files that could lead to image rejection 2020-04-15 20:14:47 +02:00
Thomas Bernard 4b64bf1cee tiffset: pass size for TIFFTAG_INKNAMES
Uses TIFFFieldPassCount() to know which arguments need to be
passed to TiffSetField()

fixes #18
see http://bugzilla.maptools.org/show_bug.cgi?id=2202
2020-04-05 19:33:02 +02:00
Thomas Bernard aa9d52ac2b tiffinfo: showdata for tiled images 2020-04-05 01:19:10 +02:00
Thomas Bernard 691427ea8d tiffinfo: fix dump of Tiled images
fixes #80
2020-04-05 00:46:12 +02:00
Even Rouault 632f6a1a4f Merge branch 'issue-117' into 'master'
tiffcrop: enforce memory allocation limit

Closes #117

See merge request libtiff/libtiff!140
2020-04-03 19:11:09 +00:00
Thomas Bernard 1f3e801d96 tiffcrop: enforce memory allocation limit
uses -k option to change limit (default to 256MiB)
fixes #117 / http://bugzilla.maptools.org/show_bug.cgi?id=2757
2020-04-03 19:11:09 +00:00
Even Rouault 57449991d7 Merge branch 'issue-45' into 'master'
tiffcp: disable strip chopping when trying to convert to JBIG compression

Closes #45

See merge request libtiff/libtiff!138
2020-04-02 08:07:26 +00:00
Even Rouault a203c9ba20 Merge branch 'issue-124' into 'master'
TIFFGetFields(3tiff): TIFFTAG_*BYTECOUNTS TIFFTAG_*OFFSETS are uint64

Closes #124

See merge request libtiff/libtiff!137
2020-04-02 08:06:58 +00:00
Even Rouault 31ca59cb04 Merge branch 'aix_itrunc' into 'master'
Rename itrunc to fix name clash with a different itrunc in math.h on AIX. Fixes issue #189

Closes #189

See merge request libtiff/libtiff!139
2020-04-02 08:06:16 +00:00
Rob Boehne e2ea6e93b2 Rename itrunc to fix name clash with a different itrunc in math.h on AIX. Fixes issue #189 2020-04-01 19:05:40 -05:00
Thomas Bernard e526f620ef tiffcp: disable strip chopping when trying to convert to JBIG compression
fixes #45
2020-04-02 01:18:10 +02:00
Thomas Bernard ccf53d7417 TIFFGetFields(3tiff): TIFFTAG_*BYTECOUNTS TIFFTAG_*OFFSETS are uint64
fixes #124 / http://bugzilla.maptools.org/show_bug.cgi?id=2774
2020-03-29 19:28:25 +02:00
Even Rouault 94679bc2d8 Merge branch 'issue-48' into 'master'
tiff2pdf: fix "raw" copy of Deflate streams

Closes #48

See merge request libtiff/libtiff!136
2020-03-29 16:11:18 +00:00
Thomas Bernard 4efb92d1c9 tiff2pdf: fix "raw" copy of Deflate streams
The Predictor parametter was not copied from the source tiff to the PDF.
fixes #48 / http://bugzilla.maptools.org/show_bug.cgi?id=2442
2020-03-27 22:34:37 +01:00
Thomas Bernard f1e9078f92 tif_fax3: quit Fax3Decode2D() when a buffer overflow occurs
fixes #186
2020-03-26 23:08:28 +01:00
Even Rouault ed881da0db Merge branch 'issue-143-144' into 'master'
tiffdump: avoid unaligned memory access

Closes #144 et #143

See merge request libtiff/libtiff!133
2020-03-24 12:39:48 +00:00
Even Rouault 3c47638aaa Merge branch 'issue-133' into 'master'
tiff2pdf: avoid divide by 0

Closes #133

See merge request libtiff/libtiff!126
2020-03-24 12:39:18 +00:00
Thomas Bernard bd49c5810f tiff2pdf: normalizePoint() macro to normalize the white point 2020-03-24 11:34:36 +01:00
Thomas Bernard 37121e1574 tiffdump: avoid unaligned memory access
fixes #143
fixes #144
2020-03-24 00:18:32 +01:00
Even Rouault 6c63f17749 Merge branch 'out-of-memory' into 'master'
tiffcp/tiff2pdf/tiff2ps: enforce maximum malloc size

Closes #153, #84, #116 et #115

See merge request libtiff/libtiff!130
2020-03-23 18:11:02 +00:00
Even Rouault 9b64089083 Merge branch 'issue-157' into 'master'
tiffset: check memory allocation

Closes #157

See merge request libtiff/libtiff!132
2020-03-23 18:06:41 +00:00
Even Rouault 204c464327 Merge branch 'issue-185' into 'master'
tif_fax3: more buffer overflow checks in Fax3Decode2D()

Closes #185

See merge request libtiff/libtiff!131
2020-03-23 18:05:54 +00:00
Thomas Bernard b738aaa834 tiffset: check memory allocation
fixes #157 / http://bugzilla.maptools.org/show_bug.cgi?id=2850
2020-03-23 17:17:17 +01:00
Thomas Bernard 3440ac2164 tif_fax3: more buffer overflow checks in Fax3Decode2D()
fixes #185
2020-03-23 17:00:23 +01:00
Thomas Bernard dff30c4d5d tiff2ps: enforce memory allocation limit
fixes #153 / http://bugzilla.maptools.org/show_bug.cgi?id=2845
2020-03-21 15:50:38 +01:00
Thomas Bernard 791046b3c6 tiff2pdf: enforce maximum data size
fixes #116 / http://bugzilla.maptools.org/show_bug.cgi?id=2756
fixes #84 / http://bugzilla.maptools.org/show_bug.cgi?id=2683
2020-03-21 15:30:43 +01:00
Thomas Bernard bbf1da8750 update man page for tiffcp regarding the -m option 2020-03-21 15:00:43 +01:00
Thomas Bernard 035c1961d6 tiffcp.c: _TIFFmalloc() => limitMalloc() 2020-03-21 13:20:17 +01:00
Thomas Bernard 0a58e22b17 tiffcp: enforce maximum malloc size
default is 256MB. use -m option to change

fixes #115 / http://bugzilla.maptools.org/show_bug.cgi?id=2755
2020-03-21 13:20:12 +01:00
Even Rouault 443bd37f65 Merge branch 'issue-184' into 'master'
CmakeLists.txt: define WORDS_BIGENDIAN when the CPU is big endian

Closes #184

See merge request libtiff/libtiff!127
2020-03-21 11:33:13 +00:00
Even Rouault 41159741d7 Merge branch 'issue-44' into 'master'
tiff2pdf: "" causes the relevant argument not to be written

Closes #44

See merge request libtiff/libtiff!128
2020-03-21 11:21:33 +00:00
Even Rouault 7cadcb901b Merge branch 'issue-56' into 'master'
fix man for TIFFReadEncodedStrip(), TIFFStripSize, TIFFVStripSize, TIFFRawStripSize

Closes #56

See merge request libtiff/libtiff!129
2020-03-21 11:17:03 +00:00
Thomas Bernard 37a29d56a7 fix man for TIFFReadEncodedStrip(), TIFFStripSize, TIFFVStripSize, TIFFRawStripSize
fixes #56
http://bugzilla.maptools.org/show_bug.cgi?id=2507
2020-03-21 01:14:36 +01:00
Thomas Bernard f704878200 tiff2pdf: "" causes the relevant argument not to be written
fixes #44
2020-03-21 01:05:41 +01:00
Thomas Bernard 35cc068275 CmakeLists.txt: define WORDS_BIGENDIAN when the CPU is big endian
fixes #184
2020-03-21 00:31:41 +01:00
Thomas Bernard dbc90f9374 tiff2pdf: avoid divide by 0
fixes #133 http://bugzilla.maptools.org/show_bug.cgi?id=2796
2020-03-18 01:37:54 +01:00
Even Rouault 7c8dafc28c Merge branch 'issue-22' into 'master'
do not _tiffMapProc 0 size files

Closes #22

See merge request libtiff/libtiff!125
2020-03-17 22:51:09 +00:00
Thomas Bernard e99c4b816a tif_win32.c: do not _tiffMapProc() 0 sized files
see #22
2020-03-14 00:10:29 +01:00
Thomas Bernard 0c04331f97 tif_unix.c: do not _tiffMapProc 0 size files
fixes #22
http://bugzilla.maptools.org/show_bug.cgi?id=2249
2020-03-14 00:08:49 +01:00
Even Rouault fe10bc1bc3 tif_fax3.c: fix warning C4018: '<': signed/unsigned mismatch introduced in past commits 2020-03-12 14:22:00 +01:00
Even Rouault 0cd92e6459 tiff.h: mention TIFFTAG_RPCCOEFFICIENT, TIFFTAG_TIFF_RSID, TIFFTAG_GEO_METADATA 2020-03-12 01:06:41 +01:00
Even Rouault c47ae56a6a Merge branch 'issue-60' into 'master'
added support for more private tags

Closes #60

See merge request libtiff/libtiff!124
2020-03-12 00:01:11 +00:00
Even Rouault 08e67f831a Merge branch 'issue-160' into 'master'
Fax3SetupState(): check consistency of rowbytes and rowpixels

Closes #160

See merge request libtiff/libtiff!123
2020-03-11 23:55:10 +00:00
Thomas Bernard 0bd069f88f added support for more private tags
see https://gitlab.com/libtiff/libtiff/-/issues/60
bugzilla.maptools.org/show_bug.cgi?id=2525

closes #60

original author : art1@andreas-romeyke.de
2020-03-12 00:03:35 +01:00
Thomas Bernard 197bfe4c14 Fax3SetupState(): check consistency of rowbytes and rowpixels
also add some parameter documentation to Fax3Decode1D()

fixes #160
http://bugzilla.maptools.org/show_bug.cgi?id=2854
2020-03-11 23:34:21 +01:00
Even Rouault 8614c4046f Merge branch 'issue-11-const-pointers' into 'master'
Make pointers returned via TIFFGetField const

Closes #11

See merge request libtiff/libtiff!118
2020-03-10 22:33:57 +00:00
Even Rouault 1120a2d578 tif_ojpeg.c: relax again too strict sanity checks to allow reading of valid images such as https://gitlab.com/libtiff/libtiff/-/issues/181#note_302535232. Fixes #181 2020-03-10 16:31:41 +01:00
Even Rouault ae054d59ae Merge branch 'issue-52' into 'master'
contrib/win_dib/tiff2dib: fix Uninitialized variable: lpBits

Closes #52

See merge request libtiff/libtiff!121
2020-03-09 10:31:52 +00:00
Thomas Bernard 70b8c095f8 contrib/win_dib/tiff2dib: fix Uninitialized variable: lpBits
fixes #52
http://bugzilla.maptools.org/show_bug.cgi?id=2469
2020-03-09 09:08:07 +01:00
Even Rouault dce4bb0da5 Merge branch 'issue-58' into 'master'
Make TIFFTAG_CFAPATTERN variable count

Closes #58

See merge request libtiff/libtiff!120
2020-03-08 22:31:25 +00:00
Even Rouault 84b8b9a3e7 Merge branch 'issue-158-no-predictor-in-webp' into 'master'
TIFFTAG_PREDICTOR is not supported for WebP

Closes #158

See merge request libtiff/libtiff!119
2020-03-08 22:21:33 +00:00
Sam Hasinoff 2eb5a954cb Make TIFFTAG_CFAPATTERN variable count
The TIFFTAG_CFAPATTERN tag (33422) from TIFF/EP, recently introduced in libtiff
3363eda09d / http://bugzilla.maptools.org/show_bug.cgi?id=2457
is described as having a fixed count of 4.
But the TIFF/EP spec says this should support a variable count (= CFARepeatRows * CFARepeatCols):

TIFF/EP, ISO 12234-2:2001
http://www.barrypearson.co.uk/top2009/downloads/TAG2000-22_DIS12234-2.pdf
page 18 and 26
2020-03-08 21:23:16 +01:00
Thomas Bernard 54ce8c5220 TIFFTAG_PREDICTOR is not supported for WebP
fixes #158
https://gitlab.com/libtiff/libtiff/-/issues/158

this bug was introduced by 9eacd59fec
merge request !32
2020-03-08 20:33:34 +01:00
Adam Goode d6827861cb Make the default whitepoint and ycbcrcoeffs arrays const
Now that we are returning const pointers in TIFFGetFieldDefaulted,
we can now make these static default arrays const.

see #11
2020-03-08 00:54:36 +01:00
Adam Goode 63c666344f Make pointers returned via TIFFGetField const
According to http://bugzilla.maptools.org/show_bug.cgi?id=2125#c6
callers are not allowed to modify pointer or array values returned from
TIFFGetField or the like. So, make this explicit in the documentation
by specifying these things as const. Note that this is not an ABI
change, since C does not encode const in libraries. Also, this is
not really an API change, since the varargs call strips away all
the types anyway. So it really is more of a documentation change.

fixes #11
2020-03-08 00:51:28 +01:00
Even Rouault e95584d3b8 CMake: Skip custom_dir_EXIF_231 test on shared builds to avoid issues on Windows 2020-03-07 17:37:42 +01:00
Even Rouault d83f5ce943 Merge branch 'EXIF231_GPS_upgrade' into 'master'
EXIF 2.32 and GPS TIFF-tags and functionality upgraded.

See merge request libtiff/libtiff!91
2020-03-07 16:01:12 +00:00
Su_Laus a8193c438f EXIF 2.32 and GPS tags and functionality upgraded.
- Existing EXIF field definition of tags is upgraded to EXIF version 2.3.2
- EXIF-GPS structure, tags and access functions are added as special CustomDirectory (like it was done for EXIF).
- Test program custom_dir_EXIF_231.c added to test writing/reading of EXID IFD and GPS IFD tags
  and to highlight some quirks of IFD-handling and peculiarities of reading/writing the different data types.
- Reading error for FileSource and SceneType tags corrected.

- EXIF_GPS_upgrade rebased onto c8c5309b76 (Merge branch 'Rational2DoublePrecision_correction' into 'master')
and adapted:
- tif_dirinfo.c:         All rational tags set to TIFF_SETGET_FLOAT but only the GPSTAG_ tags set to TIFF_SETGET_DOUBLE.
- custom_dir_EXIF_231.c: Editorials amended and gcc warnigs fixed.
- CMakeLists.txt: add_test(NAME "custom_dir_EXIF_231"  COMMAND "custom_dir_EXIF_231")  added.
2020-03-07 16:50:18 +01:00
Even Rouault 74cf519c9f Merge branch 'issue-55' into 'master'
ppm2tiff: support any bps value from 1 to 16

Closes #55

See merge request libtiff/libtiff!106
2020-03-07 11:02:38 +00:00
Thomas Bernard 5f84fefcf5 ppm2tiff: Add test for 16bpc PPM 2020-03-07 11:46:20 +01:00
Thomas Bernard 622492cb31 ppm2tiff: remove unused argument warning 2020-03-07 10:56:31 +01:00
Ludolf Holzheid 5582d0bfad ppm2tiff: support any bps value from 1 to 16
fix #55
http://bugzilla.maptools.org/show_bug.cgi?id=2505

Patch originally submited by Ludolf Holzheid <ludolf.holzheid@gmx.de>
2020-03-07 10:56:31 +01:00
Even Rouault bba9d00d77 Merge branch 'fax-test' into 'master'
add test for fax4 decoding

See merge request libtiff/libtiff!114
2020-03-06 09:03:45 +00:00
Thomas Bernard ff56dc47af add test for fax4 decoding
This will check for regression on #46
https://gitlab.com/libtiff/libtiff/issues/46
http://bugzilla.maptools.org/show_bug.cgi?id=2434
2020-03-05 23:51:32 +01:00
Even Rouault a712dc3f42 Merge branch 'freebsd-tests' into 'master'
make tests pass under FreeBSD.

See merge request libtiff/libtiff!113
2020-03-05 22:26:11 +00:00
Thomas Bernard ed9d09cf0a make tests pass under FreeBSD.
the -I option for the GNU diff and the FreeBSD diff
behaves differently regarding escaping the ( ) and |

By using two -I option, we avoid using such charracters.
2020-03-05 23:15:06 +01:00
Even Rouault a6d3c1d64b Merge branch 'issue-31' into 'master'
HTML

Closes #31

See merge request libtiff/libtiff!111
2020-03-05 11:45:15 +00:00
Even Rouault d71530462f Merge branch 'issue-179' into 'master'
tif_fax3.h: check for buffer overflow in EXPAND2D before "calling" CLEANUP_RUNS()

Closes #179

See merge request libtiff/libtiff!112
2020-03-05 11:39:34 +00:00
Thomas Bernard a9f96b79d7 v4.1.0.html: fix for validation
long <!----------------> comments were replaced
because they confused some parsers
2020-03-05 11:57:23 +01:00
Thomas Bernard f5d1d8df7b add DOCTYPE on v*.html 2020-03-05 11:43:57 +01:00
Thomas Bernard 690cc7a701 fix HTML files so they are valid according to https://validator.w3.org 2020-03-05 11:38:31 +01:00
Thomas Bernard b351db8be1 tif_fax3.h: check for buffer overflow in EXPAND2D before "calling" CLEANUP_RUNS()
fixes #179

this fixes the regression introduced in 02bb0175 / 72c4acef
( merge request !110 )

It may be a better fix to do the overflow check in SETVALUE() but the
macro do { } while(0) construct makes it difficult to quit the loop
properly.
2020-03-05 10:27:04 +01:00
Thomas Bernard 535830c277 index.html: fix unclosed <tt> tag 2020-03-01 22:26:55 +01:00
Thomas Bernard 794ec1ad50 html: do not force colors (which are default anyway)
If needed, style should be set using CSS.

fixes #31
https://gitlab.com/libtiff/libtiff/issues/31
http://bugzilla.maptools.org/show_bug.cgi?id=2326
2020-03-01 22:25:29 +01:00
Even Rouault 25b274126d TIFFReadCustomDirectory(): fix potential heap buffer overflow when reading a custom directory, after a regular directory where a codec was active. Fixes https://gitlab.com/libtiff/libtiff/issues/178 2020-03-01 22:22:01 +01:00
Even Rouault 18ca4b4276 Merge branch 'issue-46' into 'master'
fix decoding of fax4 images

Closes #46

See merge request libtiff/libtiff!110
2020-03-01 10:39:07 +00:00
Thomas Bernard 72c4acef4b tif_fax3: better fix for CVE-2011-0192
There are some legitimate case which were forbidden by the previous fix
2020-03-01 00:38:59 +01:00
Thomas Bernard 02bb01750f tif_fax3.h: allow 0 length run in DECODE2D
fixes #46
https://gitlab.com/libtiff/libtiff/issues/46
http://bugzilla.maptools.org/show_bug.cgi?id=2434
2020-02-29 23:30:07 +01:00
Even Rouault bd03e1a27f Merge branch 'mingwlibm' into 'master'
Don't use libm with libtiff due to conflict with libmsvcrt

See merge request libtiff/libtiff!73
2020-02-29 18:08:09 +00:00
Even Rouault c8c5309b76 Merge branch 'Rational2DoublePrecision_correction' into 'master'
tif_dirwrite.c: bugfix DoubleToSrational() for plain signed integers

See merge request libtiff/libtiff!109
2020-02-29 18:04:50 +00:00
Su_Laus 30222c13d6 tif_dirwrite.c: bugfix DoubleToSrational(), which returns plain signed interger values always as unsigned rationals.
Add a test into rational_precision2double.c for "-1.0" and some editorials in tif_dirwrite.c.
(code is related to 6df997c786 changes).
2020-02-29 17:59:59 +01:00
Even Rouault d04e3d26c5 Merge branch 'issue-174' into 'master'
tif_fax3.c: check buffer overflow in Fax4Decode()

Closes #174

See merge request libtiff/libtiff!108
2020-02-29 11:35:15 +00:00
Thomas Bernard df38126420 Fax4Decode(): log error message in case of buffer overrun 2020-02-29 11:28:01 +01:00
Thomas Bernard c4710ee226 tif_fax3.c: check buffer overflow in Fax4Decode()
fixes #174
2020-02-29 11:17:25 +01:00
Even Rouault a6fa499e20 typo fixes in code comments 2020-02-29 01:17:17 +01:00
Even Rouault facb37f149 ToRationalEuclideanGCD: remove useless test that confuses Coverity Scan about a potential later modulo by zero 2020-02-28 20:40:27 +01:00
Even Rouault 388a1dba72 tif_dirwrite.c: fix other warnings related to 6df997c786 changes 2020-02-27 22:02:58 +01:00
Even Rouault 721120d0d7 rational_precision2double.c: fix many warnings, and do not build it on CMake on shared lib builds 2020-02-27 22:00:41 +01:00
Even Rouault edc16ac20a tif_dirwrite.c: fix various warnings found when building GDAL with internal libtiff after 6df997c786 changes 2020-02-27 21:50:59 +01:00
Even Rouault 8c4b470889 tif_dirwrite.c: qualify ToRationalEuclideanGCD() with static 2020-02-27 21:30:28 +01:00
Even Rouault 27a1338723 Merge branch 'Rational2DoublePrecision' into 'master'
Rational with Double Precision Upgrade

See merge request libtiff/libtiff!100
2020-02-27 20:28:18 +00:00
Su_Laus 6df997c786 Rational with Double Precision Upgrade
Unfortunately, custom rational tags (TIFF_RATIONAL with field_bit=FIELD_CUSTOM) are defined as TIFF_SETGET_DOUBLE
but for the reading interface and LibTiff internally they are stored ALLWAYS as floating point SINGLE precision.
Double precision custom rational tags are not supported by LibTiff.

For the GPS tags in WGS84 a higher accuracy / precision is needed.
Therefore, this upgrade is made, keeping the old interface for the already defined tags and allowing a double precision definition,
as well as calculating rationals with higher accuracy / precision.
This higher accuracy can be used for newly defined tags like that in EXIF/GPS.

Refer also to the very old Bugzilla issue 2542 (#69)

A test file rational_precision2double.c is added, which shows prevention of the old interface to the already defined custom rational tags
with the standard library as well as with the upgraded library.

Also TIFFTAG_XRESOLUTION, TIFFTAG_YRESOLUTION, TIFFTAG_XPOSITION, TIFFTAG_YPOSITION amended from TIFF_SETGET_DOUBLE to TIFF_SETGET_FLOAT and testcase inserted in rational_precision2double.c
2020-02-27 21:11:20 +01:00
Chris Degawa 16377d39ea mingw-w64 cmake: Don't find libm
mingw-w64 will provide libm symbols by default without -lm and mingw-64's
libm is just a stub.

This is just to make sure that on systems with msys2 and also cygwin, cmake
doesn't find a libm that actually contains math functions.
2020-02-26 23:03:32 +00:00
Even Rouault 06d6e36187 Merge branch 'division-by-zero' into 'master'
tools/tiffcp.c: fix potential division by zero

See merge request libtiff/libtiff!83
2020-02-26 21:37:54 +00:00
Even Rouault bf53c80aea Merge branch 'fix-unused-warning' into 'master'
warnings: mark conditionally used parameters

See merge request libtiff/libtiff!49
2020-02-26 21:31:27 +00:00
Even Rouault a1b7eac5e8 Merge branch 'master' into 'master'
fix issue #78 warnings regarding RichTIFFIPTC data type

Closes #78

See merge request libtiff/libtiff!99
2020-02-26 21:25:42 +00:00
Even Rouault e3f0b1d894 Merge branch 'win64-handle-casts-warn-fix' into 'master'
Avoid warnings about casts between HANDLE and int in Win64 builds

Closes #2

See merge request libtiff/libtiff!93
2020-02-26 21:23:57 +00:00
Even Rouault 2a4d9b4fab Merge branch 'bug2839' into 'master'
raw2tiff: avoid divide by 0

Closes #151

See merge request libtiff/libtiff!103
2020-02-26 21:22:26 +00:00
Even Rouault 2832b9829f Merge branch 'bug2669' into 'master'
tiff2pdf: palette bound check in t2p_sample_realize_palette()

Closes #82

See merge request libtiff/libtiff!104
2020-02-26 21:21:09 +00:00
Even Rouault e9a124f52f Merge branch 'int-shift' into 'master'
tiffcrop: fix asan runtime error caused by integer promotion

See merge request libtiff/libtiff!105
2020-02-26 21:20:10 +00:00
Even Rouault a7276b9198 Merge branch 'bug-2538' into 'master'
libtiff.html: fix function casing

Closes #68

See merge request libtiff/libtiff!107
2020-02-26 21:17:27 +00:00
Thomas Bernard bdcf1add10 raw2tiff: avoid divide by 0
fixes #151 / http://bugzilla.maptools.org/show_bug.cgi?id=2839

first memcmp() lines before computing corellation
and always avoid divide by 0 anyway
2020-02-16 19:20:37 +01:00
Even Rouault b4820b2179 Merge branch 'bug2855' into 'master'
tiff2ps: fix heap buffer read overflow in PSDataColorContig()

Closes #161

See merge request libtiff/libtiff!102
2020-02-09 13:11:39 +00:00
Thomas Bernard 8c9dca34be libtiff.html: fix function casing 2020-02-08 18:02:15 +01:00
Thomas Bernard 2cdc041d62 libtiff.html: fix function casing
fixes #68 / http://bugzilla.maptools.org/show_bug.cgi?id=2538
2020-02-08 17:54:51 +01:00
Thomas Bernard 4f168b7368 tiffcrop: fix asan runtime error caused by integer promotion
tiffcrop.c:4027:20: runtime error: left shift of 190 by 24 places cannot be represented in type 'int'

C treats (byte << 24) as an int expression.
casting explicitely to unsigned type uint32 avoids the problem.

the same issue has been fixed elsewhere with a242136916

I detected the bug with the test file of #86
2020-02-08 13:43:35 +01:00
Thomas Bernard 3107393354 tiff2pdf: palette bound check in t2p_sample_realize_palette()
fixes #82
2020-02-08 13:27:51 +01:00
Thomas Bernard ebf0864306 tiff2ps: fix heap buffer read overflow in PSDataColorContig()
fixes #161 / http://bugzilla.maptools.org/show_bug.cgi?id=2855

in 05029fb7f1 I missed that 1 extra byte is read
in this loop.
2020-02-08 12:10:56 +01:00
Even Rouault 3334704ebc tif_dirread.c: suppress CLang static Analyzer 9.0 false positive 2020-02-06 01:25:03 +01:00
Even Rouault 37a02ad493 TIFFSetupStrips: enforce 2GB limitation of Strip/Tile Offsets/ByteCounts arrays
TIFFWriteDirectoryTagData() has an assertion that checks that the
arrays are not larger than 2GB. So error out earlier if in that situation.
2020-02-01 18:11:11 +01:00
Bob Friesenhahn 7a335a32eb Simplify nmake configuration for building port directory. Now there
is only one boolean setting to enable building strtoll() and strtoull()
port functions.  The boolean setting enables the necessary port files
to be built, but the remainder of the logic is via pre-processor code
in the common tif_config.h, which was prepared before entering the
port directory to do a build.
2020-01-29 08:03:39 -06:00
Bob Friesenhahn ed3b07c4e2 Make sure that tif_config.h is produced prior to entering the port
directory and add an include path so that the port files can include
tif_config.h.  Do not actually include tif_config.h at this time
since CMake and Autotools builds are not prepared for that.  This
issue could be handled by updating the CMake and Autotools builds
or by adding a define which directs libport.h to include tif_config.h.
2020-01-28 08:16:05 -06:00
Bob Friesenhahn 550f8708d2 Fix nmake build mistakes in my last commit:
tif_config.vc.h:

  Always define HAVE_STRTOL/HAVE_STRTOUL.
  Define HAVE_STRTOLL/HAVE_STRTOULL if _MSC_VER >= 1900.

nmake.opt:

  Provide defaults suitable for MSVC prior to 14.0.

libport.h:

  The sense of the pre-processor logic was inverted from what it
  should be.  The intention is to only provide the prototype if the
  function is missing.
2020-01-26 19:17:23 -06:00
Bob Friesenhahn 58b16f47a8 Add nmake build support for manually configuring the 'port' files to be
built based on MSVC features.
Include tif_config.h in tools/tiffset.c.
2020-01-25 14:11:05 -06:00
Even Rouault f5e1d765eb Adjust previous fix to avoid undue warning in some situations triggered by GDAL 2020-01-23 20:40:53 +01:00
Even Rouault 3db0ff91bc _TIFFPartialReadStripArray: bring back support for non-conformant SLONG8 data type
Such as in https://github.com/OSGeo/gdal/issues/2165
2020-01-12 14:54:02 +01:00
Even Rouault 8192df23fa test: add test for single-strip OJPEG file without RowsPerStrip tag (like in CR2 files) 2020-01-07 23:41:26 +01:00
Even Rouault 0a8245b7b8 OJPEGReadHeaderInfo: if rowsperstrip not defined, then assume one-single-strip. Complementary fix to 0356ea76ba 2020-01-07 23:13:11 +01:00
Angel Sánchez 1fc1faa5a9 fix issue #78 warnings regarding RichTIFFIPTC data type 2019-12-16 13:12:20 +01:00
Even Rouault 4f6db6a129 contrib/oss-fuzz/build.sh: fix broken if construct 2019-12-14 12:03:43 +01:00
Even Rouault b52fb8a91d contrib/oss-fuzz/build.sh: other attempt at fixing build failure 2019-11-28 14:18:38 +01:00
Even Rouault ad25410d09 contrib/oss-fuzz/build.sh: install liblzma-dev for x86_64 builds 2019-11-20 12:04:31 +01:00
Even Rouault 6927706c57 contrib/oss-fuzz/build.sh: install liblzma-dev:i386 on i386 builds 2019-11-17 12:58:30 +01:00
Even Rouault 4ef21c27c9 Merge branch 'cmake-parse' into 'master'
CMake: simplify parsing variables from configure

See merge request libtiff/libtiff!98
2019-11-15 22:02:02 +00:00
Rolf Eike Beer 47b1d516d3 CMake: simplify parsing variables from configure 2019-11-15 10:45:47 +01:00
Even Rouault 4159bda6db contrib/oss-fuzz/build.sh: fix ossfuzz build by statically linking to lzma 2019-11-14 15:12:43 +01:00
Even Rouault d73aaf0757 Merge branch 'fix_ojpeg_172' into 'master'
OJPEG: fix broken sanity check added in 4.1.0 (#fixes 172)

See merge request libtiff/libtiff!97
2019-11-12 14:55:53 +00:00
Even Rouault 0356ea76ba OJPEG: fix broken sanity check added in 4.1.0, and add two OJPEG test files 2019-11-11 23:07:57 +01:00
Even Rouault f417f056c5 test/: add missing generated .sh files 2019-11-11 23:01:03 +01:00
Even Rouault d0a8a3262c Merge branch 'fix-missing-checks-TIFFGetField-tiffcrop' into 'master'
adds missing checks on TIFFGetField in tiffcrop tool

Closes #170

See merge request libtiff/libtiff!96
2019-11-04 21:14:38 +00:00
Bug Checkers 47656ccb3f adds missing checks on TIFFGetField in tiffcrop tool (fixes #170) 2019-11-04 21:14:38 +00:00
Even Rouault 91d4a30dbc Merge branch 'adds-missing-TIFFClose-rgb2ycbcr' into 'master'
adds a missing TIFFClose in rgb2ycbcr tool

See merge request libtiff/libtiff!95
2019-11-04 20:04:20 +00:00
Mansour Ahmadi f2f1289601 adds a missing TIFFClose in rgb2ycbcr tool 2019-11-04 14:48:13 -05:00
Bob Friesenhahn e0d707dc15 libtiff 4.1.0 released 2019-11-03 14:15:37 -06:00
Bob Friesenhahn 9700cdfa77 ChangeLog updated with latest git commits. 2019-11-03 14:00:24 -06:00
Bob Friesenhahn 0cbdf1f903 Added a step for updating the legacy ChangeLog file. 2019-11-03 13:48:37 -06:00
Bob Friesenhahn 73975cbcb2 Ignore emacs temporary files (ending with tilde character). 2019-11-03 13:47:08 -06:00
Bob Friesenhahn 014441b770 Added release summary page for the 4.1.0 release. 2019-11-03 13:31:26 -06:00
Bob Friesenhahn f18e1a2db5 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.
2019-11-03 11:21:26 -06:00
Bob Friesenhahn aeb87392ad Fax2tiff.sh needs to remove its output file in advance. Syntax changes so that bash is not required. 2019-11-03 09:55:14 -06:00
Even Rouault 0219b01b54 tif_jpeg.c: extra cast to silence Coverity warning. GDAL CID 1406475 2019-10-26 22:45:36 +02:00
Even Rouault 8bf7b73703 tif_jpeg.c: fix warning added by previous commit (on 32bit builds) 2019-10-23 16:54:38 +02:00
Even Rouault dc3eab1cdf Merge branch 'coverity-fixes' into 'master'
Coverity fixes

See merge request libtiff/libtiff!94
2019-10-23 13:20:38 +00:00
Timothy Lyanguzov 2105b48383 Use 64-bit calculations correctly 2019-10-23 11:43:43 +13:00
Timothy Lyanguzov aa05cb1181 Fix size calculation to use 64-bit tmsize_t correctly 2019-10-23 11:20:34 +13:00
Timothy Lyanguzov ec6f7c572d Make bytesperclumpline calculations using tmsize_t type 2019-10-23 10:40:50 +13:00
Vadim Zeitlin cad76c5b08 Avoid warnings about casts between HANDLE and int in Win64 builds
Add helper thandle_{from,to}_int() functions performing the casts
between (64-bit, under Win64) thandle_t and (32-bit, always) int in a
way that doesn't trigger compiler warnings.

Also explain why suppressing these warnings is the right thing to do.

Closes https://gitlab.com/libtiff/libtiff/issues/2
2019-10-06 01:50:33 +02:00
Even Rouault 43b0c984f0 tif_read: align code of TIFFReadRawStrip() and TIFFReadRawTile() that differed for non good reason. Non-functional change normally. (fixes GitLab #162) 2019-10-03 21:14:44 +02:00
Even Rouault fb5fbc320b HTML: update for GitLab issues 2019-10-01 21:27:46 +02:00
Even Rouault 19f6b70d63 html/v3.5.6-beta.html: redact URL of defunct web site 2019-09-29 18:20:11 +02:00
Even Rouault 4d8cc50973 Website: update links to mailing list 2019-09-29 18:14:38 +02:00
Even Rouault e86d43caee TIFFReadAndRealloc(): avoid too large memory allocation attempts. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17244 2019-09-18 01:21:17 +02:00
Even Rouault 3519ab6c7f 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-03 20:15:41 +02:00
Even Rouault 6de57f7e0f tif_ojpeg.c: avoid relying on isTiled macro being wrapped in () 2019-09-02 16:22:10 +02:00
Even Rouault 7475a28508 tif_ojpeg.c: avoid use of uninitialized memory on edge/broken file. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16844 2019-09-02 16:21:02 +02:00
Even Rouault 4b2a343001 tiff_read_rgba_fuzzer.cc: add a -DSTANDALONE mode for easier reproduction of oss-fuzz reports 2019-09-02 15:33:46 +02:00
Even Rouault 760ecced1e tif_dirread.c: allocChoppedUpStripArrays(). avoid unsigned integer overflow. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16846 2019-09-01 15:57:17 +02:00
Even Rouault c22f319eb4 tif_ojpeg.c: avoid unsigned integer overflow. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16793 2019-08-27 10:58:21 +02:00
Even Rouault 9034afb440 TIFFReadDirEntryData(): rewrite to avoid unsigned integer overflow (not a bug). Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16792 2019-08-27 00:02:29 +02:00
Even Rouault 244dfb46af TIFFFetchDirectory(): fix invalid cast from uint64 to tmsize_t. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16784 2019-08-26 18:57:29 +02:00
Even Rouault 1a4efdd151 JPEG: avoid use of unintialized memory on corrupted files
Follow-up of cf3ce6fab8
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16602
Credit to OSS Fuzz
2019-08-25 14:54:26 +02:00
Even Rouault 804f40f3bf _TIFFPartialReadStripArray(): avoid unsigned integer overflow. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16685 2019-08-24 00:37:17 +02:00
Even Rouault 7db298e3a8 OJPEGWriteHeaderInfo(): avoid unsigned integer overflow on strile dimensions close to UINT32_MAX. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16683 2019-08-23 23:03:15 +02:00
Even Rouault 67f7561e70 TIFFFillStrip(): avoid harmless unsigned integer overflow. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16653 2019-08-23 14:54:26 +02:00
Even Rouault ea271d7434 EstimateStripByteCounts(): avoid unsigned integer overflow. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16643& 2019-08-23 13:03:44 +02:00
Even Rouault 5f6349d3f8 tif_ojpeg: avoid unsigned integer overflow (probably not a bug). Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16635 2019-08-23 12:38:46 +02:00
Even Rouault c9edebfdb0 tif_thunder: avoid unsigned integer overflow (not a bug). Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16632 2019-08-23 12:28:25 +02:00
Even Rouault f277541bd8 _TIFFMultiply32() / _TIFFMultiply64(): avoid relying on unsigned integer overflow (not a bug) 2019-08-22 13:02:07 +02:00
Even Rouault c8f268ef1b EstimateStripByteCounts(): avoid unsigned integer overflow 2019-08-22 10:19:44 +02:00
Even Rouault 761d50e34d EstimateStripByteCounts(): avoid unsigned integer overflow 2019-08-21 17:59:15 +02:00
Even Rouault 324aa65c0d EstimateStripByteCounts(): avoid harmless unsigned integer overflow 2019-08-20 18:09:46 +02:00
Even Rouault dd50fedc2f _TIFFPartialReadStripArray(): avoid triggering unsigned integer overflow with -fsanitize=unsigned-integer-overflow (not a bug, this is well defined by itself) 2019-08-20 15:29:06 +02:00
Even Rouault b04da30e11 tiff2ps: fix use of wrong data type that caused issues (/Height being written as 0) on 64-bit big endian platforms 2019-08-18 10:52:45 +02:00
Even Rouault 1a11c9df6e setByteArray(): fix previous commit 2019-08-16 19:59:18 +02:00
Even Rouault 1302ffb350 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-16 19:47:42 +02:00
Even Rouault 4bb584a35f 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-15 15:05:28 +02:00
Even Rouault 2218055ca6 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-14 09:47:58 +00:00
Even Rouault 1b5e3b6a23 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-13 10:40:08 +02:00
Even Rouault 12768a24b1 TIFFClientOpen(): fix memory leak if one of the required callbacks is not provided. Fixed Coverity GDAL CID 1404110 2019-08-12 22:51:09 +02:00
Even Rouault ea69462ea2 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-12 17:55:56 +02:00
Even Rouault 187e596861 oss-fuzz/tiff_read_rgba_fuzzer.cc: fix wrong env variable value in previous commit 2019-08-11 00:36:31 +02:00
Even Rouault 2c7e74245a oss-fuzz/tiff_read_rgba_fuzzer.cc: avoid issue with libjpeg-turbo and MSAN 2019-08-11 00:24:41 +02:00
Even Rouault 43908ce15e 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 2019-08-10 19:36:09 +02:00
Even Rouault 75c1cf5e91 Merge branch 'ossfuzz_i386' 2019-08-10 18:45:16 +02:00
Even Rouault 76f1531f5f contrib/oss-fuzz/build.sh: fix for i386 build of jbigkit, and use $LIB_FUZZING_ENGINE 2019-08-10 18:40:50 +02:00
Even Rouault a7fa3410d9 Merge branch 'patch-1' into 'master'
fix two tiny typos

See merge request libtiff/libtiff!89
2019-08-10 16:00:00 +00:00
Reto Kromer 3fd6bb95dc fix two tiny typos 2019-08-10 15:54:23 +00:00
Even Rouault 66ff50ec79 Merge branch 'patch-1' into 'master'
fix a typo in man page

See merge request libtiff/libtiff!88
2019-08-09 17:26:44 +00:00
Reto Kromer 2d4bb5bdc2 fix typo 2019-08-09 17:20:26 +00:00
Even Rouault c9cb49177b 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 13:23:07 +00:00
Su Laus 6f5c9477dd 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-08-04 13:23:07 +00:00
Even Rouault d8e707a953 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-16 09:54:55 +00:00
Even Rouault 5e7e9b597f 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-15 12:19:27 +02:00
Even Rouault a21714f028 TIFFWriteCheck(): call TIFFForceStrileArrayWriting() when needed (should have gone with eaeca6274a) (master only) 2019-07-09 13:56:18 +02:00
Even Rouault 6662e2b388 Merge branch 'fix_chromium_925269' into 'master'
OJPEG: avoid use of unintialized memory on corrupted files

See merge request libtiff/libtiff!86
2019-07-09 11:47:43 +00:00
Even Rouault cf3ce6fab8 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-07-05 18:51:46 +02:00
Even Rouault ab3204b167 Merge branch 'fix-division-by-zero' into 'master'
Return infinite distance when denominator is zero.

See merge request libtiff/libtiff!85
2019-06-29 16:54:50 +00:00
Dirk Lemstra b381187db6 Return infinite distance when denominator is zero. 2019-06-29 18:44:38 +02:00
Even Rouault 424972255f Merge branch 'typetests' into 'master'
Add test to check that libtiff types have the correct size

See merge request libtiff/libtiff!57
2019-06-29 09:41:17 +00:00
Nikola Forró e897442344 tools/tiffcp.c: fix potential division by zero
Signed-off-by: Nikola Forró <nforro@redhat.com>
2019-06-12 12:23:33 +02:00
Thomas Bernard 4d26884a15 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 20:10:51 +02:00
Thomas Bernard 69ce2652ef 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-31 20:10:51 +02:00
Even Rouault 91480d3d3c Merge branch 'defer_strile_writing' into 'master'
Add TIFFDeferStrileArrayWriting() and TIFFForceStrileArrayWriting()

See merge request libtiff/libtiff!82
2019-05-29 20:11:57 +00:00
Even Rouault 9cf3a97bea Merge branch 'TIFFReadFromUserBuffer' into 'master'
Add TIFFReadFromUserBuffer()

See merge request libtiff/libtiff!81
2019-05-29 20:11:43 +00:00
Even Rouault f273e83262 Fix vulnerability in 'D' (DeferStrileLoad) mode (master only) (fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14908) 2019-05-26 11:33:47 +02:00
Even Rouault cc84dc7409 Replace 'stripped' by 'striped' in error messages 2019-05-25 13:46:50 +02:00
Even Rouault eaeca6274a 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-25 11:37:34 +02:00
Even Rouault 0f797bf386 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.
2019-05-24 11:20:27 +02:00
Even Rouault fdec42f217 Fix typo in error message (master only) 2019-05-24 10:34:39 +02:00
Even Rouault 4e74734ded 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.
2019-05-23 00:38:59 +02:00
Even Rouault 06337fdcfd libtiff.def: add missing new symbols 2019-05-22 22:57:41 +02:00
Even Rouault d2e2b4eeac test/defer_strile_loading.c: fix warning with Visual C++ 2019-05-22 22:34:27 +02:00
Even Rouault f017d2fae3 _TIFFRewriteField(): fix for bigtiff case (master only)
116cf67f4c made StripByteCount/TileByteCount to
always be rewritten as TIFF_LONG8.
2019-05-22 21:55:01 +02:00
Even Rouault ef82728f44 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 13:46:23 +00:00
Even Rouault 57bc1126ba 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 13:46:03 +00:00
Even Rouault d0ec0aeab6 Merge branch 'html_link' into 'master'
libtiff.html, bigtiffpr.html: absolute => relative link

See merge request libtiff/libtiff!80
2019-05-21 13:45:33 +00:00
Thomas Bernard 02c16a3e2e libtiff.html, bigtiffpr.html: absolute => relative link 2019-05-14 20:05:13 +02:00
Even Rouault 371ad2658c 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 14:46:45 +02:00
Even Rouault 458c211ae2 Creation: use SHORT type when possible for StripByteCounts/TileByteCounts
This follows the same logic as previous commit.
2019-05-10 11:08:01 +02:00
Even Rouault 116cf67f4c 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-09 22:47:15 +02:00
Even Rouault b9b93f661e Merge branch 'bug2799' into 'master'
fix fax2tiff

See merge request libtiff/libtiff!55
2019-05-08 08:36:34 +00:00
Even Rouault 9acff86b56 Merge branch 'bug_2829' into 'master'
WIN32: use tif_win32.c when building with CMake

See merge request libtiff/libtiff!75
2019-05-08 08:16:38 +00:00
Even Rouault 2f8bd01315 Merge branch 'FILESOURCE_SCENETYPE_reading' into 'master'
Reading error for FileSource and SceneType tags corrected.

See merge request libtiff/libtiff!76
2019-05-06 19:32:13 +00:00
Su Laus ca75b773c9 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-05-06 19:32:13 +00:00
Thomas Bernard 59eb35172f 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 14:35:51 +02:00
Even Rouault 453be8a9ce Merge branch 'gitlab_pages' into 'master'
Advertise https://libtiff.gitlab.io/libtiff/ as mirror

See merge request libtiff/libtiff!70
2019-04-25 10:25:58 +00:00
Even Rouault 3c0becb4aa Merge branch 'bug_2844' into 'master'
tiff2ps.c: PSDataColorContig(): avoid heap buffer overrun

See merge request libtiff/libtiff!69
2019-04-25 09:39:01 +00:00
Even Rouault db77de50bc 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-25 09:37:26 +00:00
Even Rouault c824479e4c Merge branch 'fix_gdal_1439' into 'master'
TIFFWriteEncodedStrip/TIFFWriteEncodedTile: fix rewriting of LZW-compressed data

See merge request libtiff/libtiff!74
2019-04-11 19:12:56 +00:00
Even Rouault 0f88612e3e 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-11 21:00:56 +02:00
Even Rouault f9fc01c331 Merge branch 'bug2848' into 'master'
tif_luv.c: LogLuvSetupEncode() error must return 0

See merge request libtiff/libtiff!72
2019-04-08 08:18:30 +00:00
Thomas Bernard a18ef87a5a build/gitlab-ci: fix typo 2019-04-03 14:56:33 +02:00
Thomas Bernard cce0a85e6f show test-suite.log in gitlab-ci
useful when build fails
2019-04-03 14:55:46 +02:00
Thomas Bernard 57c112bfa9 Add output check for tiff2ps
note : the reference files have been generated in master branch
2019-04-03 14:55:29 +02:00
Ben Boeckel a978e75e7c warnings: mark conditionally used parameters 2019-03-26 12:03:34 -04:00
Even Rouault bf35895107 tif_read.c: potentially fix false positive from Coverity Scan. CID 1400288 2019-03-23 11:31:10 +01:00
Even Rouault 12ae83914e tif_read.c: potentially fix false positive from Coverity Scan. CID 1400271 2019-03-23 11:30:18 +01:00
Even Rouault b6b2f1ff5b tif_zip.c: remove dead code. CID 1400360 2019-03-23 11:25:44 +01:00
Even Rouault 301463dacf tif_webp.c: remove false positive warning about dereference before null check. CID 1400255 2019-03-23 11:24:50 +01:00
Even Rouault f4b7eb7cd3 tif_pixarlog.c: remove dead code. CID 1400342 2019-03-23 11:21:24 +01:00
Even Rouault c12b6a2a39 tif_pixarlog.c: avoid false positive Coverity Scan warnings about overflow. CID 1400300 and 1400367 2019-03-23 11:20:18 +01:00
Even Rouault d0358fdbc3 tif_lzw.c: silence CoverityScan false positive. CID 1400355 2019-03-23 11:16:22 +01:00
Even Rouault 07f939bf59 tif_luv.c: silence CoverityScan false positive. CID 1400231, 1400251, 1400254, 1400272, 1400318, 1400356 2019-03-23 11:09:42 +01:00
Even Rouault dd2dfe1d6a TryChopUpUncompressedBigTiff(): avoid potential division by zero. master only. GDAL Coverity CID 1400263 2019-03-23 11:05:49 +01:00
Thomas Bernard 1fb9e731ef 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 12:17:28 +01:00
Thomas Bernard 933575f505 add a test for fax2tiff tool 2019-03-22 10:06:01 +01:00
Thomas Bernard ea2e933b17 tiff2pdf.c: don't call t2p_tile_collapse_left() when buffer size is wrong
see http://bugzilla.maptools.org/show_bug.cgi?id=2785
2019-02-28 13:44:49 +01:00
Thomas Bernard 9a926b2d89 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 13:32:27 +01:00
Even Rouault e3d738277b 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 12:30:20 +00:00
Thomas Bernard b7d479cf8b tiff2pdf.c: check colormap pointers
Avoid access to non initialized pointers
http://bugzilla.maptools.org/show_bug.cgi?id=2826
2019-02-28 13:05:19 +01:00
Even Rouault 621b54a0b5 Merge branch 'fix_warnings' into 'master'
tiff2ps.c: fix warning caused by integer promotion

See merge request libtiff/libtiff!68
2019-02-27 21:00:33 +00:00
Thomas Bernard 05029fb7f1 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-24 00:50:12 +01:00
Thomas Bernard a242136916 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 16:23:33 +01:00
Even Rouault 3c792f726b Merge branch 'large_strile_improvements' into 'master'
Large strile support improvements

See merge request libtiff/libtiff!63
2019-02-22 10:48:51 +00:00
Even Rouault c8b6bdc680 Merge branch 'gitlab-pages' into 'master'
ci: Add pages job

See merge request libtiff/libtiff!45
2019-02-21 18:26:06 +00:00
Even Rouault 27124e9148 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 14:39:26 +00:00
Even Rouault 6947b21a4f Merge branch 'issue_2831' into 'master'
tiffcrop.c: fix invertImage() for bps 2 and 4

See merge request libtiff/libtiff!61
2019-02-19 14:36:59 +00:00
Even Rouault 0224f7d4f2 Merge branch 'issue_2842' into 'master'
move _TIFFClampDoubleToFloat() to tif_aux.c

See merge request libtiff/libtiff!62
2019-02-19 14:31:35 +00:00
Even Rouault 2ff9c01bd9 tif_zip.c: allow reading and writing strips/tiles with more than 4 GB of compressed or uncompressed data 2019-02-19 15:10:36 +01:00
Even Rouault 0489f1f879 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 15:10:00 +01:00
Even Rouault 28f67ba4bd Merge branch 'size_t_typo' into 'master'
CMakeLists.txt: fix TIFF_SIZE_T

See merge request libtiff/libtiff!59
2019-02-19 13:56:12 +00:00
Thomas Bernard 8420a31e8c 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-12 16:04:28 +01:00
Thomas Bernard 9cfa5c4691 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 23:08:25 +01:00
Thomas Bernard 7cc76e9bc4 tiffcp.c: use INT_MAX 2019-02-11 21:42:03 +01:00
Thomas Bernard 2b0d0e6997 check that (Tile Width)*(Samples/Pixel) do no overflow
fixes bug 2833
2019-02-11 10:05:33 +01:00
Thomas Bernard 2201714e88 CMakeLists.txt: fix TIFF_SIZE_T 2019-02-03 14:13:54 +01:00
Even Rouault ae0bed1fe5 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 14:46:05 +00:00
Even Rouault 933784a10a Merge branch 'bug2835' into 'master'
tiff2ps: fix heap-buffer-overflow

See merge request libtiff/libtiff!53
2019-02-02 14:32:58 +00:00
Even Rouault 38ede78b13 Fix warning (use of uninitialized value) added per d0a842c5db (fixes https://gitlab.com/libtiff/libtiff/merge_requests/54#note_137742985) 2019-02-02 15:30:14 +01:00
Yuri Aksenov 88b410f800 fix fax2tiff
see http://bugzilla.maptools.org/show_bug.cgi?id=2799
fixes d9bc8472e7
2019-02-02 15:14:54 +01:00
Even Rouault cee7c07789 Merge branch 'tiffcrop' into 'master'
tiffcrop: shut up clang warnings

See merge request libtiff/libtiff!52
2019-02-02 12:11:01 +00:00
Even Rouault 329433af90 Merge branch 'bug2833' into 'master'
TIFFWriteDirectoryTagTransferfunction() : fix NULL dereferencing

See merge request libtiff/libtiff!54
2019-02-01 20:31:04 +00:00
Even Rouault 8d966dfbe2 Merge branch 'gitignore' into 'master'
add test/ files to .gitignore

See merge request libtiff/libtiff!56
2019-02-01 20:28:46 +00:00
Even Rouault 1edeee44c8 Merge branch 'master' into 'master'
tif_dir: unset transferfunction field if necessary (CVE-2018-19210)

See merge request libtiff/libtiff!47
2019-02-01 20:21:02 +00:00
Thomas Bernard 578f3f4600 add test/ files to .gitignore 2019-01-29 16:37:09 +01:00
Thomas Bernard 802d3cbf30 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 11:21:47 +01:00
Thomas Bernard 309bfd7f61 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-29 10:47:14 +01:00
Thomas Bernard 5c222ec96c tiffcrop: shut up clang warnings
make the out filename building a bit more simple
and remove the use of strcat()
2019-01-28 16:10:28 +01:00
Scott Gayou 0c74a9f49b 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-23 15:09:59 -05:00
Bob Friesenhahn a0e273fdca 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.
2019-01-05 13:56:09 -06:00
Hugo Lefeuvre d0a842c5db 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-14 06:19:04 +01:00
Bob Friesenhahn 56a1976e92 Do not attempt to re-sync zip stream after reported data error from inflate(). 2018-12-08 15:36:14 -06:00
Even Rouault ae0325a1ab Merge branch 'resource-leaks' into 'master'
Fix two resource leaks

See merge request libtiff/libtiff!43
2018-12-07 20:58:13 +00:00
Even Rouault 15d01b63a9 Merge branch 'build-jbig' into 'master'
add jbig support to the fuzzer

See merge request libtiff/libtiff!42
2018-12-07 20:56:22 +00:00
Bob Friesenhahn d6f7cf744c tiffcrop.c: Avoid new clang warning about tools/tiffcrop.c "size argument in 'strncat' call appears to be size of the source". 2018-12-01 09:16:10 -06:00
Even Rouault 5bcf0cb3c1 Merge branch 'webp_memleak' into 'master'
fixed mem leak in webp compression

See merge request libtiff/libtiff!48
2018-11-28 21:54:25 +00:00
Norman Barker 9323b7b139 fixed mem leak in webp compression 2018-11-28 15:45:39 -06:00
Even Rouault 4e3faaf6f5 Merge branch 'lossless_webp' into 'master'
fixed lossless webp compression config

See merge request libtiff/libtiff!46
2018-11-20 19:32:10 +00:00
Norman Barker c7774df9a7 fixed lossless webp compression config 2018-11-20 11:54:01 -06:00
Bob Friesenhahn 6b7fc9f116 snprintf porting fix for Visual Studio 2003 2018-11-18 20:25:17 -06:00
Roger Leigh 8addf2c1f7 ci: Add pages job 2018-11-18 10:37:37 +00:00
Bob Friesenhahn 2f79874c30 Change references from defunct ftp site to https site. 2018-11-10 14:38:21 -06:00
Bob Friesenhahn 64b6f939bf Change download URL from ftp to https protocol. 2018-11-10 13:46:14 -06:00
Bob Friesenhahn 6c3e4801bd HOWTO-RELEASE: Add GPG release file signing procedure. 2018-11-10 13:43:05 -06:00
Bob Friesenhahn b8eac98dd0 libtiff 4.0.10 released. 2018-11-10 09:33:11 -06:00
Bob Friesenhahn 126a949736 Change COMPRESSION_ZSTD to 50000 and COMPRESSION_WEBP to 50001. 2018-11-10 08:58:18 -06:00
Bob Friesenhahn 779e54ca32 Added preliminary release notes for release 4.0.10 2018-11-04 14:14:25 -06:00
Bob Friesenhahn 2480971bba tiff2pdf: Eliminate compiler warning about snprintf output truncation when formatting pdf_datetime. 2018-11-03 13:27:20 -05:00
Olivier Paquet 2d25c90327 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 16:51:41 +00:00
Bob Friesenhahn ed624dfe48 tiffcrop.c: Eliminate compiler warning about snprintf output truncation when formatting filenum. 2018-11-03 10:00:11 -05:00
Bob Friesenhahn d1b5834dfe TWebPVGetField(): Add apparently missing break statement impacting TIFFTAG_WEBP_LOSSLESS. 2018-11-03 09:41:15 -05:00
Bob Friesenhahn 34b5be5a2e Eliminate compiler warnings about duplicate definitions of streq/strneq macros. 2018-11-03 09:35:19 -05:00
Bob Friesenhahn 64ee065f13 Ignore generated files 2018-11-03 09:34:52 -05:00
Bob Friesenhahn b72c756c43 Remove and ignore files which are a product of autogen.sh 2018-11-03 09:22:11 -05:00
Bob Friesenhahn 90771bcd56 Fix TIFFErrorExt() formatting of size_t type for 32-bit compiles.
o
2018-11-02 07:34:22 -05:00
Nikola Forró 2f694198f1 Fix two resource leaks
Signed-off-by: Nikola Forró <nforro@redhat.com>
2018-10-31 11:50:48 +01:00
Even Rouault 99b10edde9 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 2018-10-30 18:50:27 +01:00
Even Rouault 67b755b334 tiffio.h: fix comment 2018-10-30 18:49:53 +01:00
Paul Kehrer 2d32b100aa add jbig support to the fuzzer 2018-10-29 11:36:13 +08:00
Even Rouault 7030e8acbc 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 17:55:49 +00:00
Kurt Schwehr f05e33ac98 Fix 725279bd: Standalone tif_predict.h: tiff.h should be tiffiop.h 2018-10-26 10:38:03 -07:00
Even Rouault eaad7b257f Merge branch 'headers' into 'master'
Add includes to headers to allow them to stand alone.

See merge request libtiff/libtiff!40
2018-10-25 08:05:08 +00:00
Kurt Schwehr 725279bd1f 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-24 16:29:33 -07:00
Even Rouault 4429f75fab LZMAPreEncode: emit verbose error if lzma_stream_encoder() fails (typically because not enough memory available) 2018-10-18 11:10:31 +02:00
Even Rouault d780c9db3f tif_webp.c: fix previous commit that broke scanline decoding 2018-10-17 23:36:26 +02:00
Even Rouault 00a987988c tif_webp.c: fix potential read outside libwebp buffer on corrupted images 2018-10-17 21:32:25 +02:00
Even Rouault 183102bc26 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 15:57:45 +00:00
Even Rouault 681748ec2f 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-14 16:45:14 +02:00
Even Rouault d438fab328 tif_webp.c: fix scanline reading/writing 2018-10-05 22:59:49 +02:00
Even Rouault 6aae33f758 WEBP codec: initialize nSamples in TWebPSetupDecode() and TWebPSetupEncode() 2018-10-05 22:03:24 +02:00
Even Rouault 1a926533b8 Merge branch 'tif_webp' into 'master'
webp support

See merge request libtiff/libtiff!32
2018-10-05 19:41:16 +00:00
Norman Barker 9eacd59fec webp in tiff 2018-10-05 11:21:17 -05:00
Even Rouault 31374a7bf1 Merge branch 'master' into 'master'
fix three potential vulnerabilities.

See merge request libtiff/libtiff!33
2018-09-17 18:33:33 +00:00
Young_X 97c95667f6 fix out-of-bound read on some tiled images. 2018-09-08 15:07:53 +08:00
Young_X 6da1fb3f64 avoid potential int32 overflows in multiply_ms() 2018-09-08 14:46:27 +08:00
Young_X f1b94e8a3b only read/write TIFFTAG_GROUP3OPTIONS or TIFFTAG_GROUP4OPTIONS if compression is COMPRESSION_CCITTFAX3 or COMPRESSION_CCITTFAX4 2018-09-08 14:36:12 +08:00
Even Rouault 981e43ecae 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-15 16:34:40 +02:00
Even Rouault 97a9e1a677 ZSTD: fix flush issue that can cause endless loop in ZSTDEncode()
Fixes https://github.com/OSGeo/gdal/issues/833
2018-08-07 22:37:08 +02:00
Even Rouault 7bad03e938 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 10:01:33 +00:00
Even Rouault 4af64003c8 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-08-07 11:54:27 +02:00
Even Rouault 48e2696e9b 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-05 21:01:02 +02:00
Even Rouault 1db1efeb20 Fix TIFFTAG_ZSTD_LEVEL pseudo tag value to be > 65536, and the next one in the series 2018-07-02 20:07:45 +02:00
Stefan Weil 924405d5b3 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.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-25 08:42:50 +02:00
Even Rouault 58a898cb44 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.
2018-05-12 15:32:31 +02:00
Even Rouault b68fc85f39 TIFFFetchNormalTag(): avoid (probably false positive) clang-tidy clang-analyzer-core.NullDereference warnings 2018-05-12 14:36:49 +02:00
Even Rouault de144fd228 TIFFWriteDirectorySec: avoid assertion. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2795. CVE-2018-10963 2018-05-12 14:24:15 +02:00
Even Rouault 6150fd4349 tif_color.c: fix code comment 2018-05-04 21:03:41 +02:00
Even Rouault be9c1f7785 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 20:35:25 +00:00
Paul Kehrer ba1eba2761 remove a pointless multiplication and a variable that's not necessary 2018-04-17 22:38:41 +08:00
Even Rouault 80ff5e2c39 Merge branch 'ossfuzz' into 'master'
move oss-fuzz build script and fuzzer into libtiff tree

See merge request libtiff/libtiff!28
2018-04-17 08:52:07 +00:00
Paul Kehrer a6cfa01085 move oss-fuzz build script and fuzzer into libtiff tree 2018-04-17 08:52:07 +00:00
Even Rouault c4f9b53aa5 _TIFFGetMaxColorChannels: update for LOGLUV, ITULAB and ICCLAB that have 3 color channels 2018-04-14 17:17:34 +02:00
Even Rouault 47be9914dd Fix MSVC warning 2018-04-13 00:07:13 +02:00
Even Rouault 18d85181e9 Merge branch 'master' into 'master'
Fix NULL pointer dereference in TIFFPrintDirectory (bugzilla 2778/CVE-2018-7456)

See merge request libtiff/libtiff!27
2018-04-12 20:09:44 +00:00
Hugo Lefeuvre be4c85b16e 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-04-11 23:09:59 -04:00
Even Rouault 33f1b16788 Merge branch 'tiffset-long8' into 'master'
tiffset: Add support for LONG8, SLONG8 and IFD8 field types

See merge request libtiff/libtiff!25
2018-03-27 16:46:09 +00:00
Roger Leigh bf5a45de67 port: Clean up NetBSD sources and headers to build standalone 2018-03-26 14:20:21 +01:00
Roger Leigh 14f304998e port: Add strtol, strtoll and strtoull
Also update strtoul.  All use the same implementation from NetBSD libc.
2018-03-23 22:37:17 +00:00
Roger Leigh 43586d4105 tiffset: Add support for LONG8, SLONG8 and IFD8 field types 2018-03-23 22:11:17 +00:00
Even Rouault 7a092f8af2 ChopUpSingleUncompressedStrip: avoid memory exhaustion (CVE-2017-11613)
Rework fix done in 3719385a3f 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-17 09:36:29 +01:00
Even Rouault a621460666 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 15:51:37 +01:00
Even Rouault 0a2e5e98b3 Merge branch 'avoid_memory_exhaustion_in_ChopUpSingleUncompressedStrip' into 'master'
ChopUpSingleUncompressedStrip: avoid memory exhaustion (CVE-2017-11613)

See merge request libtiff/libtiff!26
2018-03-13 14:39:30 +00:00
Even Rouault 3719385a3f 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-11 11:16:12 +01:00
Even Rouault 277644d8a4 Typo fix in comment 2018-03-10 14:07:02 +01:00
Even Rouault 25840917ad Avoid warning with gcc 8 (partially revert 647b0e8c11) 2018-03-03 23:00:28 +01:00
Even Rouault 7b4da45999 Merge branch 'typos' into 'master'
Fix some typos

See merge request libtiff/libtiff!23
2018-02-25 15:43:27 +00:00
Stefan Weil 642b8f998e Fix some typos
Most of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-02-24 21:47:52 +01:00
Even Rouault cad3e7d875 Typo fix in comment 2018-02-14 15:50:53 +01:00
Even Rouault 442fa64e41 Merge branch 'zstd' 2018-02-14 15:41:04 +01:00
Even Rouault 5347f0f731 Add warning about COMPRESSION_ZSTD not being officialy registered 2018-02-14 15:39:32 +01:00
Even Rouault f01c227048 Merge branch 'bug2772' into 'master'
Fix for bug 2772

See merge request libtiff/libtiff!20
2018-02-14 14:33:42 +00:00
Nathan Baker 473851d211 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-12 09:43:34 -05:00
Even Rouault eafc7e3052 Merge branch 'libtiff-as-subdirectory-fixes' into 'master'
Prefer target_include_directories

See merge request libtiff/libtiff!12
2018-02-09 14:32:32 +00:00
Even Rouault 1091090144 Merge branch 'cmake-cleanups' into 'master'
Cmake cleanups

See merge request libtiff/libtiff!11
2018-02-06 19:37:54 +00:00
Even Rouault 781bdb7263 Merge branch 'check-right-cxx-variable' into 'master'
Check right cxx variable

See merge request libtiff/libtiff!19
2018-02-06 18:43:25 +00:00
Even Rouault db67c2d15e Merge branch 'dont-leak-stream-open' into 'master'
Fix a memory leak in TIFFStreamOpen

See merge request libtiff/libtiff!17
2018-02-06 18:29:49 +00:00
Ben Boeckel 4125ca9a47 cmake: check CXX_SUPPORT
This variable is set in response to the `cxx` cache variable; use it
instead.
2018-02-06 10:37:23 -05:00
Olivier Paquet 13b99f8f3a Merge branch 'warnings' into 'master'
Fix all compiler warnings for default build

See merge request libtiff/libtiff!16
2018-02-04 23:54:24 +00:00
Nathan Baker e9fa4baf1d Fix all compiler warnings for default build 2018-02-04 23:54:17 +00:00
Paul Kehrer 92556cf625 tabs are hard 2018-01-31 07:58:18 +08:00
Paul Kehrer 08084a9774 use hard tabs like the rest of the project 2018-01-30 13:56:49 +08:00
Paul Kehrer abd37566d8 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-30 13:45:01 +08:00
Kevin Funk 7bf855b942 Bump minimum required CMake version to v2.8.11
Because we use the BUILD_INTERFACE generator expression
2018-01-29 20:38:02 +01:00
Even Rouault c4d31e9b06 Merge branch 'patch-1' into 'master'
Update CMakeLists.txt for build fix on Windows

See merge request libtiff/libtiff!14
2018-01-27 11:22:09 +00:00
Even Rouault fb0489937c Merge branch 'patch-2' into 'master'
Update tiffgt.c for build fix on Windows

See merge request libtiff/libtiff!13
2018-01-27 11:20:46 +00:00
Olivier Paquet 470e40204f Merge branch 'bug2750' into 'master'
Add workaround to pal2rgb buffer overflow.

See merge request libtiff/libtiff!15
2018-01-25 21:28:19 +00:00
Nathan Baker 9171da596c Add workaround to pal2rgb buffer overflow. 2018-01-25 21:28:15 +00:00
Andrea a6195d0ad4 Update tiffgt.c for build fix on Windows 2018-01-24 01:25:13 +00:00
Andrea e7b87e5d3e Update CMakeLists.txt for build fix on Windows 2018-01-24 01:19:44 +00:00
Even Rouault 070abb3aae 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 16:56:10 +00:00
Ben Boeckel 4eb15b2739 cmake: avoid setting hard-coded variables in the cache 2018-01-15 11:27:34 -05:00
Ben Boeckel 8d3c75b99f cmake: avoid an unnecessary intermediate variable 2018-01-15 11:27:34 -05:00
Ben Boeckel 0f2624713b cmake: avoid an unnecessary intermediate variable 2018-01-15 11:27:34 -05:00
Ben Boeckel bed3b0cb9d cmake: avoid tautological logic 2018-01-15 11:27:34 -05:00
Ben Boeckel fc3b735300 cmake: use check_symbol_exists
This accounts for symbols being provided by macros.
2018-01-15 11:27:34 -05:00
Ben Boeckel f5b23ab1bf cmake: remove unused configure checks 2018-01-15 11:27:34 -05:00
Kevin Funk 0b05f43209 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-12 12:17:13 +01:00
Ben Boeckel 647b0e8c11 tiffiop: use __has_attribute to detect the no_sanitize attribute 2018-01-09 15:09:02 -05:00
Even Rouault 1dcf5303e1 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 2017-12-31 15:42:52 +01:00
Even Rouault 8d4d8b5c2f 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 2017-12-31 15:30:44 +01:00
Even Rouault c6f41df7b5 libtiff/tif_print.c: TIFFPrintDirectory(): fix null pointer dereference on corrupted file. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2770 2017-12-31 15:09:41 +01:00
Even Rouault 25c14f84a8 Add libzstd to gitlab-ci 2017-12-21 14:52:30 +01:00
Even Rouault 62b9df5d2a 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-21 13:32:02 +01:00
Even Rouault 5848777bd7 Merge branch 'fix_cve-2017-9935' into 'master'
Fix CVE-2017-9935

See merge request libtiff/libtiff!7
2017-12-10 21:00:44 +00:00
Brian May d4f213636b 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-11 07:35:41 +11:00
Brian May 3dd8f6a357 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-11 07:35:18 +11:00
Even Rouault 254262f395 Merge branch 'undef-warn-fixes' into 'master'
Fix a couple of harmless but annoying -Wundef warnings

See merge request libtiff/libtiff!8
2017-12-10 18:09:50 +00:00
Vadim Zeitlin 7293a4165b 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.
2017-12-08 03:33:33 +01:00
Vadim Zeitlin 1eb6fefb2e Avoid harmless -Wundef warnings for __clang_major__
Check that we're using Clang before checking its version.
2017-12-08 03:33:31 +01:00
Even Rouault 9c243a11a3 Merge branch 'remove_autogenerated_files' into 'master'
Remove autogenerated files

See merge request libtiff/libtiff!5
2017-12-02 22:10:48 +00:00
Bob Friesenhahn 0a5f4b92bb 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 21:12:15 +00:00
Bob Friesenhahn 79bb4d034f 'tif_config.h' or 'tiffio.h' must be included before any system header. 2017-12-02 14:45:03 -06:00
Even Rouault 64541f2893 .gitignore: add patterns for build from root 2017-12-01 16:00:49 +01:00
Even Rouault c56eda4b7e Remove remaining .cvsignore files 2017-12-01 15:55:10 +01:00
Even Rouault 2440a113ea Remove autoconf/automake generated files, and add them to .gitignore 2017-12-01 15:54:48 +01:00
Olivier Paquet e000ac8aa5 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 14:16:01 +00:00
Even Rouault b02973f1bf 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 11:48:17 +01:00
Even Rouault 311335ea46 Merge branch 'git_updates' into 'master'
CVS to Git updates

See merge request libtiff/libtiff!2
2017-12-01 10:02:10 +00:00
Even Rouault 95665760ef HOWTO-RELEASE: update to use signed tags 2017-12-01 10:58:09 +01:00
Even Rouault f756566000 README.md: use markdown syntax for hyperlinks 2017-12-01 10:52:18 +01:00
Even Rouault b48399eabe Add .gitignore 2017-11-30 18:23:40 +01:00
Even Rouault 8603db6cfa Regenerate autoconf files 2017-11-30 18:10:01 +01:00
Even Rouault 40c6649483 Makefile.am: update to reflect removal of README.vms and README -> README.md 2017-11-30 18:09:43 +01:00
Even Rouault f0a54a4fa0 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
Even Rouault 5cc89a8c8d HOWTO-RELEASE: update for git 2017-11-30 17:46:53 +01:00
Even Rouault 22c0c1ec70 Remove outdated .cvsignore 2017-11-30 17:45:40 +01:00
Even Rouault 5c661fa019 Remove outdated commit script 2017-11-30 17:45:20 +01:00
Even Rouault be7c2b687b Remove README.vms 2017-11-30 17:44:53 +01:00
Even Rouault 0769c447b7 Rename README as README.md, and update content 2017-11-30 17:44:47 +01:00
Even Rouault b1374e94ac html/index.html: reflect change from CVS to gitlab 2017-11-30 16:55:01 +01:00
Olivier Paquet 92d54fd77a Merge branch 'test-ci' into 'master'
Update CI configuration

See merge request libtiff/libtiff!1
2017-11-30 14:04:12 +00:00
Roger Leigh 68c928923a appveyor: Correct path for git clone and skip artefact archival 2017-11-23 08:23:34 +00:00
Roger Leigh 4f84ea631b travis-ci: Remove unused matrix exclusion 2017-11-22 22:58:32 +00:00
Roger Leigh 1ac42d5f93 Add gitlab-ci build support 2017-11-22 22:57:48 +00:00
Bob Friesenhahn 38ec4dd074 Change default user id in HOWTO-RELEASE to mine. 2017-11-18 20:04:50 +00:00
Bob Friesenhahn 020bd2fd3b * configure.ac: libtiff 4.0.9 released. 2017-11-18 20:00:43 +00:00
Bob Friesenhahn 737c52ae13 * html/v4.0.9.html: Add HTML file to document changes in libtiff
v4.0.9.
2017-11-18 19:38:06 +00:00
Even Rouault 5426f499e8 * libtiff/tif_aux.c, tif_getimage.c, tif_read.c: typo fixes in
comments.
2017-11-17 20:20:59 +00:00
Bob Friesenhahn 238b103ba5 List Frank Warmerdam and Andrey Kiselev as past maintainers since they have not been active in years. 2017-11-07 02:00:06 +00:00
Bob Friesenhahn 45065882ae * test/Makefile.am: Add some tests for tiff2bw. 2017-11-02 13:51:22 +00:00
Bob Friesenhahn 25f9ffa565 * tools/tiff2bw.c (main): Free memory allocated in the tiff2bw
program.  This is in response to the report associated with
CVE-2017-16232 but does not solve the extremely high memory usage
with the associated POC file.
2017-11-01 13:41:58 +00:00
Bob Friesenhahn 61d4eb3a01 tiff2pdf.c: Fix possible overflow in bounds check computation and eliminate signed/unsigned comparison. 2017-10-29 18:50:41 +00:00
Bob Friesenhahn 1cb6c46b9d fax2tiff: Pass the FAX_Client_Data struct as client data 2017-10-29 18:28:43 +00:00
Even Rouault f258b80230 * libtiff/tif_getimage.c: avoid floating point division by zero in
initCIELabConversion()
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3733
Credit to OSS Fuzz
2017-10-23 11:34:26 +00:00
Even Rouault 5bf07456da * libtiff/tif_jpeg.c: add compatibility with libjpeg-turbo 1.5.2 that
honours max_memory_to_use > 0.
Cf https://github.com/libjpeg-turbo/libjpeg-turbo/issues/162
2017-10-17 19:04:47 +00:00
Even Rouault 7c1a32bb9f * nmake.opt: support a DEBUG=1 option, so as to adjust OPTFLAGS and use
/MDd runtime in debug mode.
2017-10-10 14:39:43 +00:00
Even Rouault 76a2b9d619 * tools/tiffset.c: fix setting a single value for the ExtraSamples tag
(and other tags with variable number of values).
So 'tiffset -s ExtraSamples 1 X'. This only worked
when setting 2 or more values, but not just one.
2017-10-01 17:38:12 +00:00
Even Rouault 28bf544f33 * libtiff/libtiff.def: add TIFFReadRGBAStripExt and TIFFReadRGBATileExt
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2735
2017-09-29 11:18:50 +00:00
Even Rouault dfbdd88c5a dummy commit to check CVS is working 2017-09-22 13:55:49 +00:00
Even Rouault 46c51095d6 * libtiff/tif_dirread.c: add NULL check to avoid likely false positive
null-pointer dereference warning by CLang Static Analyzer.
2017-09-09 21:44:42 +00:00
Even Rouault c4a2f72e9d * libtiff/tiffiop.h, tif_aux.c: redirect SeekOK() macro to a _TIFFSeekoK()
function that checks if the offset is not bigger than INT64_MAX, so as
to avoid a -1 error return code of TIFFSeekFile() to match a required
seek to UINT64_MAX/-1.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2726
Adapted from proposal by Nicolas Ruff.
2017-09-07 14:02:52 +00:00
Even Rouault 71ce9dbe19 Fix signed vs unsigned comparison 2017-08-29 08:08:10 +00:00
Even Rouault 860943a370 * libtiff/tif_jpeg.c: accept reading the last strip of a JPEG compressed
file if the codestream height is larger than the truncated height of the
strip. Emit a warning in this situation since this is non compliant.


* test/Makefile.am: add missing reference to images/quad-lzw-compat.tiff
to fix "make distcheck". Patch by Roger Leigh
2017-08-29 07:30:07 +00:00
Even Rouault 6dac309a97 * test/Makefile.am: add missing reference to images/quad-lzw-compat.tiff
to fix "make distcheck". Patch by Roger Leigh
2017-08-28 15:43:14 +00:00
Even Rouault fe7f0e43ee * libtiff/tif_dirwrite.c: replace assertion to tag value not fitting
on uint32 when selecting the value of SubIFD tag by runtime check
(in TIFFWriteDirectoryTagSubifd()).
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2728
Reported by team OWL337


SubIFD tag by runtime check (in TIFFWriteDirectorySec())
2017-08-23 13:33:42 +00:00
Even Rouault 4958e19fae * libtiff/tif_dirwrite.c: replace assertion related to not finding the
SubIFD tag by runtime check.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2727
Reported by team OWL337
2017-08-23 13:21:41 +00:00
Even Rouault 8ad1c70dc1 * libtiff/tif_luv.c: further reduce memory requirements for temporary
buffer when RowsPerStrip >= image_length in LogLuvInitState() and
LogL16InitState().
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2700
Credit to OSS Fuzz
2017-07-24 12:47:30 +00:00
Even Rouault 06155116f6 * libtiff/tif_getimage.c: fix fromskew computation when to-be-skipped
pixel number is not a multiple of the horizontal subsampling, and
also in some other cases. Impact putcontig8bitYCbCr44tile,
putcontig8bitYCbCr42tile, putcontig8bitYCbCr41tile,
putcontig8bitYCbCr21tile and putcontig8bitYCbCr12tile
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2637 (discovered
by Agostino Sarubbo)
and https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2691 (credit
to OSS Fuzz)
2017-07-24 10:34:14 +00:00
Even Rouault ec4d8e0895 * libtiff/tif_getimage.c: gtTileContig() and gtTileSeparate():
properly break from loops on error when stoponerr is set, instead
of going on iterating on row based loop.
2017-07-24 09:52:23 +00:00
Even Rouault c3980af085 * libtiff/tif_luv.c: LogLuvInitState(): avoid excessive memory
allocation when RowsPerStrip tag is missing.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2683
Credit to OSS-Fuzz
2017-07-18 19:45:11 +00:00
Even Rouault 2b14fd7f6e Fix warning with x86_64-w64-mingw32-g++ 2017-07-15 14:27:50 +00:00
Even Rouault 024b2fa26a Fix signed vs unsigned comparison warning on Windows 2017-07-15 13:51:22 +00:00
Even Rouault d99c422dbf * libtiff/tif_read.c: add protection against excessive memory
allocation attempts in TIFFReadDirEntryArray() on short files.
Effective for mmap'ed case. And non-mmap'ed case, but restricted
to 64bit builds.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2675
2017-07-15 13:23:09 +00:00
Even Rouault 02271af177 * libtiff/tif_read.c: in TIFFFetchStripThing(), only grow the
arrays that hold StripOffsets/StripByteCounts, when they are smaller
than the expected number of striles, up to 1 million striles, and
error out beyond. Can be tweaked by setting the environment variable
LIBTIFF_STRILE_ARRAY_MAX_RESIZE_COUNT.
This partially goes against a change added on 2002-12-17 to accept
those arrays of wrong sizes, but is needed to avoid denial of services.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2350
Credit to OSS Fuzz
2017-07-15 13:19:56 +00:00
Even Rouault 5b7f711586 * libtiff/tif_read.c: TIFFFillStrip() / TIFFFillTile().
Complementary fix for http://bugzilla.maptools.org/show_bug.cgi?id=2708
in the isMapped() case, so as to avoid excessive memory allocation
when we need a temporary buffer but the file is truncated.
2017-07-15 12:33:25 +00:00
Even Rouault 979751c407 * tools/tiff2pdf.c: prevent heap buffer overflow write in "Raw"
mode on PlanarConfig=Contig input images.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2715
Reported by team OWL337
2017-07-15 11:13:46 +00:00
Even Rouault 2ac7bddb78 * libtiff/tif_dir.c: avoid potential null pointer dereference in
_TIFFVGetField() on corrupted TIFFTAG_NUMBEROFINKS tag instance.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2713
2017-07-11 21:38:04 +00:00
Even Rouault c8665b503c * libtiff/tif_lzw.c: fix potential out-of-buffer read on 1-byte LZW
strips. Crashing issue only on memory mapped files, where the strip
offset is the last byte of the file, and the file size is a multiple
of one page size on the CPU architecture (typically 4096). Credit
to myself :-)
2017-07-11 10:54:29 +00:00
Even Rouault abc862b594 * test/tiffcp-lzw-compat.sh, test/images/quad-lzw-compat.tiff: new files
to test old-style LZW decompression
* test/common.sh, Makefile.am, CMakeList.txt: updated with above
2017-07-11 09:20:31 +00:00
Even Rouault 222083301a * refresh autoconf/make stuff with what is on Ubuntu 16.04 (minor changes) 2017-07-11 09:10:28 +00:00
Even Rouault 311af0ba08 * libtiff/tif_lzw.c: fix 4.0.8 regression in the decoding of old-style LZW
compressed files.
2017-07-11 08:55:07 +00:00
Even Rouault d69a373ecf * libtiff/tif_pixarlog.c: avoid excessive memory allocation on decoding
when RowsPerStrip tag is not defined (and thus td_rowsperstrip == UINT_MAX)
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2554
Credit to OSS Fuzz
2017-07-10 10:40:27 +00:00
Even Rouault 9129c40f98 Commit files that should have gone with previous commit 2017-07-04 13:28:42 +00:00
Even Rouault c2be1447d9 * libtiff/tif_read.c, tiffiop.h: add a _TIFFReadEncodedTileAndAllocBuffer()
and _TIFFReadTileAndAllocBuffer() variants of TIFFReadEncodedTile() and
TIFFReadTile() that allocates the decoded buffer only after a first
successful TIFFFillTile(). This avoids excessive memory allocation
on corrupted files.
* libtiff/tif_getimage.c: use _TIFFReadTileAndAllocBuffer().
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2470
Credit to OSS Fuzz.
2017-07-04 13:27:45 +00:00
Even Rouault 733109e510 * libtiff/tif_error.c, tif_warning.c: correctly use va_list when both
an old-style and new-style warning/error handlers are installed.
Patch by Paavo Helde (sent on the mailing list)
2017-07-04 12:54:42 +00:00
Even Rouault 8eff533db2 * libtiff/tif_read.c: TIFFStartTile(): set tif_rawcc to
tif_rawdataloaded when it is set. Similarly to TIFFStartStrip().
This issue was revealed by the change of 2017-06-30 in TIFFFileTile(),
limiting the number of bytes read. But it could probably have been hit
too in CHUNKY_STRIP_READ_SUPPORT mode previously ?
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2454
Credit to OSS Fuzz
2017-07-02 14:13:39 +00:00
Even Rouault 0f83a86b7b * man: update documentation regarding SubIFD tag and
TIFFSetSubDirectory() data type.
Patch by Eric Piel
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2671
2017-06-30 17:40:02 +00:00
Even Rouault 170f9a6019 Fix module names in error message 2017-06-30 17:31:45 +00:00
Even Rouault 3cb621f5cf * libtiff/tif_dirwrite.c: in TIFFWriteDirectoryTagCheckedXXXX()
functions associated with LONG8/SLONG8 data type, replace assertion that
the file is BigTIFF, by a non-fatal error.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2712
Reported by team OWL337
2017-06-30 17:29:44 +00:00
Even Rouault 5ba0b3116f * libtiff/tif_read.c, tiffiop.h: add a _TIFFReadEncodedStripAndAllocBuffer()
function, variant of TIFFReadEncodedStrip() that allocates the
decoded buffer only after a first successful TIFFFillStrip(). This avoids
excessive memory allocation on corrupted files.
* libtiff/tif_getimage.c: use _TIFFReadEncodedStripAndAllocBuffer().
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2708 and
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2433 .
Credit to OSS Fuzz
2017-06-30 13:11:18 +00:00
Even Rouault 12bb476389 * libtiff/tif_read.c: TIFFFillTile(): add limitation to the number
of bytes read in case td_stripbytecount[strip] is bigger than
reasonable, so as to avoid excessive memory allocation (similarly to
what was done for TIFFFileStrip() on 2017-05-10)
2017-06-30 11:29:22 +00:00
Even Rouault 385edd37e9 * libtiff/tiffiop.h, libtiff/tif_jpeg.c, libtiff/tif_jpeg_12.c,
libtiff/tif_read.c: make TIFFReadScanline() works in
CHUNKY_STRIP_READ_SUPPORT mode with JPEG stream with multiple scans.
Also make configurable through a LIBTIFF_JPEG_MAX_ALLOWED_SCAN_NUMBER
environment variable the maximum number of scans allowed. Defaults to
100.
2017-06-29 07:37:12 +00:00
Even Rouault 976774deac * libtiff/tif_dirread.c: in TIFFReadDirEntryFloat(), check that a
double value can fit in a float before casting. Patch by Nicolas RUFF
2017-06-27 13:44:44 +00:00
Even Rouault ede7b68218 * libtiff/tif_jbig.c: fix memory leak in error code path of JBIGDecode()
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2706
Reported by team OWL337

* libtiff/tif_jpeg.c: error out at decoding time if anticipated libjpeg
2017-06-26 15:19:59 +00:00
Even Rouault a85d5f09dd * libjpeg/tif_jpeg.c: error out at decoding time if anticipated libjpeg
memory allocation is above 100 MB. libjpeg in case of multiple scans,
which is allowed even in baseline JPEG, if components are spread over several
scans and not interleavedin a single one, needs to allocate memory (or
backing store) for the whole strip/tile.
See http://www.libjpeg-turbo.org/pmwiki/uploads/About/TwoIssueswiththeJPEGStandard.pdf
This limitation may be overriden by setting the
LIBTIFF_ALLOW_LARGE_LIBJPEG_MEM_ALLOC environment variable, or recompiling
libtiff with a custom value of TIFF_LIBJPEG_LARGEST_MEM_ALLOC macro.
2017-06-24 15:33:28 +00:00
Even Rouault b1ee48b775 * libtiff/tif_jpeg.c: add anti-denial of service measure to avoid excessive
CPU consumption on progressive JPEGs with a huge number of scans.
See http://www.libjpeg-turbo.org/pmwiki/uploads/About/TwoIssueswiththeJPEGStandard.pdf
Note: only affects libtiff since 2014-12-29 where support of non-baseline JPEG
was added.
2017-06-24 13:03:25 +00:00
Even Rouault df51988637 * libtiff/tiffiop.h: add TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW macro to
disable CLang warnings raised by -fsanitize=undefined,unsigned-integer-overflow
* libtiff/tif_predict.c: decorate legitimate functions where unsigned int
overflow occur with TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
* libtiff/tif_dirread.c: avoid unsigned int overflow in EstimateStripByteCounts()
and BYTECOUNTLOOKSBAD when file is too short.
* libtiff/tif_jpeg.c: avoid (harmless) unsigned int overflow on tiled images.
* libtiff/tif_fax3.c: avoid unsigned int overflow in Fax3Encode2DRow(). Could
potentially be a bug with huge rows.
* libtiff/tif_getimage.c: avoid many (harmless) unsigned int overflows.
2017-06-18 10:31:50 +00:00
Even Rouault 7057734d98 * libtiff/tif_dirread.c: TIFFFetchStripThing(): limit the number of items
read in StripOffsets/StripByteCounts tags to the number of strips to avoid
excessive memory allocation.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2215
Credit to OSS Fuzz
2017-06-12 19:13:49 +00:00
Even Rouault 56d802d409 Reference GDAL ticket 2017-06-12 10:48:25 +00:00
Even Rouault 1cdea8b9e9 * libtiff/tif_dirread.c: fix regression of libtiff 4.0.8 in
ChopUpSingleUncompressedStrip() regarding update of newly single-strip
uncompressed files whose bytecount is 0. Before the change of 2016-12-03,
the condition bytecount==0 used to trigger an early exit/disabling of
strip chop. Re-introduce that in update mode. Otherwise this cause
later incorrect setting for the value of StripByCounts/StripOffsets.
2017-06-12 10:45:35 +00:00
Even Rouault ea6228c185 * .appveyor.yml, .travis.yml, build/travis-ci: apply patches
0001-ci-Travis-script-improvements.patch and
0002-ci-Invoke-helper-script-via-shell.patch by Roger Leigh
(sent to mailing list)
2017-06-09 22:07:08 +00:00
Even Rouault fb19084f4d Re-add build/travis-ci with execution bit 2017-06-09 11:04:33 +00:00
Even Rouault ff179125e2 remove build/travis-ci to re-add it with +x bit 2017-06-09 11:03:51 +00:00
Even Rouault f2a3b02040 * .travis.yml, build/travis-ci: new files from
0001-ci-Add-Travis-support-for-Linux-builds-with-Autoconf.patch by
Roger Leigh (sent to mailing list on 2017-06-08)
This patch adds support for the Travis-CI service.

* .appveyor.yml: new file from
0002-ci-Add-AppVeyor-support.patch by Roger Leigh (sent to mailing
list on 2017-06-08)
This patch adds a .appveyor.yml file to the top-level.  This allows
one to opt in to having a branch built on Windows with Cygwin,
MinGW and MSVC automatically when a branch is pushed to GitHub,
GitLab, BitBucket or any other supported git hosting service.

* CMakeLists.txt, test/CMakeLists.txt, test/TiffTestCommon.cmake: apply
patch 0001-cmake-Improve-Cygwin-and-MingGW-test-support.patch from Roger
Leigh (sent to mailing list on 2017-06-08)
This patch makes the CMake build system support running the tests
with MinGW or Cygwin.
2017-06-08 20:46:10 +00:00
Even Rouault 1d658302f8 * libtiff/tif_swab.c: if DISABLE_CHECK_TIFFSWABMACROS is defined, do not do
the #ifdef TIFFSwabXXX checks. Make it easier for GDAL to rename the symbols
of its internal libtiff copy.
2017-06-08 16:39:50 +00:00
Even Rouault 6281927e03 * libtiff/tif_dirinfo.c, tif_dirread.c: add _TIFFCheckFieldIsValidForCodec(),
and use it in TIFFReadDirectory() so as to ignore fields whose tag is a
codec-specified tag but this codec is not enabled. This avoids TIFFGetField()
to behave differently depending on whether the codec is enabled or not, and
thus can avoid stack based buffer overflows in a number of TIFF utilities
such as tiffsplit, tiffcmp, thumbnail, etc.
Patch derived from 0063-Handle-properly-CODEC-specific-tags.patch
(http://bugzilla.maptools.org/show_bug.cgi?id=2580) by Raphaël Hertzog.
Fixes:
http://bugzilla.maptools.org/show_bug.cgi?id=2580
http://bugzilla.maptools.org/show_bug.cgi?id=2693
http://bugzilla.maptools.org/show_bug.cgi?id=2625 (CVE-2016-10095)
http://bugzilla.maptools.org/show_bug.cgi?id=2564 (CVE-2015-7554)
http://bugzilla.maptools.org/show_bug.cgi?id=2561 (CVE-2016-5318)
http://bugzilla.maptools.org/show_bug.cgi?id=2499 (CVE-2014-8128)
http://bugzilla.maptools.org/show_bug.cgi?id=2441
http://bugzilla.maptools.org/show_bug.cgi?id=2433
2017-06-01 12:44:04 +00:00
Even Rouault ed38dcc52c * libtiff/tif_getimage.c: initYCbCrConversion(): stricter validation for
refBlackWhite coefficients values. To avoid invalid float->int32 conversion
(when refBlackWhite[0] == 2147483648.f)
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1907
Credit to OSS Fuzz
2017-05-29 11:29:06 +00:00
Even Rouault 4d3c3eec0c Fix date in changelog entry 2017-05-29 10:14:26 +00:00
Even Rouault 2b3a489164 * libtiff/tif_color.c: TIFFYCbCrToRGBInit(): stricter clamping to avoid
int32 overflow in TIFFYCbCrtoRGB().
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1844
Credit to OSS Fuzz
2017-05-29 10:12:54 +00:00
Bob Friesenhahn 84e1f1b66d libtiff 4.0.8 released 2017-05-21 19:10:50 +00:00
Bob Friesenhahn c714d5b5a7 html/v4.0.8.html: Add description of changes targeting the 4.0.8 release. 2017-05-21 17:47:46 +00:00
Even Rouault 1a690c0e10 * libtiff/tif_getimage.c: initYCbCrConversion(): stricter validation for
refBlackWhite coefficients values. To avoid invalid float->int32 conversion.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1718
Credit to OSS Fuzz

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1663
2017-05-20 11:29:02 +00:00
Even Rouault 3d5081d29b * libtiff/tif_getimage.c: initYCbCrConversion(): check luma[1] is not zero
to avoid division by zero.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1665
Credit to OSS Fuzz
2017-05-18 06:44:35 +00:00
Even Rouault cbe0307490 * libtiff/tif_read.c: _TIFFVSetField(): fix outside range cast of double to
float.
Credit to Google Autofuzz project
2017-05-17 21:54:04 +00:00
Even Rouault bda5be3a14 * libtiff/tif_getimage.c: initYCbCrConversion(): add basic validation of
luma and refBlackWhite coefficients (just check they are not NaN for now),
to avoid potential float to int overflows.
Fixes ://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1663
Credit to OSS Fuzz
2017-05-17 13:48:34 +00:00
Even Rouault f277dbaff0 * libtiff/tif_pixarlog.c: PixarLogDecode(): resync tif_rawcp with
next_in and tif_rawcc with avail_in at beginning and end of function,
similarly to what is done in LZWDecode(). Likely needed so that it
works properly with latest chnges in tif_read.c in CHUNKY_STRIP_READ_SUPPORT
mode. But untested...
2017-05-17 09:53:06 +00:00
Even Rouault 3f72698b8a * libtiff/tif_lzw.c: update dec_bitsleft at beginning of LZWDecode(),
and update tif_rawcc at end of LZWDecode(). This is needed to properly
work with the latest chnges in tif_read.c in CHUNKY_STRIP_READ_SUPPORT
mode.
2017-05-17 09:38:58 +00:00
Even Rouault 352c653057 * libtiff/tif_luv.c: LogL16InitState(): avoid excessive memory
allocation when RowsPerStrip tag is missing.
Credit to OSS-Fuzz (locally run, on GDAL)
2017-05-14 10:17:27 +00:00
Even Rouault 8d4e459102 * libtiff/tif_packbits.c: fix out-of-buffer read in PackBitsDecode()
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1563
Credit to OSS-Fuzz
2017-05-14 02:26:07 +00:00
Even Rouault 99e8fb373e * libtiff/tif_pixarlog.c, tif_luv.c: avoid potential int32
overflows in multiply_ms() and add_ms().
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1558
Credit to OSS-Fuzz
2017-05-13 18:29:38 +00:00
Even Rouault 0a6763b5a0 * libtiff/tif_color.c: avoid potential int32 overflow in
TIFFYCbCrToRGBInit()
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1533
Credit to OSS-Fuzz
2017-05-13 18:17:34 +00:00
Even Rouault 0a5c524577 * libtiff/tif_read.c: update tif_rawcc in CHUNKY_STRIP_READ_SUPPORT
mode with tif_rawdataloaded when calling TIFFStartStrip() or
TIFFFillStripPartial(). This avoids reading beyond tif_rawdata
when bytecount > tif_rawdatasize.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1545.
Credit to OSS-Fuzz
2017-05-13 15:34:06 +00:00
Even Rouault 2d7b1f8c16 * libtiff/tif_read.c: TIFFFillStripPartial():
avoid excessive memory allocation in case of shorten files.
Only effective on 64 bit builds.
Credit to OSS-Fuzz (locally run, on GDAL)
2017-05-12 21:12:24 +00:00
Even Rouault 76084fb831 * libtiff/tif_read.c: TIFFFillStripPartial() / TIFFSeek(),
avoid potential integer overflows with read_ahead in
CHUNKY_STRIP_READ_SUPPORT mode. Should
especially occur on 32 bit platforms.
2017-05-12 20:16:37 +00:00
Even Rouault 80ee713d88 Rename variable added in previous commit to avoid symbol clash 2017-05-10 19:54:54 +00:00
Even Rouault c9a6cfc51a * libtiff/tif_read.c: TIFFFillStrip() and TIFFFillTile():
avoid excessive memory allocation in case of shorten files.
Only effective on 64 bit builds and non-mapped cases.
Credit to OSS-Fuzz (locally run, on GDAL)
2017-05-10 19:38:49 +00:00
Even Rouault 328189565b * libtiff/tif_zip.c, tif_pixarlog.c, tif_predict.c: fix memory
leak when the underlying codec (ZIP, PixarLog) succeeds its
setupdecode() method, but PredictorSetup fails.
Credit to OSS-Fuzz (locally run, on GDAL)
2017-05-10 15:21:16 +00:00
Even Rouault 8fb8265260 * libtiff/tif_read.c: TIFFFillStrip(): add limitation to the number
of bytes read in case td_stripbytecount[strip] is bigger than
reasonable, so as to avoid excessive memory allocation.
2017-05-10 13:37:19 +00:00
Even Rouault d606ea22bb * tools/tiff2bw.c: close TIFF handle in error code path.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2677
2017-04-28 18:08:47 +00:00
Even Rouault fa55777370 * litiff/tif_fax3.c: avoid crash in Fax3Close() on empty file.
Patch by Alan Coopersmith  + complement by myself.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2673
* tools/fax2tiff.c: emit appropriate message if the input file is
empty. Patch by Alan Coopersmith.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2672
2017-04-27 19:50:01 +00:00
Even Rouault bb30ee4f09 * libtiff/tif_ojpeg.c: fix potential memory leak in
OJPEGReadHeaderInfoSecTablesQTable, OJPEGReadHeaderInfoSecTablesDcTable
and OJPEGReadHeaderInfoSecTablesAcTable
Patch by Nicolás Peña.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2670
2017-04-27 17:29:26 +00:00
Even Rouault 697bfd9f39 * libtiff/tif_dirread.c: fix memory leak in non DEFER_STRILE_LOAD
mode (ie default) when there is both a StripOffsets and
TileOffsets tag, or a StripByteCounts and TileByteCounts
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2689
* tools/tiff2ps.c: call TIFFClose() in error code paths.
2017-04-27 15:46:22 +00:00
Even Rouault 8a752e1e3a * libtiff/tif_fax3.c, tif_predict.c, tif_getimage.c: fix GCC 7
-Wimplicit-fallthrough warnings.
2017-02-25 17:05:12 +00:00
Even Rouault 19a159d7c4 * libtiff/tif_pixarlog.c: fix memory leak in error code path of
PixarLogSetupDecode(). Patch by Nicolás Peña.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2665
2017-02-18 20:30:26 +00:00
Even Rouault 09a7433335 * libtiff/tif_lzw.c: in LZWPostEncode(), increase, if necessary, the
code bit-width after flushing the remaining code and before emitting
the EOI code.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=1982
2017-02-18 18:46:00 +00:00
Even Rouault 62473b596b * libtiff/tif_jpeg.c: only run JPEGFixupTagsSubsampling() if the
YCbCrSubsampling tag is not explicitly present. This helps a bit to reduce
the I/O amount when te tag is present (especially on cloud hosted files).
2017-01-31 13:02:27 +00:00
Even Rouault 55e5962794 * tools/raw2tiff.c: avoid integer division by zero.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2631
2017-01-14 13:12:33 +00:00
Even Rouault ab7f27a984 * libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesQTable,
OJPEGReadHeaderInfoSecTablesDcTable and OJPEGReadHeaderInfoSecTablesAcTable
2017-01-12 19:23:20 +00:00
Even Rouault ad7aea728d * libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesAcTable
when read fails.
Patch by Nicolás Peña.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2659
2017-01-12 17:43:25 +00:00
Even Rouault d043ca1be9 * libtiff/tif_luv.c, tif_lzw.c, tif_packbits.c: return 0 in Encode
functions instead of -1 when TIFFFlushData1() fails.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2130
2017-01-11 20:33:35 +00:00
Even Rouault 480167a350 * tools/tiffcp.c: error out cleanly in cpContig2SeparateByRow and
cpSeparate2ContigByRow if BitsPerSample != 8 to avoid heap based overflow.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2656 and
http://bugzilla.maptools.org/show_bug.cgi?id=2657
2017-01-11 19:25:44 +00:00
Even Rouault f5858f50b5 Fix commit message 2017-01-11 19:03:18 +00:00
Even Rouault 33e002a170 * libtiff/tiffiop.h, tif_unix.c, tif_win32.c, tif_vms.c: add _TIFFcalloc()
* libtiff/tif_read.c: TIFFReadBufferSetup(): use _TIFFcalloc() to zero
initialize tif_rawdata.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2651
2017-01-11 19:02:49 +00:00
Even Rouault 537cd1da18 Initialize variable to fix MSVC warning (caused by previous commit) 2017-01-11 17:48:11 +00:00
Even Rouault a48c640a01 * libtiff/tif_getimage.c: add explicit uint32 cast in putagreytile to
avoid UndefinedBehaviorSanitizer warning.
Patch by Nicolás Peña.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2658
2017-01-11 16:38:26 +00:00
Even Rouault 50b48786d5 * libtiff/tif_read.c: avoid potential undefined behaviour on signed integer
addition in TIFFReadRawStrip1() in isMapped() case.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2650
2017-01-11 16:33:34 +00:00
Even Rouault 153418c943 * libtiff/tif_jpeg.c: validate BitsPerSample in JPEGSetupEncode() to avoid
undefined behaviour caused by invalid shift exponent.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2648
2017-01-11 16:13:50 +00:00
Even Rouault d2e6964efc * libtiff/tif_dir.c, tif_dirread.c, tif_dirwrite.c: implement various clampings
of double to other data types to avoid undefined behaviour if the output range
isn't big enough to hold the input value.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2643
http://bugzilla.maptools.org/show_bug.cgi?id=2642
http://bugzilla.maptools.org/show_bug.cgi?id=2646
http://bugzilla.maptools.org/show_bug.cgi?id=2647
2017-01-11 16:09:02 +00:00
Even Rouault a39f613104 * libtiff/tif_dirread.c: avoid division by floating point 0 in
TIFFReadDirEntryCheckedRational() and TIFFReadDirEntryCheckedSrational(),
and return 0 in that case (instead of infinity as before presumably)
Apparently some sanitizers do not like those divisions by zero.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2644
2017-01-11 13:28:01 +00:00
Even Rouault 9f839d9233 * libtiff/tif_dirwrite.c: in TIFFWriteDirectoryTagCheckedRational, replace
assertion by runtime check to error out if passed value is strictly
negative.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2535

* tools/tiffcrop.c: remove extraneous TIFFClose() in error code path, that
caused double free.
Related to http://bugzilla.maptools.org/show_bug.cgi?id=2535
2017-01-11 12:51:59 +00:00
Even Rouault 20dd00743c * libtiff/tif_jpeg.c: avoid integer division by zero in
JPEGSetupEncode() when horizontal or vertical sampling is set to 0.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2653
2017-01-11 12:15:01 +00:00
Even Rouault 553d4c5d05 * libtiff/tif_jpeg.c: increase libjpeg max memory usable to
10 MB instead of libjpeg 1MB default. This helps when creating files
with "big" tile, without using libjpeg temporary files.
Related to https://trac.osgeo.org/gdal/ticket/6757
2017-01-03 17:22:49 +00:00
Even Rouault 6d97ea6dcc * tools/tiff2pdf.c: avoid potential heap-based overflow in
t2p_readwrite_pdf_image_tile().
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2640
2016-12-20 17:28:17 +00:00
Even Rouault 5e95f6a34c * tools/tiff2pdf.c: avoid potential invalid memory read in
t2p_writeproc.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2639
2016-12-20 17:24:35 +00:00
Even Rouault 7fb75582f4 * tools/tiff2pdf.c: fix wrong usage of memcpy() that can trigger
unspecified behaviour.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2638
2016-12-20 17:13:26 +00:00
Even Rouault 7d919c7849 * libtiff/tif_getimage.c: fix potential memory leaks in error code
path of TIFFRGBAImageBegin().
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2627
2016-12-18 22:28:42 +00:00
Even Rouault 732f8e0b46 * tools/tiff2pdf.c: prevent heap-based buffer overflow in -j mode
on a paletted image. Note: this fix errors out before the overflow
happens. There could probably be a better fix.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2635
2016-12-18 10:37:59 +00:00
Even Rouault f9f8686c7d * libtiff/tiffio.h, libtiff/tif_getimage.c: add TIFFReadRGBAStripExt()
and TIFFReadRGBATileExt() variants of the functions without ext, with
an extra argument to control the stop_on_error behaviour.
2016-12-17 22:33:11 +00:00
Even Rouault 0a85b00c8b * tools/tiff2ps.c: fix 2 heap-based buffer overflows (in PSDataBW
and PSDataColorContig). Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2633 and
http://bugzilla.maptools.org/show_bug.cgi?id=2634.
2016-12-17 19:45:28 +00:00
Lee Howard 709f14f258 HylaFAX not Halyfax 2016-12-14 18:36:27 +00:00
Even Rouault 6e3867b3e6 Fix spelling in ChangeLog 2016-12-13 18:27:47 +00:00
Even Rouault 27d6152ddd * libtiff/tif_fax3.h: revert change done on 2016-01-09 that made
Param member of TIFFFaxTabEnt structure a uint16 to reduce size of
the binary. It happens that the Hylafax software uses the tables that
follow this typedef (TIFFFaxMainTable, TIFFFaxWhiteTable,
TIFFFaxBlackTable), also they are not in a public libtiff header.
Raised by Lee Howard.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2636
2016-12-13 18:15:48 +00:00
Even Rouault a3196dff73 * html/man/Makefile.am: remove thumbnail.1.html and rgb2ycbcr.1.html
from installed pages since the corresponding utilities are no longer
installed. Reported by Havard Eidnes
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2606
2016-12-04 17:56:18 +00:00
Even Rouault ef0803fc75 * libtiff/tif_write.c: fix misleading indentation as warned by GCC. 2016-12-03 21:57:44 +00:00
Even Rouault 2766c8583d * tools/tiffcp.c: replace assert( (bps % 8) == 0 ) by a non assert check.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2605
2016-12-03 16:50:02 +00:00
Even Rouault bae8284136 * tools/tiffcp.c: fix uint32 underflow/overflow that can cause heap-based
buffer overflow.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2610
2016-12-03 16:40:01 +00:00
Even Rouault b1e5ae5984 * tools/tiffcp.c: avoid potential division by zero is BitsPerSamples tag is
missing.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2607
2016-12-03 15:44:15 +00:00
Even Rouault f703a4c7b3 * man/Makefile.am: remove thumbnail.1 and rgb2ycbcr.1 from installed man
pages since the corresponding utilities are no longer installed.
Reported by Havard Eidnes
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2606
2016-12-03 15:39:49 +00:00
Even Rouault 1f7151900c * tools/tif_dir.c: when TIFFGetField(, TIFFTAG_NUMBEROFINKS, ) is called,
limit the return number of inks to SamplesPerPixel, so that code that parses
ink names doesn't go past the end of the buffer.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2599


Reported by Agostino Sarubbo.
2016-12-03 15:30:31 +00:00
Even Rouault 5b52559d39 * tools/tiffcp.c: avoid potential division by zero is BitsPerSamples tag is
missing.
Reported by Agostino sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2597
2016-12-03 14:42:40 +00:00
Even Rouault 2deb7183ca * tools/tiffinfo.c: fix null pointer dereference in -r mode when the image has
no StripByteCount tag.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2594
2016-12-03 14:18:48 +00:00
Even Rouault 4dc0503820 Fix typo on reporter name 2016-12-03 13:30:45 +00:00
Even Rouault 5c47f33899 * tools/tiffcrop.c: fix integer division by zero when BitsPerSample is missing.
Reported by Agostina Sarubo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2619
2016-12-03 13:00:03 +00:00
Even Rouault 7aad042fc8 * tools/tiffcrop.c: add 3 extra bytes at end of strip buffer in
readSeparateStripsIntoBuffer() to avoid read outside of heap allocated buffer.
Reported by Agostina Sarubo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2621
2016-12-03 12:19:32 +00:00
Even Rouault 3a1c5ac67b * tools/tiffcrop.c: fix readContigStripsIntoBuffer() in -i (ignore) mode so
that the output buffer is correctly incremented to avoid write outside bounds.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2620
2016-12-03 11:35:56 +00:00
Even Rouault 45ba019d0f * libtiff/tif_ojpeg.c: make OJPEGDecode() early exit in case of failure in
OJPEGPreDecode(). This will avoid a divide by zero, and potential other issues.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2611
2016-12-03 11:15:18 +00:00
Even Rouault 9e9a0bbfb2 * libtiff/tif_dirread.c: modify ChopUpSingleUncompressedStrip() to
instanciate compute ntrips as TIFFhowmany_32(td->td_imagelength, rowsperstrip),
instead of a logic based on the total size of data. Which is faulty is
the total size of data is not sufficient to fill the whole image, and thus
results in reading outside of the StripByCounts/StripOffsets arrays when
using TIFFReadScanline().
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2608.

* libtiff/tif_strip.c: revert the change in TIFFNumberOfStrips() done
for http://bugzilla.maptools.org/show_bug.cgi?id=2587 / CVE-2016-9273 since
the above change is a better fix that makes it unnecessary.
2016-12-03 11:02:15 +00:00
Even Rouault cec2d959be * libtiff/tif_pixarlog.c, libtiff/tif_luv.c: fix heap-based buffer
overflow on generation of PixarLog / LUV compressed files, with
ColorMap, TransferFunction attached and nasty plays with bitspersample.
The fix for LUV has not been tested, but suffers from the same kind
of issue of PixarLog.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2604
2016-12-02 23:05:51 +00:00
Even Rouault 78dab0996f * tools/tiffcp.c: avoid uint32 underflow in cpDecodedStrips that
can cause various issues, such as buffer overflows in the library.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2598
2016-12-02 22:13:32 +00:00
Even Rouault 30703a1677 * libtiff/tif_read.c, libtiff/tiffiop.h: fix uint32 overflow in
TIFFReadEncodedStrip() that caused an integer division by zero.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2596
2016-12-02 21:56:56 +00:00
Even Rouault 523e4e33e8 Add CVE number 2016-11-22 10:58:57 +00:00
Even Rouault 58788e4ea1 * libtiff/tif_predict.c, libtiff/tif_print.c: fix printf unsigned
vs signed formatting (cppcheck invalidPrintfArgType_uint warnings)
2016-11-20 22:31:21 +00:00
Even Rouault cdc3c9b7e1 Commit changes that should have gone with previous commit 2016-11-20 22:29:47 +00:00
Even Rouault a9cf335a77 * libtiff/tif_getimage.c, libtiff/tif_open.c: add parenthesis to
fix cppcheck clarifyCalculation warnings
2016-11-20 22:20:46 +00:00
Bob Friesenhahn 5ba49e2beb * tools/fax2tiff.c (main): Applied patch by Jörg Ahrens to fix
passing client data for Win32 builds using tif_win32.c
(USE_WIN32_FILEIO defined) for file I/O.  Patch was provided via
email on November 20, 2016.
2016-11-20 18:04:52 +00:00
Bob Friesenhahn 884f973652 * libtiff 4.0.7 released.
* configure.ac: Update for 4.0.7 release.
2016-11-19 17:47:39 +00:00
Bob Friesenhahn 07e63bcdf8 * tools/tiffdump.c (ReadDirectory): Remove uint32 cast to
_TIFFmalloc() argument which resulted in Coverity report.  Added
more mutiplication overflow checks.
2016-11-19 15:42:46 +00:00
Even Rouault 1aa4ee54c8 Assign CVE numbers 2016-11-19 10:33:19 +00:00
Even Rouault c80c06ce45 * tools/tiffcrop.c: Fix memory leak in (recent) error code path.
Fixes Coverity 1394415.
2016-11-18 14:58:46 +00:00
Bob Friesenhahn 2c81e2ffa9 Cast away unused return value from snprintf() to possibly eliminate a compilation warning. 2016-11-18 02:52:13 +00:00
Bob Friesenhahn ca5b774b0c * libtiff/tif_getimage.c: Fix some benign warnings which appear in
64-bit compilation under Microsoft Visual Studio of the form
"Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit
value.  Results might not be an expected value.".  Problem was
reported on November 16, 2016 on the tiff mailing list.
2016-11-18 02:47:45 +00:00
Even Rouault 6d055b4f99 * libtiff/tif_dirread.c: in TIFFFetchNormalTag(), do not dereference
NULL pointer when values of tags with TIFF_SETGET_C16_ASCII / TIFF_SETGET_C32_ASCII
access are 0-byte arrays.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2593 (regression introduced
by previous fix done on 2016-11-11 for CVE-2016-9297).
Reported by Henri Salo.
2016-11-16 15:14:15 +00:00
Even Rouault 5936de5bae Assign CVE-2016-9297 number 2016-11-14 19:08:24 +00:00
Bob Friesenhahn 6ff69f4673 Move mis-classified change note. 2016-11-12 21:43:44 +00:00
Bob Friesenhahn c22e3e5b42 * tools/tiffinfo.c (TIFFReadContigTileData): Fix signed/unsigned
comparison warning.
(TIFFReadSeparateTileData): Fix signed/unsigned comparison
warning.
2016-11-12 20:06:05 +00:00
Bob Friesenhahn b6779d1454 tmsize_t is a signed type so change casting to cast to unsigned type before compare 2016-11-12 19:57:16 +00:00
Bob Friesenhahn d2c7f195f1 * tools/tiffcrop.c (readContigTilesIntoBuffer): Fix
signed/unsigned comparison warning.
2016-11-12 18:35:11 +00:00
Bob Friesenhahn 35b7f035a7 * html/v4.0.7.html: Add a file to document the pending 4.0.7
release.
2016-11-12 18:30:47 +00:00
Even Rouault 17d6936499 Fix typo in comment 2016-11-12 16:48:28 +00:00
Even Rouault 34e2075125 Fix typo in comment 2016-11-11 21:28:24 +00:00
Even Rouault 57b0f8ba24 * tools/tiff2pdf.c: avoid undefined behaviour related to overlapping
of source and destination buffer in memcpy() call in
t2p_sample_rgbaa_to_rgb()
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2577
2016-11-11 21:22:50 +00:00
Even Rouault 16e71ae0a2 * tools/tiff2pdf.c: fix potential integer overflows on 32 bit builds
in t2p_read_tiff_size()
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2576
2016-11-11 21:15:25 +00:00
Even Rouault 1a64e2ccd1 Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2587 (CVE-2016-9273) 2016-11-11 21:09:07 +00:00
Even Rouault 56f3e29d18 * libtiff/tif_aux.c: fix crash in TIFFVGetFieldDefaulted()
when requesting Predictor tag and that the zip/lzw codec is not
configured.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2591
2016-11-11 20:45:53 +00:00
Even Rouault 9bddab5035 * libtiff/tif_dirread.c: in TIFFFetchNormalTag(), make sure that
values of tags with TIFF_SETGET_C16_ASCII / TIFF_SETGET_C32_ASCII
access are null terminated, to avoid potential read outside buffer
in _TIFFPrintField().
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2590
2016-11-11 20:22:01 +00:00
Even Rouault 1120426ba0 * libtiff/tif_dirread.c: reject images with OJPEG compression that
have no TileOffsets/StripOffsets tag, when OJPEG compression is
disabled. Prevent null pointer dereference in TIFFReadRawStrip1()
and other functions that expect td_stripbytecount to be non NULL.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2585
2016-11-11 20:01:55 +00:00
Even Rouault 49062afa56 * tools/tiffcrop.c: fix multiple uint32 overflows in
writeBufferToSeparateStrips(), writeBufferToContigTiles() and
writeBufferToSeparateTiles() that could cause heap buffer overflows.
Reported by Henri Salo from Nixu Corporation.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2592
2016-11-11 19:33:06 +00:00
Even Rouault a7abf0ba90 * libtiff/tif_strip.c: make TIFFNumberOfStrips() return the td->td_nstrips
value when it is non-zero, instead of recomputing it. This is needed in
TIFF_STRIPCHOP mode where td_nstrips is modified. Fixes a read outsize of
array in tiffsplit (or other utilities using TIFFNumberOfStrips()).
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2587
2016-11-09 23:00:49 +00:00
Even Rouault 3f5f68e91b * libtiff/tif_predic.c: fix memory leaks in error code paths added in
previous commit (fix for MSVR 35105)
2016-11-04 09:19:13 +00:00
Even Rouault a41c294c3f * libtiff/tif_predict.h, libtiff/tif_predict.c:
Replace assertions by runtime checks to avoid assertions in debug mode,
or buffer overflows in release mode. Can happen when dealing with
unusual tile size like YCbCr with subsampling. Reported as MSVR 35105
by Axel Souchet	& Vishal Chauhan from the MSRC Vulnerabilities & Mitigations
team.
2016-10-31 17:24:26 +00:00
Even Rouault 124d8fc810 * tools/fax2tiff.c: fix segfault when specifying -r without
argument. Patch by Yuriy M. Kaminskiy.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2572
2016-10-25 22:22:45 +00:00
Even Rouault c1a5a07a3a Fixing last ChangeLog entry 2016-10-25 21:38:35 +00:00
Even Rouault 739dcd28a0 * libtiff/tif_dir.c: discard values of SMinSampleValue and
SMaxSampleValue when they have been read and the value of
SamplesPerPixel is changed afterwards (like when reading a
OJPEG compressed image with a missing SamplesPerPixel tag,
and whose photometric is RGB or YCbCr, forcing SamplesPerPixel
being 3). Otherwise when rewriting the directory (for example
with tiffset, we will expect 3 values whereas the array had been
allocated with just one), thus causing a out of bound read access.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2500
(CVE-2014-8127, duplicate: CVE-2016-3658)

* libtiff/tif_write.c: avoid null pointer dereference on td_stripoffset
when writing directory, if FIELD_STRIPOFFSETS was artificially set
for a hack case	in OJPEG case.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2500
(CVE-2014-8127, duplicate: CVE-2016-3658)
2016-10-25 21:35:15 +00:00
Even Rouault 0c05834d05 * tools/tiffinfo.c: fix out-of-bound read on some tiled images.
(http://bugzilla.maptools.org/show_bug.cgi?id=2517)

* libtiff/tif_compress.c: make TIFFNoDecode() return 0 to indicate an
error and make upper level read routines treat it accordingly.
(linked to the test case of http://bugzilla.maptools.org/show_bug.cgi?id=2517)
2016-10-25 20:04:21 +00:00
Even Rouault 0d521dfab0 * tools/tiffcrop.c: fix out-of-bound read of up to 3 bytes in
readContigTilesIntoBuffer(). Reported as MSVR 35092 by Axel Souchet
& Vishal Chauhan from the MSRC Vulnerabilities & Mitigations team.
2016-10-14 19:13:20 +00:00
Even Rouault 0937638efd * tools/tiff2pdf.c: fix write buffer overflow of 2 bytes on JPEG
compressed images. Reported by Tyler Bohan of Cisco Talos as
TALOS-CAN-0187 / CVE-2016-5652.
Also prevents writing 2 extra uninitialized bytes to the file stream.
2016-10-09 11:03:36 +00:00
Even Rouault 6f13bf391a * tools/tiffcp.c: fix out-of-bounds write on tiled images with odd
tile width vs image width. Reported as MSVR 35103
by Axel Souchet and Vishal Chauhan from the MSRC Vulnerabilities &
Mitigations team.
2016-10-08 15:54:56 +00:00
Even Rouault 7399a6f13b * tools/tiff2pdf.c: fix read -largely- outsize of buffer in
t2p_readwrite_pdf_image_tile(), causing crash, when reading a
JPEG compressed image with TIFFTAG_JPEGTABLES length being one.
Reported as MSVR 35101 by Axel Souchet and Vishal Chauhan from
the MSRC Vulnerabilities & Mitigations team.
2016-10-08 15:14:42 +00:00
Even Rouault 5707841070 * tools/tiffcp.c: fix read of undefined variable in case of missing
required tags. Found on test case of MSVR 35100.
* tools/tiffcrop.c: fix read of undefined buffer in
readContigStripsIntoBuffer() due to uint16 overflow. Probably not a
security issue but I can be wrong. Reported as MSVR 35100 by Axel
Souchet from the MSRC Vulnerabilities & Mitigations team.
2016-10-08 15:04:31 +00:00
Bob Friesenhahn d4dd6ccc1e * html: Change as many remotesensing.org broken links to a working
URL as possible.
2016-09-25 20:05:44 +00:00
Bob Friesenhahn 65d7db09a5 * libtiff/tif_getimage.c (TIFFRGBAImageOK): Reject attempts to
read floating point images.

* libtiff/tif_predict.c (PredictorSetup): Enforce bits-per-sample
requirements of floating point predictor (3).  Fixes CVE-2016-3622
"Divide By Zero in the tiff2rgba tool."

places where it isn't done currently, but it seems this patch is enough.
2016-09-24 23:11:55 +00:00
Even Rouault edde1c583a * tools/tiffcrop.c: fix various out-of-bounds write vulnerabilities
in heap or stack allocated buffers. Reported as MSVR 35093,
MSVR 35096 and MSVR 35097. Discovered by Axel Souchet and Vishal
Chauhan from the MSRC Vulnerabilities & Mitigations team.
* tools/tiff2pdf.c: fix out-of-bounds write vulnerabilities in
heap allocate buffer in t2p_process_jpeg_strip(). Reported as MSVR
35098. Discovered by Axel Souchet and Vishal Chauhan from the MSRC
Vulnerabilities & Mitigations team.
* libtiff/tif_pixarlog.c: fix out-of-bounds write vulnerabilities
in heap allocated buffers. Reported as MSVR 35094. Discovered by
Axel Souchet and Vishal Chauhan from the MSRC Vulnerabilities &
Mitigations team.
* libtiff/tif_write.c: fix issue in error code path of TIFFFlushData1()
that didn't reset the tif_rawcc and tif_rawcp members. I'm not
completely sure if that could happen in practice outside of the odd
behaviour of t2p_seekproc() of tiff2pdf). The report points that a
better fix could be to check the return value of TIFFFlushData1() in
places where it isn't done currently, but it seems this patch is enough.
Reported as MSVR 35095. Discovered by Axel Souchet & Vishal Chauhan &
Suha Can from the MSRC Vulnerabilities & Mitigations team.
2016-09-23 22:12:18 +00:00
Bob Friesenhahn 645af692f6 * html/man/index.html: Comment out links to documentation for
abandoned utilities.
2016-09-20 13:35:17 +00:00
Even Rouault b7ec5fe89c * libtiff/tif_lzma.c: typo fix in comment 2016-09-17 09:18:58 +00:00
Even Rouault 4fd5fe674a * libtiff/*.c: fix warnings raised by clang 3.9 -Wcomma 2016-09-04 21:32:55 +00:00
Even Rouault e85c35f54e * libtiff/tif_dirwrite.c, libtiff/tif_color.c: fix warnings raised
by GCC 5 / clang -Wfloat-conversion
2016-09-03 20:15:35 +00:00
Even Rouault 3318c65cbb * libtiff/tif_dirwrite.c: fix warnings raised by GCC 5 -Wfloat-conversion 2016-09-02 22:42:00 +00:00
Even Rouault cbdc8d8ae9 * tools/tiffcrop.c: fix C99'ism. 2016-08-16 08:54:01 +00:00
Even Rouault ac16d2213c * tools/tiff2bw.c: fix weight computation that could result of color
value overflow (no security implication). Fix bugzilla #2550.
Patch by Frank Freudenberg.
2016-08-15 22:01:31 +00:00
Even Rouault ee80566cd1 Fix signed vs unsigned comparison 2016-08-15 21:36:43 +00:00
Even Rouault f18e33b3a5 * tools/rgb2ycbcr.c: validate values of -v and -h parameters to
avoid potential divide by zero. Fixes CVE-2016-3623 (bugzilla #2569)
2016-08-15 21:26:56 +00:00
Even Rouault 5dd73c2b77 * tools/tiffcrop.c: Fix out-of-bounds write in loadImage().
From patch libtiff-CVE-2016-3991.patch from
libtiff-4.0.3-25.el7_2.src.rpm by Nikola Forro (bugzilla #2543)
2016-08-15 21:05:40 +00:00
Even Rouault a71b62bcff * libtiff/tif_pixarlog.c: Fix write buffer overflow in PixarLogEncode
if more input samples are provided than expected by PixarLogSetupEncode.
Idea based on libtiff-CVE-2016-3990.patch from
libtiff-4.0.3-25.el7_2.src.rpm by Nikola Forro, but with different and
simpler check. (bugzilla #2544)


invalid tests that rejected valid files. (bugzilla #2545)
2016-08-15 20:49:48 +00:00
Even Rouault 01bac25a5a * tools/tiff2rgba.c: Fix integer overflow in size of allocated
buffer, when -b mode is enabled, that could result in out-of-bounds
write. Based initially on patch tiff-CVE-2016-3945.patch from
libtiff-4.0.3-25.el7_2.src.rpm by Nikola Forro, with correction for
invalid tests that rejected valid files.
2016-08-15 20:06:40 +00:00
Even Rouault e54eac223b (CVE-2016-5321 / CVE-2016-5323 , bugzilla #2558 / #2559) 2016-07-11 21:38:31 +00:00
Even Rouault a1277756ad * tools/tiffcrop.c: Avoid access outside of stack allocated array
on a tiled separate TIFF with more than 8 samples per pixel.
Reported by Kaixiang Zhang of the Cloud Security Team, Qihoo 360
(CVE-2016-5321, bugzilla #2558)
2016-07-11 21:26:03 +00:00
Even Rouault febda236ac * libtiff/tif_read.c: Fix out-of-bounds read on
memory-mapped files in TIFFReadRawStrip1() and TIFFReadRawTile1()
when stripoffset is beyond tmsize_t max value (reported by
Mathias Svensson)
2016-07-10 18:00:20 +00:00
Even Rouault a0faaf8910 Fix build failure due to previous commit 2016-07-10 16:56:18 +00:00
Even Rouault 292c431e5d * tools/tiffdump.c: fix a few misaligned 64-bit reads warned
by -fsanitize
2016-07-10 15:34:06 +00:00
Even Rouault 234b8543a8 Fix typo in CVE number for CVE-2016-5875 2016-07-10 10:15:07 +00:00
Even Rouault b46aa51809 * libtiff/tif_read.c: make TIFFReadEncodedStrip() and
TIFFReadEncodedTile() directly use user provided buffer when
no compression (and other conditions) to save a memcpy().

* libtiff/tif_write.c: make TIFFWriteEncodedStrip() and
TIFFWriteEncodedTile() directly use user provided buffer when
no compression to save a memcpy().
2016-07-03 16:02:17 +00:00
Even Rouault 33c391eff4 * libtiff/tif_luv.c: validate that for COMPRESSION_SGILOG and
PHOTOMETRIC_LOGL, there is only one sample per pixel. Avoid
potential invalid memory write on corrupted/unexpected images when
using the TIFFRGBAImageBegin() interface (reported by
Clay Wood)

(CVE-2016-587)
2016-07-01 11:06:04 +00:00
Even Rouault f8b7c3de4d Fix warning about unsigned vs signed comparison 2016-06-28 15:37:33 +00:00
Even Rouault bf5b698868 * libtiff/tif_pixarlog.c: fix potential buffer write overrun in
PixarLogDecode() on corrupted/unexpected images (reported by Mathias Svensson)
2016-06-28 15:12:19 +00:00
Bob Friesenhahn c0eb1847f4 * libtiff/libtiff.def: Added _TIFFMultiply32 and _TIFFMultiply64
to libtiff.def
2016-06-15 13:28:11 +00:00
Bob Friesenhahn 30366c9f22 * tools/Makefile.am: The libtiff tools bmp2tiff, gif2tiff,
ras2tiff, sgi2tiff, sgisv, and ycbcr are completely removed from
the distribution.  The libtiff tools rgb2ycbcr and thumbnail are
only built in the build tree for testing.  Old files are put in
new 'archive' subdirectory of the source repository, but not in
distribution archives.  These changes are made in order to lessen
the maintenance burden.
2016-06-05 19:53:59 +00:00
Bob Friesenhahn 01c8ca66b3 * libtiff/tif_config.vc.h (HAVE_SNPRINTF): Add a '1' to the
HAVE_SNPRINTF definition.'
2016-05-10 13:04:48 +00:00
Bob Friesenhahn d7aa10673b * libtiff/tif_config.vc.h (HAVE_SNPRINTF): Applied patch by Edward
Lam to define HAVE_SNPRINTF for Visual Studio 2015.
2016-05-10 01:01:09 +00:00
Even Rouault 958d9b5a8d * libtiff/tif_dirread.c: when compiled with DEFER_STRILE_LOAD,
fix regression, introduced on 2014-12-23, when reading a one-strip
file without a StripByteCounts tag. GDAL #6490
2016-04-27 11:38:00 +00:00
Bob Friesenhahn c7ff695d1b * html/bugs.html: Replace Andrey Kiselev with Bob Friesenhahn for
purposes of security issue reporting.
2016-04-08 02:34:00 +00:00
Even Rouault caf986e723 * libtiff/*: upstream typo fixes (mostly contributed by Kurt Schwehr)
coming from GDAL internal libtiff
2016-01-23 21:20:34 +00:00
Even Rouault eb52becbb9 * libtiff/tif_fax3.h: make Param member of TIFFFaxTabEnt structure
a uint16 to reduce size of the binary.
2016-01-09 22:19:21 +00:00
Even Rouault 2794a67c27 * libtiff/tif_read.c, tif_dirread.c: fix indentation issues raised
by GCC 6 -Wmisleading-indentation
2016-01-03 10:01:25 +00:00
Even Rouault 62382d0653 * libtiff/tif_pixarlog.c: avoid zlib error messages to pass a NULL
string to %s formatter, which is undefined behaviour in sprintf().
2015-12-27 20:14:11 +00:00
Even Rouault 7dfc35c299 Fix MSVC breakage in previous commit 2015-12-27 17:14:52 +00:00
Even Rouault a1506aa413 * libtiff/tif_next.c: fix potential out-of-bound write in NeXTDecode()
triggered by http://lcamtuf.coredump.cx/afl/vulns/libtiff5.tif
(bugzilla #2508)
2015-12-27 16:55:20 +00:00
Even Rouault 13963114dd * libtiff/tif_luv.c: fix potential out-of-bound writes in decode
functions in non debug builds by replacing assert()s by regular if
checks (bugzilla #2522).
Fix potential out-of-bound reads in case of short input data.
2015-12-27 16:25:11 +00:00
Even Rouault b7cc3e5902 * libtiff/tif_getimage.c: fix out-of-bound reads in TIFFRGBAImage
interface in case of unsupported values of SamplesPerPixel/ExtraSamples
for LogLUV / CIELab. Add explicit call to TIFFRGBAImageOK() in
TIFFRGBAImageBegin(). Fix CVE-2015-8665 reported by limingxing and
CVE-2015-8683 reported by zzf of Alibaba.
2015-12-26 17:32:03 +00:00
Even Rouault 212816f6e4 * libtiff/tif_dirread.c: workaround false positive warning of Clang Static
Analyzer about null pointer dereference in TIFFCheckDirOffset().
2015-12-20 23:18:51 +00:00
Even Rouault a292bc2d27 * libtiff/tif_fax3.c: remove dead assignment in Fax3PutEOLgdal(). Found
by Clang Static Analyzer
2015-12-19 21:50:51 +00:00
Even Rouault 22ee4bcd8d offsets on a even offset (affects BigTIFF). This was a regression of the
changeset of 2015-10-19.
2015-12-18 14:08:11 +00:00
Even Rouault 56ae8c1ee3 * libtiff/tif_dirwrite.c: fix truncation to 32 bit of file offsets in
TIFFLinkDirectory() and TIFFWriteDirectorySec() when aligning directory
offsets on a even offset (affects BigTIFF)
2015-12-18 11:11:00 +00:00
Even Rouault 845ee2f85b * libtiff/tif_write.c: TIFFWriteEncodedStrip() and TIFFWriteEncodedTile()
should return -1 in case of failure of tif_encodestrip() as documented
* libtiff/tif_dumpmode.c: DumpModeEncode() should return 0 in case of
failure so that the above mentionned functions detect the error.
2015-12-12 18:04:26 +00:00
Even Rouault b452d9b91c * libtiff/uvcode.h: const'ify uv_code array 2015-12-07 00:12:33 +00:00
Even Rouault 5b64b34dc9 * libtiff/tif_dirinfo.c: const'ify tiffFields, exifFields,
tiffFieldArray and exifFieldArray arrays
2015-12-06 23:51:44 +00:00
Even Rouault fdda780a4b * libtiff/tif_print.c: constify photoNames and orientNames arrays 2015-12-06 22:19:56 +00:00
Even Rouault e4df80bf75 * libtiff/tif_close.c, libtiff/tif_extension.c : rename link
variable to avoid -Wshadow warnings
2015-12-06 11:13:43 +00:00
Even Rouault 142a8a8d4e * libtiff/tif_close.c: rename variable to avoid -Wshadow warning 2015-12-06 10:51:14 +00:00
Even Rouault f238db387f * libtiff/*.c: fix typos in comments (patch by Kurt Schwehr) 2015-11-22 22:37:27 +00:00
Even Rouault 3ba1a57e00 tif_ojpec.c: modify previous change to be compatible with all MSVC versions 2015-11-22 16:40:43 +00:00
Even Rouault 1c9ef8f17c * libtiff/*.c: fix MSVC warnings related to cast shortening and
assignment within conditional expression
2015-11-22 15:31:03 +00:00
Even Rouault 87f02eaced * libtiff/*.c: fix clang -Wshorten-64-to-32 warnings 2015-11-18 20:35:07 +00:00
Even Rouault 7cf3e7efeb * libtiff/tif_dirread.c: initialize double* data at line 3693 to NULL
to please MSVC 2013
2015-11-18 18:26:03 +00:00
Even Rouault 1dacfe503f Fix previous commit 2015-11-17 16:21:02 +00:00
Even Rouault 1784d0edf7 * libtiff/tif_dirread.c: prevent reading ColorMap or TransferFunction
if BitsPerPixel > 24, so as to avoid huge memory allocation and file
read attempts
2015-11-17 12:17:31 +00:00
Even Rouault d91cba049c * libtiff/tif_dirread.c: remove duplicated assignment (reported by
Clang static analyzer)
2015-11-02 09:52:08 +00:00
Even Rouault 1874d4e8c8 * libtiff/tif_dir.c, libtiff/tif_dirinfo.c, libtiff/tif_compress.c,
libtiff/tif_jpeg_12.c: suppress warnings about 'no previous
declaration/prototype'
2015-10-28 19:10:20 +00:00
Even Rouault aefadd720c * libtiff/tiffiop.h, libtiff/tif_dirwrite.c: suffix constants by U to fix
'warning: negative integer implicitly converted to unsigned type' warning
(part of -Wconversion)
2015-10-19 12:04:23 +00:00
Even Rouault ecc78ef4c1 * libtiff/tif_dir.c, libtiff/tif_dirread.c, libtiff/tif_getimage.c,
libtiff/tif_print.c: fix -Wshadow warnings (only in libtiff/)
2015-10-17 10:13:14 +00:00
Bob Friesenhahn 5612707c08 Fix failure to update libtiff version in AC_INIT. 2015-09-12 19:50:39 +00:00
Bob Friesenhahn 20dc498028 * libtiff 4.0.6 released. 2015-09-12 19:46:23 +00:00
Bob Friesenhahn e2f860d2f4 * html/v4.0.6.html: Added release notes for 4.0.6. 2015-09-12 19:29:47 +00:00
Bob Friesenhahn d1fabc4db1 * tools/tiffgt.c: Silence glut API deprecation warnings on MacOS
X.  Patch by Roger Leigh.
2015-09-06 20:42:20 +00:00
Bob Friesenhahn 897af013fb * Makefile.am: Added a 'coverity' rule to assist with Coverity
submissions.
2015-09-06 19:34:06 +00:00
Bob Friesenhahn 7bc7b77e78 * tools/tiff2pdf.c: Fix compiler warning about unused function
when JPEG is not available.

* tools/fax2ps.c (main): Detect failure to write to temporary
file.
2015-09-06 18:24:27 +00:00
Bob Friesenhahn 2c7bbbc163 (TIFF_UINT32_MAX): Avoid use of platform-specific large constants. 2015-09-05 20:31:41 +00:00
Bob Friesenhahn 6fcb0cfb03 (TIFF_INT64_MAX): Avoid use of platform-specific large constants. 2015-09-05 20:22:45 +00:00
Bob Friesenhahn 54de96d2b8 * libtiff/tif_dirread.c (TIFFReadDirEntryCheckRangeSlongSlong8):
Change implementation so that it does not sometimes overflow the
range of a 32-bit int and to avoid a signed vs unsigned compare
compiler warning.
2015-09-05 20:15:57 +00:00
Bob Friesenhahn 878815a1f0 Missed BSD make patch due to wrong patch order. 2015-09-01 21:15:52 +00:00
Bob Friesenhahn a9afad2a9f * Makefile.am (distcheck-hook), configure.ac: Applied patches by
Roger Leigh (via tiff mailing list on 2015-09-01) to fix issue
with BSD make and to make use of cmake in 'distcheck' target
conditional on if cmake is available.
2015-09-01 19:23:16 +00:00
Bob Friesenhahn e762ba3de9 * CMakeLists.txt, Makefile.am, configure.ac: Applied patches by
Roger Leigh (via tiff mailing list on 2015-09-01).

CMake build is now included in 'distcheck' target.

Builds with CMake 2.8.9 and newer.

Tar is now resquested to use POSIX PAX format.
2015-09-01 15:38:01 +00:00
Bob Friesenhahn ba57d5f0b7 * CMakeLists.txt, libtiff/test/Makefile.am: Applied patches by
Roger Leigh (via tiff mailing list on 2015-08-31.

CMake reads all version information directly from configure.ac to
avoid duplication of values.  This basically greps over the file
for the LIBTIFF_* variables, then translates them to the form
needed for cmake. This includes the release version and libtool
shared library version information.

Make shared/static library building configurable.  Currently it
always builds shared libraries, with static libs having a _static
suffix (copying zlib, but it means it's got a non-standard name).
CMake has a -DBUILD_SHARED_LIBS=ON|OFF option to select one or the
other, which is now used instead.  There's now a single "tiff"
target to build either shared or static as required, and all the
tests and tools are linked with this. Note: the Windows tests fail
when linked with a static libtiff (says: libtiff.dll not found).
Not really a regression since this was not tested up to this
point, and it's likely the unit tests haven't (ever?) been run on
Windows with a static libtiff, so there's some additional
portability issue here to address.  Works fine on UNIX systems,
and fine on Windows with the default to build a DLL.

Add a missing file which wasn't being distributed, causing unit
tests to fail.  Note that "find . -name '*.cmake'" lists all the
CMake files which need distributing in addition to all the
CMakeLists.txt files (which now are distributed).
2015-09-01 02:51:50 +00:00
Even Rouault 704f717cf5 * libtiff/tif_predict.c: pedantic change to add explicit masking
with 0xff before casting to uchar in floating-point horizontal
differencing and accumulation routines.
2015-08-31 15:05:57 +00:00
Even Rouault 45e29cce8d * libtiff/tif_predict.c: fix generation of output with 16 bit
or 32 bit integer, when byte swapping is needed, in
horizontal predictor (#2521). Also fixes decoding when there is
a single pixel to code (unlikely case...) and byte swapping is
involved.
2015-08-31 14:36:10 +00:00
Bob Friesenhahn e9b10efff9 Additional CMake-related files were missing from the distribution tarball. 2015-08-31 00:01:18 +00:00
Bob Friesenhahn adc4f64c30 Make edit of html/Makefile.am its own step so it is not missed. 2015-08-30 21:40:39 +00:00
Bob Friesenhahn 1fea0da266 All the CMakeLists.txt files were missing from the distribution tarball. 2015-08-30 21:26:45 +00:00
Even Rouault 42bfc7006a * libtiff/tif_lzw.c: make nextdata a unsigned type to avoid
undefined behaviour with shifts (gcc -fsanitize=shift)
2015-08-30 21:07:44 +00:00
Even Rouault 6dc8110cee * libtiff/tif_fax3.c, libtiff/tif_lzw.c, libtiff/tif_predict.c:
add explicit masking with 0xff before casting
to unsigned char (make icc -check=conversions happy)

* libtiff/tif_predict.c: operate on unsigned datatypes when
computing/applying differences to avoid undefined behaviour of
signed types (C standard compliance)
2015-08-30 20:49:55 +00:00
Bob Friesenhahn 27e622bff5 * configure.ac: libtiff 4.0.5 released. 2015-08-30 17:37:46 +00:00
Bob Friesenhahn 7663ccc1ec Fix compiler warning about constant value promotion to unsigned long. 2015-08-29 20:39:17 +00:00
Bob Friesenhahn bcf0cb43f4 Add ld-version-script option to cmake build. 2015-08-29 15:30:28 +00:00
Bob Friesenhahn 036132130d Add CMake build instructions. 2015-08-29 15:30:11 +00:00
Bob Friesenhahn 0d55e7db1b Remove strange termination characters from ChangeLog. 2015-08-28 22:34:15 +00:00
Bob Friesenhahn 0841549b8a Use consistent line terminations. 2015-08-28 22:19:26 +00:00
Bob Friesenhahn c38c973b79 Added HTML file describing the changes which will appear in the 4.0.5 release. 2015-08-28 16:04:56 +00:00
Bob Friesenhahn b1f904c7a2 Add some comments in tif_win32.c regarding known issue with WIN64 build. 2015-08-23 20:12:44 +00:00
Bob Friesenhahn 5a17dc99ce For MinGW builds, make sure required CRT is available in order to enable large file support. 2015-08-23 17:49:01 +00:00
Bob Friesenhahn d9bc8472e7 fax2tiff eliminate warning about cast to thandle_t. 2015-08-23 15:40:45 +00:00
Bob Friesenhahn 7ea1078bea rewrite_tag test uses main() with no argument list. 2015-08-23 14:23:00 +00:00
Bob Friesenhahn c65c70205c Fix Cmake build issues caused by Windows large file updates. 2015-08-21 01:59:33 +00:00
Bob Friesenhahn 8ba4a1c894 Support large files under Windows using tif_unix.c and libtiff tools. 2015-08-19 02:31:04 +00:00
Bob Friesenhahn a0e1185771 Fix problem with 'boolean' definition from IJG JPEG 9. 2015-08-16 20:08:21 +00:00
Bob Friesenhahn 4199a92ce7 tif_jpeg.c consistency fixes. 2015-08-15 20:13:07 +00:00
Bob Friesenhahn 01aa45a312 CMakeLists.txt fix for libtiffxx symbol versioning. 2015-08-14 02:26:37 +00:00
Bob Friesenhahn 80dc16cf74 * cmake: Add d suffix to debug libraries with MSVC. Patch #3 of 3
by Roger Leigh posted to tiff list on Wed, 1 Jul 2015 15:58:20
+0100.

* cmake: Add extra warning flags.  Patch #2 of 3 by Roger Leigh
posted to tiff list on Wed, 1 Jul 2015 15:58:20 +0100.

* cmake: Correct snprintf fallback for VS2015.  Patch #1 of 3 by
Roger Leigh posted to tiff list on Wed, 1 Jul 2015 15:58:20 +0100.
2015-07-04 22:09:27 +00:00
Bob Friesenhahn d7db70c929 Add missing file from CMake patch set. 2015-06-25 13:24:52 +00:00
Bob Friesenhahn 5b90af247e * CMakeLists.txt: Add CMake patchset by Roger Leigh as posted to
libtiff mailing list on Mon, 22 Jun 2015 21:21:01 +0100. Several
corrections to ensure that the autotools build still works were
added by me.  I have not yet tested the build using 'cmake' or
MSVC with 'nmake'.
2015-06-25 02:27:58 +00:00
Bob Friesenhahn 0319952da2 * test/Makefile.am: tiff2rgba-quad-tile.jpg.sh depends on the JPEG
library so only execute if JPEG is available.
2015-06-21 19:32:32 +00:00
Bob Friesenhahn f5047249d2 * libtiff 4.0.4 released. 2015-06-21 19:13:03 +00:00
Bob Friesenhahn bdd91bbdf8 * configure.ac: Add a HAVE_FOO Automake conditional for each
add-on library.

* test/Makefile.am (JPEG_DEPENDENT_CHECK_PROG): raw_decode
requires JPEG support to compile.  Use Automake conditional to
only include it when JPEG support is available.
2015-06-21 18:46:29 +00:00
Bob Friesenhahn 37c8b068e1 * html/build.html: Try to improve the nmake-based VC++ build
description.
2015-06-21 18:21:28 +00:00
Bob Friesenhahn 47d8b0eafd * libtiff/tiffconf.vc.h: Build fixes based on testing.
* libtiff/tif_config.vc.h: Build fixes based on testing.
2015-06-21 17:02:12 +00:00
Bob Friesenhahn 848ff19ce2 * libtiff/libtiff.def: TIFFRasterScanline does not exist so remove
export for it.
2015-06-21 14:35:07 +00:00
Bob Friesenhahn d21d2b3057 * libtiff/tif_config.vc.h: Make adjustments to match the new
definitions that configure produces, including for WIN64.  Still
needs to be tested.

'lld' is not assured by the run-time DLLs and so GCC warns.
Add TIFF_SIZE_T and TIFF_SIZE_FORMAT to provide a type definition
and printf format specifier to deal with printing values of
'size_t' type.  In particular, this was necessary for WIN64.
Added a configure test for if the system headers provide 'optarg'
(normal case) and block out the many explicit 'extern' statements
in the utilities.  This was found to be necessary under Windows
when getopt is in a DLL and the symbols are already imported with
dllimport via standard header files.
2015-06-21 01:09:09 +00:00
Bob Friesenhahn 108fe0c660 * configure.ac: For 64-bit MinGW, fix SSIZE_FORMAT formatting
specifier.  64-bit MinGW supports 'long long' but support for
'lld' is not assured by the run-time DLLs.
2015-06-20 20:33:17 +00:00
Bob Friesenhahn b72cc590ae * test/raw_decode.c (XMD_H): Avoid conflicting typedefs for INT32
and boolean in MinGW build due to including jpeglib.h.
2015-06-20 16:52:25 +00:00
Bob Friesenhahn 64a6901448 * test/rewrite_tag.c (main): Fix problem with location of variable
declaration.
2015-06-20 16:33:40 +00:00
Bob Friesenhahn d4470e0648 * libtiff/libtiff.def: Added exports for TIFFGetConfiguredCODECs,
TIFFReadRGBAImageOriented, TIFFSetCompressionScheme,
TIFFSwabArrayOfTriples, TIFFVGetFieldDefaulted, _TIFFCheckRealloc,
TIFFRasterScanline, TIFFSetErrorHandlerExt,
TIFFSetWarningHandlerExt, TIFFNumberOfDirectories,
TIFFCreateCustomDirectory, TIFFCreateEXIFDirectory,
TIFFWriteCustomDirectory, _TIFFRewriteField as recommended by
Roger Leigh and justified by use in libtiff tests, documentation,
and changelog notes.  Also sorted symbol list and removed
duplicate entries.
2015-06-20 16:07:00 +00:00
Bob Friesenhahn d233f2b83c Add v4.0.4 changes summary in preparation for release. 2015-06-18 03:08:06 +00:00
Bob Friesenhahn 0b7487c60d * libtiff/tif_getimage.c: Fix four Coverity issues related to
unintended sign extension.
2015-06-17 03:12:20 +00:00
Bob Friesenhahn ac3107ef45 Hopefully fix four Coverity issues related to unintended sign extension. 2015-06-17 01:34:07 +00:00
Even Rouault 39113ade50 * libtiff/tif_unix.c: fix compilation with MSVC (fix by Jeff McKenna) 2015-06-16 15:33:17 +00:00
Lee Howard a2b4dfc83a Attempt to fix Coverity warning:
CID 1306634:  Integer handling issues  (SIGN_EXTENSION)
    Suspicious implicit sign extension: "img->samplesperpixel" with type
    "unsigned short" (16 bits, unsigned) is promoted in
    "img->col_offset * img->samplesperpixel" to type "int" (32 bits, signed),
    then sign-extended to type "long" (64 bits, signed).  If
    "img->col_offset * img->samplesperpixel" is greater than 0x7FFFFFFF, the
    upper bits of the result will all be 1.
2015-06-15 16:13:46 +00:00
Lee Howard 74d1dfd161 From Vadim Zeitlin on Bugzilla Bug #2510.
The attached patch fixes several harmless but still annoying warnings when
building libtiff...
2015-06-14 23:13:40 +00:00
Lee Howard b5587ac2e4 From Ludolf Holzheid on Bugzilla Bug #2498:
Attached is a patch that adds a configure option to select the file I/O style
on Windows hosts.

It defaults to --enable-win32-io on all windows targets other than Cygwin and
to --disable-win32-io on Cygwin, and thus should be backwards-compatible.

This allows programs using the Unix file I/O style (such as Netpbm's tifftopnm)
to link against libtiff if configured for e.g. MinGW.
2015-06-14 22:55:16 +00:00
Lee Howard 837fbcd07a Update. 2015-06-14 22:16:37 +00:00
Lee Howard 0899543308 Bugzilla Bug #2409: Contribution by Gary Cramblitt and fix confirmed by Charles Stewart
TIFFRGBAImageGet does not properly handle a non-zero col_offset in the
TIFFRGBAImage structure passed as the first argument.  The current (incorrect)
behaviour depends upon the organization of the input tiff file as follows:

1.  If the TIFF is stripped, col_offset is completely ignored.
2.  If the TIFF is tiled, the image result is shifted to the left to the
nearest tile boundary.  For example, if the tilewidth is 100, col_offset is
125, and requested width is 200, you get an image with pixels from 100 up to
300, not 125 up to 325 as expected.

This problem was reported in the mailing list previously as follows, but no
action was taken:

1.  http://www.asmail.be/msg0054834339.html although Andrew is wrong about
tiled images working fine.
2.  http://www.asmail.be/msg0054682793.html
2015-06-14 22:14:10 +00:00
Lee Howard a411152d3f From Marcos H. Woehrmann on Bugzilla Bug #2405. This corrects the shell equality operator. 2015-06-14 21:51:17 +00:00
Lee Howard 76939f073f From Jay Berkenbilt on Bug 2401.
An Ubuntu user noticed that tiffgt was not appropriately calling glFlush(),
which was causing tiffgt to open blank windows in some cases.  I'm not sure
what the cases are, but my system happened to be one that saw blank windows,
and the one-line fix the user provided was sufficient to solve it in my case.
2015-06-14 21:44:17 +00:00
Lee Howard 106157e7d7 change ColorTransform from "0" to "1" following Bugzilla Bug #2150. 2015-06-14 20:54:32 +00:00
Lee Howard fb9cddb6a9 Update for yesterday's commits. 2015-06-14 20:13:39 +00:00
Lee Howard b8335269b6 From Eduardo Robles Elvira:
1. libtiffcrop-fix.patch fixes a small problem in tiffcrop, it seems it
was incorrectly using TIFFSetField instead of CopyField.

And in libtiff-correct-fax-scaling.patch we have some other changes:

2. I had to remove a check in main() that didn't allow maxPageWidth to
be bigger than pageWidth.

3. [ Omitted due to question on universality ]

4. the pagewidth variable was being set as the maxpagewidth instead,
which made all the calculations bad. This made sense when the check in
point 2 was in place, but not anymore. I've modified it so that
pagewidth is set with the specified pagewidth when maxpagewidth is
bigger.

5. The remaining lines of the patch  - in exportMaskedImage() -
basically fix the scaling.
2015-06-13 05:49:18 +00:00
Lee Howard b6346f6672 From Antti S. Lankila on:
http://bugzilla.maptools.org/show_bug.cgi?id=2078#c9

The problem is that TIFF library attempts to write TIFF header as soon as the
tiff2pdf utility initializes the library. Fortunately, the library contains an
I/O abstraction feature, so there are no hardcoded writes to a file descriptor
anywhere. In particular, it appears that the utility's output suppression
feature can be used to suppress the initial write of the header.
2015-06-13 05:32:13 +00:00
Lee Howard a3f0d4471b From Yuriy M. Kaminskiy:
There are a lot of code like this:

	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
	written += t2pWriteFile(output, (tdata_t) buffer, buflen );

in tiff2pdf. This is seriously broken: when formatted string is larger than
buffer, snprintf return value is >= sizeof(buffer) [current standard] or -1
[legacy]. And in case of other errors, snprintf returns -1.
Both would result in reading unallocated memory and possible SIGSEGV (DoS).

I doubt it can be really exploitable (to begin with, in most cases buffer was
large enough and sprintf->snprintf change was pure paranoia, IMO), but /if/ you
decided previous code was not safe and snprintf is necessary, /then/ you MUST
check its return value.
2015-06-13 05:14:57 +00:00
Lee Howard 93f7131c8b Contribution from Andy Cave:
There is a longstanding bug in the LZW decompressor in LibTIFF. It
fails to decode files that contain two consecutive CODE_CLEAR codes.
These are allowed by the LZW spec and the same data sequence is
correctly decoded by Acrobat if you wrap the data in a PDF file.
2015-06-13 05:03:50 +00:00
Bob Friesenhahn 574447a0b0 * libtiff/tif_jpeg.c (JPEGDecode): Split JPEGDecode() into two
clean implementations in order to avoid pre-processor hell.  Only
one of the implementations is used in a given build.
2015-06-10 13:17:41 +00:00
Even Rouault 2d9ec3ee8d * libtiff/tif_jpeg.c: Fix compilation in BITS_IN_JSAMPLE == 12
case
2015-06-08 08:44:37 +00:00
Bob Friesenhahn d5d24e7065 (TIFFWriteScanline): Fix Coverity 715979 "Division or modulo by
zero".
2015-06-07 23:00:23 +00:00
Bob Friesenhahn b989c28d1c (TIFFWriteRawStrip): Fix Coverity 715978 "Division or modulo by
zero".
2015-06-07 22:53:17 +00:00
Bob Friesenhahn d480e894ef (TIFFWriteEncodedTile): Fix Coverity 715976 and 715977 "Division
or modulo by zero".
2015-06-07 22:47:29 +00:00
Bob Friesenhahn 30f96cda9a * libtiff/tif_write.c (TIFFWriteEncodedStrip): Fix Coverity 715975
* libtiff/tif_read.c (TIFFStartTile): Fix Coverity 715973 and
715974 "Division or modulo by zero".
2015-06-07 22:41:07 +00:00
Bob Friesenhahn f39fc2362e * libtiff/tif_read.c (TIFFStartTile): Fix Coverity 715973
"Division or modulo by zero".
2015-06-07 22:35:40 +00:00
Bob Friesenhahn 9904e70d72 * libtiff/tif_dir.c (TIFFNumberOfDirectories): Quiet Coverity
1134470 "Logically dead code" by making the roll-over check
explicit.
2015-05-31 23:11:43 +00:00
Bob Friesenhahn 7d7b3db270 (LogLuvEncodeTile): Fix Coverity 991241 "Division or modulo by
zero".
2015-05-31 21:24:44 +00:00
Bob Friesenhahn a1beead1ef (LogLuvEncodeStrip): Fix Coverity 991240 "Division or modulo by
zero".
2015-05-31 21:23:23 +00:00
Bob Friesenhahn 2b5c49d191 (LogLuvDecodeStrip): Fix Coverity 991239 "Division or modulo by
zero".
2015-05-31 21:21:22 +00:00
Bob Friesenhahn e69b354c3e * libtiff/tif_luv.c (LogLuvDecodeTile): Fix Coverity 991227
"Division or modulo by zero".
2015-05-31 21:19:07 +00:00
Bob Friesenhahn cf2cbabef1 (TIFFReadDirEntrySlong8Array): Fix Coverity 298629 "Logically dead
code"
2015-05-31 21:09:33 +00:00
Bob Friesenhahn 6132637692 (TIFFReadDirEntryFloatArray): Fix Coverity 298627 "Logically dead
code".
(TIFFReadDirEntryIfd8Array): Fix Coverity 298628 "Logically dead
code".
2015-05-31 21:07:41 +00:00
Bob Friesenhahn b3332a8f25 (TIFFReadDirEntryFloatArray): Fix 298627 "Logically dead code". 2015-05-31 21:05:22 +00:00
Bob Friesenhahn 0f01705a85 * libtiff/tif_dirread.c (TIFFReadDirEntryDoubleArray): Fix
Coverity 298626 "Logically dead code".
2015-05-31 21:01:37 +00:00
Bob Friesenhahn ffe4f83100 * libtiff/tif_dir.c (TIFFNumberOfDirectories): Don't depend on ++
operator precedenc in evaluation.  Might quench Coverity 1134470
"Logically dead code".
2015-05-31 20:57:56 +00:00
Bob Friesenhahn 666ca03c65 * libtiff/tif_jpeg.c (JPEGDecode): Fix Coverity 602597 "Operands
don't affect result".  This change uses ifdefs to include
applicable code based on properties of libjpeg.  Still needs to be
re-tested with 12-bit "6b" and "MK1".
2015-05-31 15:44:40 +00:00
Bob Friesenhahn 2223910e23 * libtiff/tif_dirwrite.c (_TIFFRewriteField): Fix Coverity 1024310
"Resource leak".

* libtiff/tif_ojpeg.c (OJPEGReadHeaderInfoSecStreamDht): Fix
Coverity 601720 "Resource leak".
2015-05-31 00:38:46 +00:00
Bob Friesenhahn 86f9adb7fd * libtiff/tif_jpeg.c (JPEGCleanup): Fix Coverity 298624
"Dereference before null check".
2015-05-30 23:52:24 +00:00
Bob Friesenhahn d875609a32 * libtiff/tif_ojpeg.c (OJPEGReadBufferFill): Fix Coverity 603400
"Missing break in switch".
2015-05-30 23:49:28 +00:00
Bob Friesenhahn 9626bb6db9 * contrib/addtiffo/tif_overview.c (TIFF_DownSample): Check buffer
size calculation for overflow.
2015-05-30 21:13:39 +00:00
Bob Friesenhahn 2b221734c6 * contrib/addtiffo/addtiffo.c (main): Possibly address Coverity
1024226 "Untrusted value as argument".
2015-05-30 20:30:27 +00:00
Bob Friesenhahn 478e51124b * tools/gif2tiff.c (readgifimage): Fix Coverity 1024222 "Untrusted
value as argument".
(checksignature): Fix Coverity 1024894 "Ignoring number of bytes
read".
(readextension): Fix Coverity 1024893 "Ignoring number of bytes
read".
(readgifimage): Fix Coverity 1024890 "Ignoring number of bytes
read".
(readraster): Fix Coverity 1024891 "Ignoring number of bytes
read".
(readgifimage): Fix Coverity 1024892 "Ignoring number of bytes
read".
2015-05-30 20:15:59 +00:00
Bob Friesenhahn 5d43ae368e * tools/tiff2pdf.c (t2p_readwrite_pdf_image): Fix Coverity 1024181
"Structurally dead code".
2015-05-30 17:07:53 +00:00
Bob Friesenhahn e18809068d * tools/raw2tiff.c (main): Fix Coverity 1024887 "Unchecked return
value from library".
(guessSize): Fix Coverity 1024888 "Unchecked return value from
library".
(guessSize): Fix Coverity 1214162 "Ignoring number of bytes read".
(guessSize): Fix Coverity 1024889 "Unchecked return value from
library".
2015-05-30 16:13:29 +00:00
Bob Friesenhahn cf204cbace * tools/tiff2pdf.c (t2p_readwrite_pdf_image): Fix Coverity 298621
"Resource leak".
(t2p_readwrite_pdf_image): Fix Coverity 1024181 "Structurally dead
code".
(t2p_write_pdf): Fix Coverity 1227690 "Unused value".
2015-05-30 15:33:54 +00:00
Bob Friesenhahn aea225d02e * contrib/iptcutil/iptcutil.c (formatIPTC): Fix Coverity 1024468
"Infinite loop".
(formatIPTC): Fix Coverity 1024727 "Truncated stdio return value".
(formatIPTC): Fix Coverity 1214240 "Untrusted loop bound".
2015-05-29 13:43:47 +00:00
Bob Friesenhahn f197c2dd60 * contrib/addtiffo/tif_ovrcache.c (TIFFCreateOvrCache): Fix
Coverity 298615 "Resource leak".
(TIFFGetOvrBlock): Fix Coverity 1024649 "Unintended sign
extension".
2015-05-29 03:08:19 +00:00
Bob Friesenhahn b22be0db67 * tools/bmp2tiff.c (main): Fix Coverity 1024225 "Untrusted value
as argument".
(main): Fix Coverity 1024678 "Unchecked return value from
library".
(main): Fix Coverity 1024679 "Unchecked return value from
library".
(main): Fix Coverity 1214160 "Ignoring number of bytes read".
2015-05-29 02:37:56 +00:00
Bob Friesenhahn 5e6fbd86d2 * contrib/addtiffo/tif_ovrcache.c (TIFFCreateOvrCache): Fix
Coverity 298615 "Resource leak".
2015-05-28 13:26:03 +00:00
Bob Friesenhahn 8942af3dfe * tools/tiffcp.c: Fix Coverity 1024306, 1024307, 1024308, 1024309
"Resource leak".
2015-05-28 13:17:35 +00:00
Bob Friesenhahn defff15535 * tools/tiffsplit.c (cpTiles): Fix Coverity 1024304 "Resource
leak".
(cpStrips): Fix Coverity 1024305 "Resource leak".
2015-05-28 13:10:26 +00:00
Bob Friesenhahn 547c3ecfcf (main): Quiet Coverity 1024223 "Untrusted value as argument". 2015-05-28 04:07:30 +00:00
Bob Friesenhahn f795d89909 (main): Fix Coverity 1301206: "Integer handling issues (BAD_SHIFT)". 2015-05-28 03:52:00 +00:00
Bob Friesenhahn 6a41c7a28f * tools/ras2tiff.c: Fix Sun Raster header definition to be safe
for 64-bit systems.  Add some header validations.  Should fix many
Coverity issues.
2015-05-28 03:30:41 +00:00
Bob Friesenhahn a80995a42b (get_histogram): Quiet Coverity 1024386 "Out-of-bounds read".
This was a benign mis-diagnosis but added code to enforce against
buffer overflow.
2015-05-28 03:08:18 +00:00
Bob Friesenhahn 73dcb5ee75 * tools/tiffmedian.c (GetInputLine): Fix Coverity 1024795 "Nesting
level does not match indentation".
2015-05-28 02:25:11 +00:00
Bob Friesenhahn c05bbbe6e8 (loadImage): Fix Coverity 1299740 "Out-of-bounds write". 2015-05-28 02:19:16 +00:00
Bob Friesenhahn 022cd04c80 (loadImage): Fix Coverity 1299741 "Dereference before null check". 2015-05-28 02:16:08 +00:00
Bob Friesenhahn 4d8fac3be8 (writeCroppedImage): Fix Coverity 1024797 "Nesting level does not
match indentation".
2015-05-28 02:11:00 +00:00
Bob Friesenhahn e6aabe4992 (writeSingleSection): Fix Coverity 1024796 "Nesting level does not
match indentation".
2015-05-28 02:07:59 +00:00
Bob Friesenhahn 0ba4515b24 (readContigTilesIntoBuffer): Fix Coverity 1024586 "Logically dead
code".
2015-05-28 02:02:09 +00:00
Bob Friesenhahn 7a8431b414 (readContigStripsIntoBuffer): Fix Coverity 1024545 "Division or
modulo by zero".
2015-05-28 01:59:10 +00:00
Bob Friesenhahn 1752529e75 * tools/tiffcrop.c (ROTATE_ANY): Fix Coverity 1294542 "Logical
vs. bitwise operator".
2015-05-28 01:50:20 +00:00
Even Rouault 7bed6738f2 * tools/tiffdither.c: check memory allocations to avoid writing to
NULL pointer. Also check multiplication overflow. Fixes #2501,
CVE-2014-8128. Derived from patch by Petr Gajdos.
2015-03-02 16:16:38 +00:00
Even Rouault cb66df4e65 * add html/v4.0.4beta.html under version control
* HOWTO-RELEASE: write that cvs add html/vX.X.html must be used
2015-01-26 15:14:45 +00:00
Even Rouault a1caf14ce4 * libtiff 4.0.4beta released 2015-01-26 12:24:11 +00:00
Even Rouault a17a6e5ecd * automake: updated to 1.15
* libtool: updated to 2.4.5
2015-01-26 10:29:40 +00:00
Even Rouault 45922132cf * tools/tiff2pdf.c: Fix two crashes (oCERT-2014-013) 2015-01-22 09:58:49 +00:00
Frank Warmerdam 09dfa00849 remove note about requiring approval to join tiff list 2015-01-05 19:49:37 +00:00
Olivier Paquet 79676ae61c * tools/tiff2pdf.c: Fixed unsigned integer addition overflow detection. 2015-01-05 19:03:11 +00:00
Even Rouault 7f884b953c * libtiff/tif_dirread.c: in TIFFCheckDirOffset(), avoid uint16 overflow
when reading more than 65535 directories, and effectively error out when
reaching that limit.
2015-01-03 18:03:40 +00:00
Even Rouault 376ee1fc20 * 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
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
JPEGSetupEncode(), before calling jpeg_set_defaults(), as specified by
libjpeg API documentation, so as to be compatible with mozjpeg library.
Note: the default settings of mozjpeg will produce progressive scans, which
is forbidden by the TechNote.
2014-12-30 16:37:22 +00:00
Even Rouault f828693705 * libtiff/tif_getimage.c: move test on vertical value of YCbCr subsampling.
to avoid buffer leak (fix previous fix, found by Coverity scan)
2014-12-29 18:28:46 +00:00
Bob Friesenhahn 70239ee78e Remove mention of freshmeat since the site is frozen. 2014-12-29 15:39:02 +00:00
Bob Friesenhahn 429b3fdc90 * Update bundled libtool to 2.4.4 release. 2014-12-29 15:34:22 +00:00
Even Rouault 5b79c1f364 * libtiff/tif_next.c: add new tests to check that we don't read outside of
the compressed input stream buffer.

* libtiff/tif_getimage.c: in OJPEG case, fix checks on strile width/height
2014-12-29 12:09:11 +00:00
Even Rouault 5b06ac3f28 * libtiff/tif_dir.c: in TIFFDefaultDirectory(), reset any already existing
extented tags installed by user code through the extender mechaninm before
calling the extender callback (GDAL #5054)
2014-12-27 15:20:42 +00:00
Bob Friesenhahn fdfa1a026f * tools/tiffcrop.c: Fix warnings about variables set but not used. 2014-12-26 16:32:31 +00:00
Bob Friesenhahn a7ced11ff1 * contrib/iptcutil/iptcutil.c: Fix warnings about variables set
but not used.
2014-12-26 16:10:08 +00:00
Bob Friesenhahn 3b48ce4c7b * tools/tiffgt.c: Fix warnings about unused parameters. 2014-12-26 16:06:41 +00:00
Bob Friesenhahn e501767856 * libtiff/tif_stream.cxx: Fix warnings about unused parameters. 2014-12-26 16:01:04 +00:00
Even Rouault 5ecaadc951 * libtiff/tif_getimage.c, libtiff/tif_ojpeg.c, libtiff/tif_zip.c: fix
various typos found by Debian lintian tool (GDAL #5756)
2014-12-25 18:29:11 +00:00
Even Rouault 65577375d4 * libtiff/tif_getimage.c: avoid divide by zero on invalid YCbCr subsampling.
http://bugzilla.maptools.org/show_bug.cgi?id=2235
2014-12-24 16:57:18 +00:00
Even Rouault 34d71374cc * tools/tiff2pdf.c: fix buffer overflow on some YCbCr JPEG compressed images.
http://bugzilla.maptools.org/show_bug.cgi?id=2445
2014-12-24 16:32:28 +00:00
Even Rouault a42442d21f * tools/tiff2pdf.c: fix buffer overflow on YCbCr JPEG compressed image.
Derived from patch by Petr Gajdos,
http://bugzilla.maptools.org/show_bug.cgi?id=2443
2014-12-24 15:38:11 +00:00
Even Rouault 59e876aeeb * libtiff/tif_dirread.c: In EstimateStripByteCounts(), check return code
of _TIFFFillStriles(). This solves crashing bug on corrupted
images generated by afl.
2014-12-23 11:06:54 +00:00
Even Rouault ed7dd273d5 * libtiff/tif_read.c: fix several invalid comparisons of a uint64 value with
<= 0 by casting it to int64 first. This solves crashing bug on corrupted
images generated by afl.
2014-12-23 10:15:35 +00:00
Bob Friesenhahn 53c7c58dd7 * tools/tiffdump.c: Guard against arithmetic overflow when
calculating allocation buffer sizes.
2014-12-22 02:52:38 +00:00
Even Rouault 5db18217c3 * tools/tiff2bw.c: when Photometric=RGB, the utility only works if
SamplesPerPixel = 3. Enforce that
http://bugzilla.maptools.org/show_bug.cgi?id=2485 (CVE-2014-8127)
2014-12-21 20:58:29 +00:00
Even Rouault aaf52fa411 * tools/pal2rgb.c, tools/thumbnail.c: fix crash by disabling TIFFTAG_INKNAMES
copying. The right fix would be to properly copy it, but not worth the burden
for those esoteric utilities.
http://bugzilla.maptools.org/show_bug.cgi?id=2484 (CVE-2014-8127)
2014-12-21 20:04:31 +00:00
Even Rouault 47647443c1 * tools/thumbnail.c: fix out-of-buffer write
http://bugzilla.maptools.org/show_bug.cgi?id=2489 (CVE-2014-8128)
2014-12-21 19:53:59 +00:00
Even Rouault 1246f97138 * tools/thumbnail.c, tools/tiffcmp.c: only read/write TIFFTAG_GROUP3OPTIONS
or TIFFTAG_GROUP4OPTIONS if compression is COMPRESSION_CCITTFAX3 or
COMPRESSION_CCITTFAX4
http://bugzilla.maptools.org/show_bug.cgi?id=2493 (CVE-2014-8128)
2014-12-21 18:52:42 +00:00
Even Rouault 7d3b9da6cb * libtiff/tif_next.c: check that BitsPerSample = 2. Fixes
http://bugzilla.maptools.org/show_bug.cgi?id=2487 (CVE-2014-8129)
2014-12-21 18:07:48 +00:00
Even Rouault 29f531aeec * tools/tiff2pdf.c: check return code of TIFFGetField() when reading
TIFFTAG_SAMPLESPERPIXEL
2014-12-21 17:36:36 +00:00
Even Rouault 2dae28a91b * tools/tiffcp.c: fix crash when converting YCbCr JPEG-compressed to none.
Based on patch by Tomasz Buchert (http://bugzilla.maptools.org/show_bug.cgi?id=2480)
Description: fix for Debian bug #741451
tiffcp crashes when converting JPEG-encoded TIFF to a different
encoding (like none or lzw). For example this will probably fail:
tiffcp -c none jpeg_encoded_file.tif output.tif
The reason is that when the input file contains JPEG data,
the tiffcp code forces conversion to RGB space. However,
the output normally inherits YCbCr subsampling parameters
from the input, which leads to a smaller working buffer
than necessary. The buffer is subsequently overrun inside
cpStripToTile() (called from writeBufferToContigTiles).
Note that the resulting TIFF file would be scrambled even
if tiffcp wouldn't crash, since the output file would contain
RGB data intepreted as subsampled YCbCr values.
This patch fixes the problem by forcing RGB space on the output
TIF if the input is JPEG-encoded and output is *not* JPEG-encoded.
Author: Tomasz Buchert <tomasz.buchert@inria.fr>
2014-12-21 16:28:37 +00:00
Even Rouault 89bef1935b Fix various crasher bugs on fuzzed images.
* libtiff/tif_dir.c: TIFFSetField(): refuse to set negative values for
TIFFTAG_XRESOLUTION and TIFFTAG_YRESOLUTION that cause asserts when writing
the directory
* libtiff/tif_dirread.c: TIFFReadDirectory(): refuse to read ColorMap or
TransferFunction if BitsPerSample has not yet been read, otherwise reading
it later will cause user code to crash if BitsPerSample > 1
* libtiff/tif_getimage.c: TIFFRGBAImageOK(): return FALSE if LOGLUV with
SamplesPerPixel != 3, or if CIELAB with SamplesPerPixel != 3 or BitsPerSample != 8
* libtiff/tif_next.c: in the "run mode", use tilewidth for tiled images
instead of imagewidth to avoid crash
* tools/bmp2tiff.c: fix crash due to int overflow related to input BMP dimensions
* tools/tiff2pdf.c: fix crash due to invalid tile count (should likely be checked by
libtiff too). Detect invalid settings of BitsPerSample/SamplesPerPixel for CIELAB / ITULAB
* tools/tiffcrop.c: fix crash due to invalid TileWidth/TileHeight
* tools/tiffdump.c: fix crash due to overflow of entry count.
2014-12-21 15:15:31 +00:00
Even Rouault 59d4cb0b11 libtiff/tif_jpeg.c: Fix regression introduced on 2010-05-07 that caused all tiles/strips to include quantization tables even when the jpegtablesmode had the JPEGTABLESMODE_QUANT bit set. Also add explicit removal of Huffman tables when jpegtablesmode has the JPEGTABLESMODE_HUFF bit set, which avoids Huffman tables to be emitted in the first tile/strip (only useful in update scenarios. create-only was fine) 2014-12-15 15:40:06 +00:00
Bob Friesenhahn 570fd679f6 * tools/tiff2pdf.c: Assure that memory size calculations for
_TIFFmalloc() do not overflow the range of tmsize_t.
2014-12-10 02:53:30 +00:00
Even Rouault 3f2b81f2c2 tools/thumbnail.c, tools/tiffcrop.c: fix heap read over-run found with Valgrind and Address Sanitizer on test suite 2014-12-07 22:33:06 +00:00
Bob Friesenhahn 02567e23b9 * tools/tiff2pdf.c (t2p_read_tiff_init): TIFFTAG_TRANSFERFUNCTION
tag can return one channel, with the other two channels set to
NULL.  The tiff2pdf code was expecting that other two channels
were duplicate pointers in the case where there is only one
channel.  Detect this condition in order to avoid a crash, and
presumably perform correctly with just one channel.
2014-12-07 19:32:25 +00:00
Bob Friesenhahn 12f78c491f Update the valgrind memcheck recipe for the test suite. 2014-12-06 20:36:14 +00:00
Bob Friesenhahn 3c92b0efc1 * tools/tiffdump.c: Fix double-free bug. 2014-12-06 15:58:40 +00:00
Even Rouault 8f38bc8e2d * libtiff/tif_config.vc.h: no longer use "#define snprintf _snprintf" with
Visual Studio 2015 aka VC 14 aka MSVC 1900
2014-11-27 17:22:10 +00:00
Even Rouault abea4b2b04 * libtiff/tif_lzw.c: prevent potential null dereference of
sp->dec_codetab in LZWPreDecode (bug #2459)

* libtiff/tif_read.c: in TIFFReadBufferSetup(), avoid passing -1 size
to TIFFmalloc() if passed user buffer size is 0 (bug #2459)

* libtiff/tif_ojpeg.c: make Coverity happier (not a bug, #2459)

* libtiff/tif_dir.c: in _TIFFVGetField() and _TIFFVSetField(), make
Coverity happier (not a bug, #2459)

* libtiff/tif_dirread.c: in TIFFFetchNormalTag(), make Coverity happier
(not a bug, #2459)

* tools/tiff2pdf.c: close PDF file (bug #2479)

* tools/fax2ps.c: check malloc()/realloc() result (bug #2470)

* tools/tiffdump.c: detect cycle in TIFF directory chaining (bug #2463)
and avoid passing a NULL pointer to read() if seek() failed before (bug #2459)

* tools/tiffcrop.c: fix segfault if bad value passed to -Z option
(bug #2459) and add missing va_end in dump_info (#2459)

* tools/gif2tif.c: apply patch for CVE-2013-4243 (#2451)
2014-11-20 16:47:21 +00:00
Even Rouault 7af4d827dd * libtiff/tif_jpeg.c: fix segfault in JPEGFixupTagsSubsampling() on
corrupted image where tif->tif_dir.td_stripoffset == NULL (bug #2471)
2014-11-20 14:34:51 +00:00
Even Rouault d1be5cb7ad * automake: updated to 1.14.1
* libtool: updated to 2.4.3
* HOWTO-RELEASE: small update about autotools building order
2014-11-20 14:28:16 +00:00
Even Rouault e6552f5de1 Add myself to COMMITTERS 2014-11-19 22:26:42 +00:00
Olivier Paquet e4f269ed3f * tools/tiff2pdf.c: Preserve input file directory order when pages
are tagged with the same page number.
2014-10-20 17:52:05 +00:00
Bob Friesenhahn 9885124f1e * libtiff/tif_dirread.c (TIFFReadDirEntryOutputErr): Incorrect
count for tag should be a warning rather than an error since
errors terminate processing.
2014-08-31 20:32:53 +00:00
Bob Friesenhahn f6fc518396 * tools/tiff2rgba.c (]): Fixed tiff2rgba usage message in that zip
was wrongly described.  Fix suggested by Miguel Medalha.
2014-06-08 03:37:01 +00:00
Bob Friesenhahn 3d49c58cf8 Clarify that patch was by Steve Underwood but forwarded to me by Lee Howard 2014-05-07 13:31:11 +00:00
Bob Friesenhahn 0056d44683 Consistently indent tiffFields. 2014-05-07 01:58:46 +00:00
Bob Friesenhahn f9f939b5e6 * libtiff/tif_dirinfo.c (TIFFField) : Fix data type for
TIFFTAG_GLOBALPARAMETERSIFD tag.  Patch by Lee Howard.
2014-05-07 01:54:29 +00:00
Frank Warmerdam 3363eda09d Actually apply TIFF/EP tags I thought I had done earlier (bug #2457) 2014-04-02 17:23:06 +00:00
Bob Friesenhahn 65f22eacee Check return status from TIFFWriteScanline() correctly in test programs. 2013-12-17 14:41:57 +00:00
Frank Warmerdam de103a76f8 fix last fix to TIFFNumberOfDirectories() 2013-11-30 20:24:36 +00:00
Frank Warmerdam e2f7c06cc5 Error out on directory counting overflow. 2013-10-21 18:23:48 +00:00
Lee Howard e289d76bce Resolves a couple of buffer overflow issues pointed out by Pedro Ribeiro (pedrib@gmail.com). 2013-09-20 16:09:01 +00:00
Lee Howard 7b8ee1facf From: David Ryskalczyk <d235j.1@gmail.com>
Date: Thu, 18 Jul 2013 14:36:47 -0400

Here's a patch to correct an issue with creating G4-compressed PDFs.

The issue is caused by == being used to compare bitfields when only
one bit is intended to be compared. Some of the tiffs I have had both
T2P_CS_ICCBASED and T2P_CS_BILEVEL set; therefore, the current code
will fail, producing certain pages that are inverted.

The patch follows, and is also attached.

--David
2013-09-20 15:35:37 +00:00
Bob Friesenhahn f4203fa738 * libtiff/tif_dir.c (TIFFAdvanceDirectory): If nextdir is found to
be defective, then set it to zero before returning error in order
to terminate processing of truncated TIFF.  Issue found and fix
suggested by Richard Nolde.

* tools/gif2tiff.c: fix possible OOB write (#2452, CVE-2013-4244)
* tools/tiff2pdf.c: terminate after failure of allocating
* tools/tiffinfo.c: Default various values fetched with
2013-09-13 02:34:50 +00:00
Frank Warmerdam 163627448a fix possible OOB write in gif2tiff.c 2013-08-14 13:59:16 +00:00
Frank Warmerdam 44650c28f1 make more resistent to corrupt/hostile input files (#2450, CVE-2013-4231) 2013-08-14 05:18:53 +00:00
Frank Warmerdam 67d92d90f8 ensure return after memory allocation failure (#2449, CVS-2013-4232) 2013-08-14 05:11:36 +00:00
Frank Warmerdam 4e7465a311 initialize TIFFGetField() fetched values in tiffinfo.c 2013-07-10 00:44:22 +00:00
Tom Lane 96ceea8c8a Rewrite t2p_process_jpeg_strip(), to fix CVE-2013-1960. 2013-05-02 14:54:08 +00:00
Tom Lane b6d66f9f30 Replace sprintf with snprintf, to fix CVE-2013-1961. 2013-05-02 14:44:29 +00:00
Bob Friesenhahn e90c73e611 * configure.ac: Applied patch by Brad Smith to improve pkg-config
static linking by adding -lm to Libs.private when needed.
2013-03-29 16:50:11 +00:00
Tom Lane feb6bd9f1d Sync tool usage printouts and man pages with reality. 2013-03-06 03:35:09 +00:00
Bob Friesenhahn c9aee05b27 Strip extraneous trailing white-space from ChangeLog 2013-01-26 02:35:44 +00:00
Bob Friesenhahn c204ef2a2f * tools/tiff2ps.c:Fix bug in auto rotate option code. Once a
rotation angle was set by the auto rotate check, it was retained
for all pages that followed instead of being retested for each
page.  Patch by Richard Nolde.
2013-01-26 02:24:05 +00:00
Frank Warmerdam 859bdf7523 avoid type cast warnings 2013-01-18 21:57:12 +00:00
Frank Warmerdam f6bca3f994 avoid warnings on MSVC (bug 2427) 2013-01-18 21:37:13 +00:00
Tom Lane 46618e9d97 Fix raw_decode test to pass with more versions of libjpeg 2012-12-20 18:08:07 +00:00
Tom Lane f752daaaab Fix TIFF_VARIABLE/TIFF_VARIABLE2 confusion in TIFFPrintDirectory. 2012-12-12 22:50:18 +00:00
Tom Lane 800527edd2 Improve previous patch for CVE-2012-4564. 2012-12-10 18:19:11 +00:00
Tom Lane bff7f45716 Detect integer overflow in addition when computing buffer size. 2012-12-10 17:27:13 +00:00
Bob Friesenhahn 74295b7487 * tools/tiffset.c: tiffset now supports a -u option to unset a
tag.  Patch by Zach Baker. See
http://bugzilla.maptools.org/show_bug.cgi?id=2419
2012-12-04 03:02:37 +00:00
Bob Friesenhahn 281ba91d09 * automake: Update Automake to 1.12.5 release. 2012-11-18 18:08:31 +00:00
Bob Friesenhahn b47e5f1a73 * libtiff/tif_{unix,vms,win32}.c (_TIFFmalloc): ANSI C does not
require malloc() to return NULL pointer if requested allocation
size is zero.  Assure that _TIFFmalloc does.
2012-11-18 17:51:52 +00:00
Frank Warmerdam 37671b36b9 fix zero size buffer exploit (CVE-2012-4564) in ppm2tiff 2012-11-02 05:13:24 +00:00
Frank Warmerdam 98fc7e047a avoid crash on null zip error messages 2012-10-18 17:34:59 +00:00
Bob Friesenhahn 21a904d74c * libtiff 4.0.3 released. 2012-09-22 16:12:43 +00:00
Bob Friesenhahn f458c10308 * Makefile.am: Update to Automake 1.12.4 2012-09-20 13:50:27 +00:00
Bob Friesenhahn ec5ce9c2b3 * Makefile.in: Update to Automake 1.12.3 2012-08-19 17:00:46 +00:00
Bob Friesenhahn 7d38024b8d * libtiff{tiff.h, tif_print.c, tif_dirinfo.c, tif_dirread.c}: Add
some TIFF/FX support in libtiff.  Add the tag definitions to
tiff.h.  Add the related TIFF field definitions to tif_dirinfo.c,
and also fixes an error in a comment.  Adds the photometric values
to tif_print.c, and fixes a bug.  These changes are by Steve
Underwood.

* libtiff/tif_write.c: Fix bug rewriting image tiles in a
2012-08-19 16:56:32 +00:00
Frank Warmerdam d85a64b6d6 fix bug rewriting image tiles in a compressed file (gdal #4771) 2012-08-13 22:10:17 +00:00
Frank Warmerdam 76cb1b57bf warn when ignoring some corrupt tags 2012-08-02 22:04:41 +00:00
Tom Lane 2d7f2b7452 Push preliminary versions of new man page html files. 2012-07-29 16:16:04 +00:00
Tom Lane 45efaab395 Add new man pages to html/man/Makefile.am; also bmp2tiff.1.html. 2012-07-29 16:08:10 +00:00
Tom Lane 84595b4fd7 Add accessor functions for the opaque type TIFFField. 2012-07-29 15:45:29 +00:00
Tom Lane 73dec72e8a Fix a couple more tiff2pdf bugs. 2012-07-19 15:43:41 +00:00
Tom Lane 7e000dd360 In tiff2pdf.c, fail when TIFFSetDirectory() fails. 2012-07-18 15:07:55 +00:00
Bob Friesenhahn 06dac7192d Eliminate GCC 4.7.0 gripe about potential use of uninitialized data. 2012-07-07 14:43:17 +00:00
Bob Friesenhahn c3e3173779 Used signed overflow checks rather than unsigned integer overflow checks since C language does not define signed overflow behavior 2012-07-06 23:24:46 +00:00
Bob Friesenhahn 39c8d4b160 Comment out set but not used variables which annoy GCC 4.7 2012-07-06 19:18:31 +00:00
Bob Friesenhahn f8180e5811 Fix warning about comparing signed and unsigned type. 2012-07-06 18:48:04 +00:00
Bob Friesenhahn a5681ca6f0 * test/raw_decode.c (main): Test fixes to work with IJG JPEG 7+.
IJG JPEG 7+ uses a different upsampling algorithm which produces
different numeric results.

* libtiff/tif_jpeg.c (JPEGPreDecode): Patch from Even Rouault to
work with IJG JPEG 7+.
2012-07-06 17:05:16 +00:00
Bob Friesenhahn 22c4ecd4a8 test/raw_decode.c: Add changes so that test can run with build directory outside of source directory. 2012-07-04 19:45:32 +00:00
Tom Lane 8ed155dcc1 Fix raw_decode test so it works on big-endian machines.
The test case was ignoring the documented API for TIFFReadRGBATile,
namely that the output pixels are uint32's and the macros TIFFGetR etc
should be used to fetch the pixel components.

Original patch by Marcus Meissner, somewhat cleaned up by me.
2012-07-03 20:48:11 +00:00
Frank Warmerdam 8eeed8edf4 Fix handling when writing RGBA jpeg compressed imagery (gdal #4732) 2012-07-03 00:57:50 +00:00
Frank Warmerdam ea64110a44 fix fax3 runs initialization sizing 2012-06-21 02:01:31 +00:00
Frank Warmerdam b48c0a0604 make tbuf large enough for one stride past the end 2012-06-21 01:01:53 +00:00
Frank Warmerdam 713699493b Removed a TODO warning for the non-literal case as I think the "cc"
check is already done at the top of the loop.
2012-06-20 05:25:33 +00:00
Frank Warmerdam c25b5e77d6 avoid read past end of source data buffer with corrupt data 2012-06-20 05:22:51 +00:00
Frank Warmerdam 871d1067f3 add _TIFFCheckMalloc 2012-06-16 17:07:53 +00:00
Frank Warmerdam ee51ab00b3 ignore various windows intermediate files 2012-06-16 17:05:37 +00:00
Frank Warmerdam 111baa289b updated for 4.0.2 release 2012-06-16 00:19:35 +00:00
Frank Warmerdam fb4124be74 add new test scripts 2012-06-15 23:36:41 +00:00
Frank Warmerdam 2471d6f4ab new 2012-06-15 23:10:14 +00:00
Frank Warmerdam 00169dfd4f restore based on standard automake tool versions 2012-06-15 23:09:38 +00:00
Frank Warmerdam 0055471655 avoid some clang warnings 2012-06-15 21:51:54 +00:00
Tom Lane f5077ed7ed Fix CVE-2012-2113 2012-06-15 21:44:31 +00:00
Frank Warmerdam 8a0e7ec48b declare variables before any action statements for backwards compiler compat. 2012-06-14 20:32:53 +00:00
Frank Warmerdam fc0de6d702 unlink temp file when successful. 2012-06-13 04:38:55 +00:00
Frank Warmerdam c805f9176d update 2012-06-13 03:12:53 +00:00
Frank Warmerdam 4d26dcb281 be careful about printing corrupt inknames fields 2012-06-13 01:08:51 +00:00
Frank Warmerdam da49b1d230 ensure fax3/4 runs array is initialized 2012-06-13 00:27:20 +00:00
Frank Warmerdam 0615e2a2b6 avoid pretty printing values without proper rawdata 2012-06-08 05:15:21 +00:00
Frank Warmerdam 2adf098410 improve handling of PAGENUMBER, HALFTONEHINTS, YCBCRSUBSAMPLING and DOTRANGE 2012-06-06 06:06:20 +00:00
Frank Warmerdam b246f148ff nicer way to avoid reading data for non-image directories 2012-06-06 06:05:29 +00:00
Frank Warmerdam 7e632eb41c treat illegal ycbcrsubsampling as runtime error, not assertion 2012-06-06 05:33:55 +00:00
Frank Warmerdam 03cfd4f542 avoid memory leak 2012-06-06 05:26:37 +00:00
Frank Warmerdam a14505cf0a add custom directory read/write testing 2012-06-06 04:58:29 +00:00
Frank Warmerdam 783c1ba4ce add TIFFCreate{Custom,EXIF}Directory() functions 2012-06-06 04:58:00 +00:00
Frank Warmerdam 0725eccdc2 avoid special handling of PAGENUMBER, HALFTONEHINTS, YCBCRSUBSAMPLING and DOTRANGE in non-image directories 2012-06-06 04:56:01 +00:00
Frank Warmerdam 9bb720cd44 remove unused variable in CMKY code 2012-06-06 00:17:49 +00:00
Frank Warmerdam 672946cf9b avoid adjusting h/v_sampling in JPEGPreDecode() 2012-06-05 03:24:30 +00:00
Frank Warmerdam b3dadc7ff3 avoid reading imagery with -D in EXIF directories 2012-06-01 23:22:53 +00:00
Frank Warmerdam 86a9d53d9e Added _SEPARATED CMKY support (#2379) 2012-06-01 22:22:04 +00:00
Frank Warmerdam bd0ea9c546 fix stdarg mispelling (#2322) 2012-06-01 22:02:44 +00:00
Frank Warmerdam ecf4fed966 use strerror() for open error messages on unix (#2341) 2012-06-01 21:40:58 +00:00
Frank Warmerdam f8fcbec59d fix serious issues with JPEGDecodeRaw() (bug 2386) Also some whitespace reformatting 2012-06-01 21:08:51 +00:00
Frank Warmerdam 7f67da5de1 add jpeg in tiff decode testing 2012-06-01 21:04:22 +00:00
Tom Lane 1358a916eb Add self to committers list. 2012-06-01 18:43:21 +00:00
Frank Warmerdam 52e121504b fix buffer overrun in JPEGDecodeRaw() with mixed up sampling 2012-06-01 01:30:55 +00:00
Frank Warmerdam 9184521f3f make sure tif_rawdatasize is zeroed when tif_rawdata is freed/cleared 2012-06-01 00:55:09 +00:00
Frank Warmerdam 0dd52ae391 Add alpha grayscale image support to TIFFReadRGBAImage 2012-06-01 00:38:39 +00:00
Frank Warmerdam 79a2449b27 fix handling of tags in custom directories which happen to match standard tags but are defined differently in the custom dir 2012-05-30 04:58:13 +00:00
Frank Warmerdam 047f4120df avoid inappropriate use of tif_rawdata when it is a pointer into mmaped file 2012-05-30 01:50:17 +00:00
Frank Warmerdam bcc1656171 Allocate working buffer one word larger since we "forward accumulate" and overwrite the end by one word in at least some cases. 2012-05-24 23:21:45 +00:00
Frank Warmerdam c6d8cdcf29 avoid accessing out of the lookup arrays for out of range inputs. 2012-05-24 05:25:14 +00:00
Frank Warmerdam 920688aac5 avoid uninitialized variable for degenerate files 2012-05-24 03:50:31 +00:00
Frank Warmerdam dbfa4e6f60 if OJPEGWriteHeader() fails once do not bother trying again on the same image. 2012-05-24 03:15:18 +00:00
Frank Warmerdam c073384446 make things more resilient in the face of files without stripbytecounts or stripoffsets or where loading these fails. 2012-05-24 02:43:51 +00:00
Frank Warmerdam af47ad26e2 be careful about whether min/max values per singular or per sample 2012-05-24 02:29:06 +00:00
Frank Warmerdam e54e9545a0 fix crash with odd 16bit count types for some custom fields 2012-05-24 01:40:24 +00:00
Frank Warmerdam c634536376 avoid one byte past end of ink names reading in some cases 2012-05-24 01:03:37 +00:00
Bob Friesenhahn b298ae255c * man/TIFFGetField.3tiff: Correct the 'count' field type in the
example for how to retreive the value of unsupported tags.
2012-05-19 23:15:22 +00:00
Frank Warmerdam f502a159f9 Fix size overflow (zdi-can-1221,CVE-2012-1173) care of Tom Lane @ Red Hat. 2012-04-06 16:46:31 +00:00
Frank Warmerdam 7017b048e1 note vs in topic and mailing list url 2012-04-06 16:45:55 +00:00
Frank Warmerdam 97a32305c9 new 2012-03-30 16:30:34 +00:00
Frank Warmerdam 7e03e5ccbd Update to reference correct sample files. 2012-03-28 18:12:26 +00:00
Bob Friesenhahn 75b1743466 * libtiff 4.0.1 released. 2012-02-18 22:11:19 +00:00
Bob Friesenhahn d766e7c5a0 * Update automake used to 1.11.3. 2012-02-18 21:58:02 +00:00
Bob Friesenhahn 7cbc7dce84 Record changes for libtiff 4.0.1 2012-02-18 21:53:27 +00:00
Bob Friesenhahn 7802e5ba91 Strip out antique instructions about unsupported build targets. 2012-02-18 21:36:31 +00:00
Bob Friesenhahn c3d1b83b0d * libtiff/tiffio.h: Use double-underbar syntax in GCC printf
attribute specification to lessen the risk of accidental macro
substitution.  Patch from Vincent Torri.
2012-02-18 16:20:26 +00:00
Frank Warmerdam b2a9c9542a Clarify the fix applied for bug 1994 with a comment. 2012-02-01 02:24:47 +00:00
Frank Warmerdam 3bdfb317f4 adjustments for security/null pointer issues - I do not think any of them are real, but they make future security audits easier 2012-02-01 01:51:00 +00:00
Bob Friesenhahn b326998fc2 * configure.ac: Add support for using library symbol versioning on
ELF systems with the GNU linker.  Support is enabled via
--enable-ld-version-script.  Disabled by default for now until
there is a decision for how to deploy a libtiff with versioned
symbols after libtiff 4.0.0 was already released.
2012-01-22 19:50:36 +00:00
Bob Friesenhahn 306ae2fb9f * libtiff/tif_win32.c: Eliminate some minor 64-bit warnings in
tif_win32.c.  Patch by Edward Lam.
2011-12-22 17:07:57 +00:00
Bob Friesenhahn d338f7fe22 * configure.ac: Add libtiff private dependency on -llzma for
pkg-config.  Patch by Mark Brand.
Updated Automake to 1.11.2.
2011-12-22 17:03:48 +00:00
Bob Friesenhahn f7b79dc7dc Released libtiff 4.0.0. 2011-12-22 00:29:28 +00:00
Frank Warmerdam 20499fa9b1 more cautious testing of _TIFFFillStriles() results (gdal #4372) 2011-12-09 03:29:10 +00:00
Frank Warmerdam 7d9fbf6d9d fix crash with invalid files, strip chopping and deferred strile loading (gdal #4372) 2011-12-08 05:48:39 +00:00
Frank Warmerdam ee5c8c505e fix error reporting when there is no tag information struct and name (gdal #4373) 2011-12-08 05:43:26 +00:00
Bob Friesenhahn ee7c87492b * Update GNU libtool to 2.4.2. 2011-10-22 17:06:02 +00:00
Bob Friesenhahn cae87ed58a * tools/tiffsplit.c (tiffcp): TIFFGetField count field should be
uint32 type for TIFFTAG_JPEGTABLES.  Patch by Christophe
Deroulers.
2011-10-22 17:03:00 +00:00
Bob Friesenhahn b741f89f25 Add defines missing from VC configuration template. 2011-09-07 21:59:17 +00:00
Bob Friesenhahn 5d3e4d37fe Use "codec" rather than "coded" 2011-08-02 14:09:43 +00:00
Frank Warmerdam 46f42f1c92 fix TIFFMergeFieldInfo typo. 2011-06-21 19:13:24 +00:00
Frank Warmerdam 63eb8b5578 restore TIFFMergeFieldInfo in libtiff.def (#42) 2011-06-21 16:43:26 +00:00
Bob Friesenhahn c51502913d * libtiff/tif_dirread.c (TIFFFetchStripThing): Free "data" also
upon failure to allocate "resizeddata".
* tools/tiff2ps.c (PSDataBW): Zero buffer *after* checking for
allocation failure, not before.
2011-05-31 17:10:18 +00:00
Bob Friesenhahn aacd29d141 * libtiff/tif_ojpeg.c: plug leaks on OJPEG read failure path 2011-05-31 17:05:07 +00:00
Bob Friesenhahn d73e9e8b19 * tools/rgb2ycbcr.c (cvtRaster): unchecked malloc 2011-05-31 17:03:16 +00:00
Bob Friesenhahn bd77483087 * libtiff/tif_jpeg.c, tools/tiff2pdf.c, tools/tiff2ps.c: mark
NULL-deref and possible overflow
2011-05-31 17:00:03 +00:00
Bob Friesenhahn e66a15f97e * tools/tiff2pdf.c: remove decl+set of set-but-not-used local, "written" 2011-05-31 16:57:10 +00:00
Bob Friesenhahn 91b49a4539 * libtiff/tif_jpeg.c (JPEGInitializeLibJPEG): Remove declaration
and set of otherwise unused local, data_is_empty.
2011-05-31 16:54:15 +00:00
Bob Friesenhahn 1e2aed2807 * libtiff/tif_jpeg.c (JPEGDecodeRaw) [JPEG_LIB_MK1_OR_12BIT]:
Diagnose out-of-memory failure and return 0 rather than
dereferencing NULL.
2011-05-31 16:51:50 +00:00
Frank Warmerdam f8a3650a7c improve error report with zero tag directories 2011-05-24 13:35:30 +00:00
Frank Warmerdam 9437f9db5a restore TIFFMergeFieldInfo (#2315) 2011-05-17 00:21:17 +00:00
Frank Warmerdam bb96a66b1d remove use of memory.h, it is unneeded and does not exist everywhere 2011-05-08 00:44:18 +00:00
Frank Warmerdam 34b7557400 Remove obsolete field info api, add missing items in libtiff.def (#2315, #2316) 2011-04-20 15:23:38 +00:00
Bob Friesenhahn aad61d031c Mention 4.0.0beta7. 2011-04-09 21:07:41 +00:00
Bob Friesenhahn feab28eac4 Release v4-0-0beta7. 2011-04-09 21:01:00 +00:00
Bob Friesenhahn 898c42e698 Reference 3.9.5 release. 2011-04-09 20:21:27 +00:00
Bob Friesenhahn 959042fdcf Fix spelling typo in tiff2ps. 2011-04-09 16:53:08 +00:00
Bob Friesenhahn b3d151d012 Fix test warnings from tiff2ps. 2011-04-09 16:52:17 +00:00
Bob Friesenhahn c546a4ccf8 * configure.ac: Should use AC_CANONICAL_HOST since host specifies
the run-time target whereas target is used to specify the final
output target if the package is a build tool (like a compiler),
which libtiff is not.  Resolves libtiff bug 2307 "Use
AC_CANONICAL_HOST macro".
2011-04-09 15:43:03 +00:00
Bob Friesenhahn 519b727004 * configure.ac: Support configuring TIFF_INT64_FORMAT and
TIFF_UINT64_FORMAT appropriately for MinGW32.

* tools/tiffdump.c (ReadDirectory): MinGW32 needs to use WIN32
printf conventions for 64-bit types because it uses the WIN32 CRT.

* libtiff/{tif_dumpmode.c,tif_luv.c,tif_lzw.c,tif_print.c,
tif_read.c,tif_strip.c,tif_thunder.c}: MinGW32 needs to use WIN32
printf conventions for 64-bit types because it uses the WIN32 CRT.

* tools/tiff2pdf.c (t2p_write_pdf_string): Fix printf syntax not
understood by WIN32 CRT.
2011-04-02 20:54:08 +00:00
Bob Friesenhahn b69a1998be * libtiff/tif_ojpeg.c: Fixes to compile with MinGW32 GCC.
* tools/fax2ps.c (main): Use tmpfile() rather than mkstemp() since
it is much more portable.  Tmpfile is included in ISO/IEC
9899:1990 and the WIN32 CRT.
2011-04-02 19:30:20 +00:00
Frank Warmerdam a9a1d1c65f Add -d and -sd switches to tiffset to allow operation on a particular
directory instead of just the first (jef)
2011-03-26 12:07:20 +00:00
Frank Warmerdam 94e26a9e89 ignore output files 2011-03-26 12:05:00 +00:00
Frank Warmerdam 0cea5839cc Correct potential buffer overflow with thunder encoded files with wrong
bitspersample set (CVE-2011-1167)
http://bugzilla.maptools.org/show_bug.cgi?id=2300
2011-03-21 16:02:27 +00:00
Frank Warmerdam 4dda1458c6 allow zero length runs at start of fax3 lines 2011-03-10 20:23:07 +00:00
Frank Warmerdam 8e9fb97983 incorporate a fix for possible fax3 decoding overflow (CVE-2011-0192) 2011-03-03 01:38:25 +00:00
Frank Warmerdam 010a264507 avoid divide by zero in degenerate case (#2296) 2011-02-23 21:57:59 +00:00
Frank Warmerdam 91479f4d42 avoid leaks if TIFFRGBAImageBegin() fails (#2295) 2011-02-23 21:46:09 +00:00
Frank Warmerdam 202ed69f77 fix rawcp/rawcc maintinance for lzma compressor 2011-02-22 21:55:13 +00:00
Bob Friesenhahn f54758cb96 Make sure that configure timestamps are good. 2011-02-19 18:00:38 +00:00
Frank Warmerdam c1225a030a fix for deferred strile loading 2011-02-18 22:54:48 +00:00
Frank Warmerdam 9d37e46393 fix macro set for chunky-read-support 2011-02-18 22:28:58 +00:00
Frank Warmerdam 0a3abc0fe8 fix bug with chunk read support and deferred strile loading. 2011-02-18 22:20:59 +00:00
Frank Warmerdam 661b698b0d Move _TIFFFillStriles() call down to avoid being ahead of variable
declaration.
2011-02-18 22:15:40 +00:00
Frank Warmerdam bc3bc9925b added a configure option to enable CHUNKY_STRIP_READ support (--enable-chunky-strip-read) 2011-02-18 21:54:22 +00:00
Frank Warmerdam 82361dfa04 implement optional support for deferred strip/tile offset/size loading 2011-02-18 20:53:04 +00:00
Frank Warmerdam 29beec44d2 remove unused variable 2011-02-11 19:21:03 +00:00
Frank Warmerdam 1b73b3d840 fix buffer overrun problem with error/warning report in non-console win32 builds (popups) (#2293) 2011-02-09 18:05:00 +00:00
Olivier Paquet addab4c8aa Added support for TIFFTAG_SMINSAMPLEVALUE and TIFFTAG_SMAXSAMPLEVALUE to have
different values for each sample. Presents the min/max of all samples by
default for compatibility. TIFFSetField/TIFFGetField can be made to handle
those tags as arrays by changing the new TIFFTAG_PERSAMPLE pseudo tag.
http://www.asmail.be/msg0055458208.html
2011-01-24 21:06:31 +00:00
Frank Warmerdam a8785bf9f4 fix tif_rawcp/rawcc handling for zip, note it is missing for pixarlog 2011-01-06 16:00:23 +00:00
Frank Warmerdam c89c8c07c7 ensure rawcp and rawcc are maintained by JPEG decoder, improve read ahead for CHUNKY_STRIP_READ_SUPPORT 2011-01-06 05:51:13 +00:00
Lee Howard 32f670caaa Another regression fix. 2011-01-04 02:52:00 +00:00
Lee Howard 863cbb8823 * libtiff/tif_jpeg.c: Fix regression with 3 band image caused by
commit on 2010-12-14 submitted by e-mail from
        Even Rouault <even.rouault@mines-paris.org>
2011-01-04 02:38:51 +00:00
Olivier Paquet cb413f61f5 * libtiff/tif_dirwrite.c: Fixed writing of TIFFTAG_REFERENCEBLACKWHITE.
http://bugzilla.maptools.org/show_bug.cgi?id=2266
2010-12-31 17:51:08 +00:00
Andrey Kiselev c46a15cf97 *** empty log message *** 2010-12-23 13:39:00 +00:00
Andrey Kiselev d499ffbfcd Added support for specifying the compression level parameter (preset) for
Deflate and LZMA encoders, e.g "-c lzma:p1" or "-c zip:p9".
2010-12-23 13:38:47 +00:00
Andrey Kiselev 73ca7bd1a5 Properly set the LZMA2 compression level (preset) in LZMAVSetField(). 2010-12-23 13:07:38 +00:00
Andrey Kiselev 9f29be434f Remove remaining CVS stuff. 2010-12-22 15:33:48 +00:00
Andrey Kiselev c748648843 Added missed record for LZMA codec. 2010-12-22 15:30:54 +00:00
Bob Friesenhahn 9f3e08cf94 Needed to add tif_lzma.c to the Makefile. 2010-12-18 16:30:15 +00:00
Lee Howard bf44739aea * libtiff/tif_dirread.c: tolerate some cases where
FIELD_COLORMAP is missing
        http://bugzilla.maptools.org/show_bug.cgi?id=2189
2010-12-15 01:05:02 +00:00
Lee Howard 69bb27992d * libtiff/tif_read.c: change read_ahead to tmsize_t
http://bugzilla.maptools.org/show_bug.cgi?id=2222
2010-12-15 00:43:25 +00:00
Lee Howard ccdc78ec32 * configure.ac, libtiff/Makefile.am: Build tif_win32.c on
Windows except on Cygwin
        http://bugzilla.maptools.org/show_bug.cgi?id=2224
2010-12-15 00:37:00 +00:00
Lee Howard cb405082bb * tools/gif2tiff.c: fix buffer overrun
http://bugzilla.maptools.org/show_bug.cgi?id=2270
2010-12-15 00:22:44 +00:00
Lee Howard 7a01aa5d24 * libtiff/tif_jpeg.c: reduce usage of JCS_UNKNOWN in order
to improve compatibility with various viewers
        submitted by e-mail from Dwight Kelly <dkelly@apago.com>
2010-12-14 23:58:39 +00:00
Andrey Kiselev 1e3630f9fd Regenerate autotools stuff. 2010-12-14 12:54:53 +00:00
Andrey Kiselev a2d72c2dd4 Implement a new TIFF compression scheme LZMA reserving a new value 34925 for
Compression tag. As per bug http://bugzilla.maptools.org/show_bug.cgi?id=2221
2010-12-14 12:52:59 +00:00
Lee Howard f7aebc2647 tiffcrop-extractz14-logluv-3c-16b.sh now passes 2010-12-14 03:27:13 +00:00
Lee Howard 630dc52808 * tools/fax2ps.c: be consistent with page-numbering
http://bugzilla.maptools.org/show_bug.cgi?id=2225
2010-12-14 03:16:45 +00:00
Lee Howard 70c91edf7c http://bugzilla.maptools.org/show_bug.cgi?id=2214 2010-12-14 03:03:24 +00:00
Lee Howard 907489cd99 * libtiff/tif_color.c: prevent crash in handling bad TIFFs
resolves CVE-2010-2595
        http://bugzilla.maptools.org/show_bug.cgi?id=2208
2010-12-14 02:22:41 +00:00
Lee Howard d96a823670 * tools/tiffcrop.c: new release by Richard Nolde
http://bugzilla.maptools.org/show_bug.cgi?id=2004
2010-12-14 02:03:24 +00:00
Lee Howard 3cb55ee486 * tools/tiff2pdf.c: fix colors for images with RGBA
interleaved data
        http://bugzilla.maptools.org/show_bug.cgi?id=2250
2010-12-13 05:41:38 +00:00
Lee Howard 7f39edf058 * libtiff/tif_dirread.c: fix for Zeiss LSM and Canon CR2 files
http://bugzilla.maptools.org/show_bug.cgi?id=2164
2010-12-13 05:15:50 +00:00
Lee Howard 3c383d15fa * tools/tiff2pdf.c: remove invalid duplication for Lab
http://bugzilla.maptools.org/show_bug.cgi?id=2162
2010-12-12 06:58:26 +00:00
Lee Howard 6972648b60 * libtiff/tif_jpeg.c: fix use of clumplines calculation
http://bugzilla.maptools.org/show_bug.cgi?id=2149
2010-12-12 01:55:00 +00:00
Lee Howard 448c6db138 spelling fixes per
http://bugzilla.maptools.org/show_bug.cgi?id=2144
2010-12-12 01:45:35 +00:00
Lee Howard 9cf3b2cd4c * tools/fax2ps.c: replace unsafe tmpfile() with mkstemp()
http://bugzilla.maptools.org/show_bug.cgi?id=2118
2010-12-12 01:11:56 +00:00
Lee Howard 6975482a3a * libtiff/tif_ojpeg.c, libtiff/tif_pixarlog.c,
libtiff/tif_zip.c: fix build errors for VC6
        http://bugzilla.maptools.org/show_bug.cgi?id=2105
2010-12-11 23:52:27 +00:00
Lee Howard 7335412b5a * libtiff/tif_dirread.c: warnings cleanup
http://bugzilla.maptools.org/show_bug.cgi?id=2092
2010-12-11 23:22:06 +00:00
Lee Howard 3467f1927f * libtiff/tif_stream.cxx: warnings cleanup
http://bugzilla.maptools.org/show_bug.cgi?id=2091
2010-12-11 23:12:29 +00:00
Lee Howard e70efefb35 * tools/tiff2pdf.c: add fill-page option
http://bugzilla.maptools.org/show_bug.cgi?id=2051
2010-12-11 22:47:49 +00:00
Lee Howard 9be929fe91 * libtiff/tif_dirread.c: modify warnings
http://bugzilla.maptools.org/show_bug.cgi?id=2016
2010-12-11 22:28:30 +00:00
Lee Howard 6707ee9df3 * libtiff/tif_ojpeg.c: fix buffer overflow on problem data
http://bugzilla.maptools.org/show_bug.cgi?id=1999
2010-12-11 21:23:21 +00:00
Lee Howard a1b7ba8c75 fix build warning 2010-12-11 19:52:52 +00:00
Lee Howard 046a69c47a * tools/tiffinfoce.c: strip byte counts are uint64* now 2010-12-11 19:33:48 +00:00
Lee Howard 22ea884fcd 2010-12-08 Lee Howard <faxguy@howardsilvan.com>
* libtiff/tif_ojpeg.c: fix crash when reading a TIFF with a zero
        or missing byte-count tag
        * tools/tiffsplit.c: abort when reading a TIFF without a byte-count
        per http://bugzilla.maptools.org/show_bug.cgi?id=1996
2010-12-11 19:16:47 +00:00
Lee Howard 15c0109ab3 fix crash when reading a badly-constructed TIFF per
http://bugzilla.maptools.org/show_bug.cgi?id=1994
2010-12-08 17:50:49 +00:00
Lee Howard 09bc85ba19 Tom Lane didn't like this... so I guess it wasn't so brain-dead. 2010-12-06 20:52:54 +00:00
Lee Howard 50db65b3a9 From SUSE SRPM:
- fixed crash while using libjpeg7 and higher
  * dont-fancy-upsampling.patch
2010-12-06 18:05:56 +00:00
Lee Howard 709e93ded0 Fix mode check before opening a file.
http://bugzilla.maptools.org/show_bug.cgi?id=1906
2010-12-06 16:54:54 +00:00
Lee Howard b3c5153919 If it doesn't fail, then it succeeds. 2010-11-28 15:35:12 +00:00
Bob Friesenhahn faf5f3ebae * libtiff-4.pc.in: Added libtiff pkg-config .pc file support.
Patch by Vincent Torri.
2010-11-27 20:54:51 +00:00
Lee Howard 01ff8dfe99 More improvements from Richard Nolde. 2010-11-26 23:26:46 +00:00
Frank Warmerdam 756ab12a5e various fixes for win32 porting 2010-10-21 19:07:32 +00:00
Lee Howard 4536beaed1 See: http://bugzilla.maptools.org/show_bug.cgi?id=1983
* tools/tiff2ps.c: improvements and enhancements from Richard Nolde
        with additional command line options for Document Title,
        Document Creator, and Page Orientation
2010-09-26 05:39:31 +00:00
Bob Friesenhahn 28d10ec5bd * tools/tiffcrop.c: Patch from Richard Nolde to avoid a
potentially unterminated buffer due to using an exceptionally long
file name.
2010-07-13 15:51:37 +00:00
Andrey Kiselev 548b403d10 Fixed ID buffer filling in t2p_write_pdf_trailer(), thanks to Dmitry V. Levin. 2010-07-08 09:37:52 +00:00
Andrey Kiselev 9969e64b8f Really reset the tag count in CheckDirCount() to expected value as the warning
message suggests. As per bug http://bugzilla.maptools.org/show_bug.cgi?id=1963
2010-07-07 15:13:57 +00:00
Andrey Kiselev 897e7e9491 Properly handle TIFFTAG_PAGENUMBER, TIFFTAG_HALFTONEHINTS,
TIFFTAG_YCBCRSUBSAMPLING, TIFFTAG_DOTRANGE which should be set by value.
2010-07-06 14:30:38 +00:00
Andrey Kiselev 1cf8becfc2 Don't use assertions in _TIFFFieldWithTag() and _TIFFFieldWithName() if the
tag is not found in the tag table. This should be normal situation and
returned NULL value should be properly handled by the caller.
2010-07-06 14:16:05 +00:00
Andrey Kiselev 2a34d038af Avoid wrong math du to the signed/unsigned integer type conversions. As per
bug http://bugzilla.maptools.org/show_bug.cgi?id=2207
2010-07-02 13:39:10 +00:00
Andrey Kiselev a32e672131 Fix the count for WhitePoint tag as per bug
http://bugzilla.maptools.org/show_bug.cgi?id=2042
2010-07-02 12:02:56 +00:00
Andrey Kiselev 004e0bab6d Tiny formatting fixes to improve code navigation. 2010-07-02 11:06:29 +00:00
Andrey Kiselev 35f7b45fa3 *** empty log message *** 2010-07-02 10:02:19 +00:00
Andrey Kiselev b3395bf1f1 *** empty log message *** 2010-07-02 09:48:25 +00:00
Andrey Kiselev 0cd06f1134 *** empty log message *** 2010-07-01 15:56:56 +00:00
Andrey Kiselev ec2b508f60 *** empty log message *** 2010-07-01 15:33:28 +00:00
Andrey Kiselev 5122fdb3e0 *** empty log message *** 2010-06-30 16:04:50 +00:00
Andrey Kiselev 5a48f5167f *** empty log message *** 2010-06-30 15:41:49 +00:00
Andrey Kiselev f4eff24f63 *** empty log message *** 2010-06-30 14:12:03 +00:00
Andrey Kiselev aa50cfd0aa *** empty log message *** 2010-06-25 12:24:13 +00:00
Bob Friesenhahn e3538640b6 C files should not use C++ style comments. 2010-06-21 19:09:26 +00:00
Bob Friesenhahn ee8700a596 * tools/tiffcrop.c: Patch from Richard Nolde. Reject YCbCr
subsampled data since tiffcrop currently doesn't support it.  Fix
JPEG support.
2010-06-16 01:54:48 +00:00
Bob Friesenhahn b16131502c Mention 3.9.4 release. 2010-06-15 19:09:03 +00:00
Frank Warmerdam 20ea500233 fix invocation of tagcompare function (#2201) 2010-06-13 19:37:23 +00:00
Frank Warmerdam 75f7f78120 various fixes for tiff2pdf (#2211) 2010-06-13 19:25:54 +00:00
Bob Friesenhahn e492476518 * libtiff/tiffiop.h (TIFFSafeMultiply): Need more castings to
avoid compiler warnings if parameter types are not sign
consistent.
2010-06-12 02:55:30 +00:00
Bob Friesenhahn af78267c3b * libtiff 4.0.0alpha6 released. 2010-06-11 22:58:57 +00:00
Bob Friesenhahn d30823e382 * tools/tiffcrop.c: Applied patch from Richard Nolde: Corrected
European page size dimensions.  Added an option to allow the user
to specify a custom page size on the command line.  Fix the case
where a page size specified with a fractional part was being
coerced to an integer by retyping the variables that define the
paper size.
2010-06-11 22:25:36 +00:00
Bob Friesenhahn a6ea66c2af * html/index.html: Update for the 3.9.3 release. 2010-06-11 22:08:01 +00:00
Bob Friesenhahn bbf76bce0f * tools/tiffcp.c (tiffcp): Applied Tom Lane's patch to reject
YCbCr subsampled data since tiffcp currently doesn't support it.
http://bugzilla.maptools.org/show_bug.cgi?id=2097
2010-06-11 21:23:12 +00:00
Bob Friesenhahn 5ec011cfe7 * Update libtool to version 2.2.10. 2010-06-11 20:31:38 +00:00
Bob Friesenhahn ce4acf471d * libtiff/tiffiop.h (TIFFSafeMultiply): Work properly if
multiplier is zero.
2010-06-10 22:53:11 +00:00
Bob Friesenhahn d36017b938 * libtiff/tif_fax3.c (Fax3SetupState): Yesterday's fix for
CVE-2010-1411 was not complete.

* libtiff/tiffiop.h (TIFFSafeMultiply): New macro to safely
multiply two integers.  Returns zero if there is an integer
overflow.

* tools/tiffcp.c (main): tiffcp should not leak memory if an error
is reported when reading the input file.
2010-06-09 17:17:13 +00:00
Bob Friesenhahn 3adc33842b * Update libtool to version 2.2.8.
* libtiff/tif_fax3.c (Fax3SetupState): Avoid under-allocation of
buffer due to integer overflow in TIFFroundup() and several other
potential overflows.  In conjunction with the fix to TIFFhowmany(),
fixes CVE-2010-1411.

* libtiff/tiffiop.h (TIFFhowmany): Return zero if parameters would
result in an integer overflow. This causes TIFFroundup() to also
return zero if there would be an integer overflow.
2010-06-08 23:32:22 +00:00
Bob Friesenhahn bfbc717684 * contrib: Add an emacs formatting mode footer to all source files
so that emacs can be effectively used.
2010-06-08 18:55:15 +00:00
Frank Warmerdam 13ab8a93b6 added -x switch to tiffcp to (re)number allt he pages (#2203) 2010-06-03 17:01:01 +00:00
Olivier Paquet 2dacef9ea0 * libtiff/tif_dirread.c: Restored TIFFReadDirEntryFloat function in order
to add missing TIFF_SETGET_FLOAT case to TIFFFetchNormalTag.
* libtiff/tif_dirinfo.c: Use correct set_field_type for
TIFFTAG_PIXAR_FOVCOT so it is readable again (regression from 3.9.2).
http://bugzilla.maptools.org/show_bug.cgi?id=2192
2010-05-08 18:34:26 +00:00
Olivier Paquet 5650916c37 * libtiff/tif_dirinfo.c: Use correct set_field_type for
TIFFTAG_PIXAR_FOVCOT so it is readable again (regression from 3.9.2).
http://bugzilla.maptools.org/show_bug.cgi?id=2192
2010-05-08 18:33:51 +00:00
Olivier Paquet 3f00ca3668 * libtiff/tif_dirread.c: Restored TIFFReadDirEntryFloat function in order
to add missing TIFF_SETGET_FLOAT case to TIFFFetchNormalTag.
http://bugzilla.maptools.org/show_bug.cgi?id=2192
2010-05-08 18:33:07 +00:00
Frank Warmerdam 8542b73911 ensure quality always set in JPEGPreEncode (gdal #3539) 2010-05-07 18:38:46 +00:00
Andrey Kiselev c7f2a88a9e Regenerated from the source. 2010-05-06 10:01:02 +00:00
Olivier Paquet 5d55f189fc * libtiff/tif_print.c: Fixed printing of TIFFTAG_REFERENCEBLACKWHITE which
had stopped working. Also made it always print 6 floats instead of
2*SamplesPerPixel.
http://bugzilla.maptools.org/show_bug.cgi?id=2191
http://bugzilla.maptools.org/show_bug.cgi?id=2186
* man/TIFFGetField.3tiff, man/TIFFSetField.3tiff: Fixed doc to reflect the
fact that libtiff considers TIFFTAG_REFERENCEBLACKWHITE to be 6 floats.
2010-05-06 02:56:46 +00:00
Olivier Paquet de8b0a300a * libtiff/tif_print.c: Fixed printing of TIFFTAG_REFERENCEBLACKWHITE which
had stopped working. Also made it always print 6 floats instead of
2*SamplesPerPixel.
http://bugzilla.maptools.org/show_bug.cgi?id=2191
http://bugzilla.maptools.org/show_bug.cgi?id=2186
2010-05-06 02:56:17 +00:00
Olivier Paquet 4a62d3518d * man/TIFFGetField.3tiff, man/TIFFSetField.3tiff: Fixed doc to reflect the
fact that libtiff considers TIFFTAG_REFERENCEBLACKWHITE to be 6 floats.
2010-05-06 02:54:46 +00:00
Frank Warmerdam e3c51cb8e6 fix to use memcmp(), not memcpy() for checking jpeg tables header 2010-05-05 18:38:38 +00:00
Frank Warmerdam 80b552d22f avoid spurious jpeg table updates 2010-04-21 20:46:17 +00:00
Olivier Paquet 117b4bd0c6 * libtiff/tif_dirinfo.c: Fixed reading of 4 pixar tags.
http://bugzilla.maptools.org/show_bug.cgi?id=2139
2010-04-20 15:25:29 +00:00
Bob Friesenhahn 9319bd574a * libtiff/tif_dir.c (_TIFFVSetField): Add a special error case for
when the tag count value is zero.  Error handling is still a
regression since in 3.9.2, empty tags are skipped (with a warning)
rather than returning a hard error and refusing to read the file.

* tools/ppm2tiff.c (main): While case for parsing comment line
requires extra parenthesis to work as expected.  Reported by
Thomas Sinclair.
2010-04-10 19:22:34 +00:00
Frank Warmerdam d85328cfc9 enable reading of very large strips in chunks (gdal #3514) 2010-04-02 19:26:22 +00:00
Frank Warmerdam 23532025ca use TIFFRewriteDirectory() in TIFFFlush() to migrate directories if needed 2010-03-31 06:40:10 +00:00
Frank Warmerdam fda0494e8e change type of dec_bitsleft to uint64 to support 256MB+ strips (gdal #3512) 2010-03-30 17:02:57 +00:00
Bob Friesenhahn 4e0d97f83c * libtiff/tif_aux.c (_TIFFCheckRealloc): Improve error message so
that it is clearly a memory allocation error message, and also
includes the size of the allocation request.
2010-03-10 18:56:48 +00:00
Olivier Paquet 70aaa84ae7 Added myself to COMMITTERS. 2010-03-02 21:19:56 +00:00
Lee Howard be0df48727 Since the 3.8 days it's sp->line and not line. 2010-02-22 21:14:10 +00:00
Lee Howard 614095e3d0 * libtiff/tif_fax3.c: Don't return error on badly-terminated MMR
strips.
        http://bugzilla.maptools.org/show_bug.cgi?id=2029
2010-02-22 19:24:39 +00:00
Lee Howard 4d1b67f0a0 Add bugzilla link. 2010-02-22 19:15:09 +00:00
Lee Howard d473b19b31 * libtiff/tif_jpeg.c: Do not generate a JPEGTables tag when creating
the JPEG TIFF as is is not required in order to prevent it from
        being unused and filled with invalid data.  (Leave it to be
        generated by later activity.)
        * tools/tiff2pdf.c: Write the JPEG SOI headers into the TIFF strip
        data rather than skipping them.  This fixes the ability to view in
        Acrobat Reader, Evince, and Ghostscript.
2010-02-22 19:10:07 +00:00
Frank Warmerdam b31672152e remove out of date mirror, points to download.osgeo.org instead of ftp.remotesensing.org 2009-12-04 19:00:37 +00:00
Frank Warmerdam bbef7fb9cb Made JPEGDecodeRaw() check for buffer overruns. Made so that when working
with downsampled images a stub function reporting an error is used for
tif_decoderow.  We cannot meaningfully support reading scanlines in this
situation.  (#1936)
2009-12-04 01:37:57 +00:00
Frank Warmerdam e1b49e08af reset tif_scanlinesize after changes to upsampling ratios (#1936) 2009-12-04 01:21:52 +00:00
Frank Warmerdam 0e5ee26f1c Fixed "artist" field number properly (#2129). 2009-12-03 19:27:55 +00:00
Frank Warmerdam b7b6095407 fix resource leaks on error (#2125) 2009-11-30 18:42:53 +00:00
Frank Warmerdam 199977b6af Return to handling TIFFTAG_REFERENCEBLACKWHITE as a field in the TIFF
directory instead  of as a custom(generic) field to avoid a potential
reentrancy problem (#2125)
2009-11-30 18:19:15 +00:00
Frank Warmerdam 917274b864 Make TIFFDisplay argument in TIFFCIELabToRGBInit const, and display_sRGB static and const. 2009-11-30 12:22:26 +00:00
Bob Friesenhahn d4038e39c5 * libtiff 4.0.0alpha5 released. 2009-11-04 17:49:25 +00:00
Bob Friesenhahn 1dc4f337d9 3.9.2 is latest stable release. 2009-11-04 17:38:13 +00:00
Bob Friesenhahn 444e4b4866 * tools/tiffcrop.c: Updated tiffcrop from Richard Nolde. This
version has undergone substantial testing with arbitrary sample
bit depths.  Also eliminates GCC compilation warnings.
2009-11-03 15:24:27 +00:00
Bob Friesenhahn c9d00c6c3c Change tiffcrop parameters to -X 60 -Y 60 2009-11-02 18:30:21 +00:00
Bob Friesenhahn 2b14d5a792 * port/libport.h: Add extern declarations for getopt standard
globals.
2009-11-02 14:44:13 +00:00
Bob Friesenhahn d35a21f9d2 * libtiff/tif_lzw.c (LZWDecode, LZWDecodeCompat): Fix warnings
noticed in 64-bit build of libtiff with Visual Studio 2005.
Resolves "Bug 2067 - Visual Studio 2005 64-bit warnings in
tif_lzw.c", http://bugzilla.maptools.org/show_bug.cgi?id=2067
2009-11-01 00:16:49 +00:00
Bob Friesenhahn ffd59cba70 * libtiff/tif_pixarlog.c (PixarLogEncode): Fix non-important
warning noticed in Visual Studio 2005 build. Resolves "Bug 2068 -
Visual Studio 2005 64-bit warning in tif_pixarlog.c",
http://bugzilla.maptools.org/show_bug.cgi?id=2068
2009-10-31 23:42:27 +00:00
Bob Friesenhahn c667654d23 * libtiff/tif_dirread.c: Eliminate GCC "dereferencing type-punned
pointer" warnings.
2009-10-29 20:04:07 +00:00
Bob Friesenhahn 0640db6d8f Include a mailto link for Bob Friesenhahn 2009-10-28 22:28:46 +00:00
Bob Friesenhahn e7ccb79ae3 Add a note that BigTIFF work is completed 2009-10-28 22:17:07 +00:00
Bob Friesenhahn 5d031f1fd9 * html/tools.html: Add manual page links, and a summary
description of tiffcrop.
2009-10-28 22:13:37 +00:00
Bob Friesenhahn 8743e53820 * configure.ac: x86_64 should use the same fill order as i386. 2009-10-07 20:15:26 +00:00
Bob Friesenhahn eecc3405f3 * tools/tiffcrop.c, man/tiffcrop.1: New tiffcrop from Richard
Nolde.  Major updates to add significant functionality for reading
and writing tile based images with bit depths not a multiple of 8
which cannot be handled by tiffcp.
2009-09-24 21:57:11 +00:00
Bob Friesenhahn 05a3dfef44 * libtiff/tif_ojpeg.c (OJPEGWriteHeaderInfo): IJG JPEG 7 needs
do_fancy_upsampling=FALSE in order to read raw data.  Resolves
"Bug 2090 - OJPEG crash with libjpeg v7".
http://bugzilla.maptools.org/show_bug.cgi?id=2090
2009-09-03 20:45:22 +00:00
Frank Warmerdam 867070ff59 capture errors properly from readtile/strip (#2071) 2009-09-03 17:41:02 +00:00
Bob Friesenhahn 840cb0032f * tools/{tiffcrop.c,tiffgt.c}: Applied patch from Oden Eriksson to
fix build with gcc when using the "-Wformat
-Werror=format-security" flags.
2009-08-30 17:38:51 +00:00
Bob Friesenhahn 61635e13d2 * test/{bmp2tiff_palette.sh, bmp2tiff_rgb.sh, gif2tiff.sh,
ppm2tiff_pbm.sh, ppm2tiff_pgm.sh, ppm2tiff_ppm.sh}: Additional
utilities tests.
2009-08-29 20:45:09 +00:00
Bob Friesenhahn d0a7c62064 Make static initialized strings const. 2009-08-29 20:05:06 +00:00
Bob Friesenhahn e39271f390 Add tiffcrop-extractz14-logluv-3c-16b.sh to XFAIL_TESTS 2009-08-28 23:53:15 +00:00
Bob Friesenhahn df3386927a * tools/tiffinfo.c: tiffinfo should return error status to the
caller.  Register a private error callback to accomplish that.
2009-08-28 23:46:56 +00:00
Bob Friesenhahn dac32d97bd Add v3.9.1.html 2009-08-28 18:54:11 +00:00
Bob Friesenhahn 0f2332cec2 * test/Makefile.am (TIFFIMAGES): Add test images in BMP, GIF, and
PNM formats so that we will be able to test more of the tools.
While adding these test images I notice that bmp2tiff and gif2tiff
only support ancient versions of their respective formats.
2009-08-28 17:46:01 +00:00
Bob Friesenhahn f7ec1e9d4f Add a note about 64-bit tags. 2009-08-27 19:23:52 +00:00
Bob Friesenhahn aeb4c8be72 * libtiff 4.0.0alpha4 released.
* HOWTO-RELEASE: Improved release instructions.
2009-08-27 17:40:49 +00:00
Bob Friesenhahn cd06c91a13 * man/{TIFFClose.3tiff,raw2tiff.1,tiffcmp.1,tiffsplit.1}: Applied
fixes for "Bug 2023 - nroff errors in manual pages".
http://bugzilla.maptools.org/show_bug.cgi?id=2023
2009-08-24 19:13:40 +00:00
Bob Friesenhahn 614f95d8b1 * tools/{rgb2ycbcr.c, tiff2rgba.c}: Applied fixes for "Bug 2079 -
CVE-2009-2347 libtiff: integer overflows in various inter-color
space conversion tools".
http://bugzilla.maptools.org/show_bug.cgi?id=2079
2009-08-24 17:15:05 +00:00
Bob Friesenhahn ed66fcdf7b * libtiff/tif_print.c (TIFFPrintDirectory): Apply fix from Jay
Berkenbilt for "Bug 2024 - possible null pointer dereference with
one-line fix".
http://bugzilla.maptools.org/show_bug.cgi?id=2024
2009-08-24 16:51:14 +00:00
Bob Friesenhahn 4dd4bbeccb * libtiff/tif_dirread.c (TIFFReadCustomDirectory): Apply patch
from Jay Berkenbilt for "Bug 1895 - logic error in tif_dirread.c:
segfault after setting tdir_tag = IGNORE".
http://bugzilla.maptools.org/show_bug.cgi?id=1895
2009-08-24 16:43:40 +00:00
Bob Friesenhahn d699d4fb3c Utilities which write to stdout needed more attention. 2009-08-24 15:48:00 +00:00
Bob Friesenhahn 2d29eb6b24 Add MEMCHECK to log messages so we can see that it is being applied. 2009-08-24 14:28:27 +00:00
Bob Friesenhahn 7492898195 Fix typo. 2009-08-24 02:55:05 +00:00
Bob Friesenhahn 044efd739c Prefix test commands with MEMCHECK 2009-08-23 23:24:21 +00:00
Bob Friesenhahn b772c5a5d6 Export certain variables (MAKE, MAKEFLAGS, MEMCHECK) to tests and
added 'memcheck' and 'ptrcheck' targets to make it easy to run the
tests under valgrind.
2009-08-23 23:23:19 +00:00
Bob Friesenhahn 63e03ebcec tiffcrop.sh into a collection of many specific tests. Re-wrote
all of the existing tests to be based on some simple shell
functions.  Make distcheck works again.
2009-08-23 22:58:25 +00:00
Bob Friesenhahn 3237e5e177 * test/Makefile.am, test/tiffcrop*.sh: Split previously existing
tiffcrop.sh into a collection of many specific tests.
2009-08-23 20:19:40 +00:00
Bob Friesenhahn b44da14dea Add start of XFAIL_TESTS 2009-08-22 01:45:32 +00:00
Bob Friesenhahn 9ebd845680 * test/tiffcp-logluv.sh: Fix test so that it works with a VPATH
build.
2009-08-21 18:00:07 +00:00
Bob Friesenhahn 38521145a6 * test/Makefile.am (AUTOMAKE_OPTIONS): Colorized tests was not
actually activated since it needed to be enabled in this
Makefile.am.  Also activated parallel-tests mode since it offers
useful features such as per-test .log files and a summary test
report .log file.
2009-08-21 16:52:14 +00:00
Bob Friesenhahn 8297307011 * configure.ac: Updated autotools. Autoconf 2.64, Automake 1.11,
libtool 2.2.6.  Enabled support for silent build rules
(--enable-silent-rules or 'make V=0') and colorized tests.

* html/{index.html, v3.9.0.html}: Update for 3.9.0 release.
2009-08-20 22:57:38 +00:00
Frank Warmerdam f4da7ed52e add -c sgilog to tiffcp, add minimal logluv testing 2009-06-30 17:25:26 +00:00
Frank Warmerdam b6de229800 fix logluv encoderow return values (#2069) 2009-06-30 13:51:52 +00:00
Frank Warmerdam 54600ed574 back out patch from #2065 and apply patch from #1085 for a better underflow fix that errors properly. 2009-06-30 04:15:24 +00:00
Frank Warmerdam 1517c5cd8f Remove an inappropriate assertion that often fails on oddly sized 12bit
jpeg compressed ycbcr images.
2009-06-26 20:55:54 +00:00
Frank Warmerdam 38b61c3b62 fix MK1 compatability per Adam's suggestion 2009-06-23 18:56:46 +00:00
Frank Warmerdam 12d0b53f44 treat SOF1 like SOF0 when doing fixup subsamples 2009-06-23 18:46:48 +00:00
Frank Warmerdam 21816633ca Added tif_jpeg_12 2009-06-23 18:25:43 +00:00
Frank Warmerdam 73dee97814 fixed buffer underflow bug (#2065) 2009-06-22 04:47:12 +00:00
Frank Warmerdam db1ab60dac add support for 8/12bit jpeg dual mode builds 2009-06-21 18:49:38 +00:00
Frank Warmerdam e1250d538c New 2009-06-20 17:05:17 +00:00
Frank Warmerdam 5e895a5ce0 do not override planar config if set (#2057) 2009-06-03 23:47:22 +00:00
Frank Warmerdam b4c7ba76a2 add TIFFUnsetField to .def file 2009-06-02 04:31:48 +00:00
Frank Warmerdam 56521d7ef1 Fixed various errors reports to use %s as format string (gdal #2976) 2009-05-03 14:29:36 +00:00
Frank Warmerdam 35128920f8 fix printdir chaining for some codecs. (#2020) 2009-03-13 02:02:51 +00:00
Frank Warmerdam e76cfb0205 ensure multi-sample (such as grey+alpha) are handled via separate interface (#2006) 2009-02-13 21:28:58 +00:00
Frank Warmerdam a042a8d460 added tiff2rgba tests 2009-02-13 21:26:03 +00:00
Frank Warmerdam 15760800eb fixed handling of tiled logluv images (#2005) 2009-02-12 18:06:17 +00:00
Frank Warmerdam a62c54d6f8 improve tag buffer allocation safety (#1998) 2009-02-09 14:29:08 +00:00
Frank Warmerdam 5d40e67e89 avoid defaulting image->res_unit to INCH in loadImage() 2009-02-06 15:43:06 +00:00
Frank Warmerdam 21cfbd887b reincorporate sanity check on tag size at 2GB to avoid 32bit system overflow (#1993) 2009-02-05 20:13:44 +00:00
Frank Warmerdam 4d658090bb removed another assertion that fires on corrupt files 2009-02-05 19:50:01 +00:00
Frank Warmerdam 06ed150673 remove assertions blown for corrupt files (#1995) 2009-02-05 19:21:45 +00:00
Frank Warmerdam 0068fcf5ad fixed testing for failed TIFFReadDirectoryFindFieldInfo() results (#1992) 2009-02-05 16:07:59 +00:00
Frank Warmerdam 8b508c187b added 32bit horizontal predictor support (#1911) 2009-01-23 15:52:39 +00:00
Frank Warmerdam 22ca888e0f fix byte swapping of next directory offset (#1924) 2009-01-23 06:21:29 +00:00
Frank Warmerdam e238751e2d initialize xres/yres values in case missing in file 2009-01-23 06:04:31 +00:00
Frank Warmerdam 6b1e83821b default srcdir to . in test scripts if not set 2009-01-23 05:37:18 +00:00
Frank Warmerdam 1c8edd0d0a turn verbose on after common setup 2009-01-23 05:32:37 +00:00
Frank Warmerdam e8d869b64d initialize tv variable to avoid warning 2009-01-23 05:25:19 +00:00
Frank Warmerdam 12449fa7d5 avoid use of system lfind() due to type issues (#1889) 2009-01-23 05:10:39 +00:00
Frank Warmerdam 28c6aee9e4 ensure libport.h gets included in distribution 2009-01-22 21:52:54 +00:00
Frank Warmerdam bb7dca71b3 include libport.h for getopt() prototype 2009-01-22 21:50:43 +00:00
Frank Warmerdam 46bac877c5 avoid 32/64bit casting warnings 2009-01-22 21:12:45 +00:00
Frank Warmerdam c4c1a95ce4 fix ordering to avoid getopt redeclaration 2009-01-22 20:59:33 +00:00
Frank Warmerdam 4bed4d565f new 2009-01-22 20:54:45 +00:00
Frank Warmerdam 3db9feb595 introduce libport.h prototypes to reduce warnings 2009-01-22 20:53:07 +00:00
Frank Warmerdam 9a47718c19 fix some warnings 2009-01-22 19:06:49 +00:00
Bob Friesenhahn 1ff9c1c489 * test/common.sh: Execute tests like 'make VERBOSE=TRUE check' in
order to trace full execution detail while executing the test suite.
2009-01-21 17:48:18 +00:00
Frank Warmerdam 01e6d4c022 tiffsplit.c: fix sampleformat to be shortv instead of longv 2009-01-21 04:42:10 +00:00
Bob Friesenhahn d6c4560053 * test/Makefile.am (CLEANFILES): Make sure that test output files
are removed by 'make clean'
2009-01-21 02:06:55 +00:00
Bob Friesenhahn 9e978f2097 * Update autotools for 4.0.0 beta3 2009-01-21 01:53:23 +00:00
Frank Warmerdam af4f213aa8 update to 4.0.0beta3 2009-01-20 22:07:18 +00:00
Bob Friesenhahn 506c21992e * test/tiffcrop.sh: New test script for tiffcrop from Richard
Nolde.

* tools/tiff2ps.c: Remove spurious message to stderr.
2009-01-12 16:23:11 +00:00
Bob Friesenhahn 771a4ea0a9 Updates for tiff2ps.1 2009-01-12 02:05:19 +00:00
Bob Friesenhahn d99686ccb2 * tools/tiff2ps.c: Incorporated significant functionality update
from Richard Nolde.  In particular, support for rotating the image
by 90, 180, 270, and 'auto' has been added.  Still waiting for
documentation patch to man/tiff2ps.1.

* man/tiffcrop.1: Incorporated documentation updates from Richard
Nolde.

* tools/tiffcrop.c: Incorporated significant functionality update
from Richard Nolde.
2009-01-11 20:04:22 +00:00
Frank Warmerdam 04d7332676 test commit 2009-01-02 03:48:45 +00:00
Bob Friesenhahn 953d02c32d * libtiff/tiffio.h: GCC will now validate format specifications
for TIFFError(), TIFFErrorExt(), TIFFWarning(), and
TIFFWarningExt() in order to reveal bugs.
* Many fixes throughout to work better as a 64-bit build.
2008-12-31 23:48:01 +00:00
Bob Friesenhahn 968401fdf3 * tools/{tiff2pdf.c, tiff2ps.c, tiffinfo.c}: Offset and length
tags now require 64-bit parameter rather than 32-bit.
* libtiff/tif_dirread.c: Fixed issues with unaligned access to
64-bit values.
2008-12-31 03:06:27 +00:00
Bob Friesenhahn f44e642634 * tools/thumbnail.c: Eliminate crash noticed while running test
suite.
2008-12-30 22:20:35 +00:00
Bob Friesenhahn bb9ee50811 Don't throw away output to stderr. Collect and display it if there is an error. 2008-12-30 21:59:54 +00:00
Bob Friesenhahn a6294fe089 * libtiff/tif_ojpeg.c (OJPEGLibjpegJpegSourceMgrFillInputBuffer):
Initialize stack variables to avoid compiler warning.
2008-12-30 01:36:26 +00:00
Bob Friesenhahn 527802616e * tools/tiffinfoce.c (main): Use toff_t for offset type when
retrieving offset of EXIF IFD.
2008-12-30 01:28:25 +00:00
Bob Friesenhahn 226f5fd57e * libtiff/tiffio.h: Undeprecate toff_t and restore its use in the
TIFFClientOpen() callback and other external function definitions.
2008-12-30 00:39:22 +00:00
Bob Friesenhahn 164884d67d Use toff_t rather than uint64 since it is a safer interface. 2008-12-30 00:12:11 +00:00
Bob Friesenhahn dbd1873ffa * tools/tiffinfo.c (main): Offset to EXIF IFD requires a 64-bit
type now.  Fixes crash when dumping files containing an EXIF IFD.
* m4/libtool.m4: Update to libtool 2.2.6.
2008-12-29 23:44:18 +00:00
Frank Warmerdam bb8117904c minor formatting changes 2008-12-21 21:07:05 +00:00
Frank Warmerdam 810460b4d9 ensure we flush dirty directories even if no imagery written 2008-12-21 20:31:33 +00:00
Frank Warmerdam a5a412f6d3 introduce TIFFUnsetField() function 2008-12-21 20:30:25 +00:00
Frank Warmerdam 54bf10fcbc avoid errors on last partial strip (#1981) 2008-12-21 20:13:38 +00:00
Frank Warmerdam 203fc17cb4 include tiffcrop 2008-12-13 15:23:15 +00:00
Frank Warmerdam a4459c9e10 clear BEENWRITING in TIFFlush() after writing strip/tile offsets (#2621) 2008-10-30 01:25:11 +00:00
Andrey Kiselev 229167b1d1 Support the JBIG-KIT 2.0 (compatibility with the older versions retained). 2008-10-21 13:16:59 +00:00
Frank Warmerdam 0cf3016d0c added file io changes needed for IPP libjpeg compatability (#1951) 2008-10-10 01:48:36 +00:00
Andrey Kiselev 28aee36491 *** empty log message *** 2008-09-05 07:07:02 +00:00
Andrey Kiselev 9498770c99 Use byte counts of proper size (uint64). Required for libtiff 4.0. 2008-09-05 07:06:26 +00:00
Andrey Kiselev 6ae8a4bd73 Use dynamically allocated array instead of static when constructing
output file names.
2008-09-05 06:44:32 +00:00
Frank Warmerdam ccbfac98d3 New 2008-09-03 15:53:08 +00:00
Andrey Kiselev 35152cd29e Bugzilla links updated; added list of maintainers. 2008-09-03 08:05:04 +00:00
Andrey Kiselev 355696533d *** empty log message *** 2008-09-03 07:48:52 +00:00
Andrey Kiselev a1a53f9c74 Get rid of unsafe strcpy()/strcat() calls when doing the filename/path
construction.
2008-09-03 07:47:26 +00:00
Andrey Kiselev 3498398196 More appropriate format string in t2p_write_pdf_string(); avoid
signed/unsigned mismatch.
2008-09-03 07:35:25 +00:00
Andrey Kiselev 187c6f11ea Properly zero out the codetable. As per bug
http://bugzilla.maptools.org/show_bug.cgi?id=1929
2008-09-03 07:16:09 +00:00
Andrey Kiselev aef997530c Properly zero out the string table. Fixes CVE-2008-2327 security issue. 2008-09-03 07:07:22 +00:00
Frank Warmerdam 9fa82bfb78 fix typo with status, and supress stderr output 2008-09-02 02:26:19 +00:00
Frank Warmerdam 80ca2298a3 avoid warnings about TIFFReadDirEntryFloat(), etc 2008-09-01 23:26:27 +00:00
Frank Warmerdam 11e620b7f9 modified to write IFDs as either IFD8 or IFD depending on whether the file
is bigtiff or classic tiff. http://bugzilla.maptools.org/show_bug.cgi?id=1917
2008-09-01 23:18:19 +00:00
Frank Warmerdam 943e72e954 added Lee as a co-maintainer 2008-09-01 22:05:21 +00:00
Bob Friesenhahn 8d2fe9f4e2 * 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
file support to work since off_t is only 32-bit.
2008-08-12 21:52:03 +00:00
Frank Warmerdam 743808438f Return an error rather than just asserting on invalid samples per
pixel or subsampling ratios (#1927).
2008-07-29 19:51:07 +00:00
Frank Warmerdam 60205a8369 note leak of anonymous field structure 2008-07-29 18:45:40 +00:00
Frank Warmerdam 6e6e603753 fix some portability and warning issues with tiffcrop 2008-06-17 20:16:54 +00:00
Frank Warmerdam 1468d4291f use same jpeg hacks for win32 as in tif_jpeg.c 2008-06-17 19:48:22 +00:00
Frank Warmerdam c7d28f4ba8 Ensure TIFFOpenW() uses same FILE_SHARE flags as TIFFOpen() 2008-06-17 18:47:03 +00:00
Frank Warmerdam 4594f2dcf2 fix alignment problems for architectures like Sparc (#1892) 2008-06-01 13:11:18 +00:00
Frank Warmerdam 80e50e5564 add TIFFFindField() to libtiff.def (#1891) 2008-05-27 16:26:16 +00:00
Frank Warmerdam dfb5da9ad4 remove SIZEOF_LONG macro as it is unused 2008-05-26 19:05:51 +00:00
Frank Warmerdam 27ebd800ef remove use of GlobalAlloc() (bug 1885) 2008-05-26 15:38:31 +00:00
Frank Warmerdam eac1a5bc85 Clarify comment on lfind(). 2008-05-26 15:17:09 +00:00
Frank Warmerdam faf612679b list JBIG_SUPPORT and MDI_SUPPORT in win32 header 2008-05-26 15:09:56 +00:00
Frank Warmerdam ac20f33758 fix unchecked malloc result 2008-05-25 03:11:33 +00:00
Frank Warmerdam 6af761b24c avoid possible NULL in error 2008-05-25 03:10:55 +00:00
Bob Friesenhahn a4e657cc8a * test {tiff2pdf.sh tiff2ps-EPS1.sh tiff2ps-PS1.sh tiff2ps-PS2.sh
tiff2ps-PS3.sh tiffcp-g3-1d-fill.sh tiffcp-g3-1d.sh
tiffcp-g3-2d-fill.sh tiffcp-g3-2d.sh tiffcp-g3.sh tiffcp-g4.sh
tiffcp-split-join.sh tiffcp-split.sh tiffcp-thumbnail.sh
tiffdump.sh tiffinfo.sh}: Added more test scripts based on
suggestions from Lee Howard posted to the tiff list on 13 Sep
2007.
2008-05-24 22:24:25 +00:00
Frank Warmerdam 75430ed547 prepare for 4.0.0beta2 2008-05-24 02:54:13 +00:00
Frank Warmerdam 6302edc888 update upload step 2008-05-24 02:53:41 +00:00
Frank Warmerdam 8035f41012 remove Id - it is causing low value churn after autogen 2008-05-24 02:25:25 +00:00
Frank Warmerdam e019c52f55 deal with a leak, and a possible runtime problem reported by coverity 2008-05-24 02:14:11 +00:00
Frank Warmerdam 90c84b3440 major update from Richard Nolde (#1888) 2008-05-24 00:18:55 +00:00
Frank Warmerdam 8a241d9f11 avoid leaks, dead code 2008-05-23 19:52:49 +00:00
Frank Warmerdam 09fe8fabf4 fix some coverity reported problems 2008-05-23 17:24:41 +00:00
Frank Warmerdam e6f5098ee8 Update bugzilla location. 2008-05-18 17:21:59 +00:00
Frank Warmerdam d4099b8eee update for 4.0.0beta1 release 2008-05-18 16:25:47 +00:00
Frank Warmerdam a8ecdf825d Use TIFF_SETGET_ASCII for Pixar Texture tags 2008-05-18 16:18:30 +00:00
Bob Friesenhahn d3b0d3dd38 Back out accidental change. 2008-05-09 16:23:29 +00:00
Bob Friesenhahn 9015352474 * Makefile.am (ACLOCAL_AMFLAGS): Libtool 2.2.4 does not like
"ACLOCAL_AMFLAGS=-I ./m4".  It wants "ACLOCAL_AMFLAGS=-I m4".
2008-05-09 16:20:49 +00:00
Andrey Kiselev 03db22ad51 *** empty log message *** 2008-04-15 14:25:20 +00:00
Andrey Kiselev 73865f3af5 Added tests for short tags with pairs of values. 2008-04-15 14:20:30 +00:00
Andrey Kiselev 924a2d8827 Added CheckShortPairedField() function. 2008-04-15 14:19:37 +00:00
Andrey Kiselev c87f985159 Added tifftest.h. 2008-04-15 14:19:08 +00:00
Andrey Kiselev f52bf76e67 New. 2008-04-15 14:18:36 +00:00
Andrey Kiselev 758e3eb654 Fixed description of the TIFFTAG_NUMBEROFINKS tag. 2008-04-15 13:54:55 +00:00
Andrey Kiselev a4317025a9 Remove test for "PixarTextureformat" tag because of its unclear status and
format of contents; test passes now.
2008-04-15 13:32:12 +00:00
Andrey Kiselev 481c2432f2 Use _TIFFRewriteField() instead of TIFFRewriteField(). 2008-04-15 12:53:07 +00:00
Andrey Kiselev 35b0e74065 Make nfields variable to be the size_t instead of uint32 in
TIFFMergeFieldInfo().
2008-04-14 09:35:43 +00:00
Andrey Kiselev 1bf045a2e1 *** empty log message *** 2008-04-14 09:05:50 +00:00
Andrey Kiselev 07818e9356 Get rid of some of "dereferencing type-punned" warnings by converting
tdir_offset field of TIFFDirEntry structure into union.
2008-04-14 09:05:25 +00:00
Andrey Kiselev 3dc82cc7b7 *** empty log message *** 2008-04-10 11:11:54 +00:00
Andrey Kiselev 4441831fef Added record about TIFFRewriteField() removal. 2008-04-10 11:11:43 +00:00
Andrey Kiselev 8c8cc432e5 TIFFRewriteField() renamed into _TIFFRewriteField() and moved out from the
public interface. Type of its 'count' parameter changed from uint32 to
tmsize_t.
2008-04-10 11:08:48 +00:00
Andrey Kiselev 3c99131a41 Make tif_nfields and tif_nfieldscompat fields of the tiff structure have the
size_t type instead of uint32.
2008-04-10 10:42:53 +00:00
Andrey Kiselev 33dbe6c262 Added support for MSVS 6.0. 2008-04-09 09:33:30 +00:00
Andrey Kiselev 08f6554c50 Use custom functions _TIFFUInt64ToFloat() and _TIFFUInt64ToDouble() to
convert 64-bit integers into floating point values on MSVS 6.0 platform.
2008-04-09 08:58:11 +00:00
Bob Friesenhahn 88d7b2ff9f Reduce compilation warnings. 2008-03-28 01:42:06 +00:00
Bob Friesenhahn 7e4803b57f Need to include string.h for strncmp() 2008-03-28 01:10:39 +00:00
Frank Warmerdam e80d604df0 disable tag size sanity checks (GDAL #2005) 2008-03-14 05:58:40 +00:00
Joris Van Damme 809dbe933b handling for PageNumber tag values different from 2 2008-02-09 09:51:46 +00:00
Frank Warmerdam e8ca21280f added missing swab functions needed for tiffdump 2008-02-04 05:41:00 +00:00
Frank Warmerdam d3d2ef5638 avoid attempting jpeg subsampling fixup if stripbytecount[0] is zero 2008-02-01 21:50:24 +00:00
Frank Warmerdam f2f169eb0e add extra casts in TIFFRewriteField to avoid warnings 2008-01-07 15:50:02 +00:00
Frank Warmerdam e9cb45c2ee fix 64bit type issues 2008-01-07 15:47:54 +00:00
Frank Warmerdam be56f42493 ifdef out unused functions 2008-01-01 16:26:13 +00:00
Frank Warmerdam 2e8e250054 Fix clean rules to be more precise, avoiding warnings from "del"
when running them after a full build.
2008-01-01 15:53:10 +00:00
Frank Warmerdam c080e30701 info on various fixes from Edward Lam 2008-01-01 15:49:43 +00:00
Frank Warmerdam 41feaacb78 Fix 64-bit warnings when compiling under MSVC 2005 (x64). 2008-01-01 15:49:00 +00:00
Frank Warmerdam bee6b8237d Changes to reflect the fact that TIFFFieldWithTag() and TIFFFieldWithName()
now return TIFFField pointers instead of TIFFFieldInfo pointers.
2008-01-01 15:46:28 +00:00
Frank Warmerdam 3e75fc789f Added ssize_t typedef on Windows since it doesn't exist. This makes
it compile again on Windows.
2008-01-01 15:45:14 +00:00
Frank Warmerdam e47164d103 Fix 64-bit warnings when compiling under MSVC 2005 (x64).
Fixed bad calls to TIFFErrorExt()
2008-01-01 15:41:49 +00:00
Frank Warmerdam 9c57ea610d Fix 64-bit warnings when compiling under MSVC 2005 (x64). 2008-01-01 15:41:22 +00:00
Frank Warmerdam 8b57e5cd14 modify CreateFileMapping() for win64 2008-01-01 15:35:54 +00:00
Frank Warmerdam bdc4949566 support WIN64 builds 2008-01-01 15:27:41 +00:00
Frank Warmerdam 19fb2c9918 added rewrite_tag test 2008-01-01 13:57:21 +00:00
Frank Warmerdam 586a6869b7 New 2008-01-01 13:55:23 +00:00
Frank Warmerdam 2b64a8aac4 added TIFFRewriteField() 2007-12-31 21:55:07 +00:00
Frank Warmerdam d0de6a396d Keep track of TIFF_DIRTYSTRIP separately from TIFF_DIRTYDIRECT to indicate
that the strip offset/size values are dirty but nothing else about the
directory is dirty.  In flush handle "just stripmaps dirty" as a special
case that just rewrites these values without otherwise modifying the
directory on disk using TIFFRewriteField().

We also modify logic so that in update mode the directory is not
marked dirty on read, but only when something is changed.  This
means we need to keep track of updates to the stripmap stuff in
TIFFAppendToStrip().
2007-12-31 21:52:16 +00:00
Frank Warmerdam a7e32673b8 improve switching between encode/decode (gdal bug #2033) 2007-12-10 19:58:41 +00:00
Frank Warmerdam 6311aae796 fix typo in last fix 2007-11-23 21:14:43 +00:00
Frank Warmerdam e427d6178d Fixed bug reference. 2007-11-23 20:55:35 +00:00
Frank Warmerdam 4dcbede5b0 introduce TIFF_BUF4WRITE flag to mark rawcc buffer as for writing 2007-11-23 20:49:42 +00:00
Andrey Kiselev d7c1603a27 Better OpenVMS support. Patches from Alexey Chupahin. 2007-11-23 10:01:34 +00:00
Frank Warmerdam d14dae9c0c avoid corruption risk with write-in-same-location logic 2007-11-02 19:57:28 +00:00
Frank Warmerdam e770990619 avoid extra tile info write in TIFFWriteDirectory() 2007-11-02 19:53:04 +00:00
Frank Warmerdam 508bb71bc3 add missing part of ChangeLog message for last change 2007-11-02 19:45:38 +00:00
Frank Warmerdam 4710fe4c8b Split pfunc into encode and decode versions to avoid mixing things
up in read/write applications.
http://trac.osgeo.org/gdal/ticket/1948
Also make a temporary working buffer to modify in PredictorEncodeTile.
http://trac.osgeo.org/gdal/ticket/1965
2007-11-02 19:43:55 +00:00
Frank Warmerdam f3c11d49d7 Improvements so that predictor based encoding and decoding works in
read-write update mode properly.  http://trac.osgeo.org/gdal/ticket/1948
2007-11-02 00:25:21 +00:00
Joris Van Damme 1a5dfd2205 tif_dirread.c: Fixed problem with bogus file triggering assert in ChopUpSingleUncompressedStrip 2007-10-24 10:19:42 +00:00
Joris Van Damme 7497b6e5f3 tif_jpeg.c: resolved buffer incrementation bug 2007-10-22 18:39:53 +00:00
Frank Warmerdam fe89e891bf update people responsible info for web site 2007-10-11 15:35:23 +00:00
Frank Warmerdam 8e40470908 Fix problem with alpha setting 2007-10-05 16:30:18 +00:00
Joris Van Damme 8753fa323f changed some more incorrect %lud printf flags to %lu 2007-10-01 12:43:48 +00:00
Joris Van Damme d8144e074c small correction to ChangeLog text entry 2007-09-29 10:37:40 +00:00
Joris Van Damme 00ddda303a tif_dirread.c: Fixed bad behaviour of strip chopping on uncompressed subsampled images. 2007-09-29 10:34:37 +00:00
Joris Van Damme cce392c46f tif_dirread.c: Logical cast working around compiler warning; tif_read.c: Correction of some error flags and parameter lists 2007-09-28 14:49:14 +00:00
Joris Van Damme 4df2d8f4f7 tif_dirread.c: made calculation of td_maxsamplevalue more robust; tif_open.c: moved early exit in case of 'h' flag, solving some unwanted bugs later on 2007-09-27 17:38:57 +00:00
Joris Van Damme fca5e791dd tif_dirinfo.c: fixed (MSVC) compiler reports about inconsistent use of const in tiffFields and exifFields definition 2007-09-24 06:40:14 +00:00
Andrey Kiselev 86a7057d06 Make all module name constants static. 2007-09-22 15:08:27 +00:00
Frank Warmerdam 37588b8480 Correct comment about tag counting in TIFFWriteDirectoryTagLongLong8Array. 2007-09-21 14:21:03 +00:00
Frank Warmerdam 86d1335d52 always write strip/tile offsets as long8 in bigtiff 2007-09-20 19:57:58 +00:00
Frank Warmerdam 08f2d19fab more improvements to error reporting in TIFFFetchDirectory 2007-09-20 19:20:54 +00:00
Frank Warmerdam 9f6ea3bef9 Fix name TIFFFetchDirectory uses in error message (was ...Classic). 2007-09-20 16:34:23 +00:00
Bob Friesenhahn 2737e0e77b * test/images: Added a small collection of test images for use by
test programs and scripts.
* test/tiffinfo.sh: A trivial example test script.
* test/common.sh: Added small script for setting the environment
used by script-based tests.
2007-09-19 21:51:00 +00:00
Frank Warmerdam 8b2b03ae11 Write the tif_nextdiroff value instead of a fixed zero when writing
directory contents to preserve the ability to rewrite directories in place,
even in the middle of a directory chain.
2007-08-24 20:49:38 +00:00
Frank Warmerdam a6bea11162 _TIFFMergeFields() now only merges in field definitions that are missing.
Existing definitions are silently ignored.  This avoids warnings with
multi-directory files.
2007-08-24 20:47:49 +00:00
Frank Warmerdam 4baacb150b Add runtime check in TIFFFetchNormalTag() 2007-08-24 20:45:59 +00:00
Joris Van Damme 3c78b558ae tif_getimage.c: removed SubsamplingHor/Ver from TIFFRGBAImage structure to revert unwanted ABI change 2007-08-10 10:19:55 +00:00
Joris Van Damme 2085534654 tif_win32.c: use SetFilePointer instead of SetFilePointerEx 2007-08-10 10:04:47 +00:00
Andrey Kiselev 0907a08768 Always test that tif_fields is not NULL before accessing array elements. 2007-07-19 17:16:25 +00:00
Andrey Kiselev d6b140da3b In TIFFCleanup() test that tif_fields is not NULL before iterating over
array.
2007-07-19 17:13:56 +00:00
Andrey Kiselev 54f0af17ca *** empty log message *** 2007-07-19 15:51:01 +00:00
Andrey Kiselev 7d5b41ee4f Use "%I64d" printf() formatter instead of "%lld" with MSVC compiler. 2007-07-19 15:50:28 +00:00
Andrey Kiselev b95ab39ef3 Put all callback functions declarations inside extern "C" block. 2007-07-19 15:44:31 +00:00
Andrey Kiselev 224710a9af Use "%I64d" printf() formatter instead of "%lld" with MSVC compiler. 2007-07-19 15:31:20 +00:00
Andrey Kiselev 9b76d52ad3 Use "%I64d" printf() formatter instead of "%lld" with MSVC compiler. 2007-07-19 13:25:43 +00:00
Andrey Kiselev 7c7f07f5d4 Added _TIFFUInt64ToFloat() and _TIFFUInt64ToDouble() functions. 2007-07-19 13:11:59 +00:00
Andrey Kiselev d27e1deccd *** empty log message *** 2007-07-18 16:06:50 +00:00
Andrey Kiselev f6bde7d27b Handle the case of MSVC 6 when using 64-bit integer constants. 2007-07-18 16:06:05 +00:00
Andrey Kiselev 91659c4185 Use __WIN32__ instead of WIN32 in preprocessor switches. 2007-07-18 15:26:09 +00:00
Andrey Kiselev 01e27cc652 Remove tif_config.h/tiffconf.h during clean. 2007-07-18 14:18:08 +00:00
Andrey Kiselev dfc01ae91e tif_config.wince.h/tiffconf.wince.h added to distribution. 2007-07-18 14:17:01 +00:00
Andrey Kiselev cd9d0d5133 Do not distribute tiffconf.h. 2007-07-18 13:53:12 +00:00
Andrey Kiselev 0067eade90 Do not use O_LARGEFILE. 2007-07-18 13:46:41 +00:00
Joris Van Damme 2167fa6349 Fix for Bob's DumpModeDecode size bug 2007-07-16 18:05:12 +00:00
Andrey Kiselev 42bed3384e libtiff 4.0.0alpha released. 2007-07-13 14:57:37 +00:00
Andrey Kiselev 8c8326e977 New. 2007-07-13 14:05:16 +00:00
Andrey Kiselev 612fe33e9d Mapping routines definitions fixed. 2007-07-12 17:32:53 +00:00
Andrey Kiselev 4bce67280a *** empty log message *** 2007-07-12 17:28:20 +00:00
Andrey Kiselev 3716b22ae8 Added missed extern optind. 2007-07-12 17:25:12 +00:00
Andrey Kiselev 875d6d385d *** empty log message *** 2007-07-12 14:00:35 +00:00
Andrey Kiselev 2d54748c15 Transition to the new-style tag extending scheme completed. 2007-07-12 13:59:34 +00:00
Andrey Kiselev 6969957dd5 Properly handle ASCII tag type in backward compatibility section.
Geotiff tags work again now.
2007-07-12 11:19:28 +00:00
Bob Friesenhahn f85a497165 Remove mis-placed comma. 2007-07-12 02:16:44 +00:00
Bob Friesenhahn 49a2425cbe Declare callback functions to use C linkage. 2007-07-11 21:27:14 +00:00
Bob Friesenhahn b2328c5b5d * libtiff/tif_stream.cxx: Adapt to use toff_t again. Update to
use standard C++ library size types and attempt to detect overflow
cases.
2007-07-11 20:27:14 +00:00
Joris Van Damme c4bddab560 BigTIFF upgrade: restoration of mapping functions protocol 2007-07-11 15:52:48 +00:00
Joris Van Damme d83d6100fd added maximum file size overflow check to avoid writing bad classictiff > 4 gig 2007-07-11 13:41:44 +00:00
Andrey Kiselev 3092c18cd3 Even more work to improve tag extending scheme. tif_fieldinfo member in TIFF
structure renamed into tif_fields to be consistent with the new function
names.
2007-07-10 11:52:02 +00:00
Joris Van Damme 70f82bf539 extended 'not enough data' error in tif_dumpmode.c for Bob's testing 2007-07-10 02:40:06 +00:00
Andrey Kiselev 80d98dc2b6 *** empty log message *** 2007-07-09 10:17:35 +00:00
Andrey Kiselev cd22afeaf9 More work on new tag extending scheme. Use the new scheme everywhere. 2007-07-09 10:15:37 +00:00
Andrey Kiselev 0de7ab49eb Rename TIFFMergeField() function into TIFFMergeFields(). 2007-07-09 09:26:57 +00:00
Andrey Kiselev 6351780a75 *** empty log message *** 2007-07-08 18:33:01 +00:00
Andrey Kiselev 6678ac1b5e TIFFFIeldInfo structure replaced with TIFFField structure. TIFFFieldInfo
retained for the backward compatibility.
2007-07-08 18:30:41 +00:00
Bob Friesenhahn de5235e3af * tools/tiff2pdf.c: Fix a compile problem when JPEG_SUPPORT is not
defined.
2007-07-06 01:25:11 +00:00
Joris Van Damme b8fde73523 BigTIFF upgrade: fix to not write TileOffsets and TileByteCounts with datatype SHORT 2007-07-06 00:49:18 +00:00
Andrey Kiselev e61241254a Enumerate constants in TIFFSetGetFieldType. 2007-07-05 16:18:57 +00:00
Joris Van Damme 28b4b36027 BigTIFF upgrade: reflected BigTIFF changes in v4.0.0.html 2007-07-05 14:15:30 +00:00
Joris Van Damme f30b4829fb BigTIFF upgrade: fix of Bob's bug on weird-endian machines 2007-07-05 02:57:12 +00:00
Bob Friesenhahn 3a23e0f57a Don't pass null pointer into bsearch(). 2007-07-04 21:33:31 +00:00
Andrey Kiselev 1e90985416 *** empty log message *** 2007-07-04 14:06:53 +00:00
Andrey Kiselev 6703aca211 New. 2007-07-04 14:06:38 +00:00
Andrey Kiselev f3758c6b0e Unused TIFFReassignTagToIgnore() function and TIFFIgnoreSense enumeration
removed.
2007-07-04 14:04:47 +00:00
Andrey Kiselev a26e2d13b6 Move tags TIFFTAG_FAXRECVPARAMS, TIFFTAG_FAXSUBADDRESS, TIFFTAG_FAXRECVTIME
and TIFFTAG_FAXDCS to the common tag directory.	These tags are not
codec-specific and relate to image content, so process them as other normal
tags.
2007-07-04 13:58:38 +00:00
Andrey Kiselev a88f534935 TIFFTagValue structure moved from the public tiffio.h to private tif_dir.h. 2007-07-04 13:21:31 +00:00
Andrey Kiselev 51b72a1eb9 *** empty log message *** 2007-07-04 11:39:22 +00:00
Andrey Kiselev 7b2906b7ca Outdated portability stuff removed. 2007-07-04 11:34:17 +00:00
Andrey Kiselev e16f59e6e2 Number of problems fixed; now this utility can be built with gcc. 2007-07-04 11:31:36 +00:00
Andrey Kiselev 009671a000 *** empty log message *** 2007-07-03 16:06:41 +00:00
Andrey Kiselev 6b8c92d3f8 tif_next.c was mentioned twice, fixed. 2007-07-03 16:06:32 +00:00
Andrey Kiselev 47588d8839 Obsoleted portability stuff removed. 2007-07-03 16:05:49 +00:00
Andrey Kiselev 1c81bc514c *** empty log message *** 2007-07-03 16:01:18 +00:00
Andrey Kiselev bf903e0588 Added support 16-bit images as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1566
Patch from William Bader.
2007-07-03 16:00:53 +00:00
Andrey Kiselev ede042221b *** empty log message *** 2007-07-03 15:51:48 +00:00
Andrey Kiselev 9a19c1e905 Fix for TIFFTAG_JPEGTABLES tag fetching and significant upgrade of the whole
utility as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1560
Now we don't need tiffiop.h in tiff2pdf anymore and will open output PDF file
using TIFFClientOpen() machinery as it is implemented by Leon Bottou.
2007-07-03 15:47:05 +00:00
Bob Friesenhahn 50f1a6ab77 Don't attempt to bsearch() on NULL tif_fieldinfo. 2007-06-29 19:20:57 +00:00
Joris Van Damme 9dd037e3c9 check of WORDS_BIGENDIAN added to configuration checks at the top of TIFFClientOpen 2007-06-29 11:30:29 +00:00
Bob Friesenhahn 7e1f1dba52 Updated for "large" I/O. 2007-06-29 01:18:07 +00:00
Bob Friesenhahn 9128f747b5 Removed inclusion of limits.h. 2007-06-28 22:23:49 +00:00
Bob Friesenhahn e04978578e Rewrote _tiffReadProc(), _tiffWriteProc(), and _tiffSeekProc(). 2007-06-28 22:21:25 +00:00
Andrey Kiselev 1a19f4c9ae Use libtool versioning instead of package release numbers. 2007-06-28 13:51:23 +00:00
Andrey Kiselev d8207f580b Version number has been changed; use libtool versioning instead of
package release numbers.
2007-06-28 13:50:27 +00:00
Andrey Kiselev 635c6b8cec Make this module buildable. We supposing that _FILE_OFFSET_BITS is set to 64
in tif_config.h.
2007-06-28 13:21:55 +00:00
Joris Van Damme c3e2c83b14 BigTIFF upgrade: unchecked and untested version of upgraded tif_jbig.c 2007-06-28 13:13:18 +00:00
Joris Van Damme 3930fc6e3a BigTIFF upgrade: changed indent from spaced to tabs in tif_jbig.c 2007-06-28 12:44:28 +00:00
Joris Van Damme 579d12785c BigTIFF upgrade: insertion of reserved member in TIFFFieldInfo structure 2007-06-28 12:43:07 +00:00
Bob Friesenhahn 100fb620da Add needed inclusion of limits.h 2007-06-28 05:51:18 +00:00
Joris Van Damme d78966c6cf BigTIFF upgrade: unchecked and untested version of upgraded tif_unix.c 2007-06-28 01:34:01 +00:00
Joris Van Damme b2519675c3 BigTIFF upgrade: misc compiler warnings workarounds and few minor bugfixes, restoration of tif_dirwrite.c 2007-06-27 16:09:58 +00:00
Joris Van Damme 06c7530fba BigTIFF upgrade: solution for uint16 through variable argument list 2007-06-27 12:28:15 +00:00
Andrey Kiselev f14d1a5636 All makefile templates regenerated. 2007-06-27 12:03:37 +00:00
Andrey Kiselev 464f812265 *** empty log message *** 2007-06-27 12:01:03 +00:00
Andrey Kiselev 78e9b0ed48 Updated to latest upstream. 2007-06-27 11:59:16 +00:00
Bob Friesenhahn 5016816617 Added support for a TIFF_SSIZE_T in order to return memory sizes but still
allow returning -1 for errors.
2007-06-26 22:52:05 +00:00
Bob Friesenhahn 671e370838 Added support for a TIFF_PTRDIFF_T type to use when doing pointer arithmetic. 2007-06-26 20:05:33 +00:00
Bob Friesenhahn 9cc5ffaf11 Somehow libtool.m4 was not updated. 2007-06-26 18:02:00 +00:00
Bob Friesenhahn 71b780383f Hopefully fixed botched upgrade of libtool. 2007-06-26 16:38:43 +00:00
Bob Friesenhahn 62362f08b7 Remove GCC-specific argument specification. 2007-06-26 15:46:23 +00:00
Bob Friesenhahn 785843bd90 * configure.ac: Fix typo when substituting value for unsigned 8 bit type.
* libtiff/tiffconf.vc.h: Add porting type defintions for WIN32.
2007-06-26 15:39:51 +00:00
Joris Van Damme 84edfb3582 BigTIFF upgrade: misc compiler warnings workarounds and few minor bugfixes 2007-06-26 12:31:25 +00:00
Joris Van Damme b6da3ca5c9 BigTIFF upgrade: warnings in platform dependent files that are not yet updated 2007-06-26 10:41:27 +00:00
Joris Van Damme a2ce1c675c BigTIFF upgrade: misc little things, indentation and some compiler warnings workarounds 2007-06-26 10:30:12 +00:00
Joris Van Damme 1988981be8 BigTIFF upgrade: misc little things, mostly indentation and unimportant stuff 2007-06-26 09:42:27 +00:00
Bob Friesenhahn 00edd87348 Forgot to delete code in #if 0 block. 2007-06-25 15:58:03 +00:00
Bob Friesenhahn 8c4398d0d6 * port/strtoull.c: New porting function in case strtoull() is not
available on the target system.
* configure.ac: Add configure support for determining sized types
in a portable way and performing necessary substitutions in
tif_config.h and tiffconf.h.  Updated tiff.h to use the new
definitions.
2007-06-25 15:38:21 +00:00
Joris Van Damme d8a844d08d BigTIFF upgrade: misc little things 2007-06-23 01:32:31 +00:00
Joris Van Damme 4ef858724a BigTIFF upgrade: mostly TIFFFieldInfo related stuff, anticipating future tag handling plans 2007-06-23 01:06:06 +00:00
Joris Van Damme f72ffa0046 BigTIFF upgrade: misc little things 2007-06-22 08:27:19 +00:00
Joris Van Damme ccb583be17 BigTIFF upgrade: misc little things, mostly indentation and unimportant stuff 2007-06-21 16:47:14 +00:00
Joris Van Damme 0cb68e6f19 BigTIFF upgrade: finalisation of tif_win32.c, read and write funcs now supporting potential 64bit size types 2007-06-20 10:43:46 +00:00
Joris Van Damme 70b42a0259 BigTIFF upgrade: tiffcp.c 2007-06-20 08:36:42 +00:00
Joris Van Damme 4bd2d780ce BigTIFF upgrade: tiffcp.c 2007-06-20 08:35:57 +00:00
Joris Van Damme 923c450f24 BigTIFF upgrade: last minute correction to do with directory writing 2007-06-15 08:08:26 +00:00
Joris Van Damme 78faf04967 BigTIFF upgrade: tiff2rgba.c (last minute correction) 2007-06-13 14:21:59 +00:00
Joris Van Damme 140aefa242 BigTIFF upgrade: tiff2rgba.c 2007-06-13 14:14:03 +00:00
Joris Van Damme 6b42b6bad5 BigTIFF upgrade: tiffdump.c, complete except for IO standard library functions 2007-06-13 13:01:43 +00:00
Joris Van Damme dfdc09321a BigTIFF upgrade: finalisation of tif_dirwrite.c 2007-06-13 10:58:59 +00:00
Joris Van Damme 6696d959b5 BigTIFF upgrade: tiffinfo.c 2007-06-12 13:08:09 +00:00
Joris Van Damme 27b1ed20d1 BigTIFF upgrade: type restoration - not so messy anymore 2007-06-12 13:07:32 +00:00
Joris Van Damme 5f482e9dc5 BigTIFF upgrade in tif_dirwrite.c - still temp mess 2007-06-12 10:42:07 +00:00
Joris Van Damme a583ba43dd BigTIFF upgrade in tif_dirwrite.c - still temp mess 2007-06-08 09:10:21 +00:00
Joris Van Damme 0b44a7943b BigTIFF upgrade in tif_dirwrite.c - still temp mess 2007-06-07 12:15:18 +00:00
Joris Van Damme 92c13c9aac BigTIFF upgrade in tif_dirwrite.c - still temp mess 2007-06-06 10:01:01 +00:00
Joris Van Damme 2258bc2217 BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-05-31 13:33:50 +00:00
Joris Van Damme c81185549e BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-05-30 13:53:17 +00:00
Joris Van Damme c5e8d4f5ac BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-05-24 15:51:35 +00:00
Joris Van Damme 28e5681dee BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-05-23 15:36:16 +00:00
Joris Van Damme 7d5139e95b site update containing BigTIFF press release 2007-05-18 12:34:54 +00:00
Andrey Kiselev 72df4cee00 Remove extra tif_jbig.obj from the list of object files as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1555
2007-05-17 14:23:09 +00:00
Joris Van Damme cee1368442 BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-05-15 11:09:16 +00:00
Joris Van Damme b91bad77c0 BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-05-11 14:41:01 +00:00
Joris Van Damme be0e76da4d BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-05-11 05:44:10 +00:00
Andrey Kiselev fd39d5b31b Typo fixed. 2007-04-30 11:27:48 +00:00
Andrey Kiselev 21ad2ee1a7 *** empty log message *** 2007-04-27 16:47:42 +00:00
Andrey Kiselev 85cec3b0a7 Check the tmpfile() return status as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=154
2007-04-27 16:47:14 +00:00
Joris Van Damme fdddd616f1 BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-04-19 00:51:47 +00:00
Andrey Kiselev d47a85ce37 Avoid warnings. 2007-04-18 08:46:33 +00:00
Joris Van Damme 1dc118560d BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-04-11 14:28:58 +00:00
Joris Van Damme 0d947e2857 BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-04-11 02:41:22 +00:00
Joris Van Damme 53b3dd936d BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-04-10 17:36:19 +00:00
Joris Van Damme 8872f01002 BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-04-10 16:45:42 +00:00
Andrey Kiselev ff1d8bf5c1 Get rid of assert() in _TIFFMergeFieldInfo() since we can return erroneus
status now.
2007-04-10 16:15:04 +00:00
Joris Van Damme ebbeebb943 BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-04-10 03:22:11 +00:00
Joris Van Damme 8dc917fd5c BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-04-10 02:56:33 +00:00
Joris Van Damme a9e2df3933 BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-04-10 02:41:15 +00:00
Joris Van Damme 05046aae9e BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-04-09 18:03:30 +00:00
Joris Van Damme edcc0081c3 BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-04-09 12:28:38 +00:00
Joris Van Damme b14fd8917f BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-04-09 11:58:04 +00:00
Andrey Kiselev a89fa14e40 Various clean-ups. 2007-04-07 15:21:10 +00:00
Andrey Kiselev d821eda158 *** empty log message *** 2007-04-07 15:16:55 +00:00
Andrey Kiselev 46f6411b2c Finally fix bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1274 by
introducing _TIFFMergeFieldInfo() returning integer error status instead of
void in case of problems with field merging (e.g., if the field with such a tag
already registered). TIFFMergeFieldInfo() in public API remains void. Use
_TIFFMergeFieldInfo() everywhere and check returned value.
2007-04-07 15:14:30 +00:00
Andrey Kiselev 7acb6903d5 Weird line ending fixed. 2007-04-07 15:06:02 +00:00
Frank Warmerdam d8921f2ad4 Fix problems with odd sized output blocks in TIFF_DownSample_Subsampled() (bug 1542). 2007-04-07 06:36:39 +00:00
Frank Warmerdam 0060e8d942 fix in JPEGInitializeLibJPEG for compress/decompress mixup (bug #1541) 2007-04-06 21:04:27 +00:00
Andrey Kiselev 6b47776e21 *** empty log message *** 2007-04-06 14:27:30 +00:00
Andrey Kiselev d7b45da13f Updated to reflect recent changes in tiffcrop. 2007-04-06 14:27:03 +00:00
Andrey Kiselev dc8ae28aa2 Significant update in functionsality as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1525
2007-04-06 14:23:54 +00:00
Andrey Kiselev 011a2dcdbf Remove *.pdb files when cleaning. 2007-04-06 14:20:56 +00:00
Joris Van Damme cccb9c5885 BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-04-05 16:15:10 +00:00
Joris Van Damme 126f04ce5e BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-04-04 04:16:07 +00:00
Joris Van Damme 7c0eb6eb47 BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-03-31 01:41:10 +00:00
Joris Van Damme ba321978d8 BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-03-31 01:04:52 +00:00
Frank Warmerdam 05c09c045b fix static/inline issue with IRIC C++ Compiler 2007-03-28 21:47:01 +00:00
Joris Van Damme a0859b11a8 BigTIFF upgrade in progress - widespread temp mess - does not compile now 2007-03-28 02:50:41 +00:00
Joris Van Damme c304b8db85 BigTIFF upgrade in progress 2007-03-27 04:24:28 +00:00
Joris Van Damme 7140e05e91 BigTIFF upgrade in progress 2007-03-26 16:16:44 +00:00
Joris Van Damme 4fa7588a37 BigTIFF upgrade in progress 2007-03-24 11:48:17 +00:00
Joris Van Damme 8d13c64b89 BigTIFF upgrade in progress 2007-03-22 05:53:23 +00:00
Joris Van Damme 01d1531ce0 BigTIFF upgrade in progress 2007-03-22 02:08:21 +00:00
Andrey Kiselev 1e551b86eb Make dummy fucntion non-static. 2007-03-21 14:54:16 +00:00
Andrey Kiselev d9eded9d9d Added CVS instructions for 3.9 branch. 2007-03-19 15:43:23 +00:00
Joris Van Damme 3c1b96c8bc BigTIFF upgrade in progress 2007-03-19 12:11:15 +00:00
Joris Van Damme 513dc25a14 BigTIFF upgrade in progress 2007-03-17 05:21:29 +00:00
Joris Van Damme d5bb03d2e2 BigTIFF upgrade in progress 2007-03-17 04:41:28 +00:00
Joris Van Damme 7cff22e59c workaround for OJPEG 'Fractional scanline' bug in tif_getimage.c 2007-03-08 03:07:42 +00:00
Joris Van Damme f547b2607b Indentation restoration, no functionality change 2007-03-08 02:18:31 +00:00
Joris Van Damme 04282d6b8f minor changes in tif_win32.c 2007-03-07 17:10:31 +00:00
Joris Van Damme 7a17af90d4 Small website changes to reflect BigTIFF-in-LibTiff project status 2007-03-02 18:36:11 +00:00
Andrey Kiselev 5ea085b57e *** empty log message *** 2007-02-27 15:46:48 +00:00
Andrey Kiselev 1ccfef7853 Use uint32 type instead of tsize_t in byte counters in TIFFFetchData(). Should
finally fix the issue http://bugzilla.remotesensing.org/show_bug.cgi?id=890
2007-02-27 15:46:34 +00:00
Andrey Kiselev 1c0564c8e8 *** empty log message *** 2007-02-24 17:16:40 +00:00
Andrey Kiselev c29dea9440 Properly handle tags with TIFF_VARIABLE writecount. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1350
2007-02-24 17:14:14 +00:00
Andrey Kiselev 6c7bf882d0 Added special function to handle SubjectDistance EXIF tag as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1362
2007-02-24 17:09:31 +00:00
Andrey Kiselev c4f2e5b44e Do not assume inches when the resolution units do not specified. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1366
2007-02-24 16:28:48 +00:00
Andrey Kiselev db88776e03 Do not change RowsPerStrip value if it was set as infinite. As per bug:
http://bugzilla.remotesensing.org/show_bug.cgi?id=1368
2007-02-24 15:57:01 +00:00
Andrey Kiselev 17526ec423 *** empty log message *** 2007-02-24 15:56:24 +00:00
Andrey Kiselev 29b4f6fbdc Added Richard Nolde to the list of contributors. 2007-02-24 15:47:04 +00:00
Andrey Kiselev e82a93e642 Use strchr() instead of index(); avoid warnings. 2007-02-24 15:27:15 +00:00
Andrey Kiselev 2ad35de456 Added tiffcrop utility. 2007-02-24 15:26:09 +00:00
Andrey Kiselev ef833c655f Regenerated. 2007-02-24 15:03:47 +00:00
Andrey Kiselev bddf26622c New. 2007-02-24 14:48:01 +00:00
Andrey Kiselev b7493a8259 Updated to recent versions. 2007-02-24 13:19:06 +00:00
Andrey Kiselev 33465b3610 Document missing '-i' command line switch as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1437
2007-02-24 11:19:33 +00:00
Andrey Kiselev 52cd7a3a70 *** empty log message *** 2007-02-22 14:07:47 +00:00
Andrey Kiselev 2e0f36bb30 Workaround for incorrect TIFFs with ExtraSamples == 999 produced by Corel
Draw. As per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1490
2007-02-22 14:07:16 +00:00
Andrey Kiselev a128f8e5b5 *** empty log message *** 2007-02-22 11:34:10 +00:00
Andrey Kiselev e42bb3f6b2 Type of the byte counters changed from tsize_t to uint32 to be able to work
with data arrays larger than 2GB. Fixes bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=890
Idea submitted by Matt Hancher.
2007-02-22 11:33:44 +00:00
Andrey Kiselev f60e3e9593 Added declaration for getopt(). 2007-02-22 11:27:17 +00:00
Andrey Kiselev a155447a5f Do not include absent tiffcomp.h header; include std headers instead. 2007-02-21 14:20:32 +00:00
Andrey Kiselev a766aaa89e *** empty log message *** 2007-01-31 14:47:15 +00:00
Andrey Kiselev c0123c7895 This utility does not work properly on big-endian architectures. It was fixed
including the bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1149
2007-01-31 14:46:59 +00:00
Andrey Kiselev 7fd8cdbe99 Attempt to fix bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1149 2007-01-27 18:38:34 +00:00
Mateusz Loskot 367a35efb3 TIFF library ported to Windows CE platform. 2007-01-15 18:40:39 +00:00
Andrey Kiselev bda9dea5ed Tiny fix in the comments. 2007-01-10 16:59:53 +00:00
Joris Van Damme 8a5381a05f Update to BigTIFF proposal page, saying four sponsors have been found 2006-12-24 12:11:05 +00:00
Frank Warmerdam 92c680cdf1 clear sorted flag if we move a strip/tile - bug 1359 2006-11-20 02:11:39 +00:00
Joris Van Damme d218770ca5 added BigTIFF project proposal page 2006-10-25 09:56:59 +00:00
Andrey Kiselev 174ca97ba5 Regenerated. 2006-10-13 15:27:43 +00:00
Andrey Kiselev 3337b034f1 *** empty log message *** 2006-10-13 15:07:40 +00:00
Andrey Kiselev b9c3214b60 More fixes for vulnerabilities, reported in Gentoo bug ():
http://bugs.gentoo.org/show_bug.cgi?id=142383
2006-10-13 15:06:52 +00:00
Andrey Kiselev c905dc9878 tiffset.exe added to the list of utilities to be build. 2006-10-13 11:06:07 +00:00
Andrey Kiselev e04a08ec2e Improve clean target a bit. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1318
2006-10-13 10:30:21 +00:00
Andrey Kiselev 576c461a28 Get rid of BSD integer types as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1319
2006-10-13 10:26:56 +00:00
Andrey Kiselev 14f595b9a0 Make xtiff utility compilable. Though it is still far from the state of being
working and useful.
2006-10-13 10:16:22 +00:00
Andrey Kiselev da07e8372e Added test for X Athena widgets. 2006-10-13 10:15:35 +00:00
Andrey Kiselev 5338cd561e New. 2006-10-13 10:13:31 +00:00
Andrey Kiselev 0140e4965d Removed. 2006-10-13 07:37:27 +00:00
Andrey Kiselev 24c0091bb2 Correct functions definitions as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1319
2006-10-13 07:22:01 +00:00
Andrey Kiselev b560709ed0 *** empty log message *** 2006-10-12 18:12:12 +00:00
Andrey Kiselev 481b53b4e1 Save the state of printdir codec dependent method. 2006-10-12 18:11:30 +00:00
Andrey Kiselev 7ddafe6c10 Save the state of printdir codec dependent method as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1273
2006-10-12 18:02:52 +00:00
Andrey Kiselev 1b6451a4f5 Fixed problem with offset value manipulation as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1322
2006-10-12 17:38:48 +00:00
Andrey Kiselev 9876fb1391 More fixes for vulnerabilities, reported in Gentoo bug ():
http://bugs.gentoo.org/show_bug.cgi?id=142383
2006-10-12 16:50:55 +00:00
Andrey Kiselev 263c34ba87 Spelling fixed. 2006-10-12 15:46:25 +00:00
Andrey Kiselev 5f25ca7464 Tavis Ormandy added to the list of contributors. 2006-10-12 15:44:42 +00:00
Andrey Kiselev 8eebc4b8d8 More fixes for vulnerabilities, reported in Gentoo bug ():
http://bugs.gentoo.org/show_bug.cgi?id=142383
2006-10-12 15:36:14 +00:00
Andrey Kiselev 8e71c5aa08 Fixed multiple vulnerabilities, as per Gentoo bug ():
http://bugs.gentoo.org/show_bug.cgi?id=142383
2006-10-12 15:01:30 +00:00
Andrey Kiselev f6c9458485 Avoid warnings. 2006-10-12 15:00:49 +00:00
Andrey Kiselev c92f74ccc1 Added a comments about future development directions. 2006-10-12 14:49:09 +00:00
Andrey Kiselev 24939d361e Added a note that libtiff is a portable software; typo fixed. 2006-10-09 16:09:47 +00:00
Andrey Kiselev c535abe2ae Fixed link to BigTIFF specification. 2006-10-05 15:20:40 +00:00
Andrey Kiselev 496e006bbe *** empty log message *** 2006-09-28 16:26:55 +00:00
Andrey Kiselev fe30eef772 Fixed multiple vulnerabilities, as per Gentoo bug ():
http://bugs.gentoo.org/show_bug.cgi?id=142383
2006-09-28 16:26:03 +00:00
Frank Warmerdam b201d46b26 fixed problem with read/write mixing for lzw/zip compressed files 2006-09-27 22:38:58 +00:00
Frank Warmerdam 0e306d2ae1 obsolete 2006-09-20 13:35:35 +00:00
Frank Warmerdam 46205c4bc3 New 2006-09-20 13:35:12 +00:00
Frank Warmerdam 649b74d9d6 rename .h.vc to .vc.h 2006-09-20 13:34:16 +00:00
Andrey Kiselev 01e076865e Add explanation about trailing comma in image indicies. 2006-08-03 17:51:32 +00:00
Andrey Kiselev d4640743e8 *** empty log message *** 2006-07-28 09:57:51 +00:00
Andrey Kiselev fa3ace0eb4 Small fix in TIFFhowmany8() macro. 2006-07-28 09:50:14 +00:00
Frank Warmerdam 06d980830c *** empty log message *** 2006-07-25 18:27:36 +00:00
Frank Warmerdam e026f4c206 Avoid handle leak in TIFFOpen() for non-TIFF files (from Thierry Pierron). 2006-07-25 18:26:33 +00:00
Frank Warmerdam 8269c6aadc (1) take care not to flush out buffer of strip/tile
data in _TIFFWriteDirectory if TIFF_BEENWRITING not set.  Relates
to bug report by Peng Gao with black strip at bottom of images.
(2) make sure to use uint32 for wordcount in
TIFFWriteNormanTag if writecount is VARIABLE2 for ASCII fields.
It already seems to have been done for other field types.  Needed
for "tiffset" on files with geotiff ascii text.
2006-07-20 03:27:01 +00:00
Frank Warmerdam 764c5d5ae2 Updated location of TIFF6.pdf on our ftp site. 2006-07-10 18:13:52 +00:00
Bob Friesenhahn 33bf9a3f4c * {configure.ac, libtiff/tif_config.h.vc, libtiff/tif_jbig.c}
(JBIGDecode): jbg_newlen is not available in older JBIG-KIT and
its use does not appear to be required, so use it only when it is
available.
2006-07-04 19:01:47 +00:00
Andrey Kiselev 1398c14781 Null definition removed. 2006-06-30 19:08:03 +00:00
Andrey Kiselev 0360163075 *** empty log message *** 2006-06-24 18:02:15 +00:00
Andrey Kiselev 2f7b9c3d39 Initial (very) preliminary implementation of the TIFFWriteCustomDirectory(). 2006-06-24 18:01:37 +00:00
Andrey Kiselev e15a7e01fb Added missed EXIF tag ColorSpace (40961). 2006-06-24 13:30:50 +00:00
Andrey Kiselev d1ea9ba101 Move IFD fetching code in the separate function TIFFFetchDirectory() avoiding
code duplication in TIFFReadDirectory() and TIFFReadCustomDirectory().
2006-06-24 13:25:48 +00:00
Frank Warmerdam 06ab41916f Fix handling of -q values. (bug 587) 2006-06-19 20:12:07 +00:00
Frank Warmerdam 8a6eb4e9c4 fixed gdaladdo bug due to overeager use of EstimateStripByteCount and lack of tile case 2006-06-17 17:20:45 +00:00
Andrey Kiselev 393d84c969 *** empty log message *** 2006-06-08 14:28:45 +00:00
Andrey Kiselev 0a27311394 Move IFD looping checking code in the separate function TIFFCheckDirOffset(). 2006-06-08 14:27:17 +00:00
Andrey Kiselev c0e99e81f8 Added _TIFFCheckRealloc() function. 2006-06-08 14:24:13 +00:00
Andrey Kiselev 5a80b5f42e Fixed floating point comparison logic as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1191
2006-06-08 11:52:27 +00:00
Andrey Kiselev e48f2efda3 Fixed problems in fax decoder as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1194
2006-06-08 11:33:00 +00:00
Andrey Kiselev 3c3ae7d37c More fixes for character type safety. 2006-06-08 11:27:11 +00:00
Andrey Kiselev a0fdd6eb0c Fixed buffer overflow condition in t2p_write_pdf_string() as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1196
2006-06-08 10:45:35 +00:00
Andrey Kiselev 01a173d4b8 Added help line for 'jbig' compression option. 2006-06-07 16:34:32 +00:00
Andrey Kiselev 7c7d6ae826 Added switches to enable JBIG support. 2006-06-07 16:33:45 +00:00
Andrey Kiselev 04847f876d Make --enable-old-jpeg working again. 2006-06-07 16:09:07 +00:00
Andrey Kiselev 514fb56f86 Regenerated. 2006-06-07 15:55:20 +00:00
Andrey Kiselev 073cc29949 *** empty log message *** 2006-06-07 15:48:45 +00:00
Andrey Kiselev 9ff07be06c Added support for JBIG compression scheme (34661 code) contributed by Lee
Howard. As per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=896
2006-06-07 15:47:43 +00:00
Andrey Kiselev bcdfba3f12 Added support for JBIG compression scheme; OJPEG support enabled by default. 2006-06-07 15:40:44 +00:00
Andrey Kiselev de8132768f Added support for JBIG compression scheme (34661 code) contributed by Lee
Howard. As per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=896
2006-06-07 15:39:03 +00:00
Andrey Kiselev 88df59e89c Updated to recent upstream. 2006-06-07 14:45:43 +00:00
Andrey Kiselev b11ec97f62 ojpeg/ directory removed. 2006-06-07 14:43:44 +00:00
Andrey Kiselev 9c8bfd33b7 Removed. 2006-06-07 14:43:05 +00:00
Andrey Kiselev 60632af919 No need in this patch anymore. 2006-06-07 14:40:51 +00:00
Bob Friesenhahn 56f599add1 * libtiff/{tif_dirinfo.c, tif_print.c} : Fix crash in
TIFFPrintDirectory().  Joris Van Damme authored the fix.
2006-06-03 15:28:29 +00:00
Andrey Kiselev 49c40df5d4 *** empty log message *** 2006-04-21 16:48:17 +00:00
Andrey Kiselev f7035cc549 Unified line ending characters (always use '\n') as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1163
2006-04-21 15:09:34 +00:00
Andrey Kiselev 005ac319dc Added support for OpenVMS by Alexey Chupahin, elvis_75@mail.ru. 2006-04-21 14:22:57 +00:00
Andrey Kiselev 39051ccc51 Added support for OpenVMS. 2006-04-21 14:18:54 +00:00
Andrey Kiselev 1222c3f1c2 *** empty log message *** 2006-04-20 12:49:00 +00:00
Andrey Kiselev 8ba8e9489a Regenerated. 2006-04-20 12:38:54 +00:00
Andrey Kiselev 550cfd7a32 Properly set the binary mode for stdin stream as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1141
2006-04-20 12:36:23 +00:00
Andrey Kiselev 55bd0128b3 Added tests for io.h header and setmode() function. 2006-04-20 12:26:46 +00:00
Andrey Kiselev 94212b3d81 Improvements in page formatting as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=114
2006-04-20 12:17:19 +00:00
Andrey Kiselev 4b9b4181fb Added description for '-b' option. 2006-04-20 12:07:41 +00:00
Andrey Kiselev e3fe101bf5 Fixed typos as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1139 2006-04-20 12:04:35 +00:00
Andrey Kiselev a2a1911b67 Fixed typos as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=113 2006-04-20 11:48:42 +00:00
Frank Warmerdam 58cea4d46c use /EHsc and -D_CRT_SECURE_NO_DEPRECATE for VS2005 support 2006-04-19 01:14:00 +00:00
Joris Van Damme afc7488f13 response to Bob's compiler warnings - no functionality change 2006-04-13 03:25:53 +00:00
Joris Van Damme b1c2b3ed27 Added support for planarconfig separate non-subsampled YCbCr to tif_getimage.c 2006-04-12 07:29:51 +00:00
Joris Van Damme 410042ad06 Revision of all RGB(A) put routines in tif_getimage.c, including bugfix in handling 16bit RGB with unassociated alpha 2006-04-11 13:33:19 +00:00
Joris Van Damme e5e88271c0 minor improvement in tif_getimage.c gtTileSeparate and gtStripSeparate, no functionality change 2006-04-11 08:03:25 +00:00
Joris Van Damme 03898a1b13 some indentation restoration, no content change 2006-04-09 03:36:58 +00:00
Joris Van Damme 64f4609a40 added explanation of OJPEG codec operation - no functionality change 2006-04-08 22:52:49 +00:00
Joris Van Damme 0394c208ba minor refactoring of tif_getimage.c to accomodate planed functionality extension - no functionality change at this time 2006-04-08 08:01:34 +00:00
Joris Van Damme d2d4ae98fb some indentation restoration, no content change 2006-04-08 03:08:56 +00:00
Joris Van Damme c3a1701f0f some indentation restoration, no content change 2006-04-08 02:41:30 +00:00
Joris Van Damme aeded5016d resolved memory leak in tif_ojpeg 2006-04-08 02:15:40 +00:00
Joris Van Damme 6dc5e60719 fix of bug in tif_getimage.c and tif_ojpeg.c, reported by Frank testing tif2rgba on smallliz 2006-04-07 00:08:56 +00:00
Joris Van Damme f83440417a response to Bob's compiler warnings - one with potential impact on functionality 2006-04-04 16:49:16 +00:00
Joris Van Damme 25dda009dc *** empty log message *** 2006-04-04 05:09:21 +00:00
Joris Van Damme afa2919856 *** empty log message *** 2006-04-04 04:14:22 +00:00
Joris Van Damme 1721a41f08 new ojpeg support 2006-04-04 02:00:08 +00:00
Frank Warmerdam 2f8a9c2b71 recompute upsample flag when photometric flag reset 2006-03-29 22:24:44 +00:00
Joris Van Damme 0993cc0252 some indentation restoration, no content change 2006-03-26 16:39:30 +00:00
Joris Van Damme 84281a8949 strip size related bugfix in tif_jpeg encode raw 2006-03-25 18:04:34 +00:00
Joris Van Damme 64bd1138df bugfix to correctly pass size of last truncated strip data to TIFFWriteEncodedStrip 2006-03-25 17:52:37 +00:00
Joris Van Damme 993becfa19 bugfix of tif_jpeg decode raw 2006-03-25 08:01:08 +00:00
Joris Van Damme fd00bb5c5c *** empty log message *** 2006-03-25 03:11:32 +00:00
Joris Van Damme 5dbfd5054d *** empty log message *** 2006-03-25 03:09:24 +00:00
Andrey Kiselev b90b47e6f7 libtiff 3.8.2 released. 2006-03-23 14:54:00 +00:00
Andrey Kiselev bd5bff3cf6 Use runtime paths linker flags when rpath option enabled. 2006-03-23 14:23:43 +00:00
Andrey Kiselev 7f8cea0b57 *** empty log message *** 2006-03-21 16:45:43 +00:00
Andrey Kiselev 55949a4b7f Added missed exports as per bug
http://bugzilla.remotesensing.org/attachment.cgi?id=337
2006-03-21 16:42:27 +00:00
Andrey Kiselev fb8fe4b17f Makefiles improvements as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1128
2006-03-21 16:41:07 +00:00
Andrey Kiselev bc6736f91d Fixed win32 I/O functions usage as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1127
2006-03-21 16:37:51 +00:00
Andrey Kiselev a1151ff372 Take subsampling in account when calculating TIFFScanlineSize(). 2006-03-21 16:29:33 +00:00
Andrey Kiselev b5a9d9642e Do not set RowsPerStrip bigger than image length. 2006-03-21 16:24:33 +00:00
Andrey Kiselev ee7446ab86 Avoid warnings. 2006-03-20 15:29:53 +00:00
Andrey Kiselev b0a93ca843 Fixed version links. 2006-03-18 17:12:47 +00:00
Andrey Kiselev d50df6e082 *** empty log message *** 2006-03-17 14:59:50 +00:00
Andrey Kiselev 08300a98ec Fixed wrong TIFFerror() invocations as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1125
2006-03-17 14:58:57 +00:00
Andrey Kiselev 9ebb2b1a85 Fixed reading the input stream from stdin as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1124
2006-03-17 14:56:42 +00:00
Andrey Kiselev 970107e773 *** empty log message *** 2006-03-16 12:41:28 +00:00
Andrey Kiselev a97907bffd Updated from the latest upstream. 2006-03-16 12:41:00 +00:00
Andrey Kiselev b2e8c33493 Use _TIFFSetDefaultCompressionState() in all codec cleanup methods. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1120
2006-03-16 12:38:24 +00:00
Andrey Kiselev b0672e6b1b Few clarifications in error reporting messages. 2006-03-16 12:24:53 +00:00
Andrey Kiselev b63d5bddef Removed decalration for _TIFFSetDefaultCompressionState(). 2006-03-16 12:23:02 +00:00
Andrey Kiselev b69e469167 Added decalration for _TIFFSetDefaultCompressionState(). 2006-03-16 12:22:27 +00:00
Andrey Kiselev 65ee861c99 *** empty log message *** 2006-03-15 20:58:15 +00:00
Andrey Kiselev 08272d5428 Do not cleanup codec state in TIFFInitJPEG(). As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1119
2006-03-15 20:56:40 +00:00
Andrey Kiselev 58eec60cc9 *** empty log message *** 2006-03-15 12:50:23 +00:00
Andrey Kiselev c9abd9c598 Use double type instead of dblparam_t. 2006-03-15 12:49:35 +00:00
Andrey Kiselev c40ed030de Removed STRIP_SIZE_DEFAULT macro definition. 2006-03-15 12:49:15 +00:00
Andrey Kiselev bc5c02bfb2 dblparam_t typedef removed; GLOBALDATA macro removed; move here the
STRIP_SIZE_DEFAULT macro definition.
2006-03-15 12:48:45 +00:00
Andrey Kiselev a243e2c9a5 Do not set RowsPerStrip larger than ImageLength. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1110
2006-03-15 12:48:24 +00:00
Andrey Kiselev 80dc9736c2 *** empty log message *** 2006-03-14 13:45:04 +00:00
Andrey Kiselev 44070a6b97 Do not check the PlanarConfig tag presence in TIFFReadDirectory, because it is
always set at the start of function and we allow TIFFs without that tag set.
2006-03-14 13:44:39 +00:00
Andrey Kiselev 0dcb9ef111 libtiff 3.8.1 released. 2006-03-13 15:06:17 +00:00
Andrey Kiselev 60734505f3 *** empty log message *** 2006-03-13 14:52:12 +00:00
Andrey Kiselev f687f36b05 Memory leak fixed. 2006-03-13 07:53:28 +00:00
Andrey Kiselev 4aaddf9843 *** empty log message *** 2006-03-07 15:56:16 +00:00
Andrey Kiselev f99e104e84 Fixed error reporting in TIFFFetchAnyArray() function as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1102
2006-03-07 15:55:27 +00:00
Andrey Kiselev b0f4d2e934 More wise check for integer overflow condition as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1102
2006-03-07 13:57:01 +00:00
Andrey Kiselev 69ab321621 Properly restore setfield/getfield methods in cleanup functions. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1102
2006-03-07 11:59:12 +00:00
Andrey Kiselev c1f6d21424 Fixed stupid mistake introduced in previous edition. 2006-03-04 16:00:45 +00:00
Andrey Kiselev 1e7ead2850 *** empty log message *** 2006-03-03 14:14:40 +00:00
Andrey Kiselev 1a9877ef13 Use TIFFPredictorCleanup() in codec cleanup methods. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1102
2006-03-03 14:13:01 +00:00
Andrey Kiselev 2ed09338d9 Added new function TIFFPredictorCleanup() to restore parent
decode/encode/field methods.
2006-03-03 14:10:09 +00:00
Andrey Kiselev 2dfa4ad011 Fixed integer overflow condition in TIFFFetchData() function. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1102
2006-03-03 13:06:00 +00:00
Andrey Kiselev dfa63c0370 *** empty log message *** 2006-03-01 11:20:33 +00:00
Andrey Kiselev 9a43e77fe9 Set the ReferenceBlackWhite with the TIFFSetField() method, not directly.
As per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1043
2006-03-01 11:09:13 +00:00
Andrey Kiselev 71818ed599 Added support for PBM files as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1044
2006-03-01 10:41:24 +00:00
Andrey Kiselev 9c79d5ec0a *** empty log message *** 2006-02-27 14:29:56 +00:00
Andrey Kiselev cfee9aff9a Small code rearrangement in TIFFWriteScanline() to avoid crash as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1081.
2006-02-27 14:29:20 +00:00
Andrey Kiselev 2042f8cbda Use STRIP_SIZE_DEFAULT in _TIFFDefaultStripSize() function. 2006-02-27 14:09:35 +00:00
Andrey Kiselev 5e5bcec4b9 *** empty log message *** 2006-02-26 17:56:38 +00:00
Andrey Kiselev 2aad3477e6 Functions t2p_sample_rgbaa_to_rgb() and t2p_sample_rgba_to_rgb() was used in
place of each other, that was resulted in problems with RGBA images with
associated alpha. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1097
2006-02-26 17:55:42 +00:00
Andrey Kiselev bb47850863 *** empty log message *** 2006-02-23 16:08:23 +00:00
Andrey Kiselev 3c4295863e Properly write TIFFTAG_DOTRANGE tag as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1088.
2006-02-23 16:07:45 +00:00
Andrey Kiselev 3cdfaeafb1 Properly read TIFFTAG_PAGENUMBER, TIFFTAG_HALFTONEHINTS,
TIFFTAG_YCBCRSUBSAMPLING and TIFFTAG_DOTRANGE tags as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1088.
2006-02-23 15:56:34 +00:00
Andrey Kiselev 1146156015 Do not hide automatic counter. 2006-02-23 15:55:02 +00:00
Andrey Kiselev 6923ef1e64 Properly scale all the pages when converting multipage TIFF with
/width/height/center options set. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1080
2006-02-23 14:50:32 +00:00
Andrey Kiselev 989d90c025 *** empty log message *** 2006-02-15 13:35:04 +00:00
Andrey Kiselev 035bbb2d62 Do not create output file until all option checks will be done. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1072
2006-02-15 13:33:59 +00:00
Andrey Kiselev d4438d6fd4 Added ability to create multipage TIFFs from the list of input files as per
bug: http://bugzilla.remotesensing.org/show_bug.cgi?id=1077
2006-02-15 13:12:30 +00:00
Andrey Kiselev b936f969d0 *** empty log message *** 2006-02-09 16:19:45 +00:00
Andrey Kiselev 8367d94a7c Fix error reporting in TIFFCheckTile() as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1063.
2006-02-09 16:15:43 +00:00
Andrey Kiselev be7063caea Avoid crashing in case of image unsupported by TIFFRGBAImage interface. 2006-02-09 16:00:34 +00:00
Andrey Kiselev f6a82c8af4 Avoid overflow in case of wrong input as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1065.
2006-02-09 15:42:20 +00:00
Andrey Kiselev cd97834bed *** empty log message *** 2006-02-07 14:49:40 +00:00
Frank Warmerdam 0a02af9e2d fix for non-YCbCr jpeg compressed files 2006-02-07 14:28:48 +00:00
Andrey Kiselev a03acbb37c *** empty log message *** 2006-02-07 11:15:40 +00:00
Andrey Kiselev 4ae296c255 Help message formatting fixed. 2006-02-07 11:08:31 +00:00
Andrey Kiselev 9e660b33c7 Properly cast values to avoid warnings. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1033.
2006-02-07 11:00:22 +00:00
Andrey Kiselev f19535c6aa Use TIFF_NOTYPE instead of 0 when appropriate. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1033.
2006-02-07 10:45:38 +00:00
Andrey Kiselev 8aacb5ecd4 Fixed type of temporary variable in _TIFFCheckMalloc() as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1033.
2006-02-07 10:41:30 +00:00
Andrey Kiselev ec7407b0a3 *** empty log message *** 2006-02-06 16:12:27 +00:00
Andrey Kiselev c3bea35fd9 Return static array when fetching default YCbCrCoefficients (another problem,
reported a the http://bugzilla.remotesensing.org/show_bug.cgi?id=1029 entry).
2006-02-06 16:11:46 +00:00
Andrey Kiselev cbcbc019f8 *** empty log message *** 2006-02-03 16:39:27 +00:00
Andrey Kiselev 29eb1c473f Clear fields FIELD_YCBCRSUBSAMPLING and FIELD_YCBCRPOSITIONING
in TIFFFreeDirectory().
2006-02-03 16:36:02 +00:00
Andrey Kiselev c155e59d8d The same fix apllies to _TIFFVGetField() function. 2006-02-03 16:27:13 +00:00
Andrey Kiselev 31c405b3b8 Special handling for PageNumber, HalftoneHints, YCbCrSubsampling and DotRange
tags as per bugs
http://bugzilla.remotesensing.org/show_bug.cgi?id=1029
http://bugzilla.remotesensing.org/show_bug.cgi?id=1034
2006-02-03 15:58:42 +00:00
Andrey Kiselev 4fab684de1 Use _TIFFGetExifFieldInfo() instead of _TIFFGetFieldInfo() in
TIFFReadEXIFDirectory() call as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1026
2006-02-03 13:25:59 +00:00
Andrey Kiselev f714980a3d libtool related stuff updated from the 2.1a branch. 2006-01-23 18:21:45 +00:00
Andrey Kiselev 6d46b8e464 Updated from libtool CVS. 2006-01-23 18:17:56 +00:00
Frank Warmerdam 4cef528582 fixed last jpeg processing patch 2006-01-11 17:03:43 +00:00
Frank Warmerdam 3949657664 fix jpeg tool option processing: bug 1025 2006-01-11 16:59:35 +00:00
Bob Friesenhahn d6b209d3b4 * configure.ac: Fix with_default_strip_size comparison as reported
by Norihiko Murase.
2006-01-09 16:56:03 +00:00
Bob Friesenhahn c1961f4111 * test/Makefile.am (LIBTIFF): Due to linking against libtiff
incorrectly, tests were not actually testing the uninstalled
libtiff.  Now they are.
2006-01-08 18:57:33 +00:00
Frank Warmerdam 3cef009696 Fixed one more link. 2006-01-04 23:38:38 +00:00
Frank Warmerdam be26ae04e9 Fixed html= to href= in bugzilla links. 2006-01-04 22:06:19 +00:00
Frank Warmerdam 12b817197c Fixed typo in href for bug. 2006-01-04 22:04:46 +00:00
Andrey Kiselev 634d926c5c *** empty log message *** 2006-01-04 17:35:18 +00:00
Andrey Kiselev 4aa0a5ce6c Added TIFFReadCustomDirectory() and TIFFReadEXIFDirectory(). 2006-01-04 14:37:19 +00:00
Andrey Kiselev c762bdc1b6 Change definitions for TIFFTAG_ICCPROFILE, TIFFTAG_PHOTOSHOP,
TIFFTAG_RICHTIFFIPTC, TIFFTAG_XMLPACKET: readcount should be uint32 value.
2006-01-04 13:22:09 +00:00
Bob Friesenhahn cfa43016a3 Update tools list to current set. 2006-01-03 02:16:07 +00:00
Bob Friesenhahn 9871aeaf92 Fix typo. 2006-01-03 01:45:41 +00:00
Bob Friesenhahn 15fd57d512 Fix URL to ImageMagick site. 2006-01-03 01:42:30 +00:00
Bob Friesenhahn 523e9fd8f0 Current version is 3.8.0. 2006-01-03 01:37:24 +00:00
Bob Friesenhahn 803e1ec055 Fix wrong formatting in ChangeLog entry. 2006-01-02 23:52:52 +00:00
Bob Friesenhahn c3402403ea * html/man/Makefile.am (htmldoc): Fix htmldoc rule so that it can
be used if build directory is not the same as source directory.
* man/{TIFFGetField.3tiff, man/TIFFSetField.3tiff}: Documented
TIFFTAG_PHOTOSHOP, TIFFTAG_RICHTIFFIPTC, and TIFFTAG_XMLPACKET,
and re-sorted tag names in alphabetical order.
2006-01-02 23:50:44 +00:00
Andrey Kiselev 0776b32d29 3.8.0 released. 2005-12-29 22:01:44 +00:00
Andrey Kiselev 301f5d59af Added 3.8.0. 2005-12-29 21:49:38 +00:00
Bob Friesenhahn b3f4f82894 * tools/bmp2tiff.c (main): Fixed warning regarding returning
inconsistent types from a condition.
2005-12-29 00:33:51 +00:00
Bob Friesenhahn 0bb0df6024 * tools/tiffcmp.c (CheckLongTag): Eliminate warning due to printf
format.
* tools/bmp2tiff.c: Reduce compilation warnings on big-endian CPUs.
2005-12-29 00:15:56 +00:00
Joris Van Damme 201ee77d94 *** empty log message *** 2005-12-28 06:53:18 +00:00
Joris Van Damme 362fa44476 *** empty log message *** 2005-12-28 06:48:12 +00:00
Joris Van Damme 25cbff2872 Cleaned up HTML 2005-12-28 06:47:50 +00:00
Joris Van Damme 17def6cef5 Some trivial code formatting and tab/spaces issues 2005-12-28 04:08:01 +00:00
Joris Van Damme a46c243387 Revised unintended mix of tabs and spaces 2005-12-28 03:09:59 +00:00
Joris Van Damme 4f0408980d *** empty log message *** 2005-12-28 01:52:57 +00:00
Joris Van Damme 93bc4d5089 Cleaned up HTML 2005-12-28 01:52:03 +00:00
Joris Van Damme 95a36b9d6a *** empty log message *** 2005-12-28 01:19:08 +00:00
Joris Van Damme a416ddbc08 Cleaned up HTML 2005-12-28 01:17:57 +00:00
Andrey Kiselev c0913bb64b Changed lfind() definition. 2005-12-27 15:08:22 +00:00
Andrey Kiselev 31b3935acf *** empty log message *** 2005-12-27 14:51:40 +00:00
Andrey Kiselev f7f87d0e1d Avoid warnings. 2005-12-27 12:20:53 +00:00
Andrey Kiselev 10963455dc Added VC_EXTRALEAN definition before including windows.h, to reduce the
compile time.
2005-12-27 11:13:58 +00:00
Andrey Kiselev 03fcc9610f *** empty log message *** 2005-12-27 10:53:18 +00:00
Bob Friesenhahn a45bff3b5a * libtiff/tif_jpeg.c: Improve compilation under MinGW. 2005-12-27 00:08:14 +00:00
Andrey Kiselev 0a94d89b9e *** empty log message *** 2005-12-26 14:59:55 +00:00
Andrey Kiselev 7f99258f80 tiffFieldInfo and exifFieldInfo arrays definitions moved back to
tif_dirinfo.c; added _TIFFGetFieldInfo() and _TIFFGetExifFieldInfo() private
functions to retrieve FieldInfo arrays.
2005-12-26 14:31:24 +00:00
Bob Friesenhahn f1e1b43b92 * html/build.html: Added some additional instructions for when
building using MSVC under Windows.  Also fixed two HTML syntax
errors and used HTML Tidy to tidy up the HTML syntax and
formatting.
2005-12-24 22:25:05 +00:00
Andrey Kiselev 7eeb1f0f66 *** empty log message *** 2005-12-24 16:17:49 +00:00
Andrey Kiselev 22925a520e Make InkSet, NumberOfInks, DotRange and StoNits tags custom. 2005-12-24 15:36:16 +00:00
Andrey Kiselev 7ebb66ffdd *** empty log message *** 2005-12-23 16:28:38 +00:00
Andrey Kiselev 90b21237df Make WhitePoint tag custom. 2005-12-23 16:28:15 +00:00
Andrey Kiselev ec9a11dfd7 More EXIF tags added. 2005-12-23 15:10:45 +00:00
Andrey Kiselev ea63fed16f More fixes in wrong wtripbytecounts guessing code. 2005-12-23 11:42:08 +00:00
Joris Van Damme 22db422fc0 *** empty log message *** 2005-12-23 01:18:58 +00:00
Andrey Kiselev d04435ec09 Fix in StribByteCount guessing code. 2005-12-22 07:13:36 +00:00
Joris Van Damme f5ebfca202 *** empty log message *** 2005-12-21 16:58:01 +00:00
Frank Warmerdam 59e0f5cb33 avoid direct use of tif_clientdata 2005-12-21 16:09:21 +00:00
Frank Warmerdam bc4b088d40 declare _TIFFerrorHandlerExt and _TIFFwarningHandlerExt here 2005-12-21 16:09:01 +00:00
Frank Warmerdam 608412f5c7 fixed TIFFErrorExit() to TIFFErrorExt() 2005-12-21 15:55:49 +00:00
Andrey Kiselev 0e1df0641f *** empty log message *** 2005-12-21 14:25:28 +00:00
Andrey Kiselev 50d7105ee6 Make RichTIFFIPTC, Photoshop and ICCProfile tags custom. 2005-12-21 14:24:41 +00:00
Joris Van Damme f182ef17da *** empty log message *** 2005-12-21 13:05:32 +00:00
Joris Van Damme 9406b8ebad *** empty log message *** 2005-12-21 12:52:35 +00:00
Joris Van Damme 5cbfc68f06 *** empty log message *** 2005-12-21 12:23:13 +00:00
Andrey Kiselev 839c207d31 *** empty log message *** 2005-12-20 16:51:57 +00:00
Andrey Kiselev 038f178e4b Added many error reporting messages; fixed integer overflow as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=789
2005-12-20 16:50:21 +00:00
Frank Warmerdam 52a32e155c *** empty log message *** 2005-12-16 06:00:42 +00:00
Frank Warmerdam c992dfcfe9 Major upgrade to support YCbCr subsampled jpeg images 2005-12-16 05:59:55 +00:00
Andrey Kiselev f6e4a0fc44 *** empty log message *** 2005-12-14 14:01:21 +00:00
Andrey Kiselev 52cdf33845 Return non-zero status when reading fails (again). 2005-12-14 13:59:52 +00:00
Andrey Kiselev d426405c2f Rename TIFFArraySize macro to TIFFArrayCount. 2005-12-13 21:23:58 +00:00
Andrey Kiselev 7901f28671 *** empty log message *** 2005-12-13 16:43:22 +00:00
Andrey Kiselev b1ec8c0aee Return non-zero status when reading fails. 2005-12-13 16:42:39 +00:00
Joris Van Damme e8b8f48572 Some minor nitpicking 2005-12-13 15:18:11 +00:00
Andrey Kiselev 574c524d61 Include stdarg.h header. 2005-12-12 22:28:41 +00:00
Joris Van Damme e37f3e1bbc Updated URL of Frank's homepage 2005-12-12 17:34:05 +00:00
Andrey Kiselev cb16e6c28a *** empty log message *** 2005-12-12 16:13:47 +00:00
Andrey Kiselev 3bb26ca681 Added more EXIF tags. 2005-12-12 16:13:18 +00:00
Andrey Kiselev 4bad9c1e20 Replace SETVAL with SETVALUE. 2005-12-12 15:30:08 +00:00
Andrey Kiselev 0e3c0d0550 Replace macro SETVAL with SETVALUE to avoid conflicts on Lynx OS. 2005-12-12 09:23:11 +00:00
Andrey Kiselev 2db87cddd6 *** empty log message *** 2005-12-09 17:53:10 +00:00
Andrey Kiselev 6d335e77eb Make XMLPacket tag custom. 2005-12-09 17:52:39 +00:00
Andrey Kiselev cdc1624cde *** empty log message *** 2005-12-09 14:53:11 +00:00
Andrey Kiselev 796777f5c5 Print EXIF directory contents if exist. 2005-12-09 14:52:48 +00:00
Andrey Kiselev b6862f8414 *** empty log message *** 2005-12-09 14:48:31 +00:00
Andrey Kiselev 13a6e30431 Few EXIF tag numbers added. 2005-12-09 14:47:42 +00:00
Andrey Kiselev d4bef27ee8 Preliminary support to read custom directories. New functions:
TIFFReadCustomDirectory() and TIFFReadEXIFDirectory().
2005-12-09 14:46:43 +00:00
Andrey Kiselev efffb31a79 Added TIFFArraySize macro. 2005-12-09 12:58:08 +00:00
Andrey Kiselev 01d4598d03 *** empty log message *** 2005-12-07 18:14:53 +00:00
Andrey Kiselev 5b60852fe6 More work to implement custom directory read support. 2005-12-07 18:11:08 +00:00
Andrey Kiselev 74a9f4282a Split the _TIFFPrintField() function from the TIFFPrintDirectory(). 2005-12-07 18:05:40 +00:00
Andrey Kiselev c3caab8095 Make ReferenceBlackWhite tag custom. 2005-12-07 17:11:53 +00:00
Andrey Kiselev 0730d44a00 Make YCbCrCoefficients tag custom. 2005-12-07 16:27:41 +00:00
Andrey Kiselev 1fd9c5e60b Added version reporting when running without parameters. 2005-12-06 22:18:13 +00:00
Andrey Kiselev 9e9c893c05 Initial implementation of the TIFFReadCustomDirectory() method. 2005-12-06 12:45:20 +00:00
Andrey Kiselev 10651e14b9 *** empty log message *** 2005-12-05 16:01:58 +00:00
Andrey Kiselev 38c00fb217 One more workaround for broken StripByteCounts tag. Handle the case when
StripByteCounts array filled with completely wrong values.
2005-12-05 15:47:36 +00:00
Andrey Kiselev 1a64d039bb *** empty log message *** 2005-12-02 16:20:38 +00:00
Andrey Kiselev 311976b572 Fixed typo. 2005-12-02 16:07:34 +00:00
Andrey Kiselev a647f3f1f0 Added -Wextra to the gcc flags in VL_PROG_CC_WARNINGS macro. 2005-11-30 14:26:58 +00:00
Andrey Kiselev 50253597da *** empty log message *** 2005-11-30 14:25:59 +00:00
Andrey Kiselev 9062f83c77 Missed debug printf removed. 2005-11-30 14:15:28 +00:00
Andrey Kiselev 5952144b80 Release file descriptor in case of failure in the TIFFOpenW() function as per
bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1003
2005-11-30 14:01:49 +00:00
Andrey Kiselev cc7d24972f Correctly yse bsearch() and lfind() functions as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1008
2005-11-30 13:54:35 +00:00
Andrey Kiselev 8ec770819c Avoid warnings. 2005-11-23 22:38:30 +00:00
Andrey Kiselev 165f748dc8 Avoid warnings. 2005-11-23 22:20:56 +00:00
Frank Warmerdam 4e449eb1c9 added MDI_SUPPORT item 2005-11-21 18:18:39 +00:00
Frank Warmerdam b86f199feb preliminary support for MS MDI format, bug 1002 2005-11-21 03:35:05 +00:00
Frank Warmerdam 7fd3fba4f3 Added a few items that appear on the web site 2005-11-21 01:36:17 +00:00
Frank Warmerdam ec9f4f2943 *** empty log message *** 2005-11-21 01:08:20 +00:00
Frank Warmerdam c28d93623c added files 2005-11-21 01:07:19 +00:00
Frank Warmerdam c5e456aa3d Added various files. 2005-11-21 01:06:43 +00:00
Frank Warmerdam 60867efab2 Added .libs and .deps. 2005-11-21 01:05:57 +00:00
Frank Warmerdam d5b74c4d29 New 2005-11-21 00:55:38 +00:00
Frank Warmerdam 84e575367f *** empty log message *** 2005-11-03 18:45:04 +00:00
Frank Warmerdam 26f3527dcf TIFFreeDirectory() now public 2005-11-03 18:22:58 +00:00
Frank Warmerdam 2830c322e9 Updated Current Version to 3.7.4. 2005-11-03 14:18:43 +00:00
Andrey Kiselev 7b02f2cde8 Added link to libtiff home page. 2005-11-02 11:07:18 +00:00
Andrey Kiselev 76c578fb53 *** empty log message *** 2005-10-31 16:01:42 +00:00
Andrey Kiselev 9f662299df Properly calculate sizes of temporary arrays as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=943
2005-10-31 14:48:59 +00:00
Andrey Kiselev c31c1537d2 Added '-r' parameter description. 2005-10-31 14:02:20 +00:00
Andrey Kiselev dcbd209375 Added option '-r' to set RowsPerStrip parameter as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=944
2005-10-31 13:40:38 +00:00
Andrey Kiselev 7a09fc0735 Typo fixed. 2005-10-31 13:31:10 +00:00
Andrey Kiselev 8c703c1e6e Fixed typeshift and typemask arrays initialization problem as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=946
2005-10-31 13:08:19 +00:00
Andrey Kiselev 85c3925771 Fixed possible integer overflow error as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=965
2005-10-31 12:59:30 +00:00
Andrey Kiselev 3007edfda7 Make XResolution, YResolution and ResolutionUnit tags modifiable during write
process. As per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=977
2005-10-31 12:30:29 +00:00
Andrey Kiselev 9640ac3133 Copy fax related fields over splitted parts as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=983
2005-10-31 12:08:17 +00:00
Andrey Kiselev 9ebdf9eaf6 Typo fixed. 2005-10-25 13:32:28 +00:00
Andrey Kiselev 963fc9c29b Added Joris Van Damme to the list of contributors. 2005-10-23 19:43:29 +00:00
Andrey Kiselev ababd54fa5 *** empty log message *** 2005-10-23 19:17:14 +00:00
Andrey Kiselev a2f6aef7f2 Added missed description of the '-m' option. 2005-10-23 19:11:34 +00:00
Frank Warmerdam f22f53188c *** empty log message *** 2005-10-21 20:52:10 +00:00
Frank Warmerdam fd536a07e5 Don't try to split up big strips into 0 new strips. This can occur
in the case of strips with no bytes allocated yet for instance.
2005-10-21 20:03:12 +00:00
Frank Warmerdam cc5800f84d Fixup indentation. 2005-10-20 14:23:49 +00:00
Joris Van Damme 4f05858cf7 *** empty log message *** 2005-10-20 05:08:09 +00:00
Joris Van Damme 8869f515ec Changed 'at scanline ...' style warning/errors with incorrect use of tif_row, to 'at line ... of strip/tile ...' style 2005-10-20 05:03:34 +00:00
Frank Warmerdam 994f850048 *** empty log message *** 2005-10-15 16:03:20 +00:00
Frank Warmerdam 2deb137e08 Fixed setting of planar config as per bug report from Joris. 2005-10-15 15:57:54 +00:00
Andrey Kiselev 0dfb8e88b0 *** empty log message *** 2005-10-07 17:29:14 +00:00
Andrey Kiselev 83d01f8c4c Make the default strip size configurable via the --with-default-strip-size and
STRIP_SIZE_DEFAULT options.
2005-10-07 17:27:35 +00:00
Andrey Kiselev ab000523ed Make the default strip size configurable via the --with-default-strip-size and
STRIP_SIZE_DEFAULT options
2005-10-07 17:27:09 +00:00
Bob Friesenhahn c59cbfc844 * html/support.html: Fixed link to documentation on Greg Ward's
LogLuv TIFF format.
2005-09-30 15:38:02 +00:00
Andrey Kiselev 0281ef42c8 *** empty log message *** 2005-09-28 12:12:11 +00:00
Andrey Kiselev ad6776b90d Fixed crash when reading malformed tags. 2005-09-28 12:10:22 +00:00
Andrey Kiselev 7e352b10d6 Fixed problem with the Solaris make utility as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=930
2005-09-21 13:37:13 +00:00
Andrey Kiselev d0f393f81a *** empty log message *** 2005-09-20 11:21:45 +00:00
Andrey Kiselev d753432f58 Added missed 'break' statement as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=932
2005-09-20 11:19:38 +00:00
Andrey Kiselev b65e32c4cf pelling corrected. 2005-09-20 11:04:16 +00:00
Andrey Kiselev 0aabc6ec8c spelling corrected. 2005-09-20 11:02:57 +00:00
Andrey Kiselev c8001089b1 Spelling fixed. 2005-09-20 10:53:44 +00:00
Andrey Kiselev 3f1512b1a5 Spelling corrected. 2005-09-20 10:49:14 +00:00
Andrey Kiselev 11d70b5aca Spelling corrected. 2005-09-20 10:25:56 +00:00
Andrey Kiselev 6819c53b00 Misspelling corrected. 2005-09-20 10:07:55 +00:00
Andrey Kiselev 1ccfce17fe Avoid warnings. 2005-09-13 14:20:20 +00:00
Andrey Kiselev 9ece518261 Avoid warnings. 2005-09-13 14:09:10 +00:00
Andrey Kiselev 76346d1aeb Avoid warnings. 2005-09-13 13:40:48 +00:00
Andrey Kiselev aa3a68ca4d Avoid warnings. 2005-09-13 13:17:57 +00:00
Frank Warmerdam 00ac9cab12 Added FSeek in open to fix issues on Solaris 2005-09-12 16:31:04 +00:00
Andrey Kiselev 6293d0cb09 Update mailing list address. 2005-09-12 14:54:58 +00:00
Andrey Kiselev bd7a0c43de *** empty log message *** 2005-09-12 14:54:06 +00:00
Andrey Kiselev a63512c436 libtiff 3.7.4 released. 2005-09-12 14:04:01 +00:00
Andrey Kiselev 284e51c2ed *** empty log message *** 2005-09-12 13:51:11 +00:00
Andrey Kiselev b36e2b823d Release 3.7.4. 2005-09-12 13:50:14 +00:00
Andrey Kiselev 96d9967176 New. 2005-09-12 13:49:01 +00:00
Andrey Kiselev d7d1e7ffe7 Added v3.7.4.html. 2005-09-12 13:48:34 +00:00
Andrey Kiselev 7ba99963a6 Typo fixed. 2005-09-12 13:47:50 +00:00
Andrey Kiselev b1e6c4d940 Lee Howard added to the list of contributors. 2005-09-12 13:38:21 +00:00
Andrey Kiselev f84c3a6a0c Applied patch from Patrick Welche (all scripts moved in the 'config' and 'm4'
directories).
2005-09-12 13:33:26 +00:00
Andrey Kiselev 2907cf36ad Moved from the project root. 2005-09-12 13:29:10 +00:00
Andrey Kiselev 1bf15d048e Moved to m4 directory. 2005-09-12 13:28:30 +00:00
Andrey Kiselev 880ad582f5 Moved to m4 directory. 2005-09-12 13:07:46 +00:00
Andrey Kiselev d1e97bf211 Moved from the project root. 2005-09-12 13:06:46 +00:00
Andrey Kiselev 2a08620235 Moved to config directory. 2005-09-12 13:05:02 +00:00
Frank Warmerdam 0270815179 Bug 922: resetting custom string field causes double free 2005-09-06 03:25:16 +00:00
Frank Warmerdam 93e611825d Include void in empty prototype arg list. 2005-08-26 16:07:40 +00:00
Frank Warmerdam 4d332c2070 added tiffconf.h to libtiff.lib dependency list. 2005-08-18 20:21:06 +00:00
Frank Warmerdam bd97c7a680 avoid signed/unsigned warning 2005-08-12 15:25:38 +00:00
Frank Warmerdam 9647ad7005 *** empty log message *** 2005-08-12 15:23:41 +00:00
Frank Warmerdam 752a25db2f Removed unused module variable. 2005-08-12 15:23:10 +00:00
Frank Warmerdam 165334b180 fixed bigendian support for swabbing double complex samples 2005-07-31 03:33:11 +00:00
Andrey Kiselev b7a295ef98 Revert back the previous change. 2005-07-28 17:46:52 +00:00
Andrey Kiselev ab98d7b94d *** empty log message *** 2005-07-28 14:50:04 +00:00
Andrey Kiselev 0c1c405678 Small fix for the previous commit. 2005-07-28 14:49:37 +00:00
Frank Warmerdam 3e53598497 return char * from _TIFFCheckMalloc to match prototype 2005-07-28 13:48:32 +00:00
Andrey Kiselev f185e92773 Small fix for the previous commit. 2005-07-28 12:05:45 +00:00
Andrey Kiselev 73a00a69bd Rename CheckMalloc() function to _TIFFCheckMalloc() and make it available
globally as an internal helper routine.
2005-07-28 11:35:12 +00:00
Andrey Kiselev 8b53cb555b *** empty log message *** 2005-07-27 19:58:03 +00:00
Andrey Kiselev 37ca481bbc More improvements in the "pass by value" part of the custom tags handling
code.
2005-07-27 19:56:44 +00:00
Frank Warmerdam 713f25bc53 Updated mailing list info. 2005-07-26 14:43:24 +00:00
Andrey Kiselev eba86f65b1 *** empty log message *** 2005-07-26 11:31:45 +00:00
Andrey Kiselev 14d96d1a75 Do not upcast BYTEs to SHORTs in the TIFFFetchByteArray(). Remove
TIFFFetchExtraSamples() function, use TIFFFetchNormalTag() instead as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=831
Remove TIFFFetchExtraSamples() function, use TIFFFetchNormalTag() instead.
2005-07-26 11:18:36 +00:00
Andrey Kiselev 356fb99cb6 One more attempt to fix the AIX bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=39
2005-07-26 10:33:57 +00:00
Andrey Kiselev 2b387c08da Include tiffiop.h before iostream. 2005-07-26 08:11:13 +00:00
Andrey Kiselev a4e14a77de *** empty log message *** 2005-07-25 15:24:59 +00:00
Andrey Kiselev f65a681de2 Fixed printing of the BYTE and SBYTE arrays. 2005-07-25 14:22:27 +00:00
Andrey Kiselev 7f535ed3f1 Added support for TIFF_IFD datatype. 2005-07-25 13:48:58 +00:00
Andrey Kiselev 7a68cf1b07 *** empty log message *** 2005-07-21 13:57:19 +00:00
Andrey Kiselev 42ffebf834 Do not check the PlanarConfiguration field in the TIFFWriteCheck() function in
case of single band images (as per TIFF spec).
2005-07-21 13:57:00 +00:00
Frank Warmerdam 3c4cbb4ee4 Updated mailing list information. 2005-07-20 18:45:33 +00:00
Frank Warmerdam e590b48e9c Updated TIFF FAQ link at Joris' request. 2005-07-13 20:50:28 +00:00
Andrey Kiselev f41cf89f4c *** empty log message *** 2005-07-12 16:07:43 +00:00
Andrey Kiselev ba7cf1b746 Use LIBPORT in a right way. 2005-07-12 16:06:38 +00:00
Andrey Kiselev 3d07ae5cb0 Updated to latest configure.ac. 2005-07-12 15:34:37 +00:00
Andrey Kiselev a1c58639ff *** empty log message *** 2005-07-12 12:38:08 +00:00
Andrey Kiselev c07191895f New. 2005-07-12 12:36:13 +00:00
Andrey Kiselev 1bdb651495 Replace #if with the #ifdef. 2005-07-12 12:22:03 +00:00
Andrey Kiselev 73dc58ddf1 Added SConstruct to the EXTRA_DIST list. 2005-07-12 12:08:15 +00:00
Andrey Kiselev f7d5a2ad97 Added SConstruct to EXTRA_DIST list. 2005-07-12 12:07:07 +00:00
Andrey Kiselev e3b6378a0a Replace #if with the #ifdef. 2005-07-12 12:03:15 +00:00
Andrey Kiselev b0ea7f14a3 Use #ifdef instead of #if in header conditionals. 2005-07-11 14:45:18 +00:00
Andrey Kiselev 673f12364f *** empty log message *** 2005-07-07 16:44:50 +00:00
Andrey Kiselev 3d0c7b2790 Added lfind() replacement module. 2005-07-07 16:42:40 +00:00
Andrey Kiselev 0da582bc10 Update modules from the NetBSD source tree (the old 4-clause BSD license
changed to the new 3-clause one).
2005-07-07 16:34:06 +00:00
Andrey Kiselev 02e9ce6f3f Removed unneeded stdio.h include directive. 2005-07-07 16:00:29 +00:00
Andrey Kiselev f3e699dca7 Added lfind() replacement module. 2005-07-07 15:59:49 +00:00
Andrey Kiselev 86ea6e5fde Make the dummy function static. 2005-07-07 15:21:52 +00:00
Andrey Kiselev ec99dd71ea *** empty log message *** 2005-07-06 11:38:45 +00:00
Andrey Kiselev d83db532b1 Fixed WhitePoint tag copying. 2005-07-06 11:38:17 +00:00
Andrey Kiselev 2c639371b0 Make FieldOfViewCotangent, MatrixWorldToScreen, MatrixWorldToCamera,
ImageFullWidth, ImageFullLength and PrimaryChromaticities tags custom.
2005-07-06 11:23:55 +00:00
Andrey Kiselev 6458b7026c *** empty log message *** 2005-07-04 13:00:43 +00:00
Andrey Kiselev 227b123d84 Libtiff 3.7.3 released. 2005-07-04 12:51:12 +00:00
Andrey Kiselev dbf1dbcbc2 *** empty log message *** 2005-07-04 12:43:24 +00:00
Andrey Kiselev 143ed91af3 Do not use empty -R option when linking with --enable-rpath. 2005-07-04 12:39:54 +00:00
Andrey Kiselev 6625d0be12 *** empty log message *** 2005-07-01 15:26:06 +00:00
Andrey Kiselev 74ff984d58 Better use of TIFFmin() macro to avoid side effects. 2005-07-01 15:25:41 +00:00
Andrey Kiselev 40c424104d Added open option 'h' to avoid reading the first IFD when needed. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=875
2005-07-01 12:35:18 +00:00
Andrey Kiselev 2bc9903a19 Local macros updated to recent versions. 2005-06-29 12:46:20 +00:00
Andrey Kiselev e1e354fc00 Updated up to the recent stable libtool. 2005-06-29 11:52:09 +00:00
Andrey Kiselev 7fbb282080 Changed indentation. 2005-06-29 10:25:52 +00:00
Andrey Kiselev e7201f6204 tif_nfields should be of size_t type. 2005-06-29 10:21:35 +00:00
Andrey Kiselev 92b8560380 Make tif_nfields field uint32. 2005-06-28 15:30:06 +00:00
Andrey Kiselev ba47ac156e Avoid warnings. 2005-06-28 15:15:58 +00:00
Andrey Kiselev 901eaee8c4 Added Bob Friesenhahn to the list of contributors. 2005-06-24 15:28:03 +00:00
Andrey Kiselev dcbfebbb38 *** empty log message *** 2005-06-23 13:38:13 +00:00
Andrey Kiselev 5834ceb1d9 Added v3.7.3.html. 2005-06-23 13:30:35 +00:00
Andrey Kiselev 9bc7885982 Print two characters per loop in the t2p_write_pdf_trailer(). As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=594
2005-06-23 13:28:33 +00:00
Andrey Kiselev c92235dc5f Added v3.7.3.html. 2005-06-23 12:01:06 +00:00
Andrey Kiselev 180a3afd4a Use MacOS X OpenGL framework when appropriate. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=844
2005-06-23 11:50:05 +00:00
Andrey Kiselev aa4f24915e Updated to latest OpenGL test macros versions. 2005-06-23 11:46:47 +00:00
Andrey Kiselev 9a8e13c032 Avoid warnings. 2005-06-23 11:27:35 +00:00
Andrey Kiselev 3ef6a2ba87 Use correct int size on Sparc 64bit/Sun compiler platform. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=855
2005-06-23 11:01:55 +00:00
Andrey Kiselev 10279e08aa Avoid warnings. 2005-06-23 10:54:02 +00:00
Andrey Kiselev dec907699f *** empty log message *** 2005-06-14 04:58:18 +00:00
Andrey Kiselev f175b7f6c2 Added support for ClipPath, XClipPathUnits and YClipPathUnits tags. 2005-06-14 04:57:33 +00:00
Andrey Kiselev 70dacb5aaa *** empty log message *** 2005-06-07 14:50:18 +00:00
Andrey Kiselev 0d4d2e5687 Properly extract tile/strip size; use pixel sized shift in contigous case. 2005-06-07 14:26:04 +00:00
Andrey Kiselev 8c7d4c13e4 Typo fixed. 2005-06-07 14:22:39 +00:00
Andrey Kiselev 6dc0ba7598 *** empty log message *** 2005-06-06 14:17:38 +00:00
Andrey Kiselev fff57028ae Make overviews working for contiguos images. 2005-06-06 14:15:47 +00:00
Andrey Kiselev 68182b56ab Make it working. 2005-06-05 16:37:21 +00:00
Andrey Kiselev 2bc3d52f28 Avoid warnings. 2005-06-05 16:33:09 +00:00
Andrey Kiselev ef56e4aee7 *** empty log message *** 2005-06-03 13:42:04 +00:00
Andrey Kiselev d9e8aad930 Replace runtime endianess check with the compile time one. 2005-06-03 13:41:13 +00:00
Andrey Kiselev 6bbed987a1 Floating point predictor now works on big-endian hosts. 2005-06-03 07:58:54 +00:00
Andrey Kiselev a4f64f839f Use #if instead of #ifdef. 2005-06-03 07:38:58 +00:00
Andrey Kiselev baffebb4f2 Few optimizations for tiffgt target. 2005-06-02 08:29:19 +00:00
Andrey Kiselev 8455ae1f86 Do not override the automake target 'html'. Rename our target in 'htmldoc'. 2005-06-02 08:11:03 +00:00
Andrey Kiselev 27d1a1dced *** empty log message *** 2005-06-01 10:41:15 +00:00
Andrey Kiselev c8f9bf5ebc Use _TIFFsetString() function when read custom ASCII values. 2005-06-01 10:39:23 +00:00
Andrey Kiselev d5805f0715 *** empty log message *** 2005-06-01 10:19:14 +00:00
Andrey Kiselev 654d8aaedf Make DocumentName, Artist, HostComputer, ImageDescription, Make, Model,
Copyright, DateTime, PageName, TextureFormat, TextureWrapModes and
TargetPrinter tags custom.
2005-06-01 10:17:21 +00:00
Andrey Kiselev 580f9e50a3 Cleanup the codec state depending on TIFF_CODERSETUP flag (to fix memry
leaks).
2005-06-01 09:41:30 +00:00
Andrey Kiselev 7bd4723ef9 Clear JPEGTables array after allocating. 2005-06-01 08:46:49 +00:00
Andrey Kiselev 32a47d9530 Do not define "inline" if already defined. 2005-05-31 17:50:15 +00:00
Andrey Kiselev f0240f75fe Include tif_config.h. 2005-05-26 18:42:56 +00:00
Andrey Kiselev 9ed49a2d4b CPL stuff removed. 2005-05-26 18:21:31 +00:00
Andrey Kiselev 91e77d24ea *** empty log message *** 2005-05-26 08:26:08 +00:00
Andrey Kiselev d72e52d31d Added workaround for OpenBSD/MirOS soname problem as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=838
2005-05-26 08:16:00 +00:00
Andrey Kiselev a4d796bca4 Use tdir_count when calling TIFFCvtNativeToIEEEDouble() in the
TIFFWriteDoubleArray() function as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=845
2005-05-26 07:50:38 +00:00
Andrey Kiselev 3fab53b53f *** empty log message *** 2005-05-25 13:38:41 +00:00
Andrey Kiselev db6a96056d Fixed format string when read PPM file header with the fscanf() function. As
per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=861
2005-05-25 13:36:56 +00:00
Andrey Kiselev 52e1c017ff TIFFFetchByteArray() returns uint16 array when fetching the BYTE and SBYTE
filds, so we should consider result as pointer to uint16 array and not as
array of chars. As per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=831
2005-05-25 13:10:09 +00:00
Andrey Kiselev c22e4acb31 More efficient custom tags retrieval as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=830
2005-05-25 11:38:32 +00:00
Andrey Kiselev 5956d92886 Use FILE_SHARE_READ | FILE_SHARE_WRITE share mode in CreateFile() call as per
bug http://bugzilla.remotesensing.org/show_bug.cgi?id=829
2005-05-25 11:27:59 +00:00
Andrey Kiselev 1ca5b48653 Avoid warnings. 2005-05-25 10:35:13 +00:00
Andrey Kiselev 9d6c1f4d7c Fixed parallel compilation of the libtiff and libtiffxx libraries as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=826
2005-05-25 10:03:24 +00:00
Andrey Kiselev 023cdf2a94 Sinchronized with GDAL. 2005-05-25 09:37:05 +00:00
Frank Warmerdam dd8c4bf8a0 *** empty log message *** 2005-05-23 22:41:54 +00:00
Frank Warmerdam c3fd66ef70 Create dummy jpegtables in TIFFInitJPEG() to ensure sufficient space
is reserved for the real jpegtable when the directory is written.
This is necessary since the real jpeg tables don't get created till
JPEGSetupEncode() at which point application may have already written
the directory.  This happens with the overview building programs for
instance.
This patch may result in more space than necessary being reserved for the
jpeg tables, thereby wasting space.  So it isn't necessarily the be
all and end all of solutions.  The key change is the "if( tif->tif_diroff==0)"
test in TIFFInitJPEG().
2005-05-23 22:40:51 +00:00
Frank Warmerdam f1826525bc avoid bogus stripbytecount messages if stripoffset zero 2005-05-22 17:36:50 +00:00
Andrey Kiselev e848181ca3 Added more asserts. 2005-05-17 15:00:28 +00:00
Andrey Kiselev fafd1f0c70 *** empty log message *** 2005-05-17 14:19:18 +00:00
Andrey Kiselev 53fb873cc2 Check for JPEGTables tag presence before copying. 2005-05-17 14:18:48 +00:00
Frank Warmerdam 3a6e371160 bug 843: similar fix to last for Longs and Anys version of function 2005-05-06 14:35:50 +00:00
Frank Warmerdam 30565aceb6 *** empty log message *** 2005-05-06 14:20:41 +00:00
Frank Warmerdam 9808f201f2 Upgraded JPEGDecodeRaw() to support JPEG_LIB_MK1. 2005-05-06 14:18:15 +00:00
Andrey Kiselev 3b8d6df405 *** empty log message *** 2005-05-05 20:54:24 +00:00
Andrey Kiselev db9bba1c19 Calculate the tilewidth properly; added new option '-b' to use interpolation
in output PDF files (Bruno Ledoux).
2005-05-05 20:52:57 +00:00
Andrey Kiselev aff0bd02dc Added new option '-b' to use interpolation in output PDF files (Bruno Ledoux). 2005-05-05 20:52:24 +00:00
Frank Warmerdam 0238118292 bug 843: handle files with too many bits/sample values 2005-05-05 18:03:22 +00:00
Andrey Kiselev 6d98cb4dcd Fixed link to the latest samples package. 2005-05-01 10:09:05 +00:00
Andrey Kiselev 80273875a5 *** empty log message *** 2005-04-27 18:38:09 +00:00
Andrey Kiselev 46f2c1aa78 Copy the PhotometricInterpretation tag from the input file. 2005-04-27 18:37:19 +00:00
Andrey Kiselev e09ee59337 Use Adobe Deflate compression code instead of old deflate code. 2005-04-15 17:50:09 +00:00
Andrey Kiselev 4d7b714feb *** empty log message *** 2005-04-14 20:36:14 +00:00
Andrey Kiselev 96bd3ba2b7 Added ability to encode floating point predictor, as per TIFF Technical Note
3.
2005-04-14 20:35:02 +00:00
Andrey Kiselev 9e952bf801 *** empty log message *** 2005-04-14 11:58:33 +00:00
Andrey Kiselev b737303768 Added ability to decode floating point predictor, as per TIFF technical Note
3.
2005-04-14 11:57:30 +00:00
Andrey Kiselev 1125b82d29 *** empty log message *** 2005-04-13 14:08:13 +00:00
Andrey Kiselev cfc778a413 Added predictor constants. 2005-04-13 14:07:43 +00:00
Andrey Kiselev 7f391ad0da Added _TIFFSwab24BitData() and TIFFSwabArrayOfLong() functions used to swap
24-bit floating point values.
2005-04-13 14:06:21 +00:00
Andrey Kiselev e66b99c926 *** empty log message *** 2005-04-08 10:18:06 +00:00
Andrey Kiselev 77b9c79278 Use uint32 type for appropriate values in _TIFFVSetField() function. Inspired
by the bug http://bugzilla.remotesensing.org/show_bug.cgi?id=816
2005-04-08 10:15:37 +00:00
Andrey Kiselev dcbeafd032 Fixed definition of the TIFFTAG_INKNAMES tag as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=816
2005-04-08 10:14:44 +00:00
Andrey Kiselev 9b5aa94a6a Added check for search.h header. 2005-04-08 10:13:24 +00:00
Andrey Kiselev 6e5ba73c1c Fixed lfind() calling parameters. 2005-04-08 10:10:44 +00:00
Andrey Kiselev c508cf3e8d Added check for search.h header. 2005-04-08 09:58:12 +00:00
Andrey Kiselev 5568e312f7 Avoid warnings. 2005-04-08 09:50:55 +00:00
Andrey Kiselev 02db2e03ba Typo fixed. 2005-04-02 17:25:58 +00:00
Andrey Kiselev 07c020dc31 *** empty log message *** 2005-03-30 13:49:42 +00:00
Andrey Kiselev 88321f931d Do not read header in case the output file should be truncated (Ron). 2005-03-30 13:49:13 +00:00
Andrey Kiselev ae711a78b0 Use lfind() instead of bsearch() in _TIFFFindFieldInfoByName() function (Ron). 2005-03-30 13:23:19 +00:00
Andrey Kiselev 1b48ada8bb Fixes in EXIF tag ordering (Ron). 2005-03-30 13:22:26 +00:00
Frank Warmerdam 647aa5243a Fixed for 12bit support with libjpeg6b in JPEGDecode(). I would presume
that corresponding changes will be needed in JPEGEncode().
Also modified to support the libjpeg Mk1 library (JPEG_LIB_MK1 defined)
for dynamic support of 8bit and 12bit in one build.  Work is preliminary.
2005-03-22 18:55:55 +00:00
Andrey Kiselev 48aae34a68 *** empty log message *** 2005-03-22 14:26:12 +00:00
Andrey Kiselev 40ae66301e Use libtool machinery to pass rpath option. 2005-03-22 10:33:04 +00:00
Andrey Kiselev 85cbe2fbc2 *** empty log message *** 2005-03-21 11:27:31 +00:00
Andrey Kiselev 78cf75a417 Handle all data types in custom tags. 2005-03-21 10:17:37 +00:00
Andrey Kiselev 5cdbfc3664 *** empty log message *** 2005-03-18 14:28:58 +00:00
Andrey Kiselev 353ce00c0d Added DNG tags. 2005-03-18 14:27:30 +00:00
Andrey Kiselev f6c869fa82 More comments; added missed DNG tag (LensInfo); added DNG 1.1.0.0 tags. 2005-03-18 14:26:44 +00:00
Andrey Kiselev b6db5920e5 More improvements in custom tag handling code. 2005-03-18 13:29:39 +00:00
Andrey Kiselev 9f65685aa9 *** empty log message *** 2005-03-18 09:53:44 +00:00
Andrey Kiselev 8745b7866e Fixed problem with alpha channel handling as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=794
2005-03-18 09:47:34 +00:00
Andrey Kiselev d5848b4fc5 Add a note about autoregistered tags. 2005-03-18 08:44:05 +00:00
Andrey Kiselev 3784c28bdd *** empty log message *** 2005-03-17 14:49:52 +00:00
Andrey Kiselev d97f912608 Add libtiff library to the libtifxx link flags. 2005-03-17 14:45:52 +00:00
Andrey Kiselev 44a965a47c *** empty log message *** 2005-03-17 14:44:06 +00:00
Andrey Kiselev 6ba5a639fc Support for custom tags, passed by value. 2005-03-17 14:43:14 +00:00
Andrey Kiselev ca3bdcae22 Fixed typo in page size handling code. 2005-03-17 14:41:59 +00:00
Andrey Kiselev 115be3bb30 Added EXIF related tags. 2005-03-17 14:41:46 +00:00
Andrey Kiselev 1680a287c2 Build with Win32 CRT library by default. 2005-03-17 14:38:54 +00:00
Andrey Kiselev efd76db64f Added EXIF related tags. 2005-03-17 14:29:41 +00:00
Andrey Kiselev 17c2ac65cf libtiff 3.7.2 released. 2005-03-15 15:42:55 +00:00
Andrey Kiselev fa6e0b93a1 *** empty log message *** 2005-03-15 15:17:44 +00:00
Andrey Kiselev bcf985cb67 Regenerated. 2005-03-11 15:47:31 +00:00
Andrey Kiselev fb46afd05f More fixes in groff rule. 2005-03-11 15:28:05 +00:00
Andrey Kiselev 05fb5662ce Improvements in page layout. 2005-03-11 10:11:53 +00:00
Andrey Kiselev 5094ad8638 Improvements in HTML generation rule. 2005-03-11 10:09:05 +00:00
Andrey Kiselev be59779681 Improvements in page formatting. 2005-03-11 10:05:49 +00:00
Andrey Kiselev 829d3d9ea8 Few improvements. 2005-03-11 09:59:28 +00:00
Frank Warmerdam 0ceb2540e3 Updated images link. 2005-03-10 00:24:39 +00:00
Andrey Kiselev 7996f73914 *** empty log message *** 2005-03-09 12:39:45 +00:00
Andrey Kiselev 26134656a4 Added ability to compare the 32-bit integer and floating point data; complain
on unsupported bit depths.
2005-03-09 12:08:30 +00:00
Andrey Kiselev 185a73a37a Regenerated. 2005-03-08 19:16:14 +00:00
Andrey Kiselev 87c5da6f6b Regenerated from sources. 2005-03-06 11:11:43 +00:00
Andrey Kiselev 86f880b8b6 Removed. 2005-03-05 12:35:06 +00:00
Andrey Kiselev 335cd1c5f4 *** empty log message *** 2005-03-05 12:27:27 +00:00
Andrey Kiselev 26a67dc72d Automatically generate HTML pages from the manuals. 2005-03-05 12:27:00 +00:00
Andrey Kiselev 926127c383 Use ios namespace instead of ios_base to support GCC 2.95. 2005-03-05 11:18:04 +00:00
Andrey Kiselev 02f17f2c96 *** empty log message *** 2005-03-05 10:53:05 +00:00
Andrey Kiselev aaca41824c Apply correct patch from Lee Howard for HylaFax DCS tag
(see http://bugzilla.remotesensing.org/show_bug.cgi?id=771)
2005-03-05 10:04:02 +00:00
Andrey Kiselev bae76af667 *** empty log message *** 2005-03-04 14:32:45 +00:00
Andrey Kiselev 24df59c637 Use -rpath option instead of -R as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=732
2005-03-04 14:30:49 +00:00
Andrey Kiselev bd640f03ea *** empty log message *** 2005-03-04 13:24:37 +00:00
Andrey Kiselev 28b82feb2f Applied patch from Lee Howard to support a new tag TIFFTAG_FAXDCS (34911) used
in HylaFax software. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=771
2005-03-04 12:32:34 +00:00
Andrey Kiselev 59379c144e Add more comments, change the config file organization a bit as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=764
2005-03-04 11:48:22 +00:00
Andrey Kiselev e045b53ee8 Outdated stuff removed; add a note about nmake.opt in Win32 section. 2005-03-04 11:40:10 +00:00
Andrey Kiselev 960dc2cc3d Use properly sized buffer in short arrays compirison as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=785
2005-03-04 10:25:24 +00:00
Andrey Kiselev 8535bc2719 *** empty log message *** 2005-03-03 16:01:56 +00:00
Andrey Kiselev 38b5f939a4 More logic to guess missed strip size as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=705
2005-03-03 16:00:01 +00:00
Andrey Kiselev 546e7e62b7 Replace insecure mktemp() function with the tmpfile() as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=78
2005-03-03 12:48:31 +00:00
Frank Warmerdam d1e479c9a4 Updated header. 2005-02-24 14:47:11 +00:00
Andrey Kiselev 2348dccc56 Calculate margins taking in account resolution unit (Richard Nolde). 2005-02-06 17:58:01 +00:00
Andrey Kiselev 668bce1d5d *** empty log message *** 2005-02-05 13:17:26 +00:00
Andrey Kiselev 1c22112c95 More comments on BYTECOUNTLOOKSBAD macro. 2005-02-05 13:16:16 +00:00
Andrey Kiselev 7b1da290b8 Added 3.7.2 description. 2005-02-04 13:27:01 +00:00
Andrey Kiselev d7710d2998 *** empty log message *** 2005-02-04 12:31:13 +00:00
Andrey Kiselev 9b9b9953e0 Changed the int8 definition to be always signed char as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=727
2005-02-04 12:25:10 +00:00
Andrey Kiselev 398724965a Move TIFFOpenW() function into the extern "C"{} block as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=763
2005-02-04 09:53:01 +00:00
Bob Friesenhahn 97367b465e * tools/tiffgt.c: Fix problem on big-endian CPUs so that images
display more correctly.  Images display brighter than they should
on a Sun workstation.
2005-02-03 19:46:49 +00:00
Andrey Kiselev 6159fe5bab *** empty log message *** 2005-02-03 18:08:09 +00:00
Andrey Kiselev bcfbe907cd Estimate strip size in case of wrong or suspicious values in the tags. As per
bugs http://bugzilla.remotesensing.org/show_bug.cgi?id=705 and
http://bugzilla.remotesensing.org/show_bug.cgi?id=320
2005-02-03 18:07:58 +00:00
Andrey Kiselev 6860033832 Fixed problem with page sizes as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=742
2005-02-03 17:02:19 +00:00
Bob Friesenhahn 69863558b1 * libtiff/tiff.h (TIFFTAG_TILEWIDTH): Corrected description.
(TIFFTAG_TILELENGTH): Corrected description.
2005-02-01 04:37:15 +00:00
Andrey Kiselev 2a7c58ca02 Fixes for --with-docdir option as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=759
2005-01-30 12:08:03 +00:00
Andrey Kiselev 9690ab1ea1 Fixes for C++ stream interface from Michael Rinne and Edward Lam. 2005-01-30 12:05:54 +00:00
Andrey Kiselev 4f0f56dae1 Remove unnesessary TIFFSeekFile() call as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=756
2005-01-30 12:05:20 +00:00
Andrey Kiselev 3158ab13d6 Clean-ups in the docdir support. 2005-01-23 09:43:26 +00:00
Andrey Kiselev c0d1f11f57 *** empty log message *** 2005-01-15 17:24:52 +00:00
Andrey Kiselev f284d8e843 Always fill the error message buffer in TIFFRGBAImageBegin() as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=739
2005-01-15 15:44:58 +00:00
Andrey Kiselev b036929113 Avoid warnings when converting float to integer as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=740
2005-01-15 15:44:05 +00:00
Andrey Kiselev c18f204a7c Use double as the second argument of pow() function in TIFFCIELabToRGBInit().
As per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=741
2005-01-15 15:42:50 +00:00
Andrey Kiselev d58f595b68 *** empty log message *** 2005-01-12 15:24:56 +00:00
Andrey Kiselev 4961ada1c9 Added ability to read/write the fax specific TIFFTAG_FAXRECVPARAMS,
TIFFTAG_FAXSUBADDRESS and TIFFTAG_FAXRECVTIME tags as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=736
2005-01-12 15:06:22 +00:00
Andrey Kiselev d29346f2f5 Fixed message formatting in functions Win32WarningHandler() and
Win32ErrorHandler() as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=735
2005-01-12 13:00:20 +00:00
Andrey Kiselev 007d721820 Interpret the -w and -h options independently. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=689
2005-01-12 12:51:26 +00:00
Andrey Kiselev e0940cb11d *** empty log message *** 2005-01-11 16:19:37 +00:00
Andrey Kiselev 343ffa8b21 Move the color conversion routines in the 'extern "C"' section as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=727
2005-01-11 15:40:26 +00:00
Andrey Kiselev ee06d51ca2 Restore back the workaround for AIX Visual Age C compiler to avoid double
definition of BSD types as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=39
2005-01-11 15:22:22 +00:00
Andrey Kiselev 6be3d0ae56 Move the C++ stuff in the separate library called libtiffxx. 2005-01-11 15:07:06 +00:00
Andrey Kiselev a4689ca7d6 *** empty log message *** 2005-01-11 14:55:51 +00:00
Andrey Kiselev 4f2212812f *** empty log message *** 2005-01-05 20:39:20 +00:00
Andrey Kiselev 2988cbc5cc Fixed problem when read broken TIFFs with the wrong tag counts (Dmitry V.
Levin, Martin Pitt).
2005-01-05 20:38:38 +00:00
Andrey Kiselev 309e1113c3 Replace --disable-c++ with the --disable-cxx option as
per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=730
2005-01-05 20:38:18 +00:00
Andrey Kiselev 1c7d7e4618 *** empty log message *** 2004-12-25 20:26:39 +00:00
Andrey Kiselev b696afc2bd More fixes for multiple-alpha-channelled RGB-images as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=713
2004-12-25 20:20:57 +00:00
Andrey Kiselev dcc1d61d82 Convert character option to integer value as per
bug http://bugzilla.remotesensing.org/show_bug.cgi?id=725
2004-12-25 20:17:00 +00:00
Andrey Kiselev ffcc0cda93 libtiff 3.7.1 released. 2004-12-20 19:43:34 +00:00
Andrey Kiselev 74767d8dbe *** empty log message *** 2004-12-20 19:31:44 +00:00
Andrey Kiselev fe55651eca Add missed tiffset.1.html. 2004-12-20 19:00:57 +00:00
Andrey Kiselev 73501de9c5 *** empty log message *** 2004-12-20 18:54:00 +00:00
Andrey Kiselev ed85967e6d Revert back libtiff data type definitions as per
bug http://bugzilla.remotesensing.org/show_bug.cgi?id=687
2004-12-20 18:52:52 +00:00
Andrey Kiselev ff7773591b *** empty log message *** 2004-12-19 18:36:21 +00:00
Andrey Kiselev dfe8bbb410 Do not forget about TIFF_VARIABLE2 when checking for tag count in
TIFFReadDirectory() function. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=713
2004-12-19 18:35:35 +00:00
Andrey Kiselev c5aef88e69 More argument checking in CheckMallock() function. 2004-12-19 18:15:51 +00:00
Andrey Kiselev f69f965a19 Support for multiple-alpha-channelled RGB-images as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=718
2004-12-19 17:11:17 +00:00
Andrey Kiselev be71b688b7 Updated. 2004-12-16 19:19:09 +00:00
Frank Warmerdam 3a3b79b284 bracketing improvement to #define A1 for clean SunPro build 2004-12-15 22:40:28 +00:00
Andrey Kiselev 9e4fa010d1 New. 2004-12-15 19:53:59 +00:00
Bob Friesenhahn 16a7a3b634 Alter execution order in autogen.sh 2004-12-11 16:41:34 +00:00
Andrey Kiselev 7fdf1b02bc *** empty log message *** 2004-12-10 15:02:55 +00:00
Andrey Kiselev 6b65b0eb1f Always write TIFFTAG_SUBIFD using LONG type as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=703
2004-12-10 14:33:01 +00:00
Andrey Kiselev f0815805e8 *** empty log message *** 2004-12-04 11:10:28 +00:00
Andrey Kiselev 18d0691106 Link with the user32.lib in windowed mode. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=697
2004-12-04 11:08:43 +00:00
Andrey Kiselev a4178b28f0 Removed unneded definitions for read/open/close/lseek
functions to fix the
http://bugzilla.remotesensing.org/show_bug.cgi?id=680
2004-12-04 11:07:21 +00:00
Andrey Kiselev 4e30fb1e7d Use char* strings instead of TCHAR in windowed mode as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=697
2004-12-04 11:06:44 +00:00
Andrey Kiselev bac66afbe4 *** empty log message *** 2004-12-03 14:20:53 +00:00
Andrey Kiselev 1b9c6e4f0a Remove TIFFReassignTagToIgnore() call from the TIFFReadDirectory() function.
TIFFReassignTagToIgnore must be removed in the future, as it was never used
properly. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=692
2004-12-03 13:16:55 +00:00
Frank Warmerdam f9e7ea11e4 added bigtiff design link 2004-12-02 14:51:19 +00:00
Frank Warmerdam e145894e41 new 2004-12-02 14:49:54 +00:00
Bob Friesenhahn aa8ccdf669 * libtiff/tif_jpeg.c: Added a work-around in order to allow
compilation with the heavily modified version of libjpeg delivered
with Cygwin.
2004-12-01 01:59:10 +00:00
Andrey Kiselev 0b5ce379b7 *** empty log message *** 2004-11-29 16:53:21 +00:00
Andrey Kiselev 9a94eb411e Properly handle tags, which have the uint32 counts. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=693
2004-11-29 16:39:13 +00:00
Andrey Kiselev d9845f725c Be able to extract the first page (#0). As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=690
2004-11-29 16:20:30 +00:00
Andrey Kiselev 9013d3b16c Add forgotten #ifdef __WIN32__ around the TIFFOpenW(). 2004-11-28 15:04:54 +00:00
Andrey Kiselev cf70481aad *** empty log message *** 2004-11-28 14:44:53 +00:00
Andrey Kiselev 7f8e225500 Avoid warnings. 2004-11-28 14:44:31 +00:00
Andrey Kiselev a482a40a41 Make UNIX module compilable (and usable) on Windows. 2004-11-28 14:42:39 +00:00
Andrey Kiselev 0c502363b0 Add missed DLLNAME variable. 2004-11-28 14:40:49 +00:00
Frank Warmerdam 2d4a8f0f63 make it easier to update the DLL name 2004-11-26 20:06:29 +00:00
Frank Warmerdam d1e79b2eb1 avoid links to www.libtiff.org 2004-11-26 14:37:20 +00:00
Andrey Kiselev 323dca809e *** empty log message *** 2004-11-24 16:34:55 +00:00
Andrey Kiselev 326ffc3be2 Improvements in the "LIST OF ROUTINES" table as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=545
2004-11-24 16:20:32 +00:00
Andrey Kiselev aec3f3bfd5 Added manual page for tiffset tool written by Jay Berkenbilt. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=678
2004-11-24 15:51:42 +00:00
Andrey Kiselev 074b3dc864 Small formatting fix. 2004-11-24 15:45:29 +00:00
Andrey Kiselev 55bc253e03 *** empty log message *** 2004-11-24 11:24:20 +00:00
Frank Warmerdam dd296723ca *** empty log message *** 2004-11-23 05:48:15 +00:00
Frank Warmerdam b31bb82a82 Fixed TIFFerror call to be TIFFError 2004-11-23 05:47:40 +00:00
Frank Warmerdam 997e147f7f *** empty log message *** 2004-11-21 22:06:21 +00:00
Frank Warmerdam a6119e69ec Updated adobe link as per email from Joris. 2004-11-21 22:04:54 +00:00
Andrey Kiselev 3ea29bb2c0 *** empty log message *** 2004-11-21 16:28:42 +00:00
Andrey Kiselev aaa9adb76d *** empty log message *** 2004-11-21 16:22:37 +00:00
Andrey Kiselev a7facb35a9 *** empty log message *** 2004-11-21 16:14:52 +00:00
Andrey Kiselev 02fa852958 C++ stream interface moved to new file tiffio.hxx. We don't have any C++ in
tiffio.h, those who want to use C++ streams should #include <tiffio.hxx>.
2004-11-21 16:12:08 +00:00
Andrey Kiselev 87a689dc5b Check the malloc results. 2004-11-13 18:50:24 +00:00
Andrey Kiselev 7fc18d4f49 Changed to compile the C++ modules properly. 2004-11-13 11:21:17 +00:00
Andrey Kiselev d7343d360b *** empty log message *** 2004-11-13 11:20:44 +00:00
Andrey Kiselev 000bacdc15 C++ stream interface updated to be compliant with the latest standard.
Appropriate additions in makefiles now completed.
2004-11-13 11:19:15 +00:00
Andrey Kiselev 57e10aa76e Added Adobe DNG tags. 2004-11-13 11:16:50 +00:00
Andrey Kiselev 0c9abf1218 Typo fixed. 2004-11-13 11:14:47 +00:00
Andrey Kiselev 315f773c52 Add stream.cxx to sources list. 2004-11-12 13:05:35 +00:00
Andrey Kiselev 078099ab9c Add support for C++ stream API. 2004-11-12 12:52:16 +00:00
Andrey Kiselev f9fb6c863e Regenerated from templates. 2004-11-11 14:47:47 +00:00
Andrey Kiselev 64fd979a67 Replace .3t suffix with the .3tiff. 2004-11-11 14:39:16 +00:00
Andrey Kiselev 6a74b9161c Replace the 3t suffix with the 3tiff. 2004-11-11 14:36:59 +00:00
Andrey Kiselev 0bd9abf123 Removed. 2004-11-11 13:36:36 +00:00
Andrey Kiselev 66a2a07d5b *** empty log message *** 2004-11-11 11:22:23 +00:00
Andrey Kiselev f23d935e98 Move the "compat" tag definitions behind the right ones. 2004-11-11 11:22:04 +00:00
Andrey Kiselev c401cfbdd9 Properly handle the different tag types. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=600
2004-11-11 11:18:09 +00:00
Andrey Kiselev 0db3f80eb1 *** empty log message *** 2004-11-10 21:08:57 +00:00
Andrey Kiselev 89cf48606e Set the appropriate ReferenceBlackWhite array for YCbCr image which lacks that
tag (noted by Hans Petter Selasky).
2004-11-10 21:08:11 +00:00
Andrey Kiselev 361d0c4e33 *** empty log message *** 2004-11-09 20:28:26 +00:00
Andrey Kiselev f3ac753d34 Division by zero fixed (Hans Petter Selasky). 2004-11-09 20:27:47 +00:00
Andrey Kiselev c8d0b4f0ec Added C++ stream interface contributed by Edward Lam (see
http://bugzilla.remotesensing.org/show_bug.cgi?id=654 for details). Though no
changes in any makefiles yet.
2004-11-07 18:20:05 +00:00
Frank Warmerdam 64152a1408 *** empty log message *** 2004-11-05 17:52:44 +00:00
Frank Warmerdam 560ec50fc2 Removed close under bad2 label in TIFFClientOpen(). We aren't allowed to
close the handle because it is owned by the caller.
http://bugzilla.remotesensing.org/show_bug.cgi?id=651
2004-11-05 17:51:35 +00:00
Andrey Kiselev dc87d8a123 *** empty log message *** 2004-11-05 13:48:54 +00:00
Andrey Kiselev cd3cacead1 Added TIFFOpenW() function to work with the double byte strings (used to
represent filenames in some locales). As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=625
2004-11-05 13:42:05 +00:00
Andrey Kiselev 7b11a46d98 Fixed problem when fetching BitsPerSample and Compression tags of type LONG
from broken TIFFS as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=662
2004-11-05 13:10:33 +00:00
Andrey Kiselev 5b831961a8 Fixed definition for TIFFTAG_RICHTIFFIPTC, the writecount should have uint32
type. As per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=662
2004-11-05 13:07:54 +00:00
Andrey Kiselev a815a111a9 Fixed wrong if() statement in TIFFAppendToStrip() function as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=660
2004-11-05 11:37:29 +00:00
Andrey Kiselev ca1310245b Added installation of documentation pages. 2004-11-04 15:27:34 +00:00
Andrey Kiselev 379037c322 Added target to install documentstion. 2004-11-04 15:02:46 +00:00
Andrey Kiselev 018c3d1662 Added descritpion for the TIFFGetBitRevTable, as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=547
2004-11-04 14:34:24 +00:00
Andrey Kiselev c45c87dc41 *** empty log message *** 2004-11-04 12:42:37 +00:00
Andrey Kiselev f2c590de79 Change definition for TIFFTAG_EXTRASAMPLES field. The caller should supply a
count when setting this field. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=648
2004-11-04 12:42:12 +00:00
Andrey Kiselev e65c9014c8 TIFFTAG_JPEGTABLES should have uint32 count. Use this type everywhere. 2004-11-04 12:40:11 +00:00
Andrey Kiselev 941f572964 Fix description for TIFFTAG_JPEGTABLES tag (count should be uint32 value). 2004-11-04 12:35:58 +00:00
Frank Warmerdam 75b4397a19 avoid use of u_long and u_char types. Bug 653 2004-11-03 22:33:27 +00:00
Frank Warmerdam d78807e2ca *** empty log message *** 2004-11-03 00:28:53 +00:00
Frank Warmerdam 2e43d3e0ab removed extra newlines in usage message 2004-11-03 00:28:24 +00:00
Frank Warmerdam ca2ead5c6d Added OPTFLAGS. 2004-11-02 21:00:26 +00:00
Frank Warmerdam a59d7311f4 removed the LIBRARY keyword, it makes it to hard to rename it 2004-11-02 20:55:29 +00:00
Andrey Kiselev 80d6a0f9ca *** empty log message *** 2004-10-30 17:07:32 +00:00
Andrey Kiselev dc65ed605a Improvements in tag writing code. 2004-10-30 17:07:01 +00:00
Andrey Kiselev c6ffb53725 *** empty log message *** 2004-10-30 13:46:57 +00:00
Andrey Kiselev 167d8a7378 Fixed wrong variable data type when read Position tags (Tristan Hill). 2004-10-30 13:46:33 +00:00
Andrey Kiselev 0bf9a0b5a0 USe http://www.remotesensing.org/libtiff/ as the libtiff homepage. 2004-10-30 13:44:45 +00:00
Andrey Kiselev c575a7fbf6 Avoid warnings. 2004-10-30 10:34:12 +00:00
Frank Warmerdam 4289905ecb *** empty log message *** 2004-10-30 04:50:14 +00:00
Frank Warmerdam 539bdf82fe Ensure that we get rid of the asserts if we don't have assert.h. 2004-10-30 04:49:27 +00:00
Andrey Kiselev 2768414cb2 *** empty log message *** 2004-10-29 12:22:39 +00:00
Andrey Kiselev b16c058b18 Add missed references as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=550
2004-10-29 12:21:16 +00:00
Andrey Kiselev 5253599232 Add missed reference as per
http://bugzilla.remotesensing.org/show_bug.cgi?id=552
2004-10-29 12:01:37 +00:00
Andrey Kiselev 8b483bfe11 Add missed reference as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=549
2004-10-29 11:57:20 +00:00
Andrey Kiselev c05fe6b6e0 Fixed case with the wrong decode routines choosing when the incorrect
Group4Options tag set. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=323
2004-10-29 11:46:06 +00:00
Andrey Kiselev 5329452448 Add missed references as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=551
2004-10-29 11:11:23 +00:00
Andrey Kiselev 0ba89e1fbd Formatting fixes. 2004-10-29 11:10:17 +00:00
Andrey Kiselev 7f2c3f8bf3 Add missed references as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=548
2004-10-29 10:57:45 +00:00
Andrey Kiselev 4ba046aad4 *** empty log message *** 2004-10-29 10:15:34 +00:00
Andrey Kiselev 7f5c56bf13 Fixed problem with passing count variable of wrong type when writing the
TIFF_BYTE/TIFF_SBYTE tags in TIFFWriteNormalTag()
2004-10-29 10:15:13 +00:00
Andrey Kiselev 548c10ca28 *** empty log message *** 2004-10-28 18:06:29 +00:00
Andrey Kiselev 6572c7ae4c Fixed wrong variable data type when read Resolution tags (Peter Fales). 2004-10-28 17:56:46 +00:00
Andrey Kiselev 2e08c7afe6 Continue rewriting. 2004-10-28 14:45:43 +00:00
Andrey Kiselev c53d8187bf Get rid of stream I/O functions. 2004-10-28 14:35:50 +00:00
Andrey Kiselev 182977f9dd Get rid of stream I/O functions. 2004-10-28 14:30:17 +00:00
Frank Warmerdam 28c864b35b updated 2004-10-28 13:35:03 +00:00
Frank Warmerdam 00cac3d90e added lots of entry points 2004-10-28 13:34:38 +00:00
Frank Warmerdam 0db378ab84 provide explicit unsigned char casts for a few values to avoid warnings 2004-10-28 13:32:28 +00:00
Andrey Kiselev cb5ad4a8a2 Start page rewriting. 2004-10-27 13:31:50 +00:00
Andrey Kiselev 9e8f48c9ab Add --enable-rpath option to embed linker path into library binary. 2004-10-27 12:43:40 +00:00
Andrey Kiselev 3fcbbf055b *** empty log message *** 2004-10-26 18:23:26 +00:00
Andrey Kiselev e921b6d3a8 Check the malloc return value (Dmitry V. Levin). 2004-10-26 18:22:47 +00:00
Andrey Kiselev 7a8b7651cd Zero division problem fixed (Vladimir Nadvornik, Dmitry V. Levin). 2004-10-26 18:17:19 +00:00
Andrey Kiselev 3de1b05f13 Don't enable the Old JPEG when --disable-old-jpeg option given. 2004-10-23 11:32:04 +00:00
Andrey Kiselev 1f8ba2cb3b Updated to latest versions. 2004-10-18 19:42:13 +00:00
Andrey Kiselev c1e97738bc *** empty log message *** 2004-10-18 19:06:55 +00:00
Andrey Kiselev 48acb2bd36 Cut the 3.7.0 release. 2004-10-16 09:17:48 +00:00
Bob Friesenhahn a8829183f1 * libtiff/tif_jpeg.c: There seems to be no need to include stdio.h
in this file so its inclusion is removed.  Including stdio.h
sometimes incurs an INT32 typedef conflict between MinGW's
basetsd.h and libjpeg's jmorecfg.h.
2004-10-15 14:49:43 +00:00
Andrey Kiselev 542625aabe USe autoconf 1.9.2. 2004-10-15 07:50:45 +00:00
Andrey Kiselev 9c94241dae Fixes in help message. 2004-10-15 07:50:15 +00:00
Andrey Kiselev 50211dbc08 New. 2004-10-15 07:49:15 +00:00
Andrey Kiselev f45c1d2b28 *** empty log message *** 2004-10-15 07:48:44 +00:00
Bob Friesenhahn f9335b105d * tools/tiffcmp.c (leof): Renamed from 'eof' in order to avoid
conflict noticed under MinGW.
* ltmain.sh: Fix for MinGW compilation.
2004-10-14 04:53:56 +00:00
Frank Warmerdam d8cd50a44c *** empty log message *** 2004-10-13 12:38:59 +00:00
Frank Warmerdam 2575338500 Corrected to indicate that aaa-zzz is now used, not aa-zz. 2004-10-13 12:38:19 +00:00
Andrey Kiselev ec21d24bdf *** empty log message *** 2004-10-12 18:53:46 +00:00
Andrey Kiselev efab18a696 Handle the zero strip/tile sizes properly (Dmitry V. Levin, Marcus Meissner). 2004-10-12 18:50:48 +00:00
Andrey Kiselev b9ccb5ba93 More fixes for SubIFD tag. 2004-10-12 06:46:50 +00:00
Andrey Kiselev c5de15bb62 *** empty log message *** 2004-10-11 20:04:38 +00:00
Andrey Kiselev 4386f668ff Type of the TIFFTAG_SUBIFD field changed to TIFF_IFD. 2004-10-11 20:03:30 +00:00
Andrey Kiselev 75865dbd68 *** empty log message *** 2004-10-10 12:33:57 +00:00
Andrey Kiselev 0244fc4839 Check the space allocation results. 2004-10-10 12:33:18 +00:00
Andrey Kiselev fc2fea250f Readability fixes. 2004-10-10 11:58:16 +00:00
Andrey Kiselev 298c868679 Casting fixes. 2004-10-10 11:54:54 +00:00
Andrey Kiselev 361f39638b *** empty log message *** 2004-10-10 11:46:16 +00:00
Andrey Kiselev d7e1ac10e9 Move _TIFFmemset() behind the pointer check in t2p_init(). 2004-10-10 11:38:34 +00:00
Andrey Kiselev 1d7710fbd1 *** empty log message *** 2004-10-09 18:36:47 +00:00
Andrey Kiselev 228e68f0eb Initialize td_tilewidth and td_tilelength fields of the TIFFDirectory
structure with the 0 instead of -1 to avoid confusing integer overflows in
TIFFTileRowSize() for striped images.
2004-10-09 18:33:56 +00:00
Andrey Kiselev 3e93e8065a *** empty log message *** 2004-10-09 14:15:45 +00:00
Andrey Kiselev 4d968f4ac2 Fixed TransferFunction tag handling reported by Ross A. Finlayson. 2004-10-09 14:15:07 +00:00
Andrey Kiselev 199de07e56 Fixed custom tags handling as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=629
2004-10-09 13:44:32 +00:00
Frank Warmerdam 624b33949d set tif_foundfield to NULL if tif_fieldinfo realloced, bug 630 2004-10-08 14:06:16 +00:00
Bob Friesenhahn 54d78d3e2b * contrib/iptcutil/README: Added the missing README which goes
along with iptcutil.
2004-10-05 01:28:40 +00:00
Andrey Kiselev fe56539115 *** empty log message *** 2004-10-03 08:37:03 +00:00
Andrey Kiselev 26eb4ec2ed Improved error reporting in TIFFGetConfiguredCODECs() (Dmitry V. Levin). 2004-10-03 08:34:01 +00:00
Andrey Kiselev 9f33c698e0 libtiff 3.7.0beta2 released. 2004-10-02 13:54:50 +00:00
Andrey Kiselev 99f69f2ea1 Added check for assert.h header. 2004-10-02 13:31:30 +00:00
Andrey Kiselev dd9d956c0d Added checks for failed memory allocations andinteger overflows
(Dmitry V. Levin).
2004-10-02 13:29:41 +00:00
Andrey Kiselev 7a6877d639 Missed TIFF_BIGTIFF_VERSION constant added. 2004-10-02 11:16:50 +00:00
Andrey Kiselev 2a85ad222c *** empty log message *** 2004-10-02 11:16:04 +00:00
Frank Warmerdam ebae7b75f6 *** empty log message *** 2004-10-01 18:53:24 +00:00
Frank Warmerdam 803f8ad8dc Added a more informative message if a BigTIFF file is opened. 2004-10-01 18:52:58 +00:00
Andrey Kiselev 453ae1a8e4 *** empty log message *** 2004-10-01 14:16:37 +00:00
Andrey Kiselev ce258158ba *** empty log message *** 2004-10-01 14:11:01 +00:00
Frank Warmerdam 830509e870 Changed type of XMLPacket to BYTE instead of UNDEFINED to match Adobe XMP
specification.  Added custom printer for XMLPacket data to tif_print.c.
2004-10-01 02:30:29 +00:00
Andrey Kiselev 79137201c4 *** empty log message *** 2004-09-30 07:44:45 +00:00
Andrey Kiselev bc0852414b Use _TIFFmemset() instead of memset(). 2004-09-29 07:44:26 +00:00
Andrey Kiselev fc930576ba Applied patches from Dmitry V. Levin to fix possible integer overflow problems. 2004-09-29 07:42:52 +00:00
Andrey Kiselev ffe773cbd7 *** empty log message *** 2004-09-28 17:17:51 +00:00
Andrey Kiselev a7a8b9e172 Dmitry V. Levin adde to the list of contributors. 2004-09-28 17:17:19 +00:00
Andrey Kiselev 8c5b07a609 Check for allocated buffers before clearing (Dmitry V. Levin). 2004-09-28 17:15:25 +00:00
Andrey Kiselev d4b4bd36f9 *** empty log message *** 2004-09-26 09:52:22 +00:00
Andrey Kiselev 4a880ff13a Optimize checking for the strip bounds. 2004-09-26 09:49:53 +00:00
Andrey Kiselev cb0a22a988 TIFFScanlineSize() and TIFFRasterScanlineSize() functions report zero in the
case of integer overflow now. Properly handle this case in TIFFReadDirectory()
(patches from Dmitry V. Levin).
2004-09-26 09:48:17 +00:00
Andrey Kiselev 642e90d1a8 *** empty log message *** 2004-09-25 19:37:42 +00:00
Andrey Kiselev d60746c12c Use TIFFhowmany8() macro where appropriate. 2004-09-25 19:36:57 +00:00
Andrey Kiselev 5f3854f6c5 *** empty log message *** 2004-09-25 18:46:19 +00:00
Andrey Kiselev 7111f6fbfa Write ImageWidth/Height tags to output file, as noted by Gennady Khokhorin. 2004-09-25 18:45:31 +00:00
Andrey Kiselev 6087ff01ea *** empty log message *** 2004-09-25 11:14:27 +00:00
Andrey Kiselev 93226a031e Potential memory leak fixed in TIFFGrowStrips() (found by Dmitry V. Levin). 2004-09-25 11:07:11 +00:00
Andrey Kiselev ba180e90d5 Potential memory leak fixed in _TIFFVSetField(). Fixed possible integer
overflow _TIFFset*Array() functions (Dmitry V. Levin).
2004-09-25 11:05:58 +00:00
Andrey Kiselev 9da27e9da7 Potential memory leak fixed in TIFFReadDirectory(). Always check the return
values, returned by the _TIFFmalloc() (Dmitry V. Levin).
2004-09-25 11:05:10 +00:00
Andrey Kiselev bfeb12aa9d *** empty log message *** 2004-09-24 15:19:30 +00:00
Andrey Kiselev c68485af5a Added TIFFGetConfiguredCODECs() to get the list of configured codecs. 2004-09-24 15:18:57 +00:00
Andrey Kiselev 9f1423f91f More overflow fixes from Dmitry V. Levin. 2004-09-24 08:10:18 +00:00
Andrey Kiselev 79cf6661ca Comment added. 2004-09-23 08:58:11 +00:00
Andrey Kiselev ba56002ab7 *** empty log message *** 2004-09-23 07:50:21 +00:00
Andrey Kiselev 34ae837599 Applied patch from Dmitry V. Levin to fix possible integer overflow in
CheckMalloc() function.
2004-09-23 07:49:58 +00:00
Andrey Kiselev 55b4911afc Use TIFFhowmany8() macro instead of plain TIFFhowmany() where appropriate. 2004-09-22 13:49:08 +00:00
Andrey Kiselev 94d3ece8d8 Implemented TIFFhowmany8() macro. 2004-09-22 13:48:20 +00:00
Andrey Kiselev 18b1c312f7 *** empty log message *** 2004-09-21 19:06:42 +00:00
Andrey Kiselev b25a2a7e4d Initialize arrays after space allocation. 2004-09-21 18:27:21 +00:00
Andrey Kiselev 653d728173 Additional check in TIFFFreeDirectory() function. 2004-09-21 14:44:06 +00:00
Andrey Kiselev 3739d496c0 Avoid warnings. 2004-09-21 13:34:39 +00:00
Andrey Kiselev 1b93e5d46a Add missed include string.h. 2004-09-21 13:31:23 +00:00
Andrey Kiselev 6e08e7728d Avoid warnings. 2004-09-21 13:24:00 +00:00
Andrey Kiselev 9199e8d328 Avoid warnings. 2004-09-21 12:45:46 +00:00
Andrey Kiselev 2ed2911af2 Avoid warnings. 2004-09-21 12:36:02 +00:00
Andrey Kiselev 77e3c70670 Avoid warnings. 2004-09-21 12:16:51 +00:00
Andrey Kiselev 5c33b43916 Avoid warnings. 2004-09-21 10:18:22 +00:00
Andrey Kiselev 90c8a73696 libtiff 3.7.0beta released. 2004-09-19 10:58:09 +00:00
Andrey Kiselev e758fc849e libtiff 3.7.0beta released. 2004-09-19 10:44:18 +00:00
Andrey Kiselev 8eb1504c33 Several buffer overruns fixed, as noted by Chris Evans. 2004-09-19 10:08:38 +00:00
Andrey Kiselev eca092d8d3 *** empty log message *** 2004-09-15 13:00:02 +00:00
Andrey Kiselev 41a9133549 *** empty log message *** 2004-09-14 15:14:21 +00:00
Andrey Kiselev cdd3cd562d New tests. 2004-09-14 15:01:16 +00:00
Bob Friesenhahn 88b14a7b11 * commit: Added a script to make it more convenient to commit
updates.  The CVS commit message is extracted from this ChangeLog
file.
2004-09-14 14:26:21 +00:00
Andrey Kiselev 0a4354de12 Typo fixed. 2004-09-14 11:52:49 +00:00
Andrey Kiselev 13114824f5 *** empty log message *** 2004-09-14 07:04:18 +00:00
Andrey Kiselev 795f959f95 Get rid of BSD data types (u_char, u_short, u_int, u_long). 2004-09-14 06:50:22 +00:00
Andrey Kiselev 2d978a7e7f Get rid of BSD data types (u_char, u_short, u_int, u_long). 2004-09-14 06:50:22 +00:00
Andrey Kiselev 8408596749 Get rid of BSD data types (u_char, u_short, u_int, u_long). 2004-09-14 06:38:49 +00:00
Andrey Kiselev b115d4a982 Get rid of BSD data types (u_char, u_short, u_int, u_long). 2004-09-14 06:32:19 +00:00
Andrey Kiselev 22cee71144 Get rid of BSD data types (u_char, u_short, u_int, u_long). 2004-09-14 06:02:56 +00:00
Andrey Kiselev ae911cb252 *** empty log message *** 2004-09-14 05:56:06 +00:00
Andrey Kiselev 46d616106e Get rid of BSD data types (u_char, u_short, u_int, u_long). 2004-09-14 05:45:46 +00:00
Bob Friesenhahn 7d6263bb48 * libtiff/tiff.h: Fix column tagging. Reference current Adobe XMP
specification. Reference libtiff bug tracking system to submit
private tag additions.
2004-09-14 02:42:37 +00:00
Andrey Kiselev ee0fe81fd0 short.tag.c test case added. 2004-09-13 10:33:57 +00:00
Bob Friesenhahn d0318870ba Fix tiffgt compilation. 2004-09-12 16:40:39 +00:00
Andrey Kiselev b3b61cecc7 New. 2004-09-12 15:04:37 +00:00
Andrey Kiselev c87f48bcf8 *** empty log message *** 2004-09-12 15:03:54 +00:00
Andrey Kiselev f23dbd1008 *** empty log message *** 2004-09-12 09:17:34 +00:00
Andrey Kiselev 7688338553 New macros to detect GLUT libraries. 2004-09-12 09:15:05 +00:00
Andrey Kiselev 9352e22c77 *** empty log message *** 2004-09-12 08:08:19 +00:00
Andrey Kiselev da2e7bcccc Added addingtags.html file. 2004-09-12 08:04:45 +00:00
Andrey Kiselev 0b84fb9160 Add obsolete warning. 2004-09-12 08:04:16 +00:00
Bob Friesenhahn fbfe4927b5 Configure and install tiffconf.h in order to satisfy application requirements. 2004-09-11 20:44:41 +00:00
Frank Warmerdam d5b5f8c101 Fixed the link for adding tags. 2004-09-10 14:52:01 +00:00
Frank Warmerdam ba1dbae3d1 Added caveats. 2004-09-10 14:50:03 +00:00
Frank Warmerdam ec5d8718b1 *** empty log message *** 2004-09-10 14:49:21 +00:00
Frank Warmerdam 28152a0a5a Added "adding new tags" link. 2004-09-10 14:48:39 +00:00
Frank Warmerdam 9cb226a4d5 Moved tag definition information into addingtags.html. 2004-09-10 14:47:31 +00:00
Frank Warmerdam fbc933211e New 2004-09-10 14:43:18 +00:00
Andrey Kiselev 13812ee594 *** empty log message *** 2004-09-10 13:48:02 +00:00
Andrey Kiselev a0cf9e9230 New. 2004-09-10 13:47:08 +00:00
Andrey Kiselev 566bf7c4d8 long_tag.c test added. 2004-09-10 13:46:21 +00:00
Andrey Kiselev c03b670e23 Bug fixed. 2004-09-10 13:40:24 +00:00
Frank Warmerdam f5b59ca7cf Fixed messed up bold closing marker that messed up the rest of
Other Comments.
2004-09-10 13:36:22 +00:00
Andrey Kiselev 31cc6250bf Avoid warnings. 2004-09-10 13:08:03 +00:00
Andrey Kiselev bcef546262 Complete this test case. 2004-09-10 12:59:57 +00:00
Andrey Kiselev 7f3ff6402c Fixes in InkNames and NumberOfInks reporting. 2004-09-10 12:53:55 +00:00
Andrey Kiselev e3f2f56044 Fixed reading TransferFunction tag as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=590
2004-09-10 11:50:57 +00:00
Andrey Kiselev 35ebc3c0a6 Don't reject to read tags of the SamplesPerPixel size when the tag count
is greater than number of samples as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=576
2004-09-10 10:55:10 +00:00
Andrey Kiselev 7b282e786d Use _TIFF_DATA_TYPEDEFS_ guardian to switch off defining int8/uint8/...
etc. types. As per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=607
2004-09-10 10:02:03 +00:00
Frank Warmerdam 8d9d8a5d0c added a couple more programs 2004-09-09 18:06:55 +00:00
Frank Warmerdam 6be58fbab2 avoid warnings 2004-09-09 18:06:14 +00:00
Frank Warmerdam f26d7e60de Added newline at end to avoid warnings. 2004-09-09 18:02:13 +00:00
Frank Warmerdam 1870bb66c4 Updated CVS repository location. 2004-09-08 20:19:42 +00:00
Andrey Kiselev 1016e7081c *** empty log message *** 2004-09-08 18:01:29 +00:00
Andrey Kiselev 570f55bb0c Added test case for ASCII tags. 2004-09-03 15:03:34 +00:00
Andrey Kiselev 0883c324fa Avoid warnings. 2004-09-03 13:57:34 +00:00
Andrey Kiselev 3244d61471 Added test directory. 2004-09-03 13:56:42 +00:00
Andrey Kiselev a3a80ae91d Avoid warnings. 2004-09-03 08:56:06 +00:00
Andrey Kiselev 95e3f76d06 Avoid warnings. 2004-09-03 08:26:08 +00:00
Andrey Kiselev e7976c2ad8 Avoid warnings. 2004-09-03 08:16:01 +00:00
Andrey Kiselev b7d0571dc7 Avoid warnings. 2004-09-03 07:55:34 +00:00
Andrey Kiselev f6e12093d8 Avoid warnings. 2004-09-03 07:53:29 +00:00
Andrey Kiselev 8ae15719de Avoid warnings. 2004-09-02 14:51:04 +00:00
Andrey Kiselev b75684f6ba Warnings removed. 2004-09-02 14:46:27 +00:00
Andrey Kiselev 1abc31ad68 *** empty log message *** 2004-09-02 14:36:33 +00:00
Andrey Kiselev dafeac1024 Warnings removed. 2004-09-02 14:27:49 +00:00
Andrey Kiselev 5828377171 *** empty log message *** 2004-09-02 14:25:22 +00:00
Andrey Kiselev 164673834b Use memcpy() function instead of pointer assigning magic in TIFFFetchFloat(). 2004-09-02 14:24:57 +00:00
Andrey Kiselev 7ad124cf2e *** empty log message *** 2004-09-02 14:11:35 +00:00
Andrey Kiselev 2ba5511a7c *** empty log message *** 2004-09-02 13:56:40 +00:00
Andrey Kiselev 5c9353bf80 *** empty log message *** 2004-09-02 13:45:37 +00:00
Andrey Kiselev c3c279431c Warnings removed. 2004-09-02 13:43:28 +00:00
Andrey Kiselev 6f1fa4b83d UNISYS patent clause removed. 2004-09-02 13:27:38 +00:00
Andrey Kiselev fe8ca9d4f6 *** empty log message *** 2004-09-01 18:44:02 +00:00
Andrey Kiselev 03893d01cb Use the new functions in the code. 2004-09-01 18:43:33 +00:00
Andrey Kiselev 2cc925e6f3 Applied patches from Joris Van Damme to avoid requirement for tiffiop.h
inclusion in some applications. See here
http://www.asmail.be/msg0054799560.html for details.
2004-09-01 18:43:11 +00:00
Andrey Kiselev 3446c24799 Work out getopt problems. 2004-08-25 18:34:55 +00:00
Andrey Kiselev 44e6d94185 *** empty log message *** 2004-08-25 13:46:06 +00:00
Andrey Kiselev 0d1363b9db Initialize arrays properly. 2004-08-25 13:43:14 +00:00
Andrey Kiselev e3f88ce09f *** empty log message *** 2004-08-25 13:14:39 +00:00
Andrey Kiselev 0abad54ad0 Avoid zero division in setupPageState() function;
properly initialize array in PSDataBW().
2004-08-25 13:14:18 +00:00
Andrey Kiselev 9b6b3ab080 Typo fixed. 2004-08-24 14:29:11 +00:00
Andrey Kiselev 37b6ba2cbb *** empty log message *** 2004-08-24 07:48:54 +00:00
Andrey Kiselev 8c15798606 More fixes for bug http://bugzilla.remotesensing.org/show_bug.cgi?id=590
from Ross Finlayson.
2004-08-24 07:48:36 +00:00
Andrey Kiselev 45de469695 Small fix in comments. 2004-08-23 19:04:40 +00:00
Andrey Kiselev 46946dafce *** empty log message *** 2004-08-23 13:17:27 +00:00
Andrey Kiselev 176881c3a0 Fixed problem with uninitialized values. 2004-08-23 13:16:54 +00:00
Andrey Kiselev 282c0b82c6 Initialize tif_foundfield data member in the TIFFDefaultDirectory()
(in addition to 2004-08-19 fix).
2004-08-23 12:57:52 +00:00
Andrey Kiselev 14dced4890 *** empty log message *** 2004-08-23 12:01:30 +00:00
Andrey Kiselev 80675eb205 Fixed a bunch of problems as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=590
2004-08-23 12:00:30 +00:00
Andrey Kiselev dab4c68188 Small bug introduced in previous patch fixed. 2004-08-22 17:23:44 +00:00
Andrey Kiselev 442be0e95d More fixes from Ross. 2004-08-21 08:09:49 +00:00
Andrey Kiselev c3a5772499 *** empty log message *** 2004-08-20 19:24:22 +00:00
Andrey Kiselev 9f25189d68 Applied patch from Ross Finlayson that checks that the input file has
compression, photometric interpretation, etcetra, tags or if not than a more
descriptive error is returned.
2004-08-20 19:23:25 +00:00
Andrey Kiselev 2b858c58c4 *** empty log message *** 2004-08-20 18:16:54 +00:00
Andrey Kiselev e00caddae1 *** empty log message *** 2004-08-20 14:42:27 +00:00
Andrey Kiselev d0a81ad681 Fixed problem in TIFFReadDirectory() in the code, responsible for tag data type
checking.
2004-08-20 14:40:10 +00:00
Andrey Kiselev 8b8023bb51 Make tif_foundfield constant pointer. 2004-08-19 08:22:01 +00:00
Andrey Kiselev 3c7e48ca3c *** empty log message *** 2004-08-18 20:14:04 +00:00
Andrey Kiselev 548d589576 Fixed problem with the static variable as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=593
2004-08-18 20:13:31 +00:00
Andrey Kiselev 2dc7eb3ce8 *** empty log message *** 2004-08-16 19:15:30 +00:00
Andrey Kiselev 8ed4e58b51 Fixed issue with missed big-endian checks as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=586
2004-08-16 19:13:53 +00:00
Andrey Kiselev 1dd55fd57c Replace INCLUDES with CPPFLAGS. 2004-08-11 19:19:34 +00:00
Andrey Kiselev 170256366d LZW related info removed. 2004-08-11 05:11:25 +00:00
Andrey Kiselev 1fef38a7cd Adde link to the FAQ. 2004-08-10 19:40:14 +00:00
Andrey Kiselev ab35e4f69a Replace wrong INCLUDE variable with the right INCLUDES one. 2004-08-09 18:24:50 +00:00
Andrey Kiselev 70040ecf02 Unneeded header removed. 2004-08-08 15:32:29 +00:00
Andrey Kiselev 6caede6c10 *** empty log message *** 2004-08-07 18:20:35 +00:00
Andrey Kiselev 532d2ad4a7 config.h.in and config.h.vc files renamed in the tif_config.h.in and
tif_config.h.vc.
2004-08-01 10:35:02 +00:00
Andrey Kiselev d79b0d1b59 config.h.in and config.h.vc files renamed in the tif_config.h.in and
tif_config.h.vc.
2004-08-01 10:30:15 +00:00
Frank Warmerdam 669e3e4074 improve error check for overview failure, fix warnings, fix header 2004-07-26 14:27:27 +00:00
Frank Warmerdam 8f1d4f9582 improve error check for overview failure, fix warnings 2004-07-26 14:25:04 +00:00
Andrey Kiselev eb7cea92e2 Added missed description for -z option (LZW compression). 2004-07-24 19:03:59 +00:00
Andrey Kiselev c79429f4fe Removed message about LZW patents. 2004-07-24 19:03:16 +00:00
Andrey Kiselev ddbcf79378 *** empty log message *** 2004-07-24 19:02:00 +00:00
Andrey Kiselev d15dbca39d LZW compression code is merged back from the separate package. 2004-07-24 19:01:15 +00:00
Andrey Kiselev 8670bb33fb *** empty log message *** 2004-07-11 20:10:22 +00:00
Andrey Kiselev 9825af7a6c Revert thandle_t back to void* type. 2004-07-11 20:09:07 +00:00
Frank Warmerdam 40e0f6c745 Updated libtiff web site link. 2004-07-11 15:35:30 +00:00
Frank Warmerdam db10428faa Updated CVS location. 2004-07-11 03:14:39 +00:00
Andrey Kiselev 9d94281cce *** empty log message *** 2004-07-10 20:07:31 +00:00
Andrey Kiselev b84b0ef102 Fixes in error messages, as suggested by Bernd Herd. 2004-07-10 20:04:47 +00:00
Frank Warmerdam 99f27de21e Removed dead link to adobe technotes page. 2004-07-09 22:19:28 +00:00
Frank Warmerdam 275f8e4c49 Fixed logluv link. 2004-07-06 20:42:00 +00:00
Frank Warmerdam 6d23304d26 added i flag to getopt call 2004-07-06 15:20:37 +00:00
Frank Warmerdam 037cab3498 update to test web site updates 2004-07-06 15:10:10 +00:00
Frank Warmerdam dbcc00fb8b updated main adobe link. 2004-07-06 14:07:12 +00:00
Andrey Kiselev 95242031c6 Avoid warnings. 2004-07-03 16:04:01 +00:00
Andrey Kiselev aa92ea59f3 Few minor improvements. 2004-07-03 16:01:29 +00:00
Andrey Kiselev a9a325f626 *** empty log message *** 2004-07-03 10:29:07 +00:00
Andrey Kiselev 58b9b9a82e Call TIFFError() instead of producing warnings when setting custom tags
by value.
2004-07-03 10:26:55 +00:00
Andrey Kiselev a61b92509b Add missed config.h.vc file. 2004-06-29 19:23:20 +00:00
Andrey Kiselev 3d90486ac8 Warnings removed. 2004-06-29 19:19:17 +00:00
Andrey Kiselev 5bf48e861c *** empty log message *** 2004-06-14 15:12:04 +00:00
Andrey Kiselev 1b6abaacc6 Add missed RawsPerStrip setting. 2004-06-14 15:10:10 +00:00
Andrey Kiselev 986fa996aa Removed. 2004-06-14 15:08:35 +00:00
Andrey Kiselev 6058d6e1db Moved from dist directory. 2004-06-14 15:07:42 +00:00
Andrey Kiselev 06965ab1f2 *** empty log message *** 2004-06-08 15:58:21 +00:00
Andrey Kiselev e31354c76d bmp2tiff utility added. 2004-06-08 15:54:12 +00:00
Andrey Kiselev e3e77ee01c Avoid warnings. 2004-06-08 09:56:35 +00:00
Andrey Kiselev 218223a65b *** empty log message *** 2004-06-07 19:34:58 +00:00
Andrey Kiselev 670cdcb608 Forgotten debug output removed. 2004-06-07 09:05:09 +00:00
Andrey Kiselev 10413ec127 *** empty log message *** 2004-06-07 09:04:19 +00:00
Andrey Kiselev ab0ace8d8a *** empty log message *** 2004-06-06 21:46:57 +00:00
Andrey Kiselev 249698e1fe *** empty log message *** 2004-06-06 21:35:53 +00:00
Andrey Kiselev 3846ae64db *** empty log message *** 2004-06-06 17:56:21 +00:00
Andrey Kiselev 0b802ceb8c *** empty log message *** 2004-06-06 10:20:39 +00:00
Andrey Kiselev 9f13334e1d Get rid of ugly 64-bit hacks, replace them with the clever (autoconf based )
ones :-).
2004-06-06 10:20:12 +00:00
Andrey Kiselev 196feb57b1 Define thandle_t as int, not void* (may cause problems in 64-bit environment). 2004-06-06 10:18:55 +00:00
Andrey Kiselev 99887fc8da Avoid warnings. 2004-06-06 10:17:26 +00:00
Andrey Kiselev a9dba67511 Get rid of u_char. 2004-06-05 21:03:16 +00:00
Andrey Kiselev e209c172d1 *** empty log message *** 2004-06-05 10:46:47 +00:00
Andrey Kiselev 04cb044f77 *** empty log message *** 2004-06-05 09:19:09 +00:00
Andrey Kiselev b72fade1e5 Removed. 2004-06-05 09:08:08 +00:00
Andrey Kiselev 7d2f892d06 tiffset now can set any libtiff supported tags. Tags can be supplied by the
mnemonic name or number.
2004-06-05 09:05:26 +00:00
Andrey Kiselev 04c1e2a285 *** empty log message *** 2004-06-05 09:02:19 +00:00
Andrey Kiselev 5c3f747c53 *** empty log message *** 2004-06-05 09:02:03 +00:00
Andrey Kiselev 19421d5e88 Avoid warnings. 2004-06-05 08:13:06 +00:00
Andrey Kiselev b5bb4b9065 New macro added. 2004-06-05 08:11:49 +00:00
Andrey Kiselev 3522985c3b Unused macro removed. 2004-06-05 08:11:26 +00:00
Andrey Kiselev 56f6fd9c5d Added two new functions TIFFFindFieldInfoByName() and TIFFFieldWithName(). 2004-06-05 08:09:28 +00:00
Andrey Kiselev bb2adadd1f Define BSDTYPES. 2004-06-04 22:03:10 +00:00
Andrey Kiselev 7ca6367f21 *** empty log message *** 2004-06-04 22:02:02 +00:00
Andrey Kiselev b1afaa5a64 *** empty log message *** 2004-06-04 19:35:15 +00:00
Andrey Kiselev 4f5e020212 *** empty log message *** 2004-06-04 15:32:40 +00:00
Andrey Kiselev 73e787830f Avoid warnings. 2004-06-04 14:16:14 +00:00
Andrey Kiselev cf7d2a38c4 Avoid warnings. 2004-06-04 13:46:25 +00:00
Andrey Kiselev c3fd399678 Avoid warnings. 2004-06-04 13:18:25 +00:00
Andrey Kiselev 37001a073e Avoid warnings. 2004-06-04 11:50:09 +00:00
Andrey Kiselev 1432ba20b1 *** empty log message *** 2004-06-04 11:27:08 +00:00
Andrey Kiselev 1a195d5f9c *** empty log message *** 2004-06-04 10:29:50 +00:00
Andrey Kiselev 08db6d83a9 tiffcomp.h removed. 2004-06-04 10:25:58 +00:00
Andrey Kiselev 8b4b3781ba *** empty log message *** 2004-05-27 10:13:47 +00:00
Andrey Kiselev 80ca7917b4 Fixed problem with duplicated SOI and SOF markers as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=581
2004-05-27 10:04:49 +00:00
Andrey Kiselev 82a4bcedb1 Get rid of __T() macro; avoid warnings. 2004-05-26 09:24:07 +00:00
Andrey Kiselev 9b47725fa1 *** empty log message *** 2004-05-26 09:20:56 +00:00
Andrey Kiselev 010cb0b768 *** empty log message *** 2004-05-25 16:02:44 +00:00
Andrey Kiselev 52f0318fd1 Don't forget to copy Photometric Interpretation tag. 2004-05-25 16:02:22 +00:00
Andrey Kiselev 546e0e24ec *** empty log message *** 2004-05-20 19:36:40 +00:00
Andrey Kiselev f23487170c Fixed problem with unproperly written multibyte files. Now output files will
be written using the same byte order flag as in the input image. See
http://bugzilla.remotesensing.org/show_bug.cgi?id=574
for details.
2004-05-20 19:20:52 +00:00
Andrey Kiselev 58499f6a0e New function added: TIFFIsBigEndian(). Function returns nonzero if given was
file written in big-endian order.
2004-05-20 19:15:54 +00:00
Andrey Kiselev 268005558a *** empty log message *** 2004-05-20 10:39:25 +00:00
Andrey Kiselev d3c3d5ebad *** empty log message *** 2004-05-19 18:28:57 +00:00
Andrey Kiselev bc3745fe4a *** empty log message *** 2004-05-19 18:05:47 +00:00
Andrey Kiselev 223cd0eca4 *** empty log message *** 2004-05-19 17:51:09 +00:00
Andrey Kiselev 7ff3c6afd4 *** empty log message *** 2004-05-19 17:27:39 +00:00
Andrey Kiselev f8e45e7ca6 *** empty log message *** 2004-05-19 17:20:27 +00:00
Andrey Kiselev 7660067e8d *** empty log message *** 2004-05-19 17:14:45 +00:00
Frank Warmerdam 833e12f327 added support for printing SSHORT, SLONG and SRATIONAL fields 2004-05-19 15:23:54 +00:00
Frank Warmerdam 3aa18ca139 *** empty log message *** 2004-05-19 15:23:41 +00:00
Frank Warmerdam 5a1af25943 close out on normal termination 2004-05-19 15:16:45 +00:00
Andrey Kiselev ac29791b51 *** empty log message *** 2004-05-19 10:49:16 +00:00
Andrey Kiselev ff2189057d Avoid warnings. 2004-05-19 10:49:01 +00:00
Andrey Kiselev 95ca2fc746 *** empty log message *** 2004-05-17 19:41:58 +00:00
Andrey Kiselev c9b88eb3b9 Avoid reading CCITT compression options if compression type mismatches. See
http://bugzilla.remotesensing.org/show_bug.cgi?id=565
2004-05-17 18:53:32 +00:00
Andrey Kiselev 21857cafef *** empty log message *** 2004-05-12 20:40:51 +00:00
Andrey Kiselev ec88d001e2 New. 2004-05-03 18:39:50 +00:00
Andrey Kiselev adfb758327 *** empty log message *** 2004-05-03 18:39:24 +00:00
Andrey Kiselev 2faf572f89 Removed. 2004-05-03 18:38:57 +00:00
Andrey Kiselev 96d57081dd *** empty log message *** 2004-05-03 18:12:57 +00:00
Andrey Kiselev 052f7872d2 New. 2004-05-03 16:47:20 +00:00
Andrey Kiselev a32202b771 *** empty log message *** 2004-05-03 16:46:36 +00:00
Andrey Kiselev 12750c8a94 Removed. 2004-05-03 16:45:59 +00:00
Frank Warmerdam b3587254f7 Increase -sf buffer size. 2004-05-03 16:39:11 +00:00
Andrey Kiselev 2902ded7da *** empty log message *** 2004-05-02 15:47:02 +00:00
Andrey Kiselev da8f5caa5a *** empty log message *** 2004-04-30 08:35:02 +00:00
Andrey Kiselev 51cc3940e8 Never return 0 from the TIFFNumberOfStrips(). 2004-04-30 08:34:44 +00:00
Andrey Kiselev 29e9522c6f *** empty log message *** 2004-04-29 07:43:22 +00:00
Andrey Kiselev f2e17f38b9 Workaround for broken TIFF writers which store single SampleFormat value
for multisampled images. See
http://bugzilla.remotesensing.org/show_bug.cgi?id=562
2004-04-29 07:42:33 +00:00
Andrey Kiselev f2c24c283a *** empty log message *** 2004-04-28 10:04:17 +00:00
Frank Warmerdam 25223dc6df Added note about emailing me. 2004-04-26 19:28:32 +00:00
Andrey Kiselev 65cc9a3473 *** empty log message *** 2004-04-26 08:36:40 +00:00
Andrey Kiselev 0bcbd88994 *** empty log message *** 2004-04-26 08:23:43 +00:00
Andrey Kiselev 78927c7750 Added tests for int8, int16 and int32 types to avoid complains on some
compilers.
2004-04-25 18:00:55 +00:00
Andrey Kiselev 0c19f9ca10 Added tests for int8, int16 and int32 types to avoid complains on some
compilers. Details at the http://bugzilla.remotesensing.org/show_bug.cgi?id=39
2004-04-25 18:00:11 +00:00
Andrey Kiselev ae30a58aa8 *** empty log message *** 2004-04-25 07:28:18 +00:00
Andrey Kiselev 6506ad3505 *** empty log message *** 2004-04-20 19:00:26 +00:00
Andrey Kiselev c5dcf82ea7 *** empty log message *** 2004-04-20 18:44:15 +00:00
Andrey Kiselev 0d8a8715cf *** empty log message *** 2004-04-20 18:38:55 +00:00
Andrey Kiselev 559e0832af *** empty log message *** 2004-04-20 18:24:02 +00:00
Andrey Kiselev e816f27a0a *** empty log message *** 2004-04-20 18:17:41 +00:00
Andrey Kiselev 4434a54ae6 New. 2004-04-20 18:17:17 +00:00
Andrey Kiselev 6302224e7f Fixed problem with unaligned access as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=555
2004-04-20 14:54:05 +00:00
Andrey Kiselev 1b6ce30452 *** empty log message *** 2004-04-20 14:52:12 +00:00
Andrey Kiselev 0545efcb1d Obsoleted configuration switches removed. 2004-04-20 14:24:31 +00:00
Andrey Kiselev 68acdfcb37 *** empty log message *** 2004-04-20 14:21:06 +00:00
Andrey Kiselev 95edc39bc1 *** empty log message *** 2004-04-20 11:04:14 +00:00
Andrey Kiselev ec09cbbadc *** empty log message *** 2004-04-20 11:04:14 +00:00
Andrey Kiselev effa526b11 *** empty log message *** 2004-04-20 10:31:05 +00:00
Andrey Kiselev 93a804062e *** empty log message *** 2004-04-19 08:09:21 +00:00
Andrey Kiselev c7c6dee549 *** empty log message *** 2004-04-16 08:12:54 +00:00
Andrey Kiselev d030528d09 *** empty log message *** 2004-04-15 19:40:07 +00:00
Andrey Kiselev 50545efe9d *** empty log message *** 2004-04-15 19:23:29 +00:00
Andrey Kiselev 8d2cb0f304 MSVC updates. 2004-04-15 10:44:32 +00:00
Andrey Kiselev 1482f0bf43 MSVC updates. 2004-04-15 10:26:06 +00:00
Andrey Kiselev 2b90981925 *** empty log message *** 2004-04-15 09:48:25 +00:00
Andrey Kiselev 90d7d78882 *** empty log message *** 2004-04-14 06:35:22 +00:00
Andrey Kiselev 1c37d7bf24 Allow in-place updating of the compressed images (don't work properly with
all codecs). For details see GDAL bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=534
2004-04-14 06:34:40 +00:00
Andrey Kiselev 973a9b78d6 *** empty log message *** 2004-04-08 14:29:48 +00:00
Frank Warmerdam 7ce8058576 added links to Joris' new archive 2004-04-07 00:07:50 +00:00
Andrey Kiselev 614fefd6c6 *** empty log message *** 2004-04-06 15:05:52 +00:00
Andrey Kiselev ba8056b704 *** empty log message *** 2004-04-06 08:50:39 +00:00
Andrey Kiselev 1f663d3a9b Workaround for wrong sampling factors used in the Intergarph JPEG
compressed TIFF images as per bug:
http://bugzilla.remotesensing.org/show_bug.cgi?id=532
2004-04-06 08:42:30 +00:00
Andrey Kiselev 1cba436f59 *** empty log message *** 2004-04-06 07:39:24 +00:00
Frank Warmerdam 4a39fd0124 *** empty log message *** 2004-04-04 17:47:15 +00:00
Frank Warmerdam 75c0c4100f deallocate client data if TIFFClientOpen() fails via bad2 2004-04-04 17:46:36 +00:00
Andrey Kiselev 02104003b9 *** empty log message *** 2004-04-02 04:52:53 +00:00
Andrey Kiselev ab8a4e1ea5 *** empty log message *** 2004-03-30 15:41:51 +00:00
Andrey Kiselev 060c3d6933 New. 2004-03-30 14:30:03 +00:00
Andrey Kiselev 2037650f15 *** empty log message *** 2004-03-30 14:28:17 +00:00
Andrey Kiselev ce3bd3e730 *** empty log message *** 2004-03-30 10:12:35 +00:00
Andrey Kiselev 81084a111a New. 2004-03-30 10:11:46 +00:00
Andrey Kiselev fcee268927 *** empty log message *** 2004-03-29 11:28:16 +00:00
Andrey Kiselev f4c312322b New. 2004-03-29 11:26:49 +00:00
Andrey Kiselev 334a4c6f39 New. 2004-03-28 12:23:46 +00:00
Andrey Kiselev c897292b63 New. 2004-03-28 12:15:18 +00:00
Andrey Kiselev 61262c1130 New. 2004-03-28 12:08:27 +00:00
Andrey Kiselev f5e80e396b *** empty log message *** 2004-03-28 12:01:22 +00:00
Andrey Kiselev ae774219f8 *** empty log message *** 2004-03-28 11:25:13 +00:00
Andrey Kiselev 0f93533189 *** empty log message *** 2004-03-28 11:18:36 +00:00
Andrey Kiselev cf2ac8deb6 *** empty log message *** 2004-03-26 15:53:42 +00:00
Andrey Kiselev 1371eb08d4 Properly set Photometric Interpretation in case of JPEG compression of
grayscale images.
2004-03-26 15:52:47 +00:00
Andrey Kiselev 82766ccd31 *** empty log message *** 2004-03-26 14:57:52 +00:00
Andrey Kiselev 58e17bf4a7 New. 2004-03-26 14:57:19 +00:00
Andrey Kiselev b6fd3dadab Added ZLIB support. 2004-03-26 14:55:31 +00:00
Andrey Kiselev c2b433791e *** empty log message *** 2004-03-26 11:44:45 +00:00
Andrey Kiselev c6cfb9d49b Don't emit warnings when Orientation tag does not present in the input image. 2004-03-26 11:39:31 +00:00
Andrey Kiselev d2141ca794 *** empty log message *** 2004-03-19 17:36:53 +00:00
Andrey Kiselev df073acdc5 New. 2004-03-19 17:36:17 +00:00
Andrey Kiselev 52f2790122 New. 2004-03-19 17:26:21 +00:00
Andrey Kiselev 1f9504178e *** empty log message *** 2004-03-19 17:23:13 +00:00
Frank Warmerdam 4b0496229e added Joris' archive link 2004-03-11 00:59:12 +00:00
Andrey Kiselev 8a848fc7a5 *** empty log message *** 2004-03-03 20:58:54 +00:00
Andrey Kiselev 095c6ec7a8 Use dummy mmap/munmap functions in TIFFClientOpen() when the appropriate
client functions was not supplied by user.
2004-03-03 20:58:32 +00:00
Frank Warmerdam f5b2263340 Fixed main declaration as per
http://bugzilla.remotesensing.org/show_bug.cgi?id=513
2004-03-02 14:59:23 +00:00
Frank Warmerdam cc0333b264 *** empty log message *** 2004-03-02 14:59:05 +00:00
Andrey Kiselev 125fa1006c *** empty log message *** 2004-02-26 10:15:32 +00:00
Andrey Kiselev 7a8485f2f5 Copy JPEGTables tag contents for JPEG compressed images. Reported by Artem
Mirolubov.
2004-02-26 10:14:19 +00:00
Andrey Kiselev 8a8b5032f0 Fixed problem with handling TIFF_UNDEFINED tag type in TIFFFetchNormalTag() as
per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=508
2004-02-26 10:12:19 +00:00
Frank Warmerdam b61df61752 Changed from <LISTING> to <PRE> as per request from Rich Pasco. 2004-02-19 07:47:59 +00:00
Frank Warmerdam d4572393da *** empty log message *** 2004-02-17 15:51:18 +00:00
Frank Warmerdam 77088971e5 fixed typo in TIFFInitPackBits name: bug 494 2004-02-17 15:50:28 +00:00
Andrey Kiselev 8a0e796bf4 *** empty log message *** 2004-02-05 15:40:31 +00:00
Andrey Kiselev 8eb41bce69 *** empty log message *** 2004-02-05 09:54:11 +00:00
Andrey Kiselev 5d03fd4ddb Fixed problem with CCITT encoding modes as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=483
But we need more work on fax codec to support update mode.
2004-02-05 09:53:39 +00:00
Frank Warmerdam ba5a005d79 *** empty log message *** 2004-01-30 20:51:30 +00:00
Frank Warmerdam ebce39af94 Added TIFFCurrentDirOffset, TIFFWriteCheck, TIFFRGBAImageOK,
TIFFNumberOfDirectories.
2004-01-30 20:50:29 +00:00
Andrey Kiselev e071c35ea7 Move TIFFCleanup() back to the tiffio.h. 2004-01-30 20:22:18 +00:00
Andrey Kiselev 792ee438d9 *** empty log message *** 2004-01-29 19:55:36 +00:00
Andrey Kiselev 6cc8d61e88 Fixed tag definitions for TIFFTAG_YCLIPPATHUNITS and TIFFTAG_INDEXED
as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=475
2004-01-29 19:54:51 +00:00
Andrey Kiselev c490e6a948 Check results, returned by the TIFFFdOpen() before returning and close
file if TIFFFdOpen() failed as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=468
2004-01-29 19:54:14 +00:00
Andrey Kiselev 9bac33086f *** empty log message *** 2004-01-29 15:40:18 +00:00
Andrey Kiselev 4fa206eca8 Check if the pointer is NULL befor proceed further as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=474
2004-01-29 15:39:52 +00:00
Andrey Kiselev 5c24d6ef92 *** empty log message *** 2004-01-29 15:34:21 +00:00
Andrey Kiselev 4f0e1dea83 More fixes for http://bugzilla.remotesensing.org/show_bug.cgi?id=468 2004-01-29 15:34:01 +00:00
Andrey Kiselev 088a2282d7 One more fix for boolean type definition. 2004-01-29 08:51:56 +00:00
Andrey Kiselev ec58068a3b TIFFCleanup() renamed to _TIFFCleanup(). declaration moved to tiffiop.h. 2004-01-29 08:47:36 +00:00
Andrey Kiselev 8df43a8f55 *** empty log message *** 2004-01-28 17:58:39 +00:00
Andrey Kiselev 45a3f9e551 Separate TIFFCleanup() from the TIFFClose() in order to fix the bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=468
2004-01-28 17:57:09 +00:00
Andrey Kiselev d75f9c355a *** empty log message *** 2004-01-28 12:17:23 +00:00
Andrey Kiselev 3a8ae673b7 Fixed problem with wrong interpretation of the InkNames tag as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=466
Memory leak fixed.
2004-01-28 12:12:01 +00:00
Andrey Kiselev 58117ffafa Get rid of C++ style comments. 2004-01-26 17:00:55 +00:00
Andrey Kiselev 3ecb080d25 Fixed problem with the boolean type definition (finally?).
See http://bugzilla.remotesensing.org/show_bug.cgi?id=188
2004-01-21 16:34:59 +00:00
Frank Warmerdam 53fc4bcc2f *** empty log message *** 2004-01-21 14:27:07 +00:00
Frank Warmerdam f61cf2733d handle field_passcount ASCII fields properly when writing 2004-01-21 14:20:53 +00:00
Andrey Kiselev 326822c435 *** empty log message *** 2004-01-20 19:43:45 +00:00
Andrey Kiselev 6ba0f602c1 Fixed reporting size of the buffer in case of stripped image in
TIFFWriteBufferSetup(). As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=460
2004-01-20 19:28:05 +00:00
Andrey Kiselev 8131e4ba37 *** empty log message *** 2004-01-11 15:34:58 +00:00
Andrey Kiselev ae40368d45 Check field_passcount value before setting the value of undefined type,
patch from Gerben Koopmans.
2004-01-11 15:30:19 +00:00
Andrey Kiselev eb23336413 Incomplete cleanup in TIFFFreeDirectory(), patch from Gerben Koopmans. 2004-01-11 15:14:02 +00:00
Andrey Kiselev 84badb3da7 *** empty log message *** 2004-01-11 15:03:20 +00:00
Frank Warmerdam 7ae4a8f8c5 added TIFFMergeFieldInfo 2004-01-08 19:29:45 +00:00
Andrey Kiselev 5f8fb0afaf Few fixes. 2004-01-07 20:12:24 +00:00
Andrey Kiselev 8a0b705c0a *** empty log message *** 2004-01-02 10:06:05 +00:00
Andrey Kiselev 17ea33280e Fixed problem with wrong Photometric setting for non-RGB images. 2004-01-02 10:02:14 +00:00
Andrey Kiselev c8907ca954 *** empty log message *** 2003-12-31 11:34:11 +00:00
Andrey Kiselev 0c88f2cc85 *** empty log message *** 2003-12-31 09:50:28 +00:00
Andrey Kiselev 85521acc1a Fixed problem with _TIFFrealloc() when the NULL pointer passed. Patch
supplied by Larry Grill.
2003-12-31 09:49:47 +00:00
Andrey Kiselev 835b0870c7 *** empty log message *** 2003-12-31 09:15:44 +00:00
Andrey Kiselev d7d1289a13 Fixes for AMD 64 platform as suggested by Jeremy C. Reed. 2003-12-31 09:14:12 +00:00
Andrey Kiselev 211975fcd9 Few fixes. 2003-12-31 09:12:30 +00:00
Andrey Kiselev 41281054e0 *** empty log message *** 2003-12-26 11:52:58 +00:00
Andrey Kiselev 1ab55dff46 libtiff 3.6.1 released. 2003-12-26 11:52:07 +00:00
Andrey Kiselev 5300539ac6 Few cleanups. 2003-12-26 10:19:41 +00:00
Andrey Kiselev 1a50c01fdb *** empty log message *** 2003-12-24 22:14:15 +00:00
Andrey Kiselev 62b5015372 TIFFrint moved to the tif_color.c 2003-12-24 22:07:23 +00:00
Andrey Kiselev 63c0c49fa5 TIFFrint moved to the tif_color.c. 2003-12-24 22:02:04 +00:00
Andrey Kiselev d8df102eaf *** empty log message *** 2003-12-24 09:21:06 +00:00
Andrey Kiselev 10a6e0f1c8 Updated from the recent upstream. 2003-12-24 09:20:47 +00:00
Andrey Kiselev 4b62921a8d Avoid warnings. 2003-12-24 08:35:47 +00:00
Andrey Kiselev 8e18d56d89 Updated to pics-3.6.1. 2003-12-23 15:01:58 +00:00
Andrey Kiselev bbee0b216a Added Ross Finlayson to the list of contributors. 2003-12-23 10:28:17 +00:00
Andrey Kiselev febb1364af New. 2003-12-23 10:27:53 +00:00
Andrey Kiselev f905c89e6f *** empty log message *** 2003-12-23 10:27:29 +00:00
Andrey Kiselev 5ecb9adefd Added TIFF_IFD data type. 2003-12-23 09:15:22 +00:00
Andrey Kiselev a146f53ed0 *** empty log message *** 2003-12-22 21:06:23 +00:00
Andrey Kiselev bc30a34e96 Warnings removed. 2003-12-22 21:06:04 +00:00
Andrey Kiselev 388ee2af07 More cleanups in color conversion interface. 2003-12-21 22:13:14 +00:00
Andrey Kiselev 11f7b31e98 Added manual page for colour conversion stuff. 2003-12-21 22:04:53 +00:00
Andrey Kiselev 1420736d1b *** empty log message *** 2003-12-21 21:54:47 +00:00
Andrey Kiselev b707d28693 *** empty log message *** 2003-12-21 21:47:11 +00:00
Andrey Kiselev 94007bce01 Warnings removed. 2003-12-20 13:47:28 +00:00
Andrey Kiselev bf02156034 *** empty log message *** 2003-12-20 13:46:57 +00:00
Andrey Kiselev f46c2378be More warnings removed. 2003-12-20 13:40:09 +00:00
Andrey Kiselev 960280856f *** empty log message *** 2003-12-19 18:34:02 +00:00
Andrey Kiselev e39da25e00 Warnings fixed as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=357
2003-12-19 18:29:49 +00:00
Andrey Kiselev dd9a7f6407 *** empty log message *** 2003-12-19 15:31:08 +00:00
Andrey Kiselev 578b287f87 Added support for alfa channel. Fixes
http://bugzilla.remotesensing.org/show_bug.cgi?id=428
2003-12-19 15:30:27 +00:00
Andrey Kiselev bd57e28a64 *** empty log message *** 2003-12-19 12:15:14 +00:00
Andrey Kiselev 0722be601f Interface for Lab->RGB color conversion is finally cleaned up. Added support
for ReferenceBlackWhite tag handling when converted from YCbCr color space.
The latter closes http://bugzilla.remotesensing.org/show_bug.cgi?id=120
2003-12-19 12:14:02 +00:00
Andrey Kiselev 885718995b Support for IJG JPEG library. 2003-12-07 13:20:41 +00:00
Andrey Kiselev c01ea11a99 *** empty log message *** 2003-12-07 13:12:03 +00:00
Andrey Kiselev 12adac7bf0 Support for IJG JPEG library. 2003-12-07 13:07:24 +00:00
Andrey Kiselev 6c867019ac Avoid warnings. 2003-12-07 13:02:13 +00:00
Andrey Kiselev 2fa548cd92 *** empty log message *** 2003-12-06 15:59:45 +00:00
Andrey Kiselev 11cb75681b Read WhitePoint tag from the file and properly use it for CIE Lab->RGB
transform.
2003-12-06 15:55:41 +00:00
Ross Finlayson 10e9be26d1 Fixed a bug, mea culpa. 2003-12-05 14:10:58 +00:00
Andrey Kiselev 3e9be7b07d *** empty log message *** 2003-12-04 10:40:27 +00:00
Andrey Kiselev 1e2bc737c6 YCbCr->RGB conversion routines now in the tif_color.c module. New function
TIFFYCbCrtoRGB() available in TIFF API.
2003-12-04 10:31:54 +00:00
Andrey Kiselev a5407eb75f Handle TIFF_IFD tag type correctly. 2003-12-04 10:26:15 +00:00
Andrey Kiselev 25ad11c155 Comma at the end of enumeration list removed. 2003-12-04 07:52:07 +00:00
Andrey Kiselev f356c7ce5d *** empty log message *** 2003-12-03 20:01:45 +00:00
Andrey Kiselev 6d52b5d379 Improvements in CIE Lab conversion code. Start moving YCbCr stuff to the
tif_color.c module.
2003-12-03 19:54:03 +00:00
Andrey Kiselev 77010a7c62 *** empty log message *** 2003-12-03 15:40:52 +00:00
Andrey Kiselev 06b1fd6374 Finally resolved problems with orientation handling. TIFFRGBAImage interface
now properly supports all possible orientations, i.e. images will be flipped
both in horizontal and vertical directions if required. 'Know bugs' section
now removed from the appropriate manual pages. Closed bug entry:
http://bugzilla.remotesensing.org/show_bug.cgi?id=322
2003-12-03 15:39:34 +00:00
Andrey Kiselev 44e2c5cf56 *** empty log message *** 2003-12-02 16:40:35 +00:00
Andrey Kiselev 87dcfa7f90 Fixed order of the parameters in TIFFError() function calls as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=440
2003-12-02 16:40:01 +00:00
Ross Finlayson 80a9dce49d Some bugs fixed. 2003-12-01 10:51:39 +00:00
Ross Finlayson 0e05ec46c4 *** empty log message *** 2003-11-29 15:34:11 +00:00
Ross Finlayson a680b7ca3e Some bugs fixed. 2003-11-29 15:32:40 +00:00
Andrey Kiselev ef971e32c1 Few cleanups and small improvements. 2003-11-28 15:10:05 +00:00
Andrey Kiselev 3767aaa2aa Fixed bug in 48-bit to 24-bit conversion routine, reported by Antonio Scuri. 2003-11-27 15:08:30 +00:00
Andrey Kiselev a2b3903296 Added support fpr tiff2pdf manual page. 2003-11-27 15:07:47 +00:00
Andrey Kiselev c8a5785b28 Few improvements in page layout. 2003-11-27 15:07:29 +00:00
Andrey Kiselev 1255f5abd3 *** empty log message *** 2003-11-27 15:07:01 +00:00
Andrey Kiselev dbdbe4c040 New. 2003-11-27 15:06:31 +00:00
Ross Finlayson 1842e23082 *** empty log message *** 2003-11-26 15:12:14 +00:00
Ross Finlayson 86dfeb6a28 Initial checkin. 2003-11-26 15:04:51 +00:00
Andrey Kiselev d22ad33202 *** empty log message *** 2003-11-26 09:50:58 +00:00
Andrey Kiselev 0f7778e39a Added tiff2pdf.exe. 2003-11-26 09:50:27 +00:00
Ross Finlayson 7975b0e5f9 Modified for CVS 2003-11-26 09:05:41 +00:00
Andrey Kiselev 23697416d3 Added support fpr tiff2pdf utility. 2003-11-26 07:41:22 +00:00
Andrey Kiselev aa049c9bcb *** empty log message *** 2003-11-26 07:40:52 +00:00
Ross Finlayson 19ecdde243 *** empty log message *** 2003-11-25 16:50:22 +00:00
Ross Finlayson 1f0f3aaf86 tiff2pdf - converts a TIFF image to a PDF document
Written by Ross Finlayson
2003-11-25 16:39:22 +00:00
Andrey Kiselev d937636773 *** empty log message *** 2003-11-22 08:49:18 +00:00
Andrey Kiselev 0fc6802536 sqrtf() replaced with sqrt(). 2003-11-22 08:42:06 +00:00
Andrey Kiselev 5279c8f2d1 *** empty log message *** 2003-11-21 21:29:25 +00:00
Andrey Kiselev 318222a1fd Removed #include <getopt.h>. 2003-11-21 21:15:05 +00:00
Ross Finlayson fb8eebb9da *** empty log message *** 2003-11-21 20:40:50 +00:00
Andrey Kiselev aeae0fe964 Unmaintained and platform dependent sgigt utility removed and replaced with
the completely rewritten portable tiffgt tool (depend on OpenGL and GLUT).
Initial revision, there is a lot of things to improve.
2003-11-21 13:28:18 +00:00
Andrey Kiselev 7eaf2d4af6 *** empty log message *** 2003-11-21 08:15:19 +00:00
Andrey Kiselev f3d1b1b4fa TIFFVGetField() function now can properly extract the fields from the OJPEG
files. Patch supplied by Ross Finlayson.
2003-11-21 08:11:38 +00:00
Andrey Kiselev 11d2461ab6 *** empty log message *** 2003-11-20 21:59:22 +00:00
Andrey Kiselev b1721a18ee Added new function TIFFIsCODECConfigured(), suggested by Ross Finlayson. 2003-11-20 21:53:40 +00:00
Andrey Kiselev e60dd3278f *** empty log message *** 2003-11-18 17:54:27 +00:00
Andrey Kiselev 5d45eab503 Implemented binary search in _TIFFMergeFieldInfo(). Patch supplied by Ross
Finlayson.
2003-11-18 17:54:09 +00:00
Andrey Kiselev 09237bb4f6 *** empty log message *** 2003-11-18 15:46:00 +00:00
Andrey Kiselev d1a31f6975 _TIFFFindOrRegisterdInfo declaration replaced with
_TIFFFindOrRegisterFieldInfo as reported by  Ross Finlayson.
2003-11-18 15:45:43 +00:00
Frank Warmerdam c26acbc771 *** empty log message *** 2003-11-17 16:41:14 +00:00
Frank Warmerdam 7a4c1ed54c do not force all custom anon-defined tags to be ignored 2003-11-17 16:40:28 +00:00
Andrey Kiselev 42fc10fb36 *** empty log message *** 2003-11-17 15:10:14 +00:00
Andrey Kiselev c9e425386e Use TIFFDataWidth() function insted of tiffDataWidth array. 2003-11-17 15:09:39 +00:00
Andrey Kiselev 86ab7434ae *** empty log message *** 2003-11-16 19:35:56 +00:00
Andrey Kiselev c97721ddd1 Added support for IFD (13) datatype, intruduced in "Adobe PageMaker TIFF
Tech. Notes".
2003-11-16 19:26:29 +00:00
Frank Warmerdam b2106d858d *** empty log message *** 2003-11-15 19:52:08 +00:00
Frank Warmerdam 346574371f Added missing backslash for tif_color. 2003-11-15 19:51:21 +00:00
Andrey Kiselev 519bca198f *** empty log message *** 2003-11-13 19:52:55 +00:00
Andrey Kiselev 474ab9ca0d New color space conversion code: CIE L*a*b* 1976 images now supported by the
TIFFRGBAImage interface. All introduced routines go to new module tif_color.c.
Eventually all color conversion functions should be moved there.
2003-11-13 19:46:39 +00:00
Andrey Kiselev 6b087cb603 *** empty log message *** 2003-11-12 19:14:33 +00:00
Andrey Kiselev ca2508d90c *** empty log message *** 2003-11-12 15:07:41 +00:00
Andrey Kiselev 397eac63be Properly determine SUN Rasterfiles with the reverse byte order (it is reported
by the magic header field). Problem reported by Andreas Wiesmann.
2003-11-12 15:07:21 +00:00
Andrey Kiselev 733ce3c8da *** empty log message *** 2003-11-12 09:20:33 +00:00
Andrey Kiselev 3230d7b837 Guessing mechanics now documented in manual page. 2003-11-12 09:20:10 +00:00
Andrey Kiselev 07c59b0650 Few improvements in correlation calculation function. 2003-11-12 09:19:53 +00:00
Andrey Kiselev 76e7ddcaa0 *** empty log message *** 2003-11-11 15:41:58 +00:00
Andrey Kiselev 1c1f312e01 Implemented image size guessing using correlation coefficient calculation
between two neighbour lines.
2003-11-11 15:39:33 +00:00
Frank Warmerdam e595ad3ab4 TIFFComputeTile 2003-11-09 22:10:57 +00:00
Frank Warmerdam 1e833d7a5f Removed spurious use of "s" in non-PLANARCONFIG_SEPERATE case.
As per bug report 387.
2003-11-09 22:04:58 +00:00
Andrey Kiselev b0098405b3 *** empty log message *** 2003-11-09 10:19:24 +00:00
Andrey Kiselev 8d7c269d96 New macros: TIFFmax, TIFFmin and TIFFrint. 2003-11-09 10:19:06 +00:00
Andrey Kiselev 81808406eb *** empty log message *** 2003-11-07 11:27:02 +00:00
Andrey Kiselev 86139e39ca Added TIFFRawStripSize() function as suggested by Chris Hanson. 2003-11-07 11:25:32 +00:00
Andrey Kiselev 41467ca1dc *** empty log message *** 2003-11-03 14:46:36 +00:00
Andrey Kiselev 66d8de7e4a Proper support for update mode as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=424
2003-11-03 14:45:38 +00:00
Andrey Kiselev 38a711333e *** empty log message *** 2003-10-29 10:13:13 +00:00
Andrey Kiselev 5c84ff97aa Added TIFFReadRGBAImageOriented. 2003-10-29 10:12:54 +00:00
Andrey Kiselev 953d9e12c0 Added note about GNU make requirement. 2003-10-29 10:12:32 +00:00
Andrey Kiselev 693c5bc1e8 *** empty log message *** 2003-10-25 17:50:18 +00:00
Andrey Kiselev de4455380b Option -p added to the mkdir command to create all directory tree structure
before installing.
2003-10-25 17:48:09 +00:00
Andrey Kiselev 7a9a35df5b Fixes in using MAKEFLAGS as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=418
2003-10-25 17:46:14 +00:00
Andrey Kiselev 5ec2639f33 Typo fixed. 2003-10-18 15:42:50 +00:00
Andrey Kiselev 5ac3cddb84 *** empty log message *** 2003-10-17 21:31:08 +00:00
Andrey Kiselev 21bbbcaa45 #include <strings.h> replaced with #include <string.h> 2003-10-17 21:25:51 +00:00
Andrey Kiselev 9cad63273e *** empty log message *** 2003-10-16 05:59:49 +00:00
Andrey Kiselev 9c4595ec81 Add an absolute path to the test_pics.sh call. 2003-10-16 05:58:19 +00:00
Andrey Kiselev fda733f80c *** empty log message *** 2003-10-12 08:46:32 +00:00
Andrey Kiselev 3503172542 #define _BSDTYPES_DEFINED when defining BSD typedefs. 2003-10-12 08:46:11 +00:00
Andrey Kiselev a24c2d6e45 *** empty log message *** 2003-10-09 08:41:00 +00:00
Andrey Kiselev d234e74582 Alpha file support removed. 2003-10-09 08:38:18 +00:00
Andrey Kiselev 9a46168ff1 Relative buildings fixed. 2003-10-09 08:33:47 +00:00
Frank Warmerdam 34a99f1615 upgrade primary and secondary sites 2003-10-07 13:34:44 +00:00
Andrey Kiselev 070e4c5ff2 Added missed v3.6.0.html. 2003-10-07 08:14:33 +00:00
Andrey Kiselev a74b3d0001 *** empty log message *** 2003-10-07 08:09:23 +00:00
Andrey Kiselev 8847cbe9f0 *** empty log message *** 2003-10-07 06:20:53 +00:00
Andrey Kiselev f18d37b7bb Typo fixed: ORIENTATION_BOTTOMLEFT replaced with ORIENTATION_BOTLEFT. 2003-10-07 06:19:21 +00:00
Andrey Kiselev c0cb42c2b0 *** empty log message *** 2003-10-04 11:38:17 +00:00
Andrey Kiselev c88d1222b1 *** empty log message *** 2003-10-03 13:10:04 +00:00
Andrey Kiselev 045fa685f1 Fixed possible endless loop as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=404
2003-10-03 13:09:38 +00:00
Andrey Kiselev 823a7791b3 *** empty log message *** 2003-10-03 11:23:30 +00:00
Andrey Kiselev 798d99bdbd Switched to use TIFFReadRGBAImageOriented() instead of TIFFReadRGBAImage(). 2003-10-03 11:22:29 +00:00
Andrey Kiselev 3fb0f108c1 New function TIFFReadRGBAImageOriented() implemented to retrieve raster array
with user-specified origin position as suggested by Jason Frank. See
http://bugzilla.remotesensing.org/show_bug.cgi?id=322 for details.
2003-10-03 11:21:23 +00:00
Andrey Kiselev 8e4ce46919 TIFFReadRGBAImageOriented() added. 2003-10-03 11:18:17 +00:00
Andrey Kiselev 569d2ea4b8 *** empty log message *** 2003-09-30 09:39:29 +00:00
Andrey Kiselev 677626c90e Check field counter against number of field in order to fix
http://bugzilla.remotesensing.org/show_bug.cgi?id=366
2003-09-30 09:38:55 +00:00
Andrey Kiselev 5bc9b3883e *** empty log message *** 2003-09-30 05:26:04 +00:00
Andrey Kiselev 34e1b3e48e Fix wrong line numbering as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=342
2003-09-30 05:20:16 +00:00
Andrey Kiselev a9755b0a0c *** empty log message *** 2003-09-25 08:37:06 +00:00
Andrey Kiselev 136507d95a Store a list of opened IFD to prevent looping as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=383
2003-09-25 08:36:21 +00:00
Andrey Kiselev bb7ac0701f *** empty log message *** 2003-09-25 08:05:34 +00:00
Andrey Kiselev e8e4fc8dd2 Store a list of opened IFD to prevent looping as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=383
2003-09-25 08:02:46 +00:00
Andrey Kiselev 4468100667 *** empty log message *** 2003-09-23 06:24:20 +00:00
Andrey Kiselev 879817ce45 More fixes for EstimateStripByteCounts(). See
http://bugzilla.remotesensing.org/show_bug.cgi?id=358
2003-09-23 06:23:39 +00:00
Frank Warmerdam 04dfed2c97 updated main page mailing list info 2003-09-17 13:06:21 +00:00
Frank Warmerdam e3ada41e8b Added -m (maxitems) flag to usage message. 2003-09-02 13:28:09 +00:00
Andrey Kiselev 428ba17b68 *** empty log message *** 2003-08-21 10:01:48 +00:00
Andrey Kiselev 6270b7262c int declaration replaced with the uint32 to support large images as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=382
2003-08-21 10:00:06 +00:00
Andrey Kiselev ae2039a6f9 *** empty log message *** 2003-08-12 09:49:07 +00:00
Andrey Kiselev 2f37a47f97 Fixed problem with building in different directory. 2003-08-12 09:48:12 +00:00
Andrey Kiselev 7b4cc29241 *** empty log message *** 2003-08-12 07:51:42 +00:00
Andrey Kiselev c6b36db6ee Added missing #include <strings.h>. 2003-08-12 07:51:03 +00:00
Andrey Kiselev 9d53f760ba More fixes for custom tags code from Ashley Dreier. 2003-08-12 07:50:37 +00:00
Andrey Kiselev 9533dc6419 *** empty log message *** 2003-08-08 19:46:55 +00:00
Andrey Kiselev 1cbcc49d2f Fixed PS comment emitted when FlateDecode is being used. Reported by Tom
Kacvinsky.
2003-08-08 19:46:20 +00:00
Andrey Kiselev e8e205be49 Fixed problem with float tags reading; support for printing RATIONAL and BYTE
tags added.
2003-08-07 16:42:55 +00:00
Andrey Kiselev 3f7ebdb05c Fixed problem with custom tags writing, reported by Ashley Dreier. 2003-08-07 16:39:06 +00:00
Andrey Kiselev 1c8f21e0b5 *** empty log message *** 2003-08-07 16:34:56 +00:00
Andrey Kiselev f8db45dca2 *** empty log message *** 2003-08-05 08:44:17 +00:00
Andrey Kiselev 015b5e862a Move LZW codec state block allocation back to TIFFInitLZW(), because its
initialization in LZWSetupDecode() cause problems with predictor
initialization. Remove O_RDONLY check during state block allocation to be able
open LZW compressed files in update mode.

Problem exist for libtiff version of the tif_lzw.c module. One from
lzw-compression-kit hasn't such troubles.
2003-08-05 08:37:41 +00:00
Frank Warmerdam 1e5a0127b9 ensure byte swapping is applied on write if needed - bug 171 2003-08-05 02:45:58 +00:00
Frank Warmerdam 19a03d4d01 patches from J.A.Strother 2003-07-26 03:55:17 +00:00
Frank Warmerdam 427105d24e avoid casting warning initializing typemask 2003-07-26 03:54:29 +00:00
Frank Warmerdam b1de4a6036 dos2unix conversion 2003-07-26 03:50:53 +00:00
Frank Warmerdam 8c657db1a6 Avoid warning casting signed value to unsigned variable.
Patch supplied by J.A. Strother.
2003-07-26 03:50:08 +00:00
Frank Warmerdam 03f0fc1b10 applied patch for to support more pages in tiffsplit 2003-07-26 03:46:08 +00:00
Frank Warmerdam 6cd6feea68 updated to explicit credit Sam with authoring the software 2003-07-25 15:13:19 +00:00
Frank Warmerdam 28da511d9e updated mailing list info 2003-07-25 15:06:44 +00:00
Andrey Kiselev 185af06f5c *** empty log message *** 2003-07-10 20:31:00 +00:00
Andrey Kiselev 19bfe77143 Added option `-p' to explicitly select color space of input image data. Closes
http://bugzilla.remotesensing.org/show_bug.cgi?id=364
2003-07-10 20:04:42 +00:00
Frank Warmerdam 7877dc7d3e avoid warning 2003-07-08 20:37:31 +00:00
Frank Warmerdam f4ce7acee1 avoid warnings 2003-07-08 20:32:54 +00:00
Frank Warmerdam 274bcd4b27 *** empty log message *** 2003-07-08 16:41:46 +00:00
Frank Warmerdam ab5312a585 avoid casting warnings at /W4 2003-07-08 16:40:46 +00:00
Frank Warmerdam 97b4f61ad6 avoid type casting warning 2003-07-08 15:51:57 +00:00
Andrey Kiselev 704176109d *** empty log message *** 2003-07-03 12:27:42 +00:00
Andrey Kiselev 97ed644e72 Memory leak fixed as reported by Robert S. Kissel. 2003-07-03 12:27:17 +00:00
Andrey Kiselev 8579f1be91 *** empty log message *** 2003-06-30 18:28:03 +00:00
Andrey Kiselev ab8b5a13e3 Further fixes for bug http://bugzilla.remotesensing.org/show_bug.cgi?id=358 2003-06-30 18:25:50 +00:00
Andrey Kiselev a05e169f19 Few compilation warnings fixed. 2003-06-30 18:23:13 +00:00
Andrey Kiselev adacb00179 TIFFDataWidth() returns 0 in case of unknown data type. 2003-06-30 18:22:28 +00:00
Andrey Kiselev 5d76acb2ec *** empty log message *** 2003-06-30 14:43:04 +00:00
Andrey Kiselev c060f35bed Fixed compilation on 64-bit architectures as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=357
2003-06-30 14:42:32 +00:00
Andrey Kiselev cb9bace322 *** empty log message *** 2003-06-30 08:25:20 +00:00
Andrey Kiselev 1bd824a289 Fixed problem with EstimateStripByteCounts() as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=358
2003-06-30 08:24:40 +00:00
Andrey Kiselev 45b1fc85cb Unused variables removed. 2003-06-30 08:22:54 +00:00
Andrey Kiselev d295e3e967 *** empty log message *** 2003-06-21 07:49:16 +00:00
Frank Warmerdam 31178b371c *** empty log message *** 2003-06-19 21:38:10 +00:00
Frank Warmerdam 3940fed69f fixed some serious bugs when printing custom fields 2003-06-19 21:37:01 +00:00
Frank Warmerdam 94e5756c47 dont mark undefined tags as IGNORE, not sure why it was done 2003-06-19 21:36:03 +00:00
Andrey Kiselev 4163e2368e *** empty log message *** 2003-06-19 20:08:30 +00:00
Andrey Kiselev 5c7b0ab06e *** empty log message *** 2003-06-18 20:30:33 +00:00
Andrey Kiselev b44be4bd24 *** empty log message *** 2003-06-18 09:58:48 +00:00
Andrey Kiselev adc20ad9b0 Fixed problem with unused data comparing as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=349
`-z' option now can be used to set the number of reported different bytes.
2003-06-18 09:57:55 +00:00
Andrey Kiselev 2f4d3521b4 Added possibility to specify value -1 to -r option to get the entire image
as one strip. See http://bugzilla.remotesensing.org/show_bug.cgi?id=343
for details.
2003-06-10 06:15:36 +00:00
Andrey Kiselev 911529dced *** empty log message *** 2003-06-09 08:27:32 +00:00
Andrey Kiselev 924316f833 *** empty log message *** 2003-06-04 10:37:15 +00:00
Andrey Kiselev b446eb0782 Set the correct RowsPerStrip and PageNumber values as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=343
2003-06-04 10:36:54 +00:00
Frank Warmerdam 9388008875 *** empty log message *** 2003-05-27 16:11:38 +00:00
Frank Warmerdam 35c7e2fcda Fixed computation of segment_height for tiled files ... always a full height
tile regardless of end-of-image issues.  Also change error msg to warning.
2003-05-27 16:10:57 +00:00
Andrey Kiselev 71e4bb174d *** empty log message *** 2003-05-25 06:04:17 +00:00
Andrey Kiselev 320ac7822a Page numbering fixed, as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=341
2003-05-25 05:56:26 +00:00
Andrey Kiselev 06a7a4c828 *** empty log message *** 2003-05-24 06:28:34 +00:00
Andrey Kiselev 147baafe89 Removing previous patch. 2003-05-24 06:25:10 +00:00
Andrey Kiselev ad19ab4f2c *** empty log message *** 2003-05-24 06:19:47 +00:00
Andrey Kiselev f00e62d510 Number pages starting with zero as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=341
2003-05-24 06:16:09 +00:00
Andrey Kiselev 0efbf194c5 raw2tiff sdded. 2003-05-24 06:05:13 +00:00
Andrey Kiselev 6a861d25b0 Switched back to the old behaviour. Likely better solution should be found for
OJPEG support.
2003-05-20 15:42:10 +00:00
Andrey Kiselev 5b80291b58 *** empty log message *** 2003-05-20 15:34:34 +00:00
Andrey Kiselev 811d4433c9 Switched back to the old behaviour. Likely better solution should be found for
OJPEG support.
2003-05-20 15:33:55 +00:00
Andrey Kiselev a77c9ce727 Switched back to the old behaviour. Likely better solution should be found for
OJPEG support.
2003-05-20 15:22:52 +00:00
Andrey Kiselev a1a66ec665 Switched back to the old behaviour. Likely better solution should be found for
OJPEG support.
2003-05-20 15:12:01 +00:00
Andrey Kiselev d45ab962e5 *** empty log message *** 2003-05-11 19:56:23 +00:00
Andrey Kiselev 670113a3f0 Fixed problem with wrong string size when reading RELEASE-DATE file. 2003-05-11 19:55:06 +00:00
Andrey Kiselev 73cbf0b9e7 *** empty log message *** 2003-05-07 08:12:53 +00:00
Andrey Kiselev af72982dab Fixed bug in Ascii85EncodeBlock() function: array index was out of range. 2003-05-07 08:12:30 +00:00
Andrey Kiselev 6e87a9bd11 *** empty log message *** 2003-05-06 18:55:47 +00:00
Andrey Kiselev 46648122c1 Properly handle TIFFTAG_PREDICTOR in TIFFVGetFieldDefaulted() function. 2003-05-06 18:52:49 +00:00
Andrey Kiselev e2afef131a *** empty log message *** 2003-05-06 13:02:06 +00:00
Andrey Kiselev 4e06689428 Improved libtiff compilation with OJPEG support. Now no need for patching
IJG JPEG library, hack requred by libtiff will be compiled and used in-place.
2003-05-06 12:58:19 +00:00
Andrey Kiselev 6dd0fd5c64 Improved libtiff compilation with OJPEG support. Now no need for patching
IJG JPEG library, hack requred by libtiff will be compiled and used in-place.
2003-05-06 12:57:14 +00:00
Andrey Kiselev 8180aa18d2 *** empty log message *** 2003-05-05 19:53:31 +00:00
Andrey Kiselev ca6bfd5717 Workaround for some images without correct info about alpha channel
as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=331
2003-05-05 19:20:11 +00:00
Andrey Kiselev cdfa074838 *** empty log message *** 2003-05-05 19:13:42 +00:00
Andrey Kiselev c34905ee73 Fixed problem with bit fill order tag setting: was not copied from source
image.
2003-05-05 19:06:52 +00:00
Andrey Kiselev 54ed047ec5 Typo fixed. 2003-05-05 10:41:17 +00:00
Andrey Kiselev a77a81b93e *** empty log message *** 2003-05-05 10:40:25 +00:00
Andrey Kiselev ac3f89b460 PPM header parser improved: now able to skip comments. 2003-05-05 10:40:04 +00:00
Andrey Kiselev d7adbd23df Add ability to generate PS Level 3. It basically allows one to use the
/flateDecode filter for ZIP compressed TIFF images. Patch supplied by
 Tom Kacvinsky. Fixes http://bugzilla.remotesensing.org/show_bug.cgi?id=328

Force deadzone printing when EPS output specified as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=325
2003-04-29 09:52:16 +00:00
Andrey Kiselev 0edaea15b0 *** empty log message *** 2003-04-29 09:50:30 +00:00
Andrey Kiselev 3c54d5badd *** empty log message *** 2003-04-29 09:50:09 +00:00
Andrey Kiselev 8415e87d3e Some more fixes to bug entry
http://bugzilla.remotesensing.org/show_bug.cgi?id=275
2003-04-21 19:13:59 +00:00
Andrey Kiselev 58a1408739 *** empty log message *** 2003-04-20 08:47:11 +00:00
Andrey Kiselev 51d06d1600 Removed additional check for StripByteCounts due to problems with
multidirectory images. Quality of error messages improved.
2003-04-17 19:28:00 +00:00
Andrey Kiselev 3ec550270a *** empty log message *** 2003-04-17 19:27:29 +00:00
Andrey Kiselev ceb2af425e Additional check for StripByteCounts correctness. Fixes
http://bugzilla.remotesensing.org/show_bug.cgi?id=320
2003-04-16 19:27:57 +00:00
Andrey Kiselev 55137ca309 *** empty log message *** 2003-04-16 19:26:56 +00:00
Andrey Kiselev ca2f9658a7 *** empty log message *** 2003-04-16 13:25:13 +00:00
Andrey Kiselev cbc8214586 Fixed problem with colorspace conversion for JPEG
encoded images. See bug entries
http://bugzilla.remotesensing.org/show_bug.cgi?id=275 and
http://bugzilla.remotesensing.org/show_bug.cgi?id=23
2003-04-16 13:21:09 +00:00
Andrey Kiselev 7f9ab89fcf *** empty log message *** 2003-03-12 14:10:44 +00:00
Andrey Kiselev c26da71049 Added library version reporting to all tools. 2003-03-12 14:05:05 +00:00
Frank Warmerdam d8cd741e3b *** empty log message *** 2003-03-07 02:38:39 +00:00
Frank Warmerdam 0811ad8923 fiddled with ROOT and DESTDIR to avoid getting paths like ///usr/local.. 2003-03-07 02:37:26 +00:00
Andrey Kiselev 1f20935271 New switch (-X) to set width of raw input page. Patch supplied by
Julien Gaulmin. See http://bugzilla.remotesensing.org/show_bug.cgi?id=293
for details.
2003-02-27 15:04:46 +00:00
Frank Warmerdam 434396645b *** empty log message *** 2003-02-26 20:39:29 +00:00
Frank Warmerdam 2e9e428515 Fixup the postdecode settings responsible for byte swapping
complex image data.
2003-02-26 20:38:49 +00:00
Frank Warmerdam 248cfa159d *** empty log message *** 2003-02-26 19:10:12 +00:00
Frank Warmerdam 2951d4de0f Defer creation of decoder state to LZWSetupDecode(). Don't depend on the
file access mode being O_RDONLY, as decoding is supported in RDWR mode.
2003-02-26 19:09:11 +00:00
Andrey Kiselev c9663e69a0 *** empty log message *** 2003-02-06 22:08:25 +00:00
Andrey Kiselev 210eb932ec Fixed problem with too many arguments. 2003-02-06 22:05:47 +00:00
Andrey Kiselev fe6e11556e Memory leak fixed. 2003-02-04 08:51:38 +00:00
Andrey Kiselev be7810fc2c Applied patch from Julien Gaulmin (thanks, Julien!). More switches for
fax2tiff tool for better control of input and output. Details at
http://bugzilla.remotesensing.org/show_bug.cgi?id=27
2003-02-03 16:54:22 +00:00
Frank Warmerdam a1a3a36d65 *** empty log message *** 2003-02-03 06:36:17 +00:00
Frank Warmerdam 25c5a79b1f create decompressor for in update mode if strips populated already 2003-02-03 06:35:06 +00:00
Frank Warmerdam 32d2ec5313 *** empty log message *** 2003-01-31 16:45:20 +00:00
Frank Warmerdam f6b073be96 Dont allow writing image data to preexisting compressed TIFF images 2003-01-31 16:43:18 +00:00
Frank Warmerdam 42862eeefd allow opening compressed tiff files in update model 2003-01-31 16:42:42 +00:00
Andrey Kiselev 4de68458fc Updated to recent upstream versions. 2003-01-31 08:50:20 +00:00
Frank Warmerdam 036ce91e1b *** empty log message *** 2003-01-15 15:56:15 +00:00
Frank Warmerdam 5fd621fae0 3.6.0 beta release 2003-01-15 15:45:50 +00:00
Frank Warmerdam 38b2a8e3b5 stripped off bare <CR> line 2002-12-21 04:19:33 +00:00
Andrey Kiselev 8ae9d8798a Page size was determined in wrong way as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=239
2002-12-19 23:06:18 +00:00
Frank Warmerdam 2d0233a504 Allow wrong sized arrays in TIFFFetchStripThing() as per bug 42 2002-12-17 17:58:37 +00:00
Frank Warmerdam a8e6ff6a9b Allow wrong sized arrays in TIFFFetchStripThing() as per bug 42 2002-12-17 17:10:07 +00:00
Frank Warmerdam 285c9384da Removed unused variable. 2002-12-05 17:57:26 +00:00
Frank Warmerdam ea674e6bbe malloc/realloc logic fix from Igor Venevtsev for custom values 2002-12-03 04:33:02 +00:00
Frank Warmerdam 267f3f7dea *** empty log message *** 2002-11-30 20:42:41 +00:00
Frank Warmerdam 9ff33eb6b4 fixed bugs with resetting an existing custom tag value in directory 2002-11-30 20:42:14 +00:00
Frank Warmerdam b920c1f99d *** empty log message *** 2002-11-30 20:13:57 +00:00
Frank Warmerdam bb99312836 fixed potential problem with custom ascii tags 2002-11-30 20:12:54 +00:00
Frank Warmerdam 743a29c475 The change below fixes a problem where "tiff2ps -1e" did not make
the scanline buffer long enough when writing rgb triplets.
The scanline needs to be 3 X the number of dots or else it will
contain an incomplete triplet and programs that try to separate
the eps by redefining the colorimage operator will get messed up.

William
http://williambader.com
2002-10-15 02:39:09 +00:00
Frank Warmerdam 699a86251e *** empty log message *** 2002-10-15 02:38:06 +00:00
Frank Warmerdam 834b6324aa *** empty log message *** 2002-10-15 02:31:49 +00:00
Frank Warmerdam 96935f8788 Added tif_extension.c to file list. 2002-10-15 02:30:31 +00:00
Andrey Kiselev 28e76dbf89 Fixed support for large files (>2GB) 2002-10-11 14:42:37 +00:00
Andrey Kiselev ebfc26c99a Fixed support for large files (>2GB). 2002-10-11 14:33:49 +00:00
Andrey Kiselev faa24a5bf6 Fixed support for large files (>2GB) 2002-10-11 14:27:38 +00:00
Andrey Kiselev 50eee27eba Fixed support for large files (>2GB). 2002-10-11 14:13:00 +00:00
Andrey Kiselev 854c71c372 Added links for TIFFGetFieldDefaulted() and TIFFVGetFieldDefaulted(). 2002-10-11 10:04:32 +00:00
Andrey Kiselev b09a3813bd Several corrections. 2002-10-10 14:35:48 +00:00
Andrey Kiselev 5ed96d05fb Fixed help formatting. 2002-10-10 14:19:26 +00:00
Frank Warmerdam cb5509b7ad use alpha, not Alpha 2002-10-10 13:44:05 +00:00
Frank Warmerdam 6cd33fc458 *** empty log message *** 2002-10-10 13:42:23 +00:00
Frank Warmerdam c48cccbd24 added direct rule for tiffvers.h. 2002-10-10 13:40:49 +00:00
Frank Warmerdam 5a00754320 updated version 2002-10-10 13:37:29 +00:00
Frank Warmerdam 1ae517467b Removed FAQ item. 2002-10-10 13:30:48 +00:00
Frank Warmerdam a494a87336 remove cvs snapshot link, added 3.6.0 link and Andreys email address. 2002-10-10 13:30:26 +00:00
Frank Warmerdam 5c56f5e2a9 New 2002-10-10 05:28:53 +00:00
Frank Warmerdam 285956981c added custom tag notes 2002-10-10 05:28:43 +00:00
Frank Warmerdam f22a5b821c Updated who list a bit. 2002-10-10 04:57:14 +00:00
Frank Warmerdam 1993ccffa1 Added Andrey. 2002-10-10 04:14:54 +00:00
Frank Warmerdam 0c5563a9bc expand tabs 2002-10-08 03:07:43 +00:00
Andrey Kiselev 1a1ccdb63a *** empty log message *** 2002-10-07 14:42:04 +00:00
Andrey Kiselev f22c208da9 *** empty log message *** 2002-10-07 13:52:41 +00:00
Andrey Kiselev fd935fb235 Updated from the actual manual pages. 2002-10-07 13:47:36 +00:00
Andrey Kiselev e985fcbddb *** empty log message *** 2002-10-07 13:15:29 +00:00
Andrey Kiselev e84a6b819a *** empty log message *** 2002-10-07 13:01:08 +00:00
Andrey Kiselev bd77199765 tools/tiff2ps.c, man/tiff2ps.1: Applied patch form Sebastian Eken (thanks,
Sebastian!). New switches:
-b # for a bottom margin of # inches
-c   center image
-l # for a left margin of # inches
-r   rotate the image by 180 degrees
New features merged with code for shrinking/overlapping. Previously added -c
and -n switches (for overriding PS units) renamed in -x and -y respectively.

http://bugzilla.remotesensing.org/show_bug.cgi?id=200
2002-10-07 12:49:32 +00:00
Frank Warmerdam a8c488d4a5 proper patch for windows boolean issue: bug 188 2002-10-07 00:17:52 +00:00
Frank Warmerdam 3721a7812b disable visualage/aix change from bugzilla bug 39 2002-10-06 23:34:22 +00:00
Frank Warmerdam a4d8682698 Don't do special AIX type handling unless USING_VISUALAGE is defined.
See bug 39 in bugzilla.
2002-10-06 23:31:21 +00:00
Frank Warmerdam fb334aa347 added COMPRESSION_JP2000 2002-10-04 13:50:25 +00:00
Frank Warmerdam 515b593cc2 *** empty log message *** 2002-10-03 19:02:30 +00:00
Andrey Kiselev 49ce50a83f *** empty log message *** 2002-10-02 15:09:45 +00:00
Andrey Kiselev 6533c96c09 New targets added: html and groffhtml for producing HTML representations
of the manual pages automatically. html target uses man2html tool,
groffhtml uses groff tool.
2002-10-02 15:09:14 +00:00
Andrey Kiselev 939e90cd85 *** empty log message *** 2002-10-02 15:04:03 +00:00
Andrey Kiselev 4c0e27b08d *** empty log message *** 2002-10-02 10:12:49 +00:00
Andrey Kiselev 744bb65d05 Set -DPIXARLOG_SUPPORT option along with -DZIP_SUPPORT 2002-10-02 10:04:29 +00:00
Andrey Kiselev 9e316db6e6 Fixed formatting. 2002-10-02 08:47:29 +00:00
Andrey Kiselev ff993722c9 Another fix for the fetching SBYTE arrays by the TIFFFetchByteArray()
function. Should finally resolve
http://bugzilla.remotesensing.org/show_bug.cgi?id=52
2002-10-02 08:46:54 +00:00
Frank Warmerdam b7acbf192d added SCO Open Server support 2002-09-29 18:14:48 +00:00
Andrey Kiselev f88cde27fb Added manual page for raw2tiff(1) tool. 2002-09-15 16:44:52 +00:00
Andrey Kiselev 630fc85d44 Added manual page for the TIFFDataWidth() function. 2002-09-12 13:45:45 +00:00
Andrey Kiselev dd84bac9be Added manual page for TIFFDataWidth() function. 2002-09-12 13:32:41 +00:00
Andrey Kiselev 8478ad5a42 Typo fixed. 2002-09-12 12:50:21 +00:00
Andrey Kiselev d07a6899ec TIFFDataWidth() moved to tiffio.h 2002-09-12 12:33:30 +00:00
Frank Warmerdam 3f6fe56d7b expand v[2] to v[4] in TIFFFetchShortPair() as per bug 196 2002-09-08 18:01:20 +00:00
Frank Warmerdam 5ae8f23ee7 bug80 - remove BeginData/EndData from PostScript output 2002-09-08 17:49:22 +00:00
Andrey Kiselev 83daf89ba1 *** empty log message *** 2002-09-02 15:42:25 +00:00
Andrey Kiselev 7e5d9d5659 Fixed problem with SBYTE type data fetching in TIFFFetchByteArray(). Problem
described in http://bugzilla.remotesensing.org/show_bug.cgi?id=52
2002-09-02 15:39:45 +00:00
Andrey Kiselev 43539aa66a *** empty log message *** 2002-08-23 11:24:25 +00:00
Andrey Kiselev 5b3e083d9c *** empty log message *** 2002-08-22 18:32:55 +00:00
Andrey Kiselev 1ed16b4290 Further additions to free custom fields in _TIFFSetupFieldInfo() function.
See http://bugzilla.remotesensing.org/show_bug.cgi?id=169 for details.
2002-08-22 18:31:40 +00:00
Andrey Kiselev c70e384ae5 *** empty log message *** 2002-08-22 16:53:50 +00:00
Andrey Kiselev 6001430ec2 Additional consistency checking added in LZWDecode() and LZWDecodeCompat(). 2002-08-22 16:50:50 +00:00
Andrey Kiselev becb4e7ffa *** empty log message *** 2002-08-22 15:17:18 +00:00
Andrey Kiselev 9b829f8c18 Added check for valid code lengths in LZWDecode() and LZWDecodeCompat().
Fixes http://bugzilla.remotesensing.org/show_bug.cgi?id=115
2002-08-22 15:13:27 +00:00
Andrey Kiselev ff411c24b5 Fixes in orientation support. 2002-08-18 17:29:17 +00:00
Andrey Kiselev 202b3ade1d *** empty log message *** 2002-08-16 15:53:50 +00:00
Andrey Kiselev 78c469463f Missed declarations added 2002-08-16 15:19:02 +00:00
Frank Warmerdam f09aa10ad4 Ensure that TIFFRGBAImageBegin() returns the return code from the underlying
pick function.  http://bugzilla.remotesensing.org/show_bug.cgi?id=177
2002-08-15 15:13:33 +00:00
Frank Warmerdam 6663496bbf *** empty log message *** 2002-08-15 15:12:38 +00:00
Frank Warmerdam f8a0f2f641 added comment 2002-08-15 12:59:50 +00:00
Frank Warmerdam e73fae909d cleanup anonymous field memory as per bug 169 2002-08-15 12:59:25 +00:00
Frank Warmerdam 5cf0697401 move fIELD_CODEC to 66 to avoid overlap with FIELD_CUSTOM 2002-08-15 12:59:08 +00:00
Frank Warmerdam b34afe14a1 added raw2tiff.c to dist list 2002-08-15 12:58:31 +00:00
Frank Warmerdam 07655e06d6 bug 169 2002-08-15 12:57:16 +00:00
Andrey Kiselev 10450bf936 Added -i commandline switch to handle different types of data interleaving 2002-08-12 15:32:37 +00:00
Andrey Kiselev 48cd8465bb *** empty log message *** 2002-08-10 15:34:35 +00:00
Andrey Kiselev 9d0b2d19e0 New tool: raw2tiff --- raw images to TIFF converter. No manual page yet. 2002-08-10 15:25:54 +00:00
Frank Warmerdam e8e71cf027 Fixed nrows setting in JPEGDecode() as per bug 129 in bugzilla.
Also corrected check for YCBCR photometric mode in subsampling hack code.
2002-07-31 21:36:08 +00:00
Frank Warmerdam 63067a98c7 bug 129 2002-07-31 21:25:41 +00:00
Frank Warmerdam c78a5bdc6d bugs 168 and 129 2002-07-31 21:12:43 +00:00
Frank Warmerdam a6873099d0 call TIFFGetField() on YCBCRSUBSAMPLING for tif_jpeg hack 2002-07-31 21:05:57 +00:00
Frank Warmerdam a0605bac6b Finished last change with regard to ycbcr subsampling. See Bugzilla:
http://bugzilla.remotesensing.org/show_bug.cgi?id=168
2002-07-31 21:05:13 +00:00
Frank Warmerdam fe7352c450 Extensive hack to pre-read the YCbCr sampling information from the jpeg
data stream
2002-07-31 20:56:15 +00:00
Frank Warmerdam afb8476510 added CHECK_JPEG_YCBCR_SUBSAMPLING switch 2002-07-31 20:55:12 +00:00
Frank Warmerdam be1e600d75 TIFFWriteScanline() now explicitly sets the tif_row value instead of just
incrementing it, in case the codec has been fooling with it.
2002-07-31 20:53:15 +00:00
Frank Warmerdam 550bfb8390 Make TIFFFillStrip() and TIFFFillTile() public for the use of tif_jpeg.c
TIFFReadScanline() now explicitly sets the tif_row value after reading a
line rather than just incrementing it, in case the codec has fooled with it.
2002-07-31 20:52:36 +00:00
Frank Warmerdam c7486651d1 Added link to Michael's tutorial. 2002-07-09 16:21:58 +00:00
Andrey Kiselev a94d5b4e3b Help option fixed 2002-06-27 13:07:46 +00:00
Andrey Kiselev c2d7ef0d2c Added support for deflate compression. 2002-06-27 07:41:33 +00:00
Andrey Kiselev 6050d390af *** empty log message *** 2002-06-22 10:37:42 +00:00
Andrey Kiselev f2558c8426 Added workaround for some software that may crash when last strip
of image contains fewer number of scanlines than specified by the
`/Height' variable. See
http://bugzilla.remotesensing.org/show_bug.cgi?id=164 for explanation.
2002-06-22 10:32:56 +00:00
Andrey Kiselev b3f6ae5b8f *** empty log message *** 2002-06-21 10:59:18 +00:00
Andrey Kiselev 419dd4c8eb *** empty log message *** 2002-06-21 10:28:38 +00:00
Andrey Kiselev 68db217599 New functionality for tiff2ps utility: splitting long images in several pages.
See http://bugzilla.remotesensing.org/show_bug.cgi?id=142 for explanation.
Patch granted by John Williams <williams@morinda.com>.
2002-06-21 10:24:40 +00:00
Andrey Kiselev f6c9c4db41 Typo fixed. 2002-06-14 11:13:14 +00:00
Frank Warmerdam 3e6470b479 *** empty log message *** 2002-06-12 03:38:17 +00:00
Frank Warmerdam 3e902beefc move win95 to win_dib, add Tiffile 2002-06-12 03:37:23 +00:00
Frank Warmerdam 9a9ed79992 updated contrib info 2002-06-12 03:35:49 +00:00
Frank Warmerdam 7fdded8a38 New 2002-06-12 03:30:24 +00:00
Frank Warmerdam 652bc9e6b8 obsolete 2002-06-12 03:29:38 +00:00
Frank Warmerdam 018acb17d9 New 2002-06-12 03:23:29 +00:00
Frank Warmerdam 29e261ef94 obsolete 2002-06-12 03:23:20 +00:00
Frank Warmerdam 6181e05b84 Applied huge patch from Scott. See bugzilla for details.
http://bugzilla.remotesensing.org/show_bug.cgi?id=156
2002-06-12 02:44:40 +00:00
Frank Warmerdam 5e0c6ea995 Added link to bugzilla input from Scott. 2002-06-12 02:29:11 +00:00
Andrey Kiselev b7a6cf276a *** empty log message *** 2002-06-02 11:41:23 +00:00
Frank Warmerdam 216ddbf235 Updated link to test images. 2002-05-17 19:15:43 +00:00
Andrey Kiselev 3877c58d11 *** empty log message *** 2002-05-10 10:49:55 +00:00
Andrey Kiselev ff51d7a6aa New commandline switches to override resolution units obtained from the input
file. Closes http://bugzilla.remotesensing.org/show_bug.cgi?id=131
2002-05-10 10:45:43 +00:00
Andrey Kiselev 4dff88aba4 *** empty log message *** 2002-04-26 08:57:57 +00:00
Andrey Kiselev 62fc04a1a7 Added missed declaration. 2002-04-26 08:55:17 +00:00
Andrey Kiselev 1cf9042ecb *** empty log message *** 2002-04-22 07:35:27 +00:00
Andrey Kiselev 2484287354 Updated to reflect latest changes in libtiff. Closes
http://bugzilla.remotesensing.org/show_bug.cgi?id=125
2002-04-22 07:32:24 +00:00
Andrey Kiselev 0a42ac77b2 *** empty log message *** 2002-04-20 12:20:08 +00:00
Andrey Kiselev f21d08fc39 Pointers to custom procedures in TIFFClientOpen() are checked to be not
NULL-pointers.
2002-04-20 12:16:52 +00:00
Andrey Kiselev 99a96cf1a1 Updated for using tif_tagmethods structure. 2002-04-18 13:24:35 +00:00
Andrey Kiselev f1c5bd7e1e Added missed declarations. 2002-04-18 13:24:15 +00:00
Andrey Kiselev 9532ac8a74 *** empty log message *** 2002-04-18 13:23:46 +00:00
Andrey Kiselev 9aa337d9f0 *** empty log message *** 2002-04-17 13:09:04 +00:00
Andrey Kiselev a8e46b54e5 *** empty log message *** 2002-04-16 14:18:16 +00:00
Andrey Kiselev d02bbd0006 Additional check for data integrity. Should finally close
http://bugzilla.remotesensing.org/show_bug.cgi?id=100
2002-04-16 13:49:14 +00:00
Andrey Kiselev a9a67d4b70 *** empty log message *** 2002-04-09 20:57:02 +00:00
Andrey Kiselev 0aa0a6dbce Divide by zero fixed. Closes
http://bugzilla.remotesensing.org/show_bug.cgi?id=88
2002-04-09 20:48:53 +00:00
Andrey Kiselev c47f69530c *** empty log message *** 2002-04-09 20:10:28 +00:00
Andrey Kiselev edf96b1546 Added description for the TIFFCheckpointDirectory() function. 2002-04-09 20:01:27 +00:00
Andrey Kiselev 3970e1fce0 TIFFCheckpointDirectory() routine added. 2002-04-09 19:36:12 +00:00
Andrey Kiselev 216bf01be7 *** empty log message *** 2002-04-08 17:07:44 +00:00
Andrey Kiselev 0623f17aa1 Somebody makes a bug in tif_dirread.c when TIFFCreateAnonFieldInfo was introduced.
Closes http://bugzilla.remotesensing.org/show_bug.cgi?id=119 in case
of _cvs_00000-00.tif, _cvs_00000-01.tif and _cvs_00000-02.tif.
2002-04-08 17:07:19 +00:00
Andrey Kiselev 336485980d *** empty log message *** 2002-04-08 15:41:04 +00:00
Andrey Kiselev 88101ad83f The way of codecs checking in TIFFRGBAImageOK changed. Now it has used
tif->tif_decodestatus and tif->tif_encodestatus.
2002-04-08 15:36:03 +00:00
Andrey Kiselev 77c65d09d3 Introduced additional members tif->tif_decodestatus and tif->tif_encodestatus
for correct handling of unconfigured codecs (we should not try to read data
or to define data size without correct codecs).
2002-04-08 15:32:05 +00:00
Andrey Kiselev 2f7e5be995 *** empty log message *** 2002-04-04 14:40:14 +00:00
Andrey Kiselev 3e540b2d38 Assertions in LXWDecode and LZWDecodeCompat replaced by warnings. Now libtiff
should read corrupted LZW-compressed files by skipping bad strips. Closes
http://bugzilla.remotesensing.org/show_bug.cgi?id=100
2002-04-04 14:35:35 +00:00
Frank Warmerdam 1fec47ce77 fixed conflict 2002-04-03 21:08:56 +00:00
Frank Warmerdam b96bdce674 removed some dead code 2002-04-03 21:06:49 +00:00
Frank Warmerdam e2b729d68d FIELD_CUSTOM: TIFFGetField() is treated as a u_short *, not int * 2002-04-03 21:04:27 +00:00
Frank Warmerdam f836f25207 removed unused static function declaration 2002-04-03 20:18:16 +00:00
Frank Warmerdam a58642e908 remove unused variable 2002-04-03 20:14:20 +00:00
Frank Warmerdam 07401b2c23 removed unused variable 2002-04-03 20:13:31 +00:00
Andrey Kiselev 9f49fe090a TIFFTAG_COPYRIGHT description fixed. 2002-04-03 12:21:52 +00:00
Andrey Kiselev adffbd3dab *** empty log message *** 2002-03-31 23:00:05 +00:00
Andrey Kiselev 900dffdcbe Added support for 'Orientation' tag in tiffcp utility (at cpStripToTile
routine).
2002-03-31 22:57:19 +00:00
Frank Warmerdam a5e9827ac8 apply bug 111 fix ... avoid div-by-zero if rowbytes==0 2002-03-27 14:46:45 +00:00
Frank Warmerdam a69516b37a *** empty log message *** 2002-03-27 06:52:10 +00:00
Frank Warmerdam d4c927efa2 use FIELD_CUSTOM mechanism for TIFFTAG_SOFTWARE 2002-03-27 06:33:59 +00:00
Frank Warmerdam f3f686f377 modified to avoid use of td_software 2002-03-27 06:32:44 +00:00
Frank Warmerdam c12023cf56 added support for printing FIELD_CUSTOM strings without passcount set 2002-03-27 06:31:29 +00:00
Dwight Kelly 39c69d9b52 mods by Dwight Kelly 2002-03-27 04:09:25 +00:00
Dwight Kelly 4c2c2d58ec added a few missing tags from Adobe TIFF technotes
TIFFTAG_CLIPPATH
TIFFTAG_XCLIPPATHUNITS
TIFFTAG_YCLIPPATHUNITS
TIFFTAG_INDEXED
TIFFTAG_OPIPROXY
TIFFTAG_OPIIMAGEID
added missing INKSET tag value INKSET_MULTIINK from TIFF 6.0 spec
2002-03-27 03:55:42 +00:00
Dwight Kelly 1aaef2444e Forgot to increment FIELD_CUSTOM after adding FIELD_XMLPACKET 2002-03-27 03:53:49 +00:00
Dwight Kelly 6f68aba31d removed XML_SUPPORT define 2002-03-27 03:50:53 +00:00
Andrey Kiselev a6a8e2509d TIFFReadRGBAStrip and TIFFReadRGBATile now also uses TIFFRGBAImageOK before
reading. This is additional fix
for http://bugzilla.remotesensing.org/show_bug.cgi?id=110
2002-03-26 10:35:27 +00:00
Andrey Kiselev 198aa7d9a4 *** empty log message *** 2002-03-26 10:31:33 +00:00
Andrey Kiselev 29269c9b70 *** empty log message *** 2002-03-25 15:45:33 +00:00
Andrey Kiselev 16c9bdcbdf Additional check for supported codecs added in TIFFRGBAImageOK and
TIFFReadRGBAImage now use TIFFRGBAImageOK before reading.
Closes http://bugzilla.remotesensing.org/show_bug.cgi?id=110
2002-03-25 15:43:16 +00:00
Frank Warmerdam 6f849e0109 Added some contributors 2002-03-24 16:36:43 +00:00
Dwight Kelly c8a4912a91 added code to implement XMLPACKET tag (enabled by defining XML_SUPPORT in tiffconf.h) 2002-03-24 15:48:39 +00:00
Dwight Kelly d931e72967 added XML_SUPPORT to enable XMLPacket tag implementation 2002-03-24 15:47:03 +00:00
Dwight Kelly 2417737c45 added ICCLab photometric tag (per Adobe Pagemaker TIFF technote and email from Chris Cox)
added TIFF/IT (IT8) tags HCUsage, TrapIndicator, and CMYKEquivalent (per ISO TIFF/IT standards)
added XMLPacket tag (per Adobe XMP technote)
2002-03-24 15:45:38 +00:00
Dwight Kelly 8953d781f0 Test commit 2002-03-22 04:39:37 +00:00
Andrey Kiselev f02a098bcc *** empty log message *** 2002-03-16 16:52:57 +00:00
Andrey Kiselev fa0ce83d3f Added routine TIFFDataWidth for detrmining TIFFDataType sizes instead of
working with tiffDataWidth array directly. Should prevent out-of-borders bugs
in case of unknown or broken data types.
EstimateStripByteCounts routine modified, so it won't work when tags with
uknown sizes founded.
2002-03-15 11:05:56 +00:00
Andrey Kiselev ce38c97afb Added support for correct handling `Orientation' tag in gtTileContig. Should
be added in other gt* functions as well, but I have not images for testing
yet. Partially resolves http://bugzilla.remotesensing.org/show_bug.cgi?id=23
2002-03-13 19:36:36 +00:00
Andrey Kiselev ec61d2b61c Added possibility to read broken TIFFs with LONG type used for
TIFFTAG_COMPRESSION, TIFFTAG_BITSPERSAMPLE, TIFFTAG_PHOTOMETRIC.
Closes http://bugzilla.remotesensing.org/show_bug.cgi?id=99
2002-03-10 13:11:35 +00:00
Andrey Kiselev 6236465593 Shared library will not be stripped when installing, utility binaries will do.
Closes http://bugzilla.remotesensing.org/show_bug.cgi?id=93
2002-03-08 07:21:53 +00:00
Andrey Kiselev ad546e9868 test update 2002-03-07 19:29:58 +00:00
Frank Warmerdam 028768c7d2 updated to use tif_tagmethods substructure 2002-03-06 14:07:27 +00:00
Frank Warmerdam 5f20db7fc0 *** empty log message *** 2002-03-01 04:10:24 +00:00
Frank Warmerdam dee5694586 Added copyright. 2002-03-01 04:10:11 +00:00
Frank Warmerdam e9ca55d134 Fixed type of TIFFTAG_COPYRIGHT. 2002-03-01 04:09:03 +00:00
Frank Warmerdam 69ba6dacab added tif_extension.c 2002-02-24 16:30:19 +00:00
Frank Warmerdam 3123dc0922 New 2002-02-24 16:13:39 +00:00
Frank Warmerdam 855ff3447d support printing custom fields 2002-02-24 16:13:13 +00:00
Frank Warmerdam 840192b9a2 support writing custom fields 2002-02-24 16:12:49 +00:00
Frank Warmerdam 6a1c358a72 moved TIFFieldInfo here, add custom field support 2002-02-24 16:09:45 +00:00
Frank Warmerdam 0d4cd777e7 added custom field support 2002-02-24 16:07:49 +00:00
Frank Warmerdam 3a3e43bea5 clean up client info links 2002-02-24 15:41:41 +00:00
Frank Warmerdam 844aa1cd1e added support for custom fields, use tagmethods 2002-02-24 15:40:57 +00:00
Frank Warmerdam 83951ab254 added support for anonymous fields, and pre-sort 2002-02-24 15:19:22 +00:00
Frank Warmerdam 25e98033e1 get/setfield methods moved into tif_tagmethods 2002-02-24 15:03:32 +00:00
Frank Warmerdam dcd231ed16 moved some stuff to tiffio.h 2002-02-24 15:02:00 +00:00
Frank Warmerdam 0b3592575a now creates anonfield info for new tags 2002-02-24 15:01:15 +00:00
Frank Warmerdam c3e810ea96 *** empty log message *** 2002-02-11 14:21:17 +00:00
Frank Warmerdam cd7704c33f Recognised __arch64__ as a 64bit system marker as per bug 94. 2002-02-11 14:01:05 +00:00
Frank Warmerdam b952210806 Added __arch64__ support as per Bug 94. 2002-02-11 13:58:25 +00:00
Frank Warmerdam c57b40c358 Fixed DESTDIR handling. Bug 95. 2002-02-11 13:53:52 +00:00
Frank Warmerdam 8ed4025043 bug 96: OpenBSD Sparc64 and DSO changes 2002-02-11 13:50:26 +00:00
Frank Warmerdam 6ccbd79787 added patches from Scott for greyscale support, see faucet.tif 2002-02-05 17:48:03 +00:00
Frank Warmerdam 8caaca6797 added OJPEG option 2002-02-05 17:46:57 +00:00
Frank Warmerdam 632c9097d5 fixed v3.4pics link 2002-01-28 14:38:36 +00:00
Frank Warmerdam b8ffea63b7 *** empty log message *** 2002-01-27 18:55:55 +00:00
Frank Warmerdam ada807fa14 removed reference to unreachable .ps file, and only refer to pdf 2002-01-27 18:42:19 +00:00
Frank Warmerdam 9d8d1086ea Fixed link to Frank. 2002-01-24 15:54:38 +00:00
Frank Warmerdam b22fe35cda fix ttn 2 link 2002-01-24 15:51:55 +00:00
Frank Warmerdam f27eafc935 updated from ftp.gnu.org/pub/config 2002-01-18 19:46:51 +00:00
Frank Warmerdam 23d724476b Added missing DESTDIR ... Maciej 2002-01-18 19:17:10 +00:00
Frank Warmerdam c777c2c041 Fixed TIFFReadEncodedStrip() if decoder returns -1 2002-01-18 19:05:27 +00:00
Frank Warmerdam c77822c1c3 Patched CheckForBigEndian for cross compilation - patch from Maciej Rozycki 2002-01-18 18:58:19 +00:00
Frank Warmerdam 9606d1f5a1 *** empty log message *** 2002-01-16 18:05:22 +00:00
Frank Warmerdam b049944746 Added TIFFTAG_JPEGTABLES entry in tag table. 2002-01-16 18:04:57 +00:00
Frank Warmerdam 7adb89763f *** empty log message *** 2002-01-16 17:50:29 +00:00
Frank Warmerdam ad9dd219cd Fix bug in error output. 2002-01-16 17:50:05 +00:00
Frank Warmerdam fb4cb16134 *** empty log message *** 2002-01-16 17:48:51 +00:00
Frank Warmerdam 0bdad6cb3c Fixed several warnings. 2002-01-16 17:48:16 +00:00
Frank Warmerdam 5c402d22f1 New 2002-01-16 17:29:20 +00:00
Frank Warmerdam c2517000c4 update TTN location 2002-01-16 17:29:11 +00:00
Frank Warmerdam d6559489c5 fixed segment_width problem with ITIFF files 2002-01-04 19:19:12 +00:00
Frank Warmerdam dc18940ad9 MacOS 10.1 (bug 94) fixes 2001-12-15 17:36:53 +00:00
Frank Warmerdam 62d3736392 bug 93: default unmarked 4th sample as alpha 2001-12-15 15:11:22 +00:00
Frank Warmerdam 05d24d304f *** empty log message *** 2001-12-13 02:04:33 +00:00
Frank Warmerdam 488424ec6c allow jpeg data stream sampling values to override those from tiff dir 2001-12-13 02:03:40 +00:00
Frank Warmerdam bf0c6fb07c bug92 2001-12-07 16:34:30 +00:00
Frank Warmerdam 0fb0aaebd8 Added two missing images: bug 92 2001-12-07 16:33:52 +00:00
Frank Warmerdam e1cc3616ed fixed clean target: bug 92 2001-12-07 16:32:08 +00:00
Frank Warmerdam 078fb4f287 New 2001-11-28 17:21:02 +00:00
Frank Warmerdam 1f1adeb8bb ensure tiffvers.h regenerated in release target 2001-11-28 17:12:25 +00:00
Frank Warmerdam 3ecaf77834 3.5.7 rerelease 2001-11-28 17:09:18 +00:00
Frank Warmerdam ce8daaa711 *** empty log message *** 2001-11-28 17:08:54 +00:00
Frank Warmerdam e1bffee010 fixed TIFF_VERSION to be YYYYMMDD 2001-11-28 17:07:13 +00:00
Frank Warmerdam f88d97ef25 *** empty log message *** 2001-11-28 17:06:47 +00:00
Frank Warmerdam c950f4708c updated info about release date and tiffvers.h 2001-11-28 17:05:31 +00:00
Frank Warmerdam 523f51c238 updated 2001-11-23 16:23:17 +00:00
Frank Warmerdam 94c413e2ea handle case of @RELEASE@ being empty in release.tar.zip target 2001-11-23 16:15:35 +00:00
Frank Warmerdam ded7e36f2e major upgrade 2001-11-23 16:05:53 +00:00
Frank Warmerdam b7508608aa updated 2001-11-23 16:02:14 +00:00
Frank Warmerdam b9a768ba71 updated for 3.5.7 2001-11-23 15:56:18 +00:00
Frank Warmerdam 3e457fdb81 New 2001-11-23 15:49:55 +00:00
Frank Warmerdam 1255b93cc9 *** empty log message *** 2001-11-23 15:00:19 +00:00
Frank Warmerdam e8185bb69b Added tif_ovrcache.{c,h} to dist list. 2001-11-23 13:56:43 +00:00
Frank Warmerdam b6b61e12ba Added tif_ojpeg.c. 2001-11-20 14:29:50 +00:00
Frank Warmerdam 4eaff9b636 fixed test for -lm 2001-11-15 17:21:05 +00:00
Frank Warmerdam 94190c5df9 added PHOTOMETRIC_ITULAB as per bug 90 2001-11-02 17:25:52 +00:00
Frank Warmerdam 2ba4c21151 T.4 and T.6 aliases added 2001-10-11 03:34:17 +00:00
Frank Warmerdam 6fe7f1942b update info on mailing list 2001-10-09 15:03:23 +00:00
Frank Warmerdam 4b1d7e4c29 added TIFFRewriteDirectory 2001-09-26 17:42:18 +00:00
Frank Warmerdam 7f05378ed7 added TIFFRewriteDirectory info 2001-09-26 17:32:24 +00:00
Frank Warmerdam 4f152a1867 New 2001-09-25 02:27:51 +00:00
Frank Warmerdam 2c26534c4b *** empty log message *** 2001-09-25 02:26:29 +00:00
Frank Warmerdam 972f16c818 updated compression kit 2001-09-25 02:24:18 +00:00
Frank Warmerdam 00c3636006 avoid VC++ 5.0 optimization bug 2001-09-25 01:59:13 +00:00
Frank Warmerdam b18d9772a7 Added dummy LZWSetupEncode() that reports failure due to patent issues.
Ensure predictor setup isn't called for encoders since it will crash.
2001-09-25 01:35:40 +00:00
Frank Warmerdam d430174dc5 remove LZW hack, return status failure for compressor initializers 2001-09-25 01:33:54 +00:00
Frank Warmerdam b742bfb9c0 3.5.7 beta 2001-09-24 20:11:10 +00:00
Frank Warmerdam 3ac929fc6c New 2001-09-24 19:59:13 +00:00
Frank Warmerdam 9fbd11fffb *** empty log message *** 2001-09-24 19:57:50 +00:00
Frank Warmerdam b6d12d041c obsolete 2001-09-24 19:55:32 +00:00
Frank Warmerdam aa1ab04f66 removed active ftp message 2001-09-24 19:54:53 +00:00
Frank Warmerdam d3daae9697 new update from Scott 2001-09-24 19:54:36 +00:00
Frank Warmerdam 19ebdba611 fixed initialization of ret flag from recent change 2001-09-24 19:40:37 +00:00
Frank Warmerdam e1d66ae974 *** empty log message *** 2001-09-23 00:10:52 +00:00
Frank Warmerdam 40a2e7a41d various improvements from Scott 2001-09-22 23:56:25 +00:00
Frank Warmerdam bc63306cd1 Resolve bug 54 - always use purify safe code 2001-09-09 16:10:37 +00:00
Frank Warmerdam ad4b0adcba *** empty log message *** 2001-09-09 16:03:40 +00:00
Frank Warmerdam 051471b915 Changes from Josep Vallverdu (@hp) for starting reads of strips or
tiles on non strip/tile boundaries.  The changes are to the functions
gtTileContig(), gtTileSeparate(), gtStripContig(), gtTileSeparate().  These
changes have not been extensively tested by the maintainer!   Deatils are in
http://bugzilla.remotesensing.org/show_bug.cgi?id=47
2001-09-09 16:02:04 +00:00
Frank Warmerdam 63c726acab *** empty log message *** 2001-09-09 15:59:34 +00:00
Frank Warmerdam c5e2b1450a fixed @DSOSUB_VERSION to be @DSOSUF_VERSION@ 2001-09-09 15:56:04 +00:00
Frank Warmerdam 4b1fc8b6ce *** empty log message *** 2001-09-09 15:34:11 +00:00
Frank Warmerdam 177169bf93 fixed last change 2001-09-08 17:28:08 +00:00
Frank Warmerdam 71715f2e02 add OJPEG support to tiff2ps 2001-09-08 17:27:38 +00:00
Frank Warmerdam 0759b2fbf9 Applied big patch from Scott for TIFFTAG_JPEGCOLORMODE support.
Did some surgery on "OJPEGDecode()" to handle Zack the Cat's problems,
and to copy the Wang color-correction hack that Scott previously put only in
"OJPEGDecodeRaw()".  Also corrected a couple of small bugs elsewhere in the
module.
2001-09-08 16:58:17 +00:00
Frank Warmerdam 335d2428c1 *** empty log message *** 2001-09-08 16:23:08 +00:00
Frank Warmerdam 6d655e5180 obsolete 2001-09-08 16:21:19 +00:00
Frank Warmerdam 2fcb12e08e New 2001-09-08 16:20:53 +00:00
Frank Warmerdam e7bdb18949 fixed memory overrun in packbits decode 2001-09-06 19:28:45 +00:00
Frank Warmerdam d15abe6676 Allow handling of images with extra samples that are to be ignored for
contiguous 8bit greyscale and paletted images.
See bug http://bugzilla.remotesensing.org/show_bug.cgi?id=75
2001-08-31 13:53:08 +00:00
Frank Warmerdam abf486d1fa fixed CMYK problem in getimage 2001-08-28 13:11:38 +00:00
Frank Warmerdam 7afe0a69bc fixed problem copying overlapping buffers in TIFFReadRGBATile() 2001-08-11 03:41:07 +00:00
Frank Warmerdam 7f12712234 fixed getopt so that -b works again 2001-08-11 03:13:59 +00:00
Frank Warmerdam 66ca643de3 added check for __LP64__ for 64bit architectures as per bugzilla bug 67 2001-08-10 02:37:52 +00:00
Frank Warmerdam c997939e76 *** empty log message *** 2001-07-27 13:25:19 +00:00
Frank Warmerdam 7925abb90f Added TIFFClientOpen man page link. 2001-07-27 13:18:50 +00:00
Frank Warmerdam 5579e5cda2 *** empty log message *** 2001-07-20 15:01:42 +00:00
Frank Warmerdam b95dedf51e define HAVE_BOOLEAN for libjpeg if RPCNDR_H included 2001-07-20 15:00:35 +00:00
Frank Warmerdam 71a2c4a090 seek back to zero patch in tif_open 2001-07-20 02:22:46 +00:00
Frank Warmerdam 5cbaf2b5b9 add contrib/ojpeg 2001-07-18 13:37:12 +00:00
Frank Warmerdam 1c30adcb67 prep for 3.5.7 alpha 4 2001-07-18 13:35:34 +00:00
Frank Warmerdam 48b7fecaa1 *** empty log message *** 2001-07-18 13:29:36 +00:00
Frank Warmerdam f9590ca93b updates from Scott ... color much better 2001-07-18 13:28:04 +00:00
Frank Warmerdam ef2858fba8 return proper errors in various cases (bug 51) 2001-07-18 13:27:35 +00:00
Frank Warmerdam 52b3695ca8 New 2001-07-18 13:12:21 +00:00
Frank Warmerdam 87f580c152 added DESTDIR support as per bug 60 2001-07-17 13:13:37 +00:00
Frank Warmerdam f45df42b1b applied openbsd patches (as per bug 61) 2001-07-16 20:42:59 +00:00
Frank Warmerdam 0ef5434120 *** empty log message *** 2001-06-29 03:18:41 +00:00
Frank Warmerdam 63ad614292 *** empty log message *** 2001-06-29 02:48:59 +00:00
Frank Warmerdam de3497b2b4 Fixed multi samples per pixel support for ContigCompare.
See http://bugzilla.remotesensing.org/show_bug.cgi?id=53
2001-06-29 02:48:00 +00:00
Frank Warmerdam 72157c76eb added addition bug cases 2001-06-29 02:46:45 +00:00
Frank Warmerdam ecfaa86dcb AIX DSO fixes 2001-06-22 21:20:08 +00:00
Frank Warmerdam e0368fb99c *** empty log message *** 2001-06-22 14:29:47 +00:00
Frank Warmerdam 8dc808ef43 Added darwin support 2001-06-22 12:49:41 +00:00
Frank Warmerdam d713a69145 added darwin support 2001-06-22 12:49:23 +00:00
Frank Warmerdam 06fe9227c6 New 2001-06-13 15:32:19 +00:00
Frank Warmerdam 08e3df0753 Added tiff2rgba in missing spot. 2001-06-13 15:26:44 +00:00
Frank Warmerdam f11ebe5337 Added tiff2rgba.1. 2001-06-13 15:25:35 +00:00
Frank Warmerdam f84737906e added -n flag 2001-06-13 15:24:37 +00:00
Frank Warmerdam 54eee39fba New 2001-06-13 15:23:57 +00:00
Frank Warmerdam f1492d5592 *** empty log message *** 2001-05-22 19:40:39 +00:00
Frank Warmerdam 8ff59a642c *** empty log message *** 2001-05-13 14:50:17 +00:00
Frank Warmerdam d6e4b16b19 Changed define output compression to PACKBITS since LZW isn't generally
available.
2001-05-13 14:49:27 +00:00
Frank Warmerdam 64cb569b8e Added windows binary link. 2001-05-12 16:37:07 +00:00
Frank Warmerdam 47c14d60ad OJPEG support 2001-05-12 04:01:32 +00:00
Frank Warmerdam 8b3eb72fa0 New 2001-05-12 04:00:02 +00:00
Frank Warmerdam d6d15c670f added ojpeg support 2001-05-12 03:59:50 +00:00
Frank Warmerdam a2252cd044 removed tee to out.sh 2001-05-12 03:11:59 +00:00
Frank Warmerdam 9046f3aab5 obsolete 2001-05-12 01:19:28 +00:00
Frank Warmerdam 72ed01b40c Changed NULL to 0 in mmap() call since NULL is not ubiquitous. 2001-05-10 02:14:16 +00:00
Frank Warmerdam 1f9632f936 moved pixar and copyright tags to keep in order 2001-05-09 01:33:16 +00:00
Frank Warmerdam 1b7a840245 *** empty log message *** 2001-05-09 01:28:10 +00:00
Frank Warmerdam a5d55c6575 Added two new entries. 2001-05-09 01:27:29 +00:00
Michael O'Rourke a472e423ed test commit 2001-05-08 12:34:14 +00:00
Frank Warmerdam 28dd547b7e attempt to resolve uint32 count size for TIFFTAG_PHOTOSHOP 2001-05-02 13:35:03 +00:00
Frank Warmerdam b117e2acd9 *** empty log message *** 2001-05-02 03:09:42 +00:00
Frank Warmerdam f43b40d0ff removed duplicate TIFFTAG_PHOTOSHOP 2001-05-02 03:08:58 +00:00
Frank Warmerdam 9191ab82fa fixed up SHELL_SH/SHELL issues 2001-04-06 03:02:33 +00:00
Frank Warmerdam 256cebdc66 made more readable 2001-04-06 02:56:33 +00:00
Frank Warmerdam f99796d17a more fixes from Scott 2001-04-06 02:54:35 +00:00
Frank Warmerdam 83ad20cfbc removed C++ style comment 2001-04-06 02:54:13 +00:00
Frank Warmerdam 61b0ba33f0 Fixed SCRIPT_SH/SHELL handling. 2001-04-06 02:53:24 +00:00
Frank Warmerdam 8cdf1878b4 added a few more documented variables 2001-04-06 02:52:35 +00:00
Frank Warmerdam 21724616f5 Wide variety of HP/UX configuration changes 2001-04-03 05:17:02 +00:00
Frank Warmerdam 60b7752932 new release 2001-04-03 04:03:30 +00:00
Frank Warmerdam 0263998eab AIX inttypes.h fix 2001-04-03 04:00:23 +00:00
Frank Warmerdam a60c564b4f *** empty log message *** 2001-04-03 03:57:59 +00:00
Frank Warmerdam 9864187bcd prepare for 3.5.7 2001-04-03 03:56:38 +00:00
Frank Warmerdam a255812074 added Darwin test to see if -lm needed 2001-04-03 03:51:57 +00:00
Frank Warmerdam 8671dffe68 applied new config.guess from MacOS X 2001-04-03 03:25:46 +00:00
Frank Warmerdam fb16c8ba87 added support for OPTIMIZER from config.site 2001-03-30 01:55:32 +00:00
Frank Warmerdam 4f4c99abfc From Helge (libtiff@oldach.net)
Here's a fix for fax2ps that corrects behaviour for non-Letter paper
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
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.

Second, scaling now preserves aspect ratio, which makes unusual faxes
(in particular short ones) print properly.
2001-03-29 01:45:43 +00:00
Frank Warmerdam a4079e754e Added Bruce for tiff2ps work. 2001-03-29 01:38:54 +00:00
Frank Warmerdam 7a1ad5e9d9 Broad changes to tiff2ps by Bruce A. Mallett.
Fixed PS_Lvl2page() code which outputs non-ASCII85 raw
    data.  Moved test for when to output a line break to
    *after* the output of a character.  This just serves
    to fix an eye-nuisance where the first line of raw
    data was one character shorter than subsequent lines.

    Added an experimental ASCII85 encoder which can be used
    only when there is a single buffer of bytes to be encoded.
    This version is much faster at encoding a straight-line
    buffer of data because it can avoid alot of the loop
    overhead of the byte-by-bye version.  To use this version
    you need to define EXP_ASCII85ENCODER (experimental ...).

    Added bug fix given by Michael Schmidt to PS_Lvl2page()
    in which an end-of-data marker ('>') was not being output
    when producing non-ASCII85 encoded PostScript Level 2
    data.

    Fixed PS_Lvl2colorspace() so that it no longer assumes that
    a TIFF having more than 2 planes is a CMYK.  This routine
    no longer looks at the samples per pixel but instead looks
    at the "photometric" value.  This change allows support of
    CMYK TIFFs.

    Modified the PostScript L2 imaging loop so as to test if
    the input stream is still open before attempting to do a
    flushfile on it.  This was done because some RIPs close
    the stream after doing the image operation.

    Got rid of the realloc() being done inside a loop in the
    PSRawDataBW() routine.  The code now walks through the
    byte-size array outside the loop to determine the largest
    size memory block that will be needed.

    Added "-m" switch to ask tiff2ps to, where possible, use the
    "imagemask" operator instead of the "image" operator.

    Added the "-i #" switch to allow interpolation to be disabled.

    Unrolled a loop or two to improve performance.
2001-03-29 01:34:33 +00:00
Frank Warmerdam f3bbcf1b9e #if fix for VisualAge/AIX 2001-03-27 22:57:51 +00:00
Frank Warmerdam dc989a55c2 *** empty log message *** 2001-03-16 21:06:14 +00:00
Frank Warmerdam 0de034d3a6 moved copyright flag ... must be in tag order! 2001-03-16 21:05:35 +00:00
Frank Warmerdam 8eea65a406 added support for 16bit minisblack/miniswhite images 2001-03-13 19:07:02 +00:00
Frank Warmerdam fa01e4a72c *** empty log message *** 2001-03-02 05:14:03 +00:00
Frank Warmerdam aba53d12dc added copyright tag 2001-03-02 04:59:52 +00:00
Frank Warmerdam 7b2e915893 New 2001-03-02 04:58:53 +00:00
Frank Warmerdam f1ca6ff832 added tiffset 2001-03-02 04:58:46 +00:00
Frank Warmerdam 50d81a1c8c added TIFFTAG_COPYRIGHT 2001-03-02 04:48:20 +00:00
Frank Warmerdam 9f642c3820 added copyright 2001-03-02 04:47:19 +00:00
Frank Warmerdam a361b724b1 Updated acknowledgements. 2001-02-19 15:31:17 +00:00
Frank Warmerdam aefe065e30 *** empty log message *** 2001-02-19 15:22:07 +00:00
Frank Warmerdam b4f624124b put -b in alphabetical order 2001-02-19 15:20:54 +00:00
Frank Warmerdam 3ba769b282 Brent Roman: added bias, and comma subfile support, removed -z 2001-02-19 15:18:19 +00:00
Frank Warmerdam 8867ddfb3e Brent Roman submitted new version adding serveral missing entry points. 2001-02-17 03:54:54 +00:00
Frank Warmerdam b18f9bb835 vms hack - tiffFieldInfo not static on VMS 2001-02-17 03:20:39 +00:00
Frank Warmerdam cde530b12f Updated my web page pointer. 2001-02-17 03:11:31 +00:00
Frank Warmerdam c0cb9fbe5c avoid warning on vc++ 2001-02-17 03:07:54 +00:00
Frank Warmerdam a6da80a7ac applied Greg Wards LogLuv patches 2001-02-17 03:03:52 +00:00
Mike Welles 6b9e77c4b4 changed ftp.onshore.com to ftp.remotesensing.org 2001-01-24 19:04:52 +00:00
Mike Welles 4e58796e7b Just committing RELEASE-DATE 2001-01-23 21:41:21 +00:00
Mike Welles ded991f5a9 Pre announcement cleanup 2001-01-23 21:40:17 +00:00
Frank Warmerdam 00761c187e fix when attempting TIFFOpen(r+) of fax3/4 compressed files 2001-01-23 14:45:58 +00:00
Mike Welles 9a1d08fc5a Makefile.in is now cleaning up after iteself in the "release" target 2001-01-08 16:07:33 +00:00
Frank Warmerdam a5a724a995 *** empty log message *** 2001-01-07 19:11:13 +00:00
Frank Warmerdam 66b26c1922 Fixed arguments to TIFFRGBAImageGet() call. 2001-01-07 19:10:29 +00:00
Frank Warmerdam f89c360121 fixed tiffvers.h support a bit better 2000-12-29 00:19:32 +00:00
Frank Warmerdam 75bfb7c8ea added RELEASE-DATE file 2000-12-28 22:59:43 +00:00
Frank Warmerdam 3ba946b076 *** empty log message *** 2000-12-28 22:59:06 +00:00
Frank Warmerdam 7c2ef4f738 *** empty log message *** 2000-12-28 22:57:48 +00:00
Frank Warmerdam f6b6e568b8 fixed to produce tiffvers.h instead of version.h 2000-12-28 22:55:11 +00:00
Mike Welles a7f6e194cf * modified Makefile.in, configure, and dist/newversion, so that.
the old code updates things based on the info in VERSION. I've
	  kept this, but added a second token in VERSION, "beta". configure
	  will now parse VERSION into $VERSION and $RELEASE.  Whatever the
	  second token is will be appened to the "release" target tar and
	  zip afiles, and will be used by dist/newversion to
	  create dist/tiff.version.
2000-12-22 22:33:41 +00:00
Mike Welles ce16b036c1 My vanity domain was hijacked. Put my link to go to bangstate.com instead. 2000-12-22 20:30:29 +00:00
Mike Welles a9c74fed15 Clean up. 2000-12-22 20:27:43 +00:00
Mike Welles 86f76420a2 Fixes and such. 2000-12-22 20:26:09 +00:00
Frank Warmerdam 22e9dda705 don't point at Niles' old jpl web site 2000-12-22 05:06:13 +00:00
Frank Warmerdam f6b252e48a Reorganized a bit, added tif_apple.c change. 2000-12-21 14:57:43 +00:00
Frank Warmerdam 924b311912 Added step about RELEASE-DATE file. 2000-12-21 14:38:01 +00:00
Frank Warmerdam 3395339870 applied carbon api support from Leonard Rosenthol <leonardr@lazerware.com> 2000-12-21 14:32:43 +00:00
Mike Welles 177452c8c9 Pre-release checkin 2000-12-19 20:12:53 +00:00
Frank Warmerdam a02f97a5d4 added EOFB support as per Frank Cringles patch 2000-12-01 15:46:46 +00:00
Frank Warmerdam e5085f2536 fixed @MACHDEPLIBS@ 2000-11-24 15:45:35 +00:00
Frank Warmerdam 228065f561 updated stuff about .so versions a bit 2000-11-24 15:44:38 +00:00
Frank Warmerdam a3c28f9888 *** empty log message *** 2000-11-24 06:41:33 +00:00
Frank Warmerdam cd6ac2d51e Added install-private target for installing everything + the private header
files.
2000-11-24 06:28:45 +00:00
Frank Warmerdam 03bad0db8f Removed all reference to ALPHAFILE, and DIST_TYPE. Now extracts DIST_POINT
from VERSION file.  Use DIST_POINT in assigning DSOSUB_VERSION value.
2000-11-24 06:28:10 +00:00
Frank Warmerdam 60e16563b9 * libtiff/Makefile.in: Added an installPrivateHdrs and install-private
target so that the private headers required by libgeotiff can be
	installed with the others.  They are not installed by default.

	* libtiff/Makefile.in: Added @MACHLIBDEPS@ to LINUXdso and GNULDdso
	targets so libtiff.so will be built with an explicit dependency
	on libm.so.

	* libtiff/Makefile.in: Use softlinks to link libtiff.so.3 to
	libtiff.so.3.5.5.

	* libtiff/Makefile.in & configure: Remove all references to the ALPHA
	file, or ALPHA version logic.  Added stuff about DIST_POINT in
	place of DIST_TYPE and the alpha release number stuff.
2000-11-24 06:26:05 +00:00
Frank Warmerdam abcd47ae35 added --prefix, and --exec-prefix support to configure 2000-11-22 14:41:35 +00:00
Frank Warmerdam 9900baca3c variety of changes to automatic version handling 2000-11-13 14:42:38 +00:00
Frank Warmerdam 7410217a75 check for _WIN32 2000-11-13 14:23:53 +00:00
Frank Warmerdam b11174bea8 *** empty log message *** 2000-10-20 17:36:16 +00:00
Frank Warmerdam 2a447f67c7 fixed ycbcr support when width/height not multiple of sample size 2000-10-20 17:35:36 +00:00
Frank Warmerdam fcd64fe6da Removed printf(). 2000-10-20 16:33:51 +00:00
Frank Warmerdam 6429172d11 *** empty log message *** 2000-10-20 14:37:19 +00:00
Frank Warmerdam de3777f0ee Modified PackBitsEncodeChunk() to ensure no more data than was provided
is encoded, if rowsize does not factor into the data size provided.  Also,
avoid chunking into rows for YCbCr since rowsize doesn't mean much.
2000-10-20 14:35:52 +00:00
Frank Warmerdam aa844c5047 *** empty log message *** 2000-10-19 13:40:15 +00:00
Frank Warmerdam e1f05487e9 fixed output strip size to account for vertical roundup to sample factor 2000-10-19 13:23:49 +00:00
Frank Warmerdam 91b8b7c26c clear TIFF_ISTILED in TIFFDefaultDirectory() 2000-10-17 03:23:36 +00:00
Frank Warmerdam 0cd032f123 *** empty log message *** 2000-10-17 02:48:21 +00:00
Frank Warmerdam 9d862966e6 Avoid overwriting end of output buffer in PackBitsDecode(). 2000-10-17 02:33:52 +00:00
Frank Warmerdam 4e0075f4cb updated mail list and bug info 2000-10-12 14:35:03 +00:00
Frank Warmerdam d9715329ff fixed for sizing of dsp->runs from Roman (see bug 11, co Roman) 2000-10-12 14:22:38 +00:00
Frank Warmerdam de9b66753d tiff2bw accuracy patch from Stanislav Brabec 2000-10-12 14:16:22 +00:00
Frank Warmerdam 8b6b975659 don't allow open of compressed files for r+ 2000-09-30 04:18:55 +00:00
Frank Warmerdam b435795f0b fixed one of the bugzilla links. 2000-09-29 15:37:43 +00:00
Frank Warmerdam 582fb18716 added GNULDdso, and switch LINUX and FreeBSD to use it 2000-09-27 16:20:40 +00:00
Frank Warmerdam 8d9e3bcf65 tif_fax3 bug fix per Roman Shpount 2000-09-26 12:59:19 +00:00
Frank Warmerdam b6348a4592 *** empty log message *** 2000-09-26 03:43:27 +00:00
Frank Warmerdam 05d0760fc7 *** empty log message *** 2000-09-25 21:04:48 +00:00
Frank Warmerdam d66a16439c don't do win32 stuff if unix defined 2000-09-25 21:02:44 +00:00
Frank Warmerdam 6e2a00dfee Fixed API to refer to row, not strip as the argument. 2000-09-25 15:39:07 +00:00
Frank Warmerdam af621273ea *** empty log message *** 2000-09-25 14:00:15 +00:00
Frank Warmerdam c6fe07eada fixed unsubsampled YCbCr case, see ycbcrbug11.tif 2000-09-25 13:48:45 +00:00
Frank Warmerdam a329e43215 *** empty log message *** 2000-09-18 21:29:46 +00:00
Frank Warmerdam 45adce06cc moved TIFFjpeg_finish_decompress to end of JPEGDecodeRaw 2000-09-18 21:27:13 +00:00
Frank Warmerdam 8e60f18d35 regress last change while I test it further 2000-09-15 20:52:42 +00:00
Frank Warmerdam da97c5e0a4 Don't return an error from TIFFWriteData() if BEENWRITING not set 2000-09-14 20:22:58 +00:00
Frank Warmerdam fb02956eb9 Don't set MMAP for O_RDWR files 2000-08-14 18:10:43 +00:00
Frank Warmerdam 0625a1295b Set STRIPCHOP_DEFAULT for O_RDWR as well as for O_RDONLY so that files
opened for update access can be "strip chopped" too.
2000-08-14 17:30:58 +00:00
Frank Warmerdam c1282751c6 fixed bug with unterminated files, and strips per separation change 2000-08-14 16:21:54 +00:00
Frank Warmerdam e0433eb06e removed extra sh 2000-07-24 16:56:31 +00:00
Frank Warmerdam ad9af004db *** empty log message *** 2000-07-17 16:55:05 +00:00
Frank Warmerdam 1dae9cb609 Fixed typo. 2000-07-17 14:50:01 +00:00
Frank Warmerdam 7c01d7c6d3 added complex types 2000-07-14 18:43:08 +00:00
Mike Welles 4b79457a0e Bugzilla info 2000-07-13 14:58:15 +00:00
Frank Warmerdam bbfb710c80 fix subtle bug with determining the number of rows for strips that are the
last strip in a separation but not the last strip of all in
TIFFReadEncodedStrip().
2000-07-12 19:20:52 +00:00
Frank Warmerdam 889ea5bfd9 *** empty log message *** 2000-07-12 19:20:14 +00:00
Frank Warmerdam c1cd54d7dd *** empty log message *** 2000-07-12 13:01:49 +00:00
Frank Warmerdam 4338667646 Fixed 16/32 bit problem.
Fix c/o Peter Skarpetis, peters@serendipity-software.com.au
2000-07-12 13:00:27 +00:00
Frank Warmerdam 33f19258e4 don't fail on del in version.h command 2000-06-29 17:30:17 +00:00
Frank Warmerdam 082013bfef *** empty log message *** 2000-06-15 15:45:44 +00:00
Frank Warmerdam 101edfd621 tried to refine rules about when to include windows.h a bit 2000-06-15 15:32:36 +00:00
Frank Warmerdam 6ed3331ca5 *** empty log message *** 2000-05-11 15:26:15 +00:00
Frank Warmerdam 40b2e31336 Updated README to refer to www.libtiff.org, and remove Sam's old email
address at SGI.
2000-05-11 15:25:47 +00:00
Frank Warmerdam b620bd3703 *** empty log message *** 2000-05-11 12:01:19 +00:00
Frank Warmerdam 07263bff09 Patched linux DSO check ... patch supplied by
Jan Van Buggenhout <chipzz@Ace.ULYSSIS.Student.KULeuven.Ac.Be>.
2000-05-11 12:00:07 +00:00
Frank Warmerdam 78563b4ff9 Don't use estimate strip byte count for one tile/strip images with an
offset, and byte count of zero. These could be "unpopulated" images.
2000-04-21 21:45:33 +00:00
Frank Warmerdam 159348246d *** empty log message *** 2000-04-21 21:45:11 +00:00
Frank Warmerdam 660d04c25f Updated a bit. 2000-04-18 22:52:11 +00:00
Frank Warmerdam 7538c6d0bc *** empty log message *** 2000-04-18 22:48:54 +00:00
Frank Warmerdam 557efe0f3c Added support for averaging resampling 2000-04-18 22:48:31 +00:00
Frank Warmerdam 859c2524f6 *** empty log message *** 2000-04-18 22:47:36 +00:00
Frank Warmerdam 82cc2afe92 copy TIFFTAG_SAMPLEFORMAT field 2000-04-18 22:47:10 +00:00
Frank Warmerdam 6be23f4fef *** empty log message *** 2000-04-18 20:30:00 +00:00
Frank Warmerdam 58102f84bf patch for SGI install command 2000-04-18 20:29:01 +00:00
Mike Welles a7eff1d63c Added a link to TTN2 at cgi 2000-04-12 16:46:06 +00:00
Mike Welles f0770083a2 * tif_win32.c: Applied patch to fix overreads and ovverwrites
caught by BoundsChecker.  From Arvan Pritchard
2000-04-04 14:54:34 +00:00
Mike Welles f076e7232f Added patch to remove compiler warnings in tif_lzw.c 2000-04-04 14:43:35 +00:00
Frank Warmerdam 1c9f6d78c5 Added contrib/stream note. 2000-03-30 22:01:25 +00:00
Frank Warmerdam e47f6b8049 added contrib/stream and contrib/addtiffo 2000-03-30 21:59:14 +00:00
Frank Warmerdam 37854eca77 New 2000-03-30 21:57:46 +00:00
Mike Welles cf8514ccfa This time I really fixed it 2000-03-29 04:50:47 +00:00
Mike Welles 13bd02a3db Fixed link to lz-compression-kit 2000-03-29 04:49:55 +00:00
Mike Welles 9770233888 Updated docs, changelog -- modified Makefile.in to make release target in parent directory 2000-03-29 04:35:28 +00:00
Frank Warmerdam 2df86f1500 *** empty log message *** 2000-03-28 18:24:33 +00:00
Frank Warmerdam 6e8bb63779 fixed swapping of width and height in BoundingBox 2000-03-28 18:22:59 +00:00
Mike Welles 5de86c812d Removed cvs tag from release makefile target. 2000-03-27 18:33:56 +00:00
Mike Welles b9c3ad2961 Got rid 2000-03-27 18:32:23 +00:00
Mike Welles c21b8b9753 ke Welles <mike@onshore.com>
* fax2ps:  Modified printruns to take uint32 instead of uint16.
	Patch courtesy of Bernt Herd <herd@herdsoft.com>

	* html:  Createdd v3.5.5.htmlCVS: Modified Files:
2000-03-27 17:05:55 +00:00
Mike Welles 342196fc47 Updated version for the coming release 2000-03-24 04:23:04 +00:00
Mike Welles d20c60a208 2000-03-20 Mike Welles <mike@onshore.com>
* configure: added test for libc6 for linux targets.  Bug reported by
          Stanislav Brabec <utx@k332.feld.cvut.cz>

	* Added 3.5 docs to html/Makefile.in.  Thanks to  Stanislav Brabec <utx@k332.feld.cvut.cz>

	* configure: fixed bugs in sed scripts (applied sed script s:/@:s;@:;s:/s;;:;: to configure).
	  fix submitted to Stanislav Brabec <utx@k332.feld.cvut.cz>

	* tools/iptcutil was not in files list, and wasn't being added to tar archive.  Updated Makefile.in.
2000-03-20 18:20:42 +00:00
Frank Warmerdam 93d33a555c made last fix more robust if run is less than -1 2000-03-17 20:33:44 +00:00
Frank Warmerdam 7ab7008fbe *** empty log message *** 2000-03-17 18:35:13 +00:00
Frank Warmerdam fcc90bee44 fixed a serious bug with _TIFFFax3fillruns and -1 run values 2000-03-17 18:34:39 +00:00
Frank Warmerdam e4c99df427 fixed fetching of TIFFTAG_SAMPLEFORMAT 2000-03-03 15:22:00 +00:00
Frank Warmerdam d3144ac463 *** empty log message *** 2000-03-03 15:16:57 +00:00
Frank Warmerdam 584d9add00 made td_sampleformat default SAMPLEFORMAT_UINT instead of VOID 2000-03-03 15:15:57 +00:00
Frank Warmerdam f4aaa718ff *** empty log message *** 2000-03-02 20:00:50 +00:00
Frank Warmerdam 77e55ad2c6 Make sure that you can get a defaulted value for TIFFTAG_SAMPLEFORMAT. 2000-03-02 19:59:52 +00:00
Frank Warmerdam 0b109722b7 *** empty log message *** 2000-03-02 15:52:41 +00:00
Frank Warmerdam 58467248ea temporary hack toallocate runs buffer 2 words larger 2000-03-02 15:38:28 +00:00
Frank Warmerdam 0429017b0c Look for libtiff.lib, not tiff.lib. 2000-02-24 16:17:05 +00:00
Frank Warmerdam ed33ffd3ca *** empty log message *** 2000-02-16 02:54:34 +00:00
Frank Warmerdam c41985f6b1 Fixed stopondiff testing so that -l works.
Patch from: Joseph Orost <joe@sanskrit.lz.att.com>
2000-02-16 02:53:49 +00:00
Frank Warmerdam 1a091b3083 fixed passing -1 as cc into TIFFWriteEncodedTiles() 2000-02-11 19:28:17 +00:00
Frank Warmerdam 846e7595c9 added Peter Smith. 2000-01-28 21:54:38 +00:00
Frank Warmerdam c84e290491 *** empty log message *** 2000-01-28 21:49:11 +00:00
Frank Warmerdam c5d306fadd added USE_64BIT_API option 2000-01-28 21:46:30 +00:00
Frank Warmerdam d5ad7d65b0 don't use // comments! 2000-01-28 21:46:21 +00:00
Frank Warmerdam d9fbb1bc81 Applied changes for seek allowing 2-4GB seeks. 2000-01-28 21:42:48 +00:00
Frank Warmerdam 592e7e59db *** empty log message *** 2000-01-28 21:30:37 +00:00
Frank Warmerdam d8dfb6780a avoid warnings on IRIX 2000-01-28 21:18:16 +00:00
Frank Warmerdam cb60accd68 make toff_t unsigned 2000-01-28 21:09:02 +00:00
Frank Warmerdam 11242afaf2 clarified some toff_t/tsize_t casting problems 2000-01-28 20:59:06 +00:00
Frank Warmerdam 0ee7c405e7 fix ReadOK macro to avoid casting warnings 2000-01-28 20:56:59 +00:00
Frank Warmerdam aa665f0147 Avoid warning on SGI compiler. 2000-01-28 18:46:41 +00:00
Frank Warmerdam 84fcd603b4 fixed typo 2000-01-28 15:42:52 +00:00
Frank Warmerdam f1abd940f4 Avoid warnings on Windows. 2000-01-28 15:42:25 +00:00
Frank Warmerdam 9675085aa5 return zero from TIFFCreateDirectory(). 2000-01-28 15:40:00 +00:00
Frank Warmerdam aca9e32b0a pass TIFF handle instead of filename to overview builder 2000-01-28 15:36:38 +00:00
Frank Warmerdam 164da391dd *** empty log message *** 2000-01-28 15:15:46 +00:00
Frank Warmerdam bd4b07a6e5 Set tif_rawdatasize to zero when freeing raw data buf in WriteDirectory 2000-01-28 15:14:50 +00:00
Frank Warmerdam 4095f411c9 added TIFFCreateDirectory 2000-01-28 15:12:17 +00:00
Frank Warmerdam dbf2339a11 BUFFERCHECK will setup the buffer if rawdata is NULL, even if the buffer
setup flag is set.  TIFFWriteCheck() is now public.
2000-01-28 15:10:34 +00:00
Frank Warmerdam a3886b8325 added writecheck/createdirectory 2000-01-28 15:09:12 +00:00
Frank Warmerdam 1adbb8e3e0 added assertion 2000-01-28 15:08:10 +00:00
Frank Warmerdam 08aef247c5 renamed source files - all C 2000-01-28 15:06:42 +00:00
Frank Warmerdam 9446e782ca source files renamed 2000-01-28 15:04:49 +00:00
Frank Warmerdam fb8149ec52 New 2000-01-28 15:03:32 +00:00
Frank Warmerdam eaad74ed60 obsolete 2000-01-28 15:02:10 +00:00
Frank Warmerdam db9e2d7536 *** empty log message *** 2000-01-05 17:36:34 +00:00
Frank Warmerdam aa54dffc6b export the TIFFmemory(3t) functions. 2000-01-05 17:35:17 +00:00
Frank Warmerdam ba2c4a8d2a Added clean target. 2000-01-05 03:13:58 +00:00
Frank Warmerdam 2e0c71f21c *** empty log message *** 2000-01-04 18:37:42 +00:00
Frank Warmerdam b70fc8bd28 Added libtiff.def to distribution TIFFFILES list. 2000-01-04 18:37:17 +00:00
Mike Welles c38ac53b1d Created lzw compression kit, as a new module (libtiff-lzw-compression-kit).
Altered descriptions in tools to reflect "by default" lzw not supported

Updated index.html to note lzw compression kit.
1999-12-27 17:35:01 +00:00
Mike Welles 509dbd236a Bad link 1999-12-21 21:37:25 +00:00
Mike Welles 4c80ff94c9 Added final bits for 3.5.4 release, fixed some versioning stuff 1999-12-21 21:09:04 +00:00
Frank Warmerdam db55f695d7 *** empty log message *** 1999-12-21 19:02:35 +00:00
Frank Warmerdam b8b475c16f Added fax3sm_winnt.c. 1999-12-21 18:59:45 +00:00
Mike Welles da558ffbe4 * Aadded Pixar tag support.
Contributed by Phil Beffery <phil@pixar.com>
	* Made one more change to tif_dir.c for removal of LZW compression.
	  Also added notice when LZW compression invoked.
	* Changed default compression in tools to TIFF_PACKBITS, and changed
	  usage description in tools to reflect removal of LZW compression
1999-12-21 17:03:03 +00:00
Mike Welles c614caf006 Forgot to note one change:
* added nostrip to install in tools/Makefile.in so that debugging
	  symbols are kept.
1999-12-20 23:49:39 +00:00
Mike Welles 1c0961757f * Fixed bug that caused LZW (non) compression to segfault. Added
warning about LZW compression removed being removed, and why.
1999-12-20 23:46:11 +00:00
Mike Welles 00ac48bc74 Added patch from Ivo Penzar <ivo.penzar@infolink-software.com>,
supporting Adobe ZIP deflate.  Untested.
1999-12-07 17:11:38 +00:00
Frank Warmerdam e57f180622 *** empty log message *** 1999-12-04 20:48:59 +00:00
Frank Warmerdam 05f6519dba Made PACKBITS the default compression instead of LZW. 1999-12-04 20:48:27 +00:00
Mike Welles e533738405 really, this time is going to be the release 1999-11-30 21:20:15 +00:00
Mike Welles bd112089d4 upped alpha for DSO_SUFFIX 1999-11-30 19:56:27 +00:00
Frank Warmerdam ff08149c1c *** empty log message *** 1999-11-30 19:43:33 +00:00
Frank Warmerdam 7e6f6cdf15 Added tif_luv. 1999-11-30 19:42:34 +00:00
Mike Welles 7609ec5fbe pre-release commit 1999-11-30 19:37:40 +00:00
Mike Welles 0e4c746eab HTML of TIFFWriteTile man page 1999-11-30 18:54:46 +00:00
Frank Warmerdam c5e8a0497a *** empty log message *** 1999-11-30 14:22:37 +00:00
Frank Warmerdam b1ddede4f2 Added REWRITE_HACK code to support rewriting existing fixed size
(uncompressed) tiles and strips.  Note that REWRITE_HACK is not
defined by default.
1999-11-30 14:21:01 +00:00
Frank Warmerdam 64158b2da6 *** empty log message *** 1999-11-29 16:45:23 +00:00
Frank Warmerdam 0964b799c6 Added TIFFWriteTile.3t. 1999-11-29 16:43:31 +00:00
Frank Warmerdam 71609d81eb added TIFFWriteTile.3t 1999-11-29 16:42:44 +00:00
Frank Warmerdam 59c8847394 New 1999-11-29 16:42:31 +00:00
Frank Warmerdam 209aa3d3f5 *** empty log message *** 1999-11-29 01:38:29 +00:00
Frank Warmerdam a5b30fd588 Fixed typo in subscription address. 1999-11-29 01:36:16 +00:00
Frank Warmerdam 91eb1e2db6 Added a few notes for building on Windows. 1999-11-29 01:31:45 +00:00
Mike Welles 9ec07df122 * Fixed apocalypse-inducing y2k bug in contrib/ras/ras2tiff.c
*  Did some casts cleaning up to reduce compiler warnings in tif_fax3.c,
	   from Bruce Carmeron <cameron@petris.com> -- modifications of
	   changes made by Frank (sun cc still complained on cast).

	*  Added tiffconf.h to install target per request from Bill
	   Radcliffe <billr@corbis.com>: "We need a way for ImageMagick to
 	   know features have been compiled into the TIFF library in order to
	   handle things properly".
1999-11-28 20:15:36 +00:00
Frank Warmerdam 29e8a99543 added entry. 1999-11-27 21:51:45 +00:00
Frank Warmerdam 16424c5824 avoid format mismatch warnings 1999-11-27 21:50:41 +00:00
Frank Warmerdam f4e0403120 added /W3 1999-11-27 21:48:57 +00:00
Frank Warmerdam ef4b14a2ee Avoid type casting warnings on vc++. 1999-11-27 21:48:25 +00:00
Frank Warmerdam 7fc2adba8d avoid warnings, add borland pragma 1999-11-27 21:43:59 +00:00
Frank Warmerdam 95d5340e48 avoid warnings 1999-11-27 21:43:28 +00:00
Frank Warmerdam 0645471266 added casting to avoid warnings 1999-11-27 21:40:53 +00:00
Frank Warmerdam b89d250937 Avoid type casting warnings. 1999-11-27 21:35:19 +00:00
Frank Warmerdam 094714135e Undefine FAR to avoid jpeg conflict. 1999-11-27 21:33:38 +00:00
Frank Warmerdam 184b6cd155 Avoid some VC warnings. 1999-11-27 21:32:10 +00:00
Frank Warmerdam 9f1357f465 Avoid some type casting warnings. 1999-11-27 21:23:42 +00:00
Frank Warmerdam e1a3208884 Avoid various type casting warnings. 1999-11-27 21:12:49 +00:00
Frank Warmerdam 6f17bbe7df Avoid type casting warnings, mostly signed/unsigned things. 1999-11-27 21:07:53 +00:00
Frank Warmerdam 634ddce3b9 Avoid warnings on gcc -Wall agin. 1999-11-27 20:11:36 +00:00
Frank Warmerdam 187d307736 fix warnings for VC++, may have lost some of gcc fixes 1999-11-27 20:07:39 +00:00
Frank Warmerdam ee8b4b4b71 avoid type casting warning 1999-11-27 20:03:47 +00:00
Frank Warmerdam 2495d546e8 Avoid type casting warning. 1999-11-27 20:01:23 +00:00
Frank Warmerdam 9e63b00026 . 1999-11-24 17:10:26 +00:00
Frank Warmerdam f5604424f3 Modified TIFFIsByteSwapped() help to not imply that application code
is normally responsible for byte swapping image data.
1999-11-24 17:08:30 +00:00
Mike Welles e0f4e7b592 Stupid mistake on index.html 1999-11-23 04:44:00 +00:00
Mike Welles 43f65d1158 Added html-ized man pages, removed (*blush*) emacs backup of said.
Updated html/index.html to link to them.
1999-11-23 04:38:13 +00:00
Mike Welles e49fae91fb Man pages to html 1999-11-23 04:29:23 +00:00
Mike Welles e7f4c35245 index.html modified some time ago. Important change: lzw compression
removed to comply with Unisys patent extortion.
1999-11-22 22:47:24 +00:00
Mike Welles 321680e4e4 fixed links to Adobe. 1999-10-05 01:01:23 +00:00
Mike Welles a9b4777def Patches from Ivo Penzar<ivo.penzar@infolink-software.com>
Bugfix for large faxes in tif_dir.c, addition of code for
Tiff_AllocateDirectory to handle memory mapped files.
1999-09-29 16:09:59 +00:00
Mike Welles 8883ce4e1c release fixing.. 1999-09-28 17:22:20 +00:00
Frank Warmerdam 455fec99c8 added files 1999-09-28 12:21:09 +00:00
Mike Welles 313cba3b6d typo 1999-09-27 01:45:38 +00:00
Mike Welles 38efa385f6 typo 1999-09-26 23:16:03 +00:00
Mike Welles 58db23364e * Corrected alpha versioning.
* Removed distinction between  alpha and release targets in Makefile.in.

	* added release.stamp target, which tags cvs tree, and updates
	  "RELEASE-DATE"

	* added releasediff target, which diffs tree with source as of
	  date in "RELEASE-DATE"

	* Ticked up version to 3.5.2 (alpha 01 -- but I think we'll moving
	  away from alpha/non-alpha distinctions).

	* updated html to reflect release
1999-09-26 22:03:46 +00:00
Frank Warmerdam 5799a2d59d set O_BINARY in open(), for Cygwin for instance. 1999-09-24 03:05:12 +00:00
Frank Warmerdam cdb12ac271 *** empty log message *** 1999-09-24 03:04:41 +00:00
Frank Warmerdam 67bb385a58 *** empty log message *** 1999-09-24 02:45:39 +00:00
Frank Warmerdam 2fe8c84036 Added a Cygwin case. 1999-09-24 02:45:04 +00:00
Mike Welles 46301bebcf Applied Francois Dagand's patch to handle fax decompression bug.
(sizes >= 65536 were failing)
1999-09-17 04:08:59 +00:00
Frank Warmerdam 478d079ae1 . 1999-09-15 01:35:46 +00:00
Frank Warmerdam 06656a52c1 Changed to use OPEN_ALWAYS in TIFFOpen() for O_RDWR|O_CREAT (mode "a"). 1999-09-15 01:28:47 +00:00
Frank Warmerdam f0abbb0d11 avoid assignment within test warning 1999-09-08 19:09:35 +00:00
Frank Warmerdam dda696d021 avoid various warnings with gcc -Wall 1999-09-08 19:07:02 +00:00
Frank Warmerdam e1b355daf3 Use CXX instead of CPPC for C++ compiler 1999-09-08 12:48:39 +00:00
Frank Warmerdam e6e37100e8 . 1999-09-08 12:41:54 +00:00
Frank Warmerdam 7b444e8a1a added IRIX/gcc support c/o Albert Chin-A-Young <china@thewrittenword.com> 1999-09-08 12:40:31 +00:00
Frank Warmerdam 6ab26a4daf Added patches for IRIX/gcc and OSF/1 4.x suggested by
Albert Chin-A-Young <china@thewrittenword.com>.
1999-09-08 12:32:18 +00:00
Frank Warmerdam f48df3f412 . 1999-09-08 12:23:25 +00:00
Frank Warmerdam ba9f0c9cca added tag ignore API for Bruce Cameron <cameron@petris.com> 1999-09-08 12:21:13 +00:00
Mike Welles 8deaff17c2 added mailling list information to index.html, added IPTC inforamtion to libtiff man page. 1999-09-06 15:25:10 +00:00
Frank Warmerdam 6f703bd090 *** empty log message *** 1999-08-25 19:37:24 +00:00
Frank Warmerdam e59d453b60 added test target 1999-08-25 19:34:25 +00:00
Frank Warmerdam d204aa6cde New 1999-08-25 19:34:13 +00:00
Mike Welles bf41775d96 Cosmetic changes 1999-08-25 17:43:19 +00:00
Frank Warmerdam e3585a7dd6 *** empty log message *** 1999-08-25 15:42:21 +00:00
Frank Warmerdam d351cfd776 Removed -ansi, added -lm. 1999-08-25 15:41:49 +00:00
Frank Warmerdam feefa18eaa New 1999-08-25 15:33:39 +00:00
Mike Welles 100b4340b4 Updated link to TIFF spec 1999-08-19 16:01:08 +00:00
Frank Warmerdam 6a661313c1 Applied TIFFWriteNormalTag() patch from Martin McBride for BYTE tags. 1999-08-18 12:38:55 +00:00
Frank Warmerdam 23f6dabba3 Added note on windows porting. 1999-08-17 03:09:42 +00:00
Frank Warmerdam 46d57b4b44 New 1999-08-17 03:07:50 +00:00
Frank Warmerdam 0c05326424 Modified to compile on Windows. 1999-08-17 03:07:43 +00:00
Frank Warmerdam 913384e4c2 Added comments. 1999-08-17 03:06:56 +00:00
Frank Warmerdam 7024aadfd5 Added TIF_PLATFORM_CONSOLE flag to avoid use of windowing api 1999-08-17 02:48:10 +00:00
Frank Warmerdam cdd4d65332 New 1999-08-17 02:47:13 +00:00
Frank Warmerdam 8ecb50d450 Added note on addtiffo. 1999-08-17 01:49:19 +00:00
Frank Warmerdam 60b7ce76c7 New 1999-08-17 01:47:59 +00:00
Frank Warmerdam bba08e8ce2 added TIFFReadRGBATile/Strip 1999-08-16 18:45:52 +00:00
Mike Welles ca28ce6431 Correct anon cvs login information 1999-08-16 18:38:48 +00:00
Frank Warmerdam 7e006ac272 New 1999-08-16 18:37:40 +00:00
Frank Warmerdam 8c87537082 tiffcp.c 1999-08-16 18:27:51 +00:00
Frank Warmerdam ef0bad9eae added tiff2rgba 1999-08-16 18:26:37 +00:00
Mike Welles 469f9d6b92 added anon cvs access instructions 1999-08-16 18:16:32 +00:00
Frank Warmerdam 8b9ba14434 Added a few more entries. 1999-08-16 18:01:39 +00:00
Frank Warmerdam d7d4ec8f3d erase old .so soft link before making a newone in LINUXdso 1999-08-16 17:57:40 +00:00
Frank Warmerdam babc83e785 New 1999-08-16 17:46:08 +00:00
Frank Warmerdam d6b02e26e5 added ReadRGBAStrip/Tile support 1999-08-16 17:43:03 +00:00
Frank Warmerdam 3a83011dfd Added TIFFReadRGBATile() / TIFFReadRGBAStrip() functions.
Make local copy of colormaps.  Previously when 8bit colormaps were
fixed up to 16bit depth, the copy of the data held by the TIFF
structure was modified causing problems in other places.
1999-08-16 17:40:52 +00:00
Frank Warmerdam 22abb1e08a added see also links for Strip/Tile oriented access 1999-08-16 17:29:55 +00:00
Frank Warmerdam 397e9f3a5c New 1999-08-16 17:16:05 +00:00
Frank Warmerdam 094fa16625 test 1999-08-16 17:09:27 +00:00
Mike Welles 152b9721f6 Minor maintenance 1999-08-16 16:47:04 +00:00
Mike Welles 9d706da70d tweak tweak tweak 1999-08-13 19:30:57 +00:00
Mike Welles dcb0555637 Typos! 1999-08-09 20:21:20 +00:00
Mike Welles 87ccea7ec7 fonts 1999-08-09 20:16:59 +00:00
Mike Welles a446e86142 fonts fonts fonts 1999-08-09 20:14:19 +00:00
Mike Welles c3d5a8a68a Minor changes 1999-08-09 19:47:34 +00:00
Mike Welles c311530918 Straightening out typos 1999-08-09 19:37:46 +00:00
Mike Welles a373b17a98 renamed 1999-08-09 18:47:18 +00:00
Mike Welles b751b3a58a Last bits of cleanup before release. 1999-08-09 18:38:26 +00:00
Mike Welles 9a04e3ea89 Removed reference to PostScript version becoming available. 1999-07-27 22:00:42 +00:00
Mike Welles 49646c9cae kfixed an unclosed tag
fixed a bad
1999-07-27 21:56:48 +00:00
Mike Welles 0ef31e1f62 Initial revision 1999-07-27 21:50:26 +00:00
757 changed files with 160991 additions and 44025 deletions

No files matched your search

+109
View File
@@ -0,0 +1,109 @@
# Operating system (build VM template)
image:
- "Visual Studio 2022"
- "Visual Studio 2019"
platform: x64
configuration:
- Release
- Debug
environment:
AV_PROJECTS: 'c:\projects'
AV_TIFF_DOWNLOAD: 'c:\projects\download'
AV_TIFF_SOURCE: 'c:\projects\libtiff'
AV_TIFF_BUILD: 'c:\projects\build'
AV_TIFF_INSTALL: 'c:\projects\install'
matrix:
- compiler: vc-cmake
- compiler: cygwin-cmake
- compiler: mingw-cmake
matrix:
exclude:
- image: "Visual Studio 2019"
compiler: cygwin-cmake
configuration: Release
- image: "Visual Studio 2019"
compiler: cygwin-cmake
configuration: Debug
- image: "Visual Studio 2019"
compiler: mingw-cmake
configuration: Release
- image: "Visual Studio 2019"
compiler: mingw-cmake
configuration: Debug
cache:
#- 'c:\projects\download -> appveyor.yml'
# Clone directory
clone_folder: 'c:\projects\libtiff'
clone_depth: 5
init:
- git config --global core.autocrlf input
before_build:
- 'if %compiler%==vc-cmake if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2022" set "generator=Visual Studio 17 2022"'
- 'if %compiler%==vc-cmake if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" set "generator=Visual Studio 16 2019"'
- 'if %compiler%==cygwin-cmake set "generator=Unix Makefiles"'
- 'if %compiler%==mingw-cmake set "generator=Ninja"'
- 'if %Configuration%==Release set "shared=ON"'
- 'if %Configuration%==Debug set "shared=OFF"'
- 'if %compiler%==vc-cmake if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2022" set "arch=x64"'
- 'if %compiler%==vc-cmake if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" set "arch=Win32"'
- 'FOR /F "tokens=* USEBACKQ" %%F IN (`C:\cygwin64\bin\cygpath -u %AV_TIFF_SOURCE%`) DO SET AV_TIFF_CYG_SOURCE=%%F'
- 'FOR /F "tokens=* USEBACKQ" %%F IN (`C:\cygwin64\bin\cygpath -u %AV_TIFF_INSTALL%`) DO SET AV_TIFF_CYG_INSTALL=%%F'
- 'if %compiler%==cygwin-cmake C:\cygwin64\setup-x86_64 -q -R C:\cygwin64 -s http://cygwin.mirror.constant.com -l %AV_TIFF_DOWNLOAD%\cygwin -g -P cmake,libjpeg-devel,zlib-devel'
- 'if %compiler%==cygwin-cmake set "PATH=C:\cygwin64\bin;%PATH%"'
- 'if %compiler%==cygwin-cmake cygpath --version || echo cygpath not found'
- 'if %compiler%==cygwin-cmake cmake --version || echo CMake not found'
- set "AV_CMAKE_ARGS=-DBUILD_SHARED_LIBS:BOOL=%shared%"
- 'if %compiler%==cygwin-cmake set "AV_CMAKE_ARGS=%AV_CMAKE_ARGS% -Dfatal-warnings=ON"'
- 'if %compiler%==mingw-cmake set "AV_CMAKE_ARGS=%AV_CMAKE_ARGS% -Dfatal-warnings=ON"'
- set "AV_TIFF_CMAKE_SOURCE=%AV_TIFF_SOURCE%"
- set "AV_TIFF_CMAKE_INSTALL=%AV_TIFF_INSTALL%"
- 'if %compiler%==cygwin-cmake set "AV_TIFF_CMAKE_SOURCE=%AV_TIFF_CYG_SOURCE%'
- 'if %compiler%==cygwin-cmake set "AV_TIFF_CMAKE_INSTALL=%AV_TIFF_CYG_INSTALL%'
- 'if %compiler%==mingw-cmake C:\msys64\usr\bin\bash -lc "pacman -Syuu --noconfirm"'
- 'if %compiler%==mingw-cmake C:\msys64\usr\bin\bash -lc "pacman -Syuu --noconfirm"'
- 'if %compiler%==mingw-cmake C:\msys64\usr\bin\bash -lc "pacman -S --needed --noconfirm mingw-w64-ucrt-x86_64-{toolchain,cmake,ninja,zlib,libjpeg-turbo}"'
- 'if %compiler%==mingw-cmake set "PATH=C:\msys64\ucrt64\bin;C:\msys64\usr\bin;%PATH%"'
- mkdir %AV_TIFF_BUILD%
- cd %AV_TIFF_BUILD%
- set
- echo Running cmake -G "%generator%" -DCMAKE_INSTALL_PREFIX=%AV_TIFF_CMAKE_INSTALL% -DCMAKE_BUILD_TYPE=%configuration% %AV_TIFF_CMAKE_SOURCE%
# Disable doc building because of 'Could not import extension sphinxcontrib.applehelp (exception: No module named 'sphinxcontrib.applehelp')'
- 'if %compiler%==cygwin-cmake bash -c "cmake -G \"%generator%\" -DCMAKE_INSTALL_PREFIX:PATH=%AV_TIFF_CMAKE_INSTALL% -DCMAKE_BUILD_TYPE=%configuration% %AV_CMAKE_ARGS% %AV_TIFF_CMAKE_SOURCE% -Dtiff-docs=off"'
- 'if %compiler%==mingw-cmake cmake -G "%generator%" -DCMAKE_INSTALL_PREFIX:PATH=%AV_TIFF_CMAKE_INSTALL% -DCMAKE_BUILD_TYPE=%configuration% %AV_CMAKE_ARGS% %AV_TIFF_CMAKE_SOURCE%'
- 'if %compiler%==vc-cmake cmake -G "%generator%" -A %arch% -DCMAKE_INSTALL_PREFIX:PATH=%AV_TIFF_CMAKE_INSTALL% -DCMAKE_BUILD_TYPE=%configuration% %AV_CMAKE_ARGS% %AV_TIFF_CMAKE_SOURCE%'
build_script:
- cd %AV_TIFF_BUILD%
- 'if %compiler%==cygwin-cmake bash -c "cmake --build . --config %configuration% --target install"'
- 'if %compiler%==mingw-cmake cmake --build . --config %configuration% --target install'
- 'if %compiler%==vc-cmake cmake --build . --config %configuration% --target install'
# scripts to run after build
after_build:
- cd %AV_TIFF_BUILD%
- '7z a %AV_TIFF_SOURCE%\libtiff-build.zip * -tzip'
- cd %AV_TIFF_INSTALL%
- '7z a %AV_TIFF_SOURCE%\libtiff.zip * -tzip'
before_test:
- cd %AV_TIFF_BUILD%
- 'if %compiler%==cygwin-cmake bash -c "ctest -V -C %configuration%"'
- 'if %compiler%==mingw-cmake ctest -V -C %configuration%'
- 'if %compiler%==vc-cmake ctest -V -C %configuration%'
# AppVeyor don't yet have a configurable retention policy, so this will
# eventually use up all the storage allowance.
#artifacts:
# - path: libtiff.zip
# name: libtiff.zip
# - path: libtiff-build.zip
# name: libtiff-build.zip
+6
View File
@@ -0,0 +1,6 @@
---
BasedOnStyle: llvm
IndentWidth: 4
ColumnLimit: 80
BreakBeforeBraces: Allman
IndentCaseLabels: true
+4
View File
@@ -0,0 +1,4 @@
42173d6ace476b5228d866640b5355f74e5a108d
b0ae5d7071890160da67d2e833d84a400e0406d0
dee020782c17c1388ca5774f9904d318b51b288b
aee0113f5ec1fd39b97458539bd79a1447425ac4
+82
View File
@@ -0,0 +1,82 @@
aclocal.m4
autom4te.cache
configure
Makefile.in
config/compile
config/config.guess
config/config.h
config/config.h.in
config/config.sub
config/depcomp
config/install-sh
config/ltmain.sh
config/missing
config/mkinstalldirs
config/test-driver
**/Makefile
*.o
*.la
*.lo
.deps
.libs
config.log
config.status
contrib/addtiffo/addtiffo
contrib/dbs/tiff-bi
contrib/dbs/tiff-grayscale
contrib/dbs/tiff-palette
contrib/dbs/tiff-rgb
contrib/iptcutil/iptcutil
libtiff-4.pc
libtiff/mkg3states
libtiff/stamp-h1
libtiff/stamp-h2
libtiff/tif_config.h
libtiff/tiffconf.h
libtool
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
tools/fax2ps
tools/fax2tiff
tools/pal2rgb
tools/ppm2tiff
tools/raw2tiff
tools/rgb2ycbcr
tools/thumbnail
tools/tiff2bw
tools/tiff2pdf
tools/tiff2ps
tools/tiff2rgba
tools/tiffcmp
tools/tiffcp
tools/tiffcrop
tools/tiffdither
tools/tiffdump
tools/tiffgt
tools/tiffinfo
tools/tiffmedian
tools/tiffset
tools/tiffsplit
test/ascii_tag
test/custom_dir
test/long_tag
test/raw_decode
test/rewrite
test/short_tag
test/strip_rw
test/defer_strile_loading
test/defer_strile_writing
test/testtypes
test/custom_dir_EXIF_231
test/rational_precision2double
test/*.log
test/*.trs
test/o-*
*~
.idea
.vs
cmake-build*
build*
+68
View File
@@ -0,0 +1,68 @@
image: registry.gitlab.com/libtiff/libtiff-ci-ubuntu24.04:latest
stages:
- build
- static-analysis
- pages
autoconf-current:
stage: build
script:
- sh build/gitlab-ci autoconf
after_script:
- 'cat autoconf-build/test/test-suite.log'
artifacts:
name: distribution
paths:
- distribution
autoconf-old:
stage: build
image: registry.gitlab.com/libtiff/libtiff-ci-ubuntu22.04:latest
script:
- sh build/gitlab-ci autoconf-minimal
after_script:
- 'cat autoconf-build/test/test-suite.log'
cmake-makefiles-current:
stage: build
script:
- sh build/gitlab-ci cmake "Unix Makefiles" Release
cmake-makefiles-current-static:
stage: build
script:
- sh build/gitlab-ci cmake "Unix Makefiles" Release static
cmake-ninja-current:
stage: build
script:
- sh build/gitlab-ci cmake "Ninja" Debug
cmake-makefiles-old:
stage: build
image: registry.gitlab.com/libtiff/libtiff-ci-ubuntu22.04:latest
script:
- sh build/gitlab-ci cmake "Unix Makefiles" Release
coverity:
stage: static-analysis
image: registry.gitlab.com/libtiff/libtiff-ci-ubuntu24.04-coverity:latest
script:
- sh build/gitlab-ci coverity "Ninja" Debug
only:
refs:
- master
pages:
stage: pages
script:
- sh build/gitlab-ci cmake "Ninja" Debug
- cp -r cmake-install/share/doc/tiff/manual/html public
artifacts:
name: $CI_PROJECT_NAME-$CI_JOB_NAME
paths:
- public
only:
- master
+22
View File
@@ -0,0 +1,22 @@
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v15.0.4'
hooks:
- id: clang-format
# tif_fax3sm.c is a generated file
# tiffvers.h as well, and its formatting is sensitive for
# FindTIFF.cmake to detect the version number
# Furthermore, the .in files are formatting sensitive for
# cmake functions.
exclude: >
(?x)^(
libtiff/tif_fax3sm.c|
libtiff/tiffvers.h|
libtiff/tiffvers.h.in|
libtiff/tif_config.h|
libtiff/tif_config.h.in|
libtiff/tif_config.h.cmake.in|
libtiff/tiffconf.h|
libtiff/tiffconf.h.in|
libtiff/tiffconf.h.cmake.in
)
+232
View File
@@ -0,0 +1,232 @@
# CMake build for libtiff
# Run "cmake" to generate the build files for your platform
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
cmake_minimum_required(VERSION 3.9.0)
# Default policy is from 3.9.0
cmake_policy(VERSION 3.9.0)
# Find CMake modules in cmake/
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
# Read version information from configure.ac.
include(AutotoolsVersion)
message(STATUS "Building tiff version ${LIBTIFF_VERSION_FULL}")
# Project definition
set(CMAKE_C_STANDARD 99)
project(tiff
VERSION "${LIBTIFF_VERSION}"
LANGUAGES C CXX)
if(NOT CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
# libtiff is being included as a subproject of some other project.
set(TIFF_INSTALL_DEFAULT OFF)
else()
set(TIFF_INSTALL_DEFAULT ON)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
endif()
option(tiff-tools "build TIFF tools" ON)
option(tiff-tests "build TIFF tests" ON)
option(tiff-contrib "build TIFF contrib" ON)
option(tiff-docs "build TIFF documentation" ON)
option(tiff-deprecated "build TIFF deprecated features" OFF)
option(tiff-install "install TIFF targets" ${TIFF_INSTALL_DEFAULT})
# Disable deprecated features to ensure clean build
if (tiff-deprecated)
add_definitions(-DTIFF_DISABLE_DEPRECATED)
endif()
# Autotools compatibility
include(AutotoolsCompat)
# Compiler checks (warning flags, etc.)
include(CompilerChecks)
# Linker checks (version script, etc.)
include(LinkerChecks)
# Processor checks (endianness, fill order, floating point, etc.)
include(ProcessorChecks)
# Checks for headers
include(IncludeChecks)
# Checks for functions and other symbols
include(SymbolChecks)
# Standard installation paths
include(GNUInstallDirs)
# Documentation install directory (default to cmake project docdir)
set(LIBTIFF_DOCDIR "${CMAKE_INSTALL_DOCDIR}")
# CTest testing
enable_testing()
# Checks for type presence and size
include(TypeSizeChecks)
# Check for POSIX Large File Support (LFS)
include(LargeFileSupport)
# Options for internal codec support
include(InternalCodecs)
# Check for Deflate codec
include(DeflateCodec)
# Check for PixarLog codec
include(PixarLogCodec)
# Check for JPEG codec
include(JPEGCodec)
# Check for JBIG codec
include(JBIGCodec)
# Check for LERC codec
include(LERCCodec)
# Check for LZMA codec
include(LZMACodec)
# Check for ZSTD codec
include(ZSTDCodec)
# Check for WebP codec
include(WebPCodec)
# Option for C++ libtiffxx library
include(CXXLibrary)
# Checks for OpenGL support
include(OpenGLChecks)
# Windows support
include(WindowsSupport)
# Orthogonal features
include(LibraryFeatures)
# math.h/libm portability
find_package(CMath REQUIRED)
# Release support
include(Release)
# Process subdirectories
add_subdirectory(port)
add_subdirectory(libtiff)
if(tiff-tools)
add_subdirectory(tools)
endif()
if(tiff-tests)
add_subdirectory(test)
endif()
if(tiff-contrib)
add_subdirectory(contrib)
endif()
add_subdirectory(build)
if(tiff-docs)
add_subdirectory(doc)
endif()
# pkg-config support
include(PkgConfig)
message(STATUS "")
message(STATUS "Libtiff is now configured for ${CMAKE_SYSTEM}")
message(STATUS "")
if (NOT LIBTIFF_RELEASE_VERSION STREQUAL LIBTIFF_VERSION_FULL)
message(STATUS " Libtiff release version ${LIBTIFF_RELEASE_VERSION} is not equal to build version!")
endif()
message(STATUS " Libtiff build version: ${LIBTIFF_VERSION_FULL}")
message(STATUS " Libtiff library version: ${SO_VERSION}")
message(STATUS " Libtiff release date: ${LIBTIFF_RELEASE_DATE}")
message(STATUS "")
message(STATUS " Installation directory: ${prefix}")
message(STATUS " Documentation directory: ${LIBTIFF_DOCDIR}")
message(STATUS " C compiler: ${CMAKE_C_COMPILER}")
message(STATUS " C++ compiler: ${CMAKE_CXX_COMPILER}")
message(STATUS " Build shared libraries: ${BUILD_SHARED_LIBS}")
message(STATUS " Build tools: ${tiff-tools}")
message(STATUS " Build tests: ${tiff-tests}")
message(STATUS " Build contrib: ${tiff-contrib}")
message(STATUS " Build docs: ${tiff-docs}")
message(STATUS " Build deprecated features: ${tiff-deprecated}")
message(STATUS " Enable linker symbol versioning: ${HAVE_LD_VERSION_SCRIPT}")
message(STATUS " Support Microsoft Document Imaging: ${mdi}")
message(STATUS " Use win32 IO: ${USE_WIN32_FILEIO}")
message(STATUS "")
message(STATUS " Support for internal codecs:")
message(STATUS " CCITT Group 3 & 4 algorithms: ${ccitt}")
message(STATUS " Macintosh PackBits algorithm: ${packbits}")
message(STATUS " LZW algorithm: ${lzw}")
message(STATUS " ThunderScan 4-bit RLE algorithm: ${thunder}")
message(STATUS " NeXT 2-bit RLE algorithm: ${next}")
message(STATUS " LogLuv high dynamic range encoding: ${logluv}")
message(STATUS "")
message(STATUS " Support for external codecs:")
message(STATUS " ZLIB support: Requested:${zlib} Availability:${ZLIB_FOUND} Support:${ZLIB_SUPPORT}")
if(ZLIB_SUPPORT)
message(STATUS " libdeflate support: Requested:${libdeflate} Availability:${DEFLATE_FOUND} Support:${LIBDEFLATE_SUPPORT}")
else()
message(STATUS " libdeflate support: Requested:${libdeflate} Availability:${DEFLATE_FOUND} Support:${LIBDEFLATE_SUPPORT} (Depends on ZLIB Support)")
endif()
if(ZLIB_SUPPORT)
message(STATUS " Pixar log-format algorithm: Requested:${pixarlog} Availability:${ZLIB_FOUND} Support:${PIXARLOG_SUPPORT}")
else()
message(STATUS " Pixar log-format algorithm: Requested:${pixarlog} Availability:${ZLIB_FOUND} Support:${PIXARLOG_SUPPORT} (Depends on ZLIB Support)")
endif()
message(STATUS " JPEG support: Requested:${jpeg} Availability:${JPEG_FOUND} Support:${JPEG_SUPPORT}")
if(JPEG_SUPPORT)
message(STATUS " Old JPEG support: Requested:${old-jpeg} Availability:${JPEG_SUPPORT} Support:${OJPEG_SUPPORT}")
else()
message(STATUS " Old JPEG support: Requested:${old-jpeg} Availability:${JPEG_SUPPORT} Support:${OJPEG_SUPPORT} (Depends on JPEG Support)")
endif()
if(JPEG_SUPPORT AND HAVE_JPEGTURBO_DUAL_MODE_8_12)
message(STATUS " JPEG 8/12 bit dual mode: Support: yes (libjpeg turbo >= 3.0 dual mode)")
else()
message(STATUS " JPEG 8/12 bit dual mode: Requested:${jpeg12} Availability:${JPEG12_FOUND} Support:${JPEG_DUAL_MODE_8_12}")
endif()
message(STATUS " ISO JBIG support: Requested:${jbig} Availability:${JBIG_FOUND} Support:${JBIG_SUPPORT}")
if(ZLIB_SUPPORT)
message(STATUS " LERC support: Requested:${lerc} Availability:${LERC_FOUND} Support:${LERC_SUPPORT}")
else()
message(STATUS " LERC support: Requested:${lerc} Availability:${LERC_FOUND} Support:${LERC_SUPPORT} (Depends on ZLIB Support)")
endif()
message(STATUS " LZMA2 support: Requested:${lzma} Availability:${liblzma_FOUND} Support:${LZMA_SUPPORT}")
message(STATUS " ZSTD support: Requested:${zstd} Availability:${ZSTD_USABLE} Support:${ZSTD_SUPPORT}")
message(STATUS " WEBP support: Requested:${webp} Availability:${WebP_FOUND} Support:${WEBP_SUPPORT}")
message(STATUS "")
message(STATUS " C++ support: ${cxx} (requested) ${CXX_SUPPORT} (availability)")
message(STATUS "")
# message(STATUS " X Athena Widgets support: ${HAVE_XAW}")
message(STATUS " OpenGL support: Requested:${tiff-opengl} Availability:${HAVE_OPENGL} Support:${OPENGL_SUPPORT}")
message(STATUS "")
+19
View File
@@ -0,0 +1,19 @@
Active Libtiff Committers
-------------------------
Frank Warmerdam (fwarmerdam): warmerdam@pobox.com
Andrey Kiselev (dron): dron@ak4719.spb.edu
Bob Friesenhahn (bfriesen): bfriesen@simple.dallas.tx.us
Joris Van Damme (joris): info@awaresystems.be
Lee Howard (faxguy): faxguy@howardsilvan.com
Olivier Paquet (olivier): olivier.paquet@gmail.com
Tom Lane (tgl): tgl@sss.pgh.pa.us
Even Rouault (erouault): even.rouault@spatialys.com
+19
View File
@@ -0,0 +1,19 @@
Contributing
------------
libtiff uses a ``.clang-format`` file to enforce code formatting rules.
Automatic code reformatting can be done with pre-commit.
Install (once) pre-commit with ``python -m pip install pre-commit``.
Install it (once) in the libtiff git repository with ``pre-commit install``.
Then the rules defined in the ``.pre-commit-config.yaml`` file will be
enforced at ``git commit`` time, with automatic reformatting.
Due to whole-tree code reformatting done during libtiff 4.5 development,
``git blame`` information might be misleading. To avoid that, you need
to modify your git configuration as following to ignore the revision of
the whole-tree reformatting:
``git config blame.ignoreRevsFile .git-blame-ignore-revs``.
+17406
View File
File diff suppressed because it is too large. Load diff
+155
View File
@@ -0,0 +1,155 @@
HOWTO-RELEASE:
Notes on releasing.
0. Make sure that you have current FSF releases of autoconf, automake,
and libtool packages installed under a common installation prefix
and that these tools are in your executable search path prior to
any other installed versions. Versions delivered with Linux may be
altered so it is best to install official FSF releases. GNU 'm4'
1.4.16 is needed in order to avoid bugs in m4. These packages may
be downloaded from the following ftp locations:
m4 - ftp://ftp.gnu.org/pub/gnu/m4
autoconf - ftp://ftp.gnu.org/pub/gnu/autoconf
automake - ftp://ftp.gnu.org/pub/gnu/automake
libtool - ftp://ftp.gnu.org/pub/gnu/libtool
It is recommended to install m4 before autoconf, since the later
requires the former.
Release builds should only be done on a system with a functioning
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.
2. Use gnulib's gitlog-to-changelog script to add new (since the last
release) entries to the traditional ChangeLog file.
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=build-aux/gitlog-to-changelog
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 doc/releases/vX.X.rst and add it to git with 'git add doc/releases/vX.X.rst'.
Update doc/releases/index.rst to point to the new file
Take ChangeLog entries and rst-ify in there.
Easist thing to do is take doc/releases/vX.(X-1).rst and use it as a template.
4. Add vX.X.rst file to the list of 'rst_sources' files in the doc/Makefile.am.
5. Update "Latest Stable Release" in doc/index.rst.
6. Increment the release version in configure.ac. Put 'alpha' or
'beta' after the version, if applicable. For example:
4.0.0
or
4.0.0beta7
Version should be updated in two places: in the second argument of the
AC_INIT macro and in LIBTIFF_xxx_VERSION variables.
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.
Note that as of libtiff 4.X, proper ELF versioning is used so
please follow the rules listed in configure.ac. At a bare minimum,
you should increment LIBTIFF_REVISION for each release so that
installed library files don't overwrite existing files. If APIs
have been added, removed, or interface structures have changed,
then more care is required.
8. Add an entry to Changelog similar to:
* libtiff 4.0.0 released.
9. In the source tree do
./autogen.sh
This step may be skipped if you have already been using a
maintainer build with current autoconf, automake, and libtool
packages. It is only needed when updating tool versions.
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:
mkdir libtiff-build
cd libtiff-build
/path/to/libtiff/configure --enable-maintainer-mode
otherwise do
./configure --enable-maintainer-mode
11. In the build tree do
make release
This will update "RELEASE-DATE", "VERSION" in the source tree,
and libtiff/tiffvers.h in the build tree.
12. In the source tree, verify that the version info in RELEASE-DATE,
VERSION is right.
In the build tree, verify that the version info in
libtiff/tiffvers.h is right.
13. In the build tree do
make
make distcheck
If 'make distcheck' fails, then correct any issues until it
succeeds.
Two files with names tiff-version.tar.gz and tiff-version.zip will
be created in the top level build directory.
14. In the source tree do
'git status', 'git add .', 'git commit' and 'git push'
15. In the source tree, create a signed tag
git tag -s v4.0.0 -m "Create tag for v4.0.0"
(or the appropriate name for the release)
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-*.tar.xz tiff-*.zip ; do \
gpg2 --output ${file}.sig --detach-sig $file ; \
done
for file in tiff-*.tar.gz tiff-*.tar.xz 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-*.tar.gz.sig tiff-*.tar.xz tiff-*.tar.xz.sig tiff-*.zip tiff-*.zip.sig \
bfriesen@upload.osgeo.org:/osgeo/download/libtiff
18. Create a gitlab release at https://gitlab.com/libtiff/libtiff/-/releases
19. Announce to list: tiff@lists.osgeo.org
+19
View File
@@ -0,0 +1,19 @@
LibTIFF Security Issue Handling
===============================
Libtiff can be a significant security risk as many tools use it to read
TIFF files which can come from hostile sources. Thus buffer overflows
and other security holes in libtiff put many users at risk. To that end
we try to deal with security problems fairly quickly and to provide advance
notice to various interested parties to role out security fixes before they
go out in a standard release.
This document is new and will presumably evolve.
1) The mailing list distros@vs.openwall.org can be used to notify folks
at various linux OS distributions as well as the BSD folks about problems
in libtiff. Make sure to prefix subject with [vs]. More info at:
http://oss-security.openwall.org/wiki/mailing-lists/distros
... to be continued ...
+4 -2
View File
@@ -1,5 +1,7 @@
Copyright (c) 1988-1995 Sam Leffler
Copyright (c) 1991-1995 Silicon Graphics, Inc.
# LibTIFF license
Copyright © 1988-1997 Sam Leffler\
Copyright © 1991-1997 Silicon Graphics, Inc.
Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee, provided
+94
View File
@@ -0,0 +1,94 @@
# Tag Image File Format (TIFF) Software
#
# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
#
# Permission to use, copy, modify, distribute, and sell this software and
# its documentation for any purpose is hereby granted without fee, provided
# that (i) the above copyright notices and this permission notice appear in
# all copies of the software and related documentation, and (ii) the names of
# Sam Leffler and Silicon Graphics may not be used in any advertising or
# publicity relating to the software without the specific, prior written
# permission of Sam Leffler and Silicon Graphics.
#
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# Process this file with automake to produce Makefile.in.
docdir = $(LIBTIFF_DOCDIR)
AUTOMAKE_OPTIONS = 1.11 dist-zip foreign
ACLOCAL_AMFLAGS = -I m4
docfiles = \
ChangeLog \
LICENSE.md \
README.md \
RELEASE-DATE \
TODO \
VERSION
EXTRA_DIST = \
placeholder.h \
cmake \
CMakeLists.txt \
HOWTO-RELEASE \
autogen.sh \
libtiff-4.pc.in
if TIFF_DOCS
dist_doc_DATA = $(docfiles)
endif
distcheck-hook:
if [ -x "$(CMAKE)" ]; then \
mkdir $(distdir)/_build/cmake \
&& cd $(distdir)/_build/cmake \
&& cmake -Dsphinx=OFF ../.. \
&& $(MAKE) \
&& ctest -V \
&& $(MAKE) DESTDIR=../../_inst/cmake install ; \
fi
rm -rf $(distdir)/_build/cmake
rm -rf $(distdir)/_inst/cmake
SUBDIRS = port libtiff tools build contrib test doc
NEW_LIBTIFF_RELEASE_DATE=$(shell date +"%Y%m%d")
release:
@(echo --- Setting release date to $(NEW_LIBTIFF_RELEASE_DATE) and release version to $(LIBTIFF_VERSION) ---)
(rm -f $(top_srcdir)/RELEASE-DATE && echo $(NEW_LIBTIFF_RELEASE_DATE) > $(top_srcdir)/RELEASE-DATE)
(rm -f $(top_srcdir)/VERSION && echo $(LIBTIFF_VERSION) > $(top_srcdir)/VERSION)
(rm -f $(top_builddir)/libtiff/tiffvers.h && sed 's,LIBTIFF_VERSION,$(LIBTIFF_VERSION),;s,LIBTIFF_RELEASE_DATE,$(NEW_LIBTIFF_RELEASE_DATE),;s,LIBTIFF_MAJOR_VERSION,$(LIBTIFF_MAJOR_VERSION),;s,LIBTIFF_MINOR_VERSION,$(LIBTIFF_MINOR_VERSION),;s,LIBTIFF_MICRO_VERSION,$(LIBTIFF_MICRO_VERSION),' $(top_srcdir)/libtiff/tiffvers.h.in > $(top_builddir)/libtiff/tiffvers.h && sed -i 's,@,,g' $(top_builddir)/libtiff/tiffvers.h)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libtiff-4.pc
# Special rules to assist with Coverity submissions.
PACKAGE_CHANGE_DATE=`awk '/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/ { print substr($$1,1,4) substr($$1,6,2) substr($$1,9,2); exit; }' $(top_srcdir)/ChangeLog`
COVERITY_EMAIL=bfriesen@simple.dallas.tx.us
COVERITY_TARBALL=libtiff.xz
COVERITY_VERSION=devel-${PACKAGE_CHANGE_DATE}
COVERITY_DESCRIPTION='libtiff development'
coverity:
$(MAKE) clean
cov-build --dir cov-int $(MAKE)
tar caf $(COVERITY_TARBALL) cov-int
curl --limit-rate 50K \
--form token=`cat $$HOME/.coverity_key_tiff` \
--form email=$(COVERITY_EMAIL) \
--form file=@$(COVERITY_TARBALL) \
--form version=$(COVERITY_VERSION) \
--form description=$(COVERITY_DESCRIPTION) \
https://scan.coverity.com/builds?project=tiff
$(RM) $(COVERITY_TARBALL)
-425
View File
@@ -1,425 +0,0 @@
#! smake
# $Header: /usr/people/sam/tiff/RCS/Makefile.in,v 1.37 1995/10/16 22:01:20 sam Exp $
#
# @WARNING@
#
# Tag Image File Format Library
#
# Copyright (c) 1988-1995 Sam Leffler
# Copyright (c) 1991-1995 Silicon Graphics, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and
# its documentation for any purpose is hereby granted without fee, provided
# that (i) the above copyright notices and this permission notice appear in
# all copies of the software and related documentation, and (ii) the names of
# Sam Leffler and Silicon Graphics may not be used in any advertising or
# publicity relating to the software without the specific, prior written
# permission of Sam Leffler and Silicon Graphics.
#
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
#
SRCDIR = @SRCDIR@
#
# VERSION: @VERSION@
# DATE: @DATE@
# TARGET: @TARGET@
# CCOMPILER: @CCOMPILER@
# CXXCOMPILER: @CXXCOMPILER@
#
@SETMAKE@
SHELL = /bin/sh
NULL =
ECHO = echo
GENDIST = ${TOOLROOT}/usr/sbin/gendist
all default:
@if [ "@PORT@" = yes ]; then \
${ECHO} "= "port; cd port; ${MAKE}; \
fi
@${ECHO} "= "libtiff; cd libtiff; ${MAKE}
@${ECHO} "= "tools; cd tools; ${MAKE}
@${ECHO} "= "man; cd man; ${MAKE}
install:
@${ECHO} "= "libtiff; cd libtiff; ${MAKE} install
@${ECHO} "= "tools; cd tools; ${MAKE} install
@${ECHO} "= "man; cd man; ${MAKE} install
clean:
@if [ "@PORT@" = yes ]; then \
${ECHO} "= "port; cd port; ${MAKE} clean; \
fi
@${ECHO} "= "libtiff; cd libtiff; ${MAKE} clean
@${ECHO} "= "tools; cd tools; ${MAKE} clean
@${ECHO} "= "man; cd man; ${MAKE} clean
# -cd contrib/dbs; ${MAKE} clean
# -cd contrib/dbs/xtiff; ${MAKE} clean
clobber distclean: clean
rm -f Makefile libtiff/port.h config.log
rm -f libtiff/Makefile
rm -f tools/Makefile
rm -f man/Makefile
rm -f port/Makefile port/install.sh
#
# The folllowing rule creates a binary distribution for IRIX.
#
product::
test -d dist || mkdir dist
rm -f dist/rawidb
SRC=`pwd` RAWIDB=`pwd`/dist/rawidb ${MAKE} install
rm -f dist/idb
sort -u +4 dist/rawidb > dist/idb
${GENDIST} -v -dist dist -idb dist/idb \
-sbase `pwd` -spec ${SRCDIR}/dist/tiff.spec
#
# These rules are used to create the source distribution images
#
HOST = sgi
COMPRESS= gzip
ZIPSUF = gz
TIFFFILES=\
configure \
config.guess \
config.sub \
config.site \
Makefile.in \
README \
VERSION \
COPYRIGHT \
TODO \
dist/tiff.spec \
dist/newalpha \
dist/newversion \
libtiff/Makefile.in \
libtiff/Makefile.lcc \
libtiff/Makefile.msc \
libtiff/t4.h \
libtiff/tiff.h \
libtiff/tiffcomp.h \
libtiff/tiffconf.h \
libtiff/tiffio.h \
libtiff/tiffiop.h \
libtiff/mkg3states.c \
libtiff/mkspans.c \
libtiff/mkversion.c \
libtiff/tif_apple.c \
libtiff/tif_atari.c \
libtiff/tif_aux.c \
libtiff/tif_close.c \
libtiff/tif_codec.c \
libtiff/tif_compress.c \
libtiff/tif_dir.h \
libtiff/tif_dir.c \
libtiff/tif_dirinfo.c \
libtiff/tif_dirread.c \
libtiff/tif_dirwrite.c \
libtiff/tif_dumpmode.c \
libtiff/tif_error.c \
libtiff/tif_fax3.c \
libtiff/tif_fax3.h \
libtiff/tif_flush.c \
libtiff/tif_getimage.c \
libtiff/tif_jpeg.c \
libtiff/tif_lzw.c \
libtiff/tif_msdos.c \
libtiff/tif_next.c \
libtiff/tif_open.c \
libtiff/tif_packbits.c \
libtiff/tif_predict.h \
libtiff/tif_predict.c \
libtiff/tif_print.c \
libtiff/tif_read.c \
libtiff/tif_strip.c \
libtiff/tif_swab.c \
libtiff/tif_thunder.c \
libtiff/tif_tile.c \
libtiff/tif_unix.c \
libtiff/tif_version.c \
libtiff/tif_vms.c \
libtiff/tif_warning.c \
libtiff/tif_win3.c \
libtiff/tif_win32.c \
libtiff/tif_write.c \
libtiff/tif_zip.c \
port/Makefile.in \
port/getopt.c \
port/install.sh.in \
port/irix/so_locations \
port/strcasecmp.c \
port/strtoul.c \
tools/Makefile.in \
tools/Makefile.lcc \
tools/fax2tiff.c \
tools/fax2ps.c \
tools/gif2tiff.c \
tools/pal2rgb.c \
tools/ppm2tiff.c \
tools/ras2tiff.c \
tools/rasterfile.h \
tools/rgb2ycbcr.c \
tools/sgi2tiff.c \
tools/sgigt.c \
tools/sgisv.c \
tools/thumbnail.c \
tools/tiff2bw.c \
tools/tiff2ps.c \
tools/tiffcmp.c \
tools/tiffcp.c \
tools/tiffdither.c \
tools/tiffdump.c \
tools/tiffinfo.c \
tools/tiffmedian.c \
tools/tiffsplit.c \
tools/ycbcr.c \
man/Makefile.in \
man/fax2tiff.1 \
man/fax2ps.1 \
man/gif2tiff.1 \
man/pal2rgb.1 \
man/ppm2tiff.1 \
man/ras2tiff.1 \
man/rgb2ycbcr.1 \
man/sgi2tiff.1 \
man/thumbnail.1 \
man/tiff2bw.1 \
man/tiff2ps.1 \
man/tiffcmp.1 \
man/tiffcp.1 \
man/tiffdither.1 \
man/tiffdump.1 \
man/tiffgt.1 \
man/tiffinfo.1 \
man/tiffmedian.1 \
man/tiffsplit.1 \
man/tiffsv.1 \
man/TIFFClose.3t \
man/TIFFError.3t \
man/TIFFFlush.3t \
man/TIFFGetField.3t \
man/TIFFOpen.3t \
man/TIFFPrintDirectory.3t \
man/TIFFReadDirectory.3t \
man/TIFFReadEncodedStrip.3t \
man/TIFFReadEncodedTile.3t \
man/TIFFReadRGBAImage.3t \
man/TIFFReadRawStrip.3t \
man/TIFFReadRawTile.3t \
man/TIFFReadScanline.3t \
man/TIFFReadTile.3t \
man/TIFFRGBAImage.3t \
man/TIFFSetDirectory.3t \
man/TIFFSetField.3t \
man/TIFFWarning.3t \
man/TIFFWriteDirectory.3t \
man/TIFFWriteEncodedStrip.3t \
man/TIFFWriteEncodedTile.3t \
man/TIFFWriteRawStrip.3t \
man/TIFFWriteRawTile.3t \
man/TIFFWriteScanline.3t \
man/libtiff.3t \
man/TIFFbuffer.3t \
man/TIFFcodec.3t \
man/TIFFmemory.3t \
man/TIFFquery.3t \
man/TIFFsize.3t \
man/TIFFstrip.3t \
man/TIFFswab.3t \
man/TIFFtile.3t \
html/Makefile.in \
html/bugs.html \
html/build.html \
html/contrib.html \
html/document.html \
html/images.html \
html/index.html \
html/internals.html \
html/intro.html \
html/libtiff.html \
html/misc.html \
html/support.html \
html/tools.html \
html/v3.4beta024.html \
html/v3.4beta018.html \
html/v3.4beta016.html \
html/v3.4beta007.html \
${NULL}
OTHERFILES=\
html/images/back.gif \
html/images/bali.jpg \
html/images/cat.gif \
html/images/cover.jpg \
html/images/cramps.gif \
html/images/dave.gif \
html/images/info.gif \
html/images/jello.jpg \
html/images/jim.gif \
html/images/note.gif \
html/images/oxford.gif \
html/images/quad.jpg \
html/images/ring.gif \
html/images/smallliz.jpg \
html/images/strike.gif \
html/images/warning.gif \
${NULL}
CONTRIBFILES=\
contrib/dbs/README \
contrib/dbs/Imakefile \
contrib/dbs/tiff-bi.c \
contrib/dbs/tiff-grayscale.c \
contrib/dbs/tiff-palette.c \
contrib/dbs/tiff-rgb.c \
contrib/dbs/xtiff/README \
contrib/dbs/xtiff/Imakefile \
contrib/dbs/xtiff/patchlevel.h \
contrib/dbs/xtiff/xtiff.c \
contrib/dbs/xtiff/xtifficon.h \
contrib/ras/ras2tif.c \
contrib/ras/tif2ras.c \
contrib/vms/libtiff/makevms.com \
contrib/vms/libtiff/tiff.opt \
contrib/vms/libtiff/tiffshraxp.opt \
contrib/vms/libtiff/tiffshrvax.opt \
contrib/vms/libtiff/tiffvec.mar \
contrib/vms/tools/makevms.com \
contrib/tags \
contrib/mac-mpw \
contrib/acorn \
contrib/win32 \
${NULL}
DISTFILES=\
${TIFFFILES} \
dist/tiff.alpha \
dist/tiff.version \
${OTHERFILES} \
${CONTRIBFILES} \
${NULL}
CONFIG=\
-with-CC=cc \
-with-GCOPTS=" " \
-with-JPEG=yes \
-with-DIR_JPEG=../src/jpeg-5a \
-with-ZIP=yes \
-with-DIR_LIBGZ=../src/zlib \
${NULL}
rcsclean:
rcsclean ${TIFFFILES} && co ${TIFFFILES}
alpha:
(cd ${SRCDIR}/dist; sh newversion)
-${MAKE} clean
${MAKE} alpha.stamp
${SRCDIR}/configure ${CONFIG}
${MAKE} product
${MAKE} alpha.tar
# stamp relevant files according to current alpha
alpha.stamp:
VERSION=`awk '{print "Alpha" $$3}' ${SRCDIR}/dist/tiff.alpha`;\
NOW=`date`; \
for i in ${TIFFFILES}; do \
REV=`rlog -h -d"$$NOW" ${SRCDIR}/$$i|fgrep 'head:'|awk '{print $$2}'`;\
rcs "-N$$VERSION:$$REV" "-sExp:$$REV" ${SRCDIR}/$$i && co -sExp ${SRCDIR}/$$i; \
done
purge-old-alphas:
VERSIONS=`awk '{for (i=1; i<=$$3; i++) printf " -nAlpha%03d",i}'\
${SRCDIR}/dist/tiff.alpha`; \
for i in ${TIFFFILES}; do \
echo rcs $$VERSIONS ${SRCDIR}/$$i; \
rcs $$VERSIONS ${SRCDIR}/$$i && co ${SRCDIR}/$$i; \
done
alphadiff:
-@for i in ${TIFFFILES}; do \
rcsdiff -r${ALPHA} ${SRCDIR}/$$i; \
done
# create alpha distribution archive
alpha.tar:
VERSION="v`cat ${SRCDIR}/VERSION``awk '{print $$3}' ${SRCDIR}/dist/tiff.alpha`"; \
rm -f tiff-$$VERSION $$VERSION $$VERSION-tar; \
ln -s ${SRCDIR} tiff-$$VERSION; \
(for i in ${DISTFILES}; do \
echo $$i; \
done) | sed "s;.*;tiff-$$VERSION/&;" >$$VERSION; \
tar cvf $$VERSION-tar `cat $$VERSION`; \
rm -f tiff-$$VERSION-tar.${ZIPSUF}; \
cat $$VERSION-tar | ${COMPRESS} >tiff-$$VERSION-tar.${ZIPSUF}; \
rm -f tiff-$$VERSION $$VERSION $$VERSION-tar;
release:
(cd ${SRCDIR}/dist; sh newversion)
-${MAKE} clean
${MAKE} release.stamp
${SRCDIR}/configure ${CONFIG}
${MAKE} product
${MAKE} release.tar
release.stamp:
VERSION="Release`sed 's/\./_/g' ${SRCDIR}/VERSION`"; \
NOW=`date`; \
for i in ${TIFFFILES}; do \
REV=`rlog -h -d"$$NOW" ${SRCDIR}/$$i|fgrep 'head:'|awk '{print $$2}'`;\
rcs "-N$$VERSION:$$REV" "-sRel:$$REV" ${SRCDIR}/$$i && co -sRel ${SRCDIR}/$$i; \
done
# create release distribution archive
release.tar:
VERSION=v`cat ${SRCDIR}/VERSION`; \
rm -f tiff-$$VERSION $$VERSION $$VERSION-tar; \
ln -s ${SRCDIR} tiff-$$VERSION; \
(for i in ${DISTFILES}; do \
echo $$i; \
done) | sed "s;.*;tiff-$$VERSION/&;" >$$VERSION; \
tar cvf $$VERSION-tar `cat $$VERSION`; \
rm -f tiff-$$VERSION-tar.${ZIPSUF}; \
cat $$VERSION-tar | ${COMPRESS} >tiff-$$VERSION-tar.${ZIPSUF}; \
rm -f tiff-$$VERSION $$VERSION $$VERSION-tar;
#
# Create a package of the test images.
#
PICS=\
pics/README \
pics/cramps.tif \
pics/cramps-tile.tif \
pics/fax2d.tif \
pics/g3test.tif \
pics/jello.tif \
pics/jim___cg.tif \
pics/jim___dg.tif \
pics/jim___gg.tif \
pics/jim___ah.tif \
pics/strike.tif \
pics/oxford.tif \
pics/quad-lzw.tif \
pics/quad-tile.tif \
pics/text.tif \
pics/ycbcr-cat.tif \
pics/smallliz.tif \
pics/zackthecat.tif \
pics/fax2d.g3 \
pics/g3test.g3 \
${NULL}
pics.tar:
tar cvf - ${PICS} | ${COMPRESS} > tiffpics.tar.${ZIPSUF}
+25 -16
View File
@@ -1,17 +1,15 @@
$Header: /usr/people/sam/tiff/RCS/README,v 1.26 1995/07/01 00:57:02 sam Exp $
TIFF Software Distribution
--------------------------
This file is just a placeholder; all the documentation is now in
HTML in the html directory. To view the documentation point your
favorite WWW viewer at html/index.html; e.g.
This file is just a placeholder; the entire documentation is now located
as reStructuredText in the doc directory. To view the documentation
as HTML, visit https://libtiff.gitlab.io/libtiff/ or
http://www.simplesystems.org/libtiff/ or within the release package
in the doc/html-prebuilt directory. The manual pages are
located at doc/man-prebuilt.
netscape html/index.html
The release package can be downloaded at
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.sgi.com/graphics/tiff/doc
http://download.osgeo.org/libtiff/
If you can't hack either of these options then basically what you
want to do is:
@@ -21,15 +19,26 @@ want to do is:
% su
# make install
If that doesn't do what you want, or something isn't clear then
sorry, but you're SOL.
More information, email contacts, and mailing list information can be
found online at http://www.simplesystems.org/libtiff/
Sam Leffler (sam@engr.sgi.com)
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
-----------------
Silicon Graphics has seen fit to allow me to give this work away. It
Silicon Graphics has seen fit to allow us to give this work away. It
is free. There is no support or guarantee of any sort as to its
operations, correctness, or whatever. If you do anything useful with
all or parts of it you need to honor the copyright notices. I would
@@ -37,8 +46,8 @@ also be interested in knowing about it and, hopefully, be acknowledged.
The legal way of saying that is:
Copyright (c) 1988-1995 Sam Leffler
Copyright (c) 1991-1995 Silicon Graphics, Inc.
Copyright (c) 1988-1997 Sam Leffler
Copyright (c) 1991-1997 Silicon Graphics, Inc.
Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee, provided
+1
View File
@@ -0,0 +1 @@
20240911
+5 -5
View File
@@ -1,10 +1,10 @@
# $Header: /usr/people/sam/tiff/RCS/TODO,v 1.2 1995/07/03 18:42:38 sam Exp $
o update manual pages
o gif2tiff segaulting on selected images
o tiffcmp read data by strip/tile instead of scanline
o YCbCr sampling support
o html manual pages
o extracate colorspace conversion support
o look at isolating all codecs from TIFF library
o tiffcp problem with JPEG-encoded image
o JPEG colormode order dependency problem
o Write documentation on how do extend tags, and how the custom field
stuff all works.
+1 -1
View File
@@ -1 +1 @@
3.4beta
4.7.0
+121
View File
@@ -0,0 +1,121 @@
<!-- Creator : groff version 1.18.1 -->
<!-- CreationDate: Sun Mar 6 13:59:56 2005 -->
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta name="Content-Style" content="text/css">
<title>BMP2TIFF</title>
</head>
<body>
<h1 align=center>BMP2TIFF</h1>
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#OPTIONS">OPTIONS</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
<hr>
<a name="NAME"></a>
<h2>NAME</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p>bmp2tiff &minus; create a <small>TIFF</small> file from a
Microsoft Windows Device Independent Bitmap image file</p>
</td>
</table>
<a name="SYNOPSIS"></a>
<h2>SYNOPSIS</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><b>bmp2tiff</b> [ <i>options</i> ] <i>input.bmp
output.tiff</i></p>
</td>
</table>
<a name="DESCRIPTION"></a>
<h2>DESCRIPTION</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><i>bmp2tiff</i> converts a Microsoft Windows Device
Independent Bitmap image file to <small>TIFF.</small> By
default, the <small>TIFF</small> image is created with data
samples packed (<i>PlanarConfiguration</i>=1), compressed
with the PackBits algorithm
(<i>Compression</i>=<i>32773),</i> and with each strip no
more than 8 kilobytes. These characteristics can overridden,
or explicitly specified with the options described
below.</p>
</td>
</table>
<a name="OPTIONS"></a>
<h2>OPTIONS</h2>
<!-- TABS -->
<table width="100%" border=0 rules="none" frame="void"
cols="5" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="2%">
<p><b>&minus;c</b></p>
</td>
<td width="5%"></td>
<td width="80%">
<p>Specify a compression scheme to use when writing image
data: <b>&minus;c none</b> for no compression, <b>-c
packbits</b> for the PackBits compression algorithm (the
default), <b>-c jpeg</b> for the baseline JPEG compression
algorithm, <b>-c zip</b> for the Deflate compression
algorithm, and <b>&minus;c lzw</b> for Lempel-Ziv &amp;
Welch.</p>
</td>
<td width="0%">
</td>
</table>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><b>&minus;r &lt;number&gt;</b></p></td>
</table>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="19%"></td>
<td width="80%">
<p>Write data with a specified number of rows per strip; by
default the number of rows/strip is selected so that each
strip is approximately 8 kilobytes.</p>
</td>
</table>
<a name="SEE ALSO"></a>
<h2>SEE ALSO</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><i>gif2tiff</i>(1), <i>pal2rgb</i>(1),
<i>ppm2tiff</i>(1), <i>raw2tiff</i>(1), <i>ras2tiff</i>(1),
<i>sgi2tiff</i>(1), <i>libtiff</i>(3TIFF)</p>
</td>
</table>
<hr>
</body>
</html>
+141
View File
@@ -0,0 +1,141 @@
<!-- Creator : groff version 1.18.1 -->
<!-- CreationDate: Sat Feb 24 18:37:19 2007 -->
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta name="Content-Style" content="text/css">
<title>GIF2TIFF</title>
</head>
<body>
<h1 align=center>GIF2TIFF</h1>
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#OPTIONS">OPTIONS</a><br>
<a href="#NOTES">NOTES</a><br>
<a href="#BUGS">BUGS</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
<hr>
<a name="NAME"></a>
<h2>NAME</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p>gif2tiff &minus; create a <small>TIFF</small> file from a
GIF87 format image file</p>
</td>
</table>
<a name="SYNOPSIS"></a>
<h2>SYNOPSIS</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><b>gif2tiff</b> [ <i>options</i> ] <i>input.gif
output.tif</i></p>
</td>
</table>
<a name="DESCRIPTION"></a>
<h2>DESCRIPTION</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><i>Gif2tiff</i> converts a file in the GIF87 format to
<small>TIFF.</small> The <small>TIFF</small> image is
created as a palette image, with samples compressed with the
Lempel-Ziv &amp; Welch algorithm (<i>Compression</i>=5).
These characteristics can overridden, or explicitly
specified with the options described below.</p>
</td>
</table>
<a name="OPTIONS"></a>
<h2>OPTIONS</h2>
<!-- TABS -->
<table width="100%" border=0 rules="none" frame="void"
cols="5" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="3%">
<p><b>&minus;c</b></p>
</td>
<td width="5%"></td>
<td width="80%">
<p>Specify a compression scheme to use when writing image
data: <b>&minus;c none</b> for no compression, <b>&minus;c
packbits</b> for the PackBits compression algorithm,
<b>&minus;c zip</b> for the Deflate compression algorithm,
and <b>&minus;c lzw</b> for Lempel-Ziv &amp; Welch (the
default).</p>
</td>
<td width="0%">
</td>
<tr valign="top" align="left">
<td width="10%"></td>
<td width="3%">
<p><b>&minus;r</b></p>
</td>
<td width="5%"></td>
<td width="80%">
<p>Write data with a specified number of rows per strip; by
default the number of rows/strip is selected so that each
strip is approximately 8 kilobytes.</p>
</td>
<td width="0%">
</td>
</table>
<a name="NOTES"></a>
<h2>NOTES</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p>The program is based on Paul Haeberli&rsquo;s
<i>fromgif</i> program which, in turn, is based on Marcel
J.E. Mol&rsquo;s GIF reader.</p>
</td>
</table>
<a name="BUGS"></a>
<h2>BUGS</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p>Should have more options to control output format.</p>
</td>
</table>
<a name="SEE ALSO"></a>
<h2>SEE ALSO</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><b>pal2rgb</b>(1), <b>tiffinfo</b>(1), <b>tiffcp</b>(1),
<b>tiffmedian</b>(1), <b>libtiff</b>(3)</p>
<!-- INDENTATION -->
<p>Libtiff library home page:
<b>http://www.remotesensing.org/libtiff/</b></p>
</td>
</table>
<hr>
</body>
</html>
+139
View File
@@ -0,0 +1,139 @@
<!-- Creator : groff version 1.18.1 -->
<!-- CreationDate: Sat Feb 24 18:37:19 2007 -->
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta name="Content-Style" content="text/css">
<title>RAS2TIFF</title>
</head>
<body>
<h1 align=center>RAS2TIFF</h1>
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#OPTIONS">OPTIONS</a><br>
<a href="#BUGS">BUGS</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
<hr>
<a name="NAME"></a>
<h2>NAME</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p>ras2tiff &minus; create a <small>TIFF</small> file from a
Sun rasterfile</p>
</td>
</table>
<a name="SYNOPSIS"></a>
<h2>SYNOPSIS</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><b>ras2tiff</b> [ <i>options</i> ] <i>input.ras
output.tif</i></p>
</td>
</table>
<a name="DESCRIPTION"></a>
<h2>DESCRIPTION</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><i>ras2tiff</i> converts a file in the Sun rasterfile
format to <small>TIFF.</small> By default, the
<small>TIFF</small> image is created with data samples
packed (<i>PlanarConfiguration</i>=1), compressed with the
Lempel-Ziv &amp; Welch algorithm (<i>Compression</i>=5), and
with each strip no more than 8 kilobytes. These
characteristics can overridden, or explicitly specified with
the options described below.</p>
<!-- INDENTATION -->
<p>Any colormap information in the rasterfile is carried
over to the <small>TIFF</small> file by including a
<i>Colormap</i> tag in the output file. If the rasterfile
has a colormap, the <i>PhotometricInterpretation</i> tag is
set to 3 (palette); otherwise it is set to 2 (RGB) if the
depth is 24 or 1 (min-is-black) if the depth is not 24.</p>
</td>
</table>
<a name="OPTIONS"></a>
<h2>OPTIONS</h2>
<!-- TABS -->
<table width="100%" border=0 rules="none" frame="void"
cols="5" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="2%">
<p><b>&minus;c</b></p>
</td>
<td width="6%"></td>
<td width="80%">
<p>Specify a compression scheme to use when writing image
data: <b>&minus;c none</b> for no compression, <b>&minus;c
packbits</b> for the PackBits compression algorithm,
<b>&minus;c jpeg</b> for the baseline JPEG compression
algorithm, <b>&minus;c zip</b> for the Deflate compression
algorithm, and <b>&minus;c lzw</b> for Lempel-Ziv &amp;
Welch (the default).</p>
</td>
<td width="0%">
</td>
<tr valign="top" align="left">
<td width="10%"></td>
<td width="2%">
<p><b>&minus;r</b></p>
</td>
<td width="6%"></td>
<td width="80%">
<p>Write data with a specified number of rows per strip; by
default the number of rows/strip is selected so that each
strip is approximately 8 kilobytes.</p>
</td>
<td width="0%">
</td>
</table>
<a name="BUGS"></a>
<h2>BUGS</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p>Does not handle all possible rasterfiles. In particular,
<i>ras2tiff</i> does not handle run-length encoded
images.</p>
</td>
</table>
<a name="SEE ALSO"></a>
<h2>SEE ALSO</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><b>pal2rgb</b>(1), <b>tiffinfo</b>(1), <b>tiffcp</b>(1),
<b>tiffmedian</b>(1), <b>libtiff</b>(3)</p>
<!-- INDENTATION -->
<p>Libtiff library home page:
<b>http://www.remotesensing.org/libtiff/</b></p>
</td>
</table>
<hr>
</body>
</html>
+147
View File
@@ -0,0 +1,147 @@
<!-- Creator : groff version 1.18.1 -->
<!-- CreationDate: Sat Feb 24 18:37:19 2007 -->
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta name="Content-Style" content="text/css">
<title>SGI2TIFF</title>
</head>
<body>
<h1 align=center>SGI2TIFF</h1>
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#OPTIONS">OPTIONS</a><br>
<a href="#BUGS">BUGS</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
<hr>
<a name="NAME"></a>
<h2>NAME</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p>sgi2tiff &minus; create a <small>TIFF</small> file from
an <small>SGI</small> image file</p>
</td>
</table>
<a name="SYNOPSIS"></a>
<h2>SYNOPSIS</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><b>sgi2tiff</b> [ <i>options</i> ] <i>input.rgb
output.tif</i></p>
</td>
</table>
<a name="DESCRIPTION"></a>
<h2>DESCRIPTION</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><i>sgi2tiff</i> converts a file in the <small>SGI</small>
image format to <small>TIFF.</small> By default, the
<small>TIFF</small> image is created with data samples
packed (<i>PlanarConfiguration</i>=1), compressed with the
Lempel-Ziv &amp; Welch algorithm (<i>Compression</i>=5), and
with each strip no more than 8 kilobytes. These
characteristics can overridden, or explicitly specified with
the options described below.</p>
</td>
</table>
<a name="OPTIONS"></a>
<h2>OPTIONS</h2>
<!-- TABS -->
<table width="100%" border=0 rules="none" frame="void"
cols="5" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="3%">
<p><b>&minus;c</b></p>
</td>
<td width="5%"></td>
<td width="80%">
<p>Specify a compression scheme to use when writing image
data: <b>&minus;c none</b> for no compression, <b>&minus;c
packbits</b> for the PackBits compression algorithm),
<b>&minus;c jpeg</b> for the baseline JPEG compression
algorithm, <b>&minus;c zip</b> for the Deflate compression
algorithm, and <b>&minus;c lzw</b> for Lempel-Ziv &amp;
Welch (the default).</p>
</td>
<td width="0%">
</td>
<tr valign="top" align="left">
<td width="10%"></td>
<td width="3%">
<p><b>&minus;p</b></p>
</td>
<td width="5%"></td>
<td width="80%">
<p>Explicitly select the planar configuration used in
organizing data samples in the output image: <b>&minus;p
contig</b> for samples packed contiguously, and <b>&minus;p
separate</b> for samples stored separately. By default
samples are packed.</p>
</td>
<td width="0%">
</td>
<tr valign="top" align="left">
<td width="10%"></td>
<td width="3%">
<p><b>&minus;r</b></p>
</td>
<td width="5%"></td>
<td width="80%">
<p>Write data with a specified number of rows per strip; by
default the number of rows/strip is selected so that each
strip is approximately 8 kilobytes.</p>
</td>
<td width="0%">
</td>
</table>
<a name="BUGS"></a>
<h2>BUGS</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p>Does not record colormap information.</p>
</td>
</table>
<a name="SEE ALSO"></a>
<h2>SEE ALSO</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><b>tiffinfo</b>(1), <b>tiffcp</b>(1),
<b>tiffmedian</b>(1), <b>libtiff</b>(3)</p>
<!-- INDENTATION -->
<p>Libtiff library home page:
<b>http://www.remotesensing.org/libtiff/</b></p>
</td>
</table>
<hr>
</body>
</html>
+207
View File
@@ -0,0 +1,207 @@
<!-- Creator : groff version 1.18.1 -->
<!-- CreationDate: Sat Feb 24 18:37:20 2007 -->
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta name="Content-Style" content="text/css">
<title>TIFFSV</title>
</head>
<body>
<h1 align=center>TIFFSV</h1>
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#OPTIONS">OPTIONS</a><br>
<a href="#NOTE">NOTE</a><br>
<a href="#BUGS">BUGS</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
<hr>
<a name="NAME"></a>
<h2>NAME</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p>tiffsv &minus; save an image from the framebuffer in a
<small>TIFF</small> file (Silicon Graphics version)</p>
</td>
</table>
<a name="SYNOPSIS"></a>
<h2>SYNOPSIS</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><b>tiffsv</b> [ <i>options</i> ] <i>output.tif</i> [
<i>x1 x2 y1 y2</i> ]</p>
</td>
</table>
<a name="DESCRIPTION"></a>
<h2>DESCRIPTION</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><i>tiffsv</i> saves all or part of the framebuffer in a
file using the Tag Image File Format, Revision 6.0. By
default, the image is saved with data samples packed
(<i>PlanarConfiguration</i>=1), compressed with the
Lempel-Ziv &amp; Welch algorithm (<i>Compression</i>=5), and
with each strip no more than 8 kilobytes. These
characteristics can be overridden, or explicitly specified
with the options described below.</p>
</td>
</table>
<a name="OPTIONS"></a>
<h2>OPTIONS</h2>
<!-- TABS -->
<table width="100%" border=0 rules="none" frame="void"
cols="5" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="3%">
<p><b>&minus;b</b></p>
</td>
<td width="5%"></td>
<td width="80%">
<p>Save the image as a greyscale image as if it were
processed by <i>tiff2bw</i>(1). This option is included for
compatibility with the standard <i>scrsave</i>(6D)
program.</p>
</td>
<td width="0%">
</td>
<tr valign="top" align="left">
<td width="10%"></td>
<td width="3%">
<p><b>&minus;c</b></p>
</td>
<td width="5%"></td>
<td width="80%">
<p>Specify the compression to use for data written to the
output file: <b>none</b> for no compression, <b>packbits</b>
for PackBits compression, <b>jpeg</b> for baseline JPEG
compression, <b>zip</b> for Deflate compression, and
<b>lzw</b> for Lempel-Ziv &amp; Welch compression
(default).</p>
</td>
<td width="0%">
</td>
</table>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="17%"></td>
<td width="82%">
<p><small>LZW</small> compression can be specified together
with a <i>predictor</i> value. A predictor value of 2 causes
each scanline of the output image to undergo horizontal
differencing before it is encoded; a value of 1 forces each
scanline to be encoded without differencing. LZW-specific
options are specified by appending a
&lsquo;&lsquo;:&rsquo;&rsquo;-separated list to the
&lsquo;&lsquo;lzw&rsquo;&rsquo; option; e.g. <b>&minus;c
lzw:2</b> for <small>LZW</small> compression with horizontal
differencing.</p>
</td>
</table>
<!-- TABS -->
<table width="100%" border=0 rules="none" frame="void"
cols="5" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="3%">
<p><b>&minus;p</b></p>
</td>
<td width="5%"></td>
<td width="80%">
<p>Specify the planar configuration to use in writing image
data. By default, <i>tiffsv</i> will create a new file with
the data samples packed contiguously. Specifying <b>&minus;p
contig</b> will force data to be written with multi-sample
data packed together, while <b>&minus;p separate</b> will
force samples to be written in separate planes.</p>
</td>
<td width="0%">
</td>
<tr valign="top" align="left">
<td width="10%"></td>
<td width="3%">
<p><b>&minus;r</b></p>
</td>
<td width="5%"></td>
<td width="80%">
<p>Specify the number of rows (scanlines) in each strip of
data written to the output file. By default, <i>tiffsv</i>
attempts to set the rows/strip that no more than 8 kilobytes
of data appear in a strip.</p>
</td>
<td width="0%">
</td>
</table>
<a name="NOTE"></a>
<h2>NOTE</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p>Except for the use of <small>TIFF,</small> this program
is equivalent to the standard <i>scrsave</i> program. This
means, for example, that you can use it in conjunction with
the standard <i>icut</i> program simply by creating a link
called <i>scrsave</i>, or by creating a shell script called
<i>scrsave</i> that invokes <i>tiffgt</i> with the
appropriate options.</p>
</td>
</table>
<a name="BUGS"></a>
<h2>BUGS</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p>If data are saved compressed and in separate planes, then
the rows in each strip is silently set to one to avoid
limitations in the <b>libtiff</b>(3TIFF) library.</p>
</td>
</table>
<a name="SEE ALSO"></a>
<h2>SEE ALSO</h2>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="91%">
<p><b>scrsave</b>(6D) <b>pal2rgb</b>(1), <b>tiffdump</b>(1),
<b>tiffgt</b>(1), <b>tiffinfo</b>(1), <b>tiffcp</b>(1),
<b>tiffmedian</b>(1), <b>libtiff</b>(3TIFF)</p>
<!-- INDENTATION -->
<p>Libtiff library home page:
<b>http://www.remotesensing.org/libtiff/</b></p>
</td>
</table>
<hr>
</body>
</html>
+35 -48
View File
@@ -1,7 +1,5 @@
.\" $Header: /usr/people/sam/tiff/man/RCS/ppm2tiff.1,v 1.10 1995/10/11 19:42:00 sam Exp $
.\"
.\" Copyright (c) 1991-1995 Sam Leffler
.\" Copyright (c) 1991-1995 Silicon Graphics, Inc.
.\" Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
.\"
.\" Permission to use, copy, modify, distribute, and sell this software and
.\" its documentation for any purpose is hereby granted without fee, provided
@@ -23,75 +21,64 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
.TH PPM2TIFF 1 "October 15, 1995"
.TH BMP2TIFF 1 "15 October, 2004" "libtiff"
.SH NAME
ppm2tiff \- create a
bmp2tiff \- create a
.SM TIFF
file from a
.SM PPM
image file
file from a Microsoft Windows Device Independent Bitmap image file
.SH SYNOPSIS
.B ppm2tiff
.B bmp2tiff
[
.I options
] [
.I input.ppm
]
.I output.tif
.I input.bmp
[
.I input2.bmp ...\&
]
.I output.tiff
.SH DESCRIPTION
.I ppm2tiff
converts a file in the
.SM PPM
image format to
.I bmp2tiff
converts a Microsoft Windows Device Independent Bitmap image file to
.SM TIFF.
By default, the
If several input BMP files are being specified the multipage
.SM TIFF
output file will be created. By default, the
.SM TIFF
image is created with data samples packed (\c
.IR PlanarConfiguration =1),
compressed with the Lempel-Ziv & Welch algorithm (\c
.IR Compression =5),
compressed with the PackBits algorithm (\c
.IR Compression =32773),
and with each strip no more than 8 kilobytes.
These characteristics can be overriden, or explicitly specified
with the options described below
.PP
If the
.SM PPM
file contains greyscale data, then the
.I PhotometricInterpretation
tag is set to 1 (min-is-black),
otherwise it is set to 2 (RGB).
.PP
If no
.SM PPM
file is specified on the command line,
.I ppm2tiff
will read from the standard input.
These characteristics can overridden, or explicitly specified
with the options described below.
.SH OPTIONS
.TP
.B \-c
Specify a compression scheme to use when writing image data:
.B "\-c none"
for no compression,
.B "-c packbits"
for the PackBits compression algorithm,
.B "-c jpeg"
.B "\-c packbits"
for the PackBits compression algorithm (the default),
.B "\-c jpeg"
for the baseline JPEG compression algorithm,
.B "-c zip
.B "\-c zip"
for the Deflate compression algorithm,
and
.B "\-c lzw"
for Lempel-Ziv & Welch compression (the default).
for Lempel-Ziv & Welch.
.TP
.B \-r
.BI \-r " number"
Write data with a specified number of rows per strip;
by default the number of rows/strip is selected so that each strip
is approximately 8 kilobytes.
.TP
.B \-R
Mark the resultant image to have the specified
X and Y resolution (in dots/inch).
.SH "SEE ALSO"
.IR tiffinfo (1),
.IR tiffcp (1),
.IR tiffmedian (1),
.IR libtiff (3)
.BR gif2tiff (1),
.BR pal2rgb (1),
.BR ppm2tiff (1),
.BR raw2tiff (1),
.BR ras2tiff (1),
.BR sgi2tiff (1),
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
.BR http://www.remotesensing.org/libtiff/
+14 -12
View File
@@ -1,7 +1,6 @@
.\" $Header: /usr/people/sam/tiff/man/RCS/gif2tiff.1,v 1.8 1995/10/11 19:41:58 sam Exp $
.\"
.\" Copyright (c) 1991-1995 Sam Leffler
.\" Copyright (c) 1991-1995 Silicon Graphics, Inc.
.\" Copyright (c) 1991-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
.\"
.\" Permission to use, copy, modify, distribute, and sell this software and
.\" its documentation for any purpose is hereby granted without fee, provided
@@ -23,7 +22,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
.TH GIF2TIFF 1 "October 15, 1995"
.TH GIF2TIFF 1 "November 2, 2005" "libtiff"
.SH NAME
gif2tiff \- create a
.SM TIFF
@@ -44,7 +43,7 @@ The
image is created as a palette image, with samples
compressed with the Lempel-Ziv & Welch algorithm (\c
.IR Compression =5).
These characteristics can overriden, or explicitly specified
These characteristics can overridden, or explicitly specified
with the options described below.
.SH OPTIONS
.TP
@@ -52,9 +51,9 @@ with the options described below.
Specify a compression scheme to use when writing image data:
.B "\-c none"
for no compression,
.B "-c packbits"
.B "\-c packbits"
for the PackBits compression algorithm,
.B "-c zip"
.B "\-c zip"
for the Deflate compression algorithm,
and
.B "\-c lzw"
@@ -71,8 +70,11 @@ program which, in turn, is based on Marcel J.E. Mol's GIF reader.
.SH BUGS
Should have more options to control output format.
.SH "SEE ALSO"
.IR pal2rgb (1),
.IR tiffinfo (1),
.IR tiffcp (1),
.IR tiffmedian (1),
.IR libtiff (3)
.BR pal2rgb (1),
.BR tiffinfo (1),
.BR tiffcp (1),
.BR tiffmedian (1),
.BR libtiff (3)
.PP
Libtiff library home page:
.BR http://www.remotesensing.org/libtiff/
+16 -13
View File
@@ -1,7 +1,6 @@
.\" $Header: /usr/people/sam/tiff/man/RCS/ras2tiff.1,v 1.13 1995/10/11 19:42:00 sam Exp $
.\"
.\" Copyright (c) 1990-1995 Sam Leffler
.\" Copyright (c) 1991-1995 Silicon Graphics, Inc.
.\" Copyright (c) 1990-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
.\"
.\" Permission to use, copy, modify, distribute, and sell this software and
.\" its documentation for any purpose is hereby granted without fee, provided
@@ -23,7 +22,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
.TH RAS2TIFF 1 "October 15, 1995"
.TH RAS2TIFF 1 "November 2, 2005" "libtiff"
.SH NAME
ras2tiff \- create a
.SM TIFF
@@ -46,7 +45,7 @@ image is created with data samples packed (\c
compressed with the Lempel-Ziv & Welch algorithm (\c
.IR Compression =5),
and with each strip no more than 8 kilobytes.
These characteristics can overriden, or explicitly specified
These characteristics can overridden, or explicitly specified
with the options described below.
.PP
Any colormap information in the rasterfile is carried over to the
@@ -65,11 +64,11 @@ is 24 or 1 (min-is-black) if the depth is not 24.
Specify a compression scheme to use when writing image data:
.B "\-c none"
for no compression,
.B "-c packbits"
.B "\-c packbits"
for the PackBits compression algorithm,
.B "-c jpeg"
.B "\-c jpeg"
for the baseline JPEG compression algorithm,
.B "-c zip
.B "\-c zip
for the Deflate compression algorithm,
and
.B "\-c lzw"
@@ -85,8 +84,12 @@ In particular,
.I ras2tiff
does not handle run-length encoded images.
.SH "SEE ALSO"
.IR pal2rgb (1),
.IR tiffinfo (1),
.IR tiffcp (1),
.IR tiffmedian (1),
.IR libtiff (3)
.BR pal2rgb (1),
.BR tiffinfo (1),
.BR tiffcp (1),
.BR tiffmedian (1),
.BR libtiff (3)
.PP
Libtiff library home page:
.BR http://www.remotesensing.org/libtiff/
+14 -12
View File
@@ -1,7 +1,6 @@
.\" $Header: /usr/people/sam/tiff/man/RCS/sgi2tiff.1,v 1.8 1995/10/11 19:42:02 sam Exp $
.\"
.\" Copyright (c) 1991-1995 Sam Leffler
.\" Copyright (c) 1991-1995 Silicon Graphics, Inc.
.\" Copyright (c) 1991-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
.\"
.\" Permission to use, copy, modify, distribute, and sell this software and
.\" its documentation for any purpose is hereby granted without fee, provided
@@ -23,7 +22,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
.TH SGI2TIFF 1 "October 15, 1995"
.TH SGI2TIFF 1 "November 2, 2005" "libtiff"
.SH NAME
sgi2tiff \- create a
.SM TIFF
@@ -50,7 +49,7 @@ image is created with data samples packed (\c
compressed with the Lempel-Ziv & Welch algorithm (\c
.IR Compression =5),
and with each strip no more than 8 kilobytes.
These characteristics can overriden, or explicitly specified
These characteristics can overridden, or explicitly specified
with the options described below.
.SH OPTIONS
.TP
@@ -58,11 +57,11 @@ with the options described below.
Specify a compression scheme to use when writing image data:
.B "\-c none"
for no compression,
.B "-c packbits"
.B "\-c packbits"
for the PackBits compression algorithm),
.B "-c jpeg"
.B "\-c jpeg"
for the baseline JPEG compression algorithm,
.B "-c zip
.B "\-c zip
for the Deflate compression algorithm,
and
.B "\-c lzw"
@@ -84,7 +83,10 @@ is approximately 8 kilobytes.
.SH BUGS
Does not record colormap information.
.SH "SEE ALSO"
.IR tiffinfo (1),
.IR tiffcp (1),
.IR tiffmedian (1),
.IR libtiff (3)
.BR tiffinfo (1),
.BR tiffcp (1),
.BR tiffmedian (1),
.BR libtiff (3)
.PP
Libtiff library home page:
.BR http://www.remotesensing.org/libtiff/
+16 -14
View File
@@ -1,7 +1,6 @@
.\" $Header: /usr/people/sam/tiff/man/RCS/tiffsv.1,v 1.16 1995/10/11 19:42:10 sam Exp $
.\"
.\" Copyright (c) 1988-1995 Sam Leffler
.\" Copyright (c) 1991-1995 Silicon Graphics, Inc.
.\" Copyright (c) 1988-1997 Sam Leffler
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
.\"
.\" Permission to use, copy, modify, distribute, and sell this software and
.\" its documentation for any purpose is hereby granted without fee, provided
@@ -23,7 +22,7 @@
.\" OF THIS SOFTWARE.
.\"
.if n .po 0
.TH TIFFSV 1 "October 15, 1995"
.TH TIFFSV 1 "September 20, 2005" "libtiff"
.SH NAME
tiffsv \- save an image from the framebuffer in a
.SM TIFF
@@ -46,7 +45,7 @@ By default, the image is saved with data samples packed (\c
compressed with the Lempel-Ziv & Welch algorithm (\c
.IR Compression =5),
and with each strip no more than 8 kilobytes.
These characteristics can be overriden, or explicitly specified
These characteristics can be overridden, or explicitly specified
with the options described below.
.SH OPTIONS
.TP
@@ -126,14 +125,17 @@ with the appropriate options.
If data are saved compressed and in separate planes, then the
rows in each strip is silently set to one to avoid limitations
in the
.IR libtiff (3)
.BR libtiff (3TIFF)
library.
.SH "SEE ALSO"
.IR scrsave (6D)
.IR pal2rgb (1),
.IR tiffdump (1),
.IR tiffgt (1),
.IR tiffinfo (1),
.IR tiffcp (1),
.IR tiffmedian (1),
.IR libtiff (3)
.BR scrsave (6D)
.BR pal2rgb (1),
.BR tiffdump (1),
.BR tiffgt (1),
.BR tiffinfo (1),
.BR tiffcp (1),
.BR tiffmedian (1),
.BR libtiff (3TIFF)
.PP
Libtiff library home page:
.BR http://www.remotesensing.org/libtiff/
File diff suppressed because it is too large. Load diff
+632
View File
@@ -0,0 +1,632 @@
/*
* Copyright (c) 1990-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
/*
* convert a GIF file into a TIFF file.
* based on Paul Haeberli's fromgif program which in turn is
* based on a GIF file reader by Marcel J.E. Mol March 23 1989
*
* if input is 320 by 200 pixel aspect is probably 1.2
* if input is 640 350 pixel aspect is probably 1.37
*
*/
#include "tif_config.h"
#include <errno.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef NEED_LIBPORT
#include "libport.h"
#endif
#include "tiffio.h"
#define GIFGAMMA (1.5) /* smaller makes output img brighter */
#define IMAX 0xffff /* max intensity value */
#define EXTRAFUDGE 128 /* some people write BAD .gif files */
#define streq(a, b) (strcmp(a, b) == 0)
#define strneq(a, b, n) (strncmp(a, b, n) == 0)
unsigned short gamtab[256];
void makegamtab(float gam)
{
int i;
for (i = 0; i < 256; i++)
gamtab[i] = (unsigned short)(IMAX * pow(i / 255.0, gam) + 0.5);
}
char *stuff[] = {
"usage: gif2tiff [options] input.gif output.tif",
"where options are:",
" -r # make each strip have no more than # rows",
"",
" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
" -c zip[:opts] compress output with deflate encoding",
" -c packbits compress output with packbits encoding",
" -c none use no compression algorithm on output",
"",
"LZW and deflate options:",
" # set predictor value",
"For example, -c lzw:2 to get LZW-encoded data with horizontal "
"differencing",
NULL};
static void usage(void)
{
char buf[BUFSIZ];
int i;
setbuf(stderr, buf);
fprintf(stderr, "%s\n\n", TIFFGetVersion());
for (i = 0; stuff[i] != NULL; i++)
fprintf(stderr, "%s\n", stuff[i]);
exit(-1);
}
#define COLSIZE 256
unsigned char *stackp;
unsigned int prefix[4096];
unsigned char suffix[4096];
unsigned char stack[4096];
int datasize, codesize, codemask; /* Decoder working variables */
int clear, eoi; /* Special code values */
int avail, oldcode;
FILE *infile;
int global; /* Is there a global color map? */
int globalbits; /* Number of bits of global colors */
unsigned char globalmap[COLSIZE][3]; /* RGB values for global color map */
unsigned char *raster; /* Decoded image data */
unsigned long width, height;
unsigned short red[COLSIZE];
unsigned short green[COLSIZE];
unsigned short blue[COLSIZE];
char *filename, *imagename;
static uint16_t compression = COMPRESSION_PACKBITS;
static uint16_t predictor = 0;
static uint32_t rowsperstrip = (uint32_t)-1;
static int processCompressOptions(char *);
int convert(void);
int checksignature(void);
int readscreen(void);
int readgifimage(char *);
int readextension(void);
int readraster(void);
int process(int, unsigned char **);
void initcolors(unsigned char[COLSIZE][3], int);
void rasterize(int, char *);
int main(int argc, char *argv[])
{
#if !HAVE_DECL_OPTARG
extern int optind;
extern char *optarg;
#endif
int c, status;
while ((c = getopt(argc, argv, "c:r:")) != -1)
switch (c)
{
case 'c': /* compression scheme */
if (!processCompressOptions(optarg))
usage();
break;
case 'r': /* rows/strip */
rowsperstrip = atoi(optarg);
break;
case '?':
usage();
/*NOTREACHED*/
}
if (argc - optind != 2)
usage();
makegamtab(GIFGAMMA);
filename = argv[optind];
imagename = argv[optind + 1];
if ((infile = fopen(imagename, "rb")) != NULL)
{
int c;
fclose(infile);
printf("overwrite %s? ", imagename);
fflush(stdout);
c = getc(stdin);
if (c != 'y' && c != 'Y')
return (1);
}
if ((infile = fopen(filename, "rb")) == NULL)
{
perror(filename);
return (1);
}
status = convert();
fclose(infile);
return (status);
}
static int processCompressOptions(char *opt)
{
if (streq(opt, "none"))
compression = COMPRESSION_NONE;
else if (streq(opt, "packbits"))
compression = COMPRESSION_PACKBITS;
else if (strneq(opt, "lzw", 3))
{
char *cp = strchr(opt, ':');
if (cp)
predictor = atoi(cp + 1);
compression = COMPRESSION_LZW;
}
else if (strneq(opt, "zip", 3))
{
char *cp = strchr(opt, ':');
if (cp)
predictor = atoi(cp + 1);
compression = COMPRESSION_ADOBE_DEFLATE;
}
else
return (0);
return (1);
}
int convert(void)
{
int ch;
char *mode = "w";
if (!checksignature())
return (-1);
if (!readscreen())
return (-1);
while ((ch = getc(infile)) != ';' && ch != EOF)
{
switch (ch)
{
case '\0':
break; /* this kludge for non-standard files */
case ',':
if (!readgifimage(mode))
return (-1);
mode = "a"; /* subsequent images append */
break;
case '!':
if (!readextension())
return (-1);
break;
default:
fprintf(stderr, "illegal GIF block type\n");
return (-1);
}
}
return (0);
}
int checksignature(void)
{
char buf[6];
if (fread(buf, 1, 6, infile) != 6)
{
fprintf(stderr, "short read from file %s (%s)\n", filename,
strerror(errno));
return 0;
}
if (strncmp(buf, "GIF", 3))
{
fprintf(stderr, "file is not a GIF file\n");
return 0;
}
if (strncmp(&buf[3], "87a", 3))
{
fprintf(stderr, "unknown GIF version number\n");
return 0;
}
return 1;
}
/*
* readscreen -
* Get information which is global to all the images stored
* in the file
*/
int readscreen(void)
{
unsigned char buf[7];
if (fread(buf, 1, 7, infile) != 7)
{
fprintf(stderr, "short read from file %s (%s)\n", filename,
strerror(errno));
return 0;
}
global = buf[4] & 0x80;
if (global)
{
globalbits = (buf[4] & 0x07) + 1;
if (fread(globalmap, 3, ((size_t)1) << globalbits, infile) !=
((size_t)1) << globalbits)
{
fprintf(stderr, "short read from file %s (%s)\n", filename,
strerror(errno));
return 0;
}
}
return 1;
}
int readgifimage(char *mode)
{
unsigned char buf[9];
int local, interleaved;
unsigned char localmap[256][3];
int localbits;
int status;
size_t raster_size;
if (fread(buf, 1, 9, infile) != 9)
{
fprintf(stderr, "short read from file %s (%s)\n", filename,
strerror(errno));
return (0);
}
width = (buf[4] + (buf[5] << 8)) & 0xffff; /* 16 bit */
height = (buf[6] + (buf[7] << 8)) & 0xffff; /* 16 bit */
local = buf[8] & 0x80;
interleaved = buf[8] & 0x40;
if (width == 0UL || height == 0UL || (width > 2000000000UL / height))
{
fprintf(stderr, "Invalid value of width or height\n");
return (0);
}
if (local == 0 && global == 0)
{
fprintf(stderr, "no colormap present for image\n");
return (0);
}
raster_size = width * height;
if ((raster_size / width) == height)
{
raster_size += EXTRAFUDGE; /* Add elbow room */
}
else
{
raster_size = 0;
}
if ((raster = (unsigned char *)_TIFFmalloc(raster_size)) == NULL)
{
fprintf(stderr, "not enough memory for image\n");
return (0);
}
if (local)
{
localbits = (buf[8] & 0x7) + 1;
fprintf(stderr, " local colors: %d\n", 1 << localbits);
if (fread(localmap, 3, ((size_t)1) << localbits, infile) !=
((size_t)1) << localbits)
{
fprintf(stderr, "short read from file %s (%s)\n", filename,
strerror(errno));
return (0);
}
initcolors(localmap, 1 << localbits);
}
else if (global)
{
initcolors(globalmap, 1 << globalbits);
}
if ((status = readraster()))
rasterize(interleaved, mode);
_TIFFfree(raster);
return status;
}
/*
* readextension -
* Read a GIF extension block (and do nothing with it).
*
*/
int readextension(void)
{
int count;
char buf[255];
int status = 1;
(void)getc(infile);
while ((count = getc(infile)) && count <= 255)
if (fread(buf, 1, count, infile) != (size_t)count)
{
fprintf(stderr, "short read from file %s (%s)\n", filename,
strerror(errno));
status = 0;
break;
}
return status;
}
/*
* readraster -
* Decode a raster image
*
*/
int readraster(void)
{
unsigned char *fill = raster;
unsigned char buf[255];
register int bits = 0;
register unsigned long datum = 0;
register unsigned char *ch;
register int count, code;
int status = 1;
datasize = getc(infile);
if (datasize > 12)
return 0;
clear = 1 << datasize;
eoi = clear + 1;
avail = clear + 2;
oldcode = -1;
codesize = datasize + 1;
codemask = (1 << codesize) - 1;
for (code = 0; code < clear; code++)
{
prefix[code] = 0;
suffix[code] = code;
}
stackp = stack;
for (count = getc(infile); count > 0 && count <= 255; count = getc(infile))
{
if (fread(buf, 1, count, infile) != (size_t)count)
{
fprintf(stderr, "short read from file %s (%s)\n", filename,
strerror(errno));
return 0;
}
for (ch = buf; count-- > 0; ch++)
{
datum += (unsigned long)*ch << bits;
bits += 8;
while (bits >= codesize)
{
code = datum & codemask;
datum >>= codesize;
bits -= codesize;
if (code == eoi)
{ /* This kludge put in */
goto exitloop; /* because some GIF files*/
} /* aren't standard */
if (!process(code, &fill))
{
status = 0;
goto exitloop;
}
}
}
if (fill >= raster + width * height)
{
fprintf(stderr, "raster full before eoi code\n");
break;
}
}
exitloop:
if (fill != raster + width * height)
{
fprintf(stderr, "warning: wrong rastersize: %ld bytes\n",
(long)(fill - raster));
fprintf(stderr, " instead of %ld bytes\n",
(long)width * height);
}
return status;
}
/*
* process -
* Process a compression code. "clear" resets the code table.
* Otherwise make a new code table entry, and output the bytes
* associated with the code.
*/
int process(register int code, unsigned char **fill)
{
int incode;
static unsigned char firstchar;
if (code == clear)
{
codesize = datasize + 1;
codemask = (1 << codesize) - 1;
avail = clear + 2;
oldcode = -1;
return 1;
}
if (oldcode == -1)
{
if (code >= clear)
{
fprintf(stderr, "bad input: code=%d is larger than clear=%d\n",
code, clear);
return 0;
}
if (*fill >= raster + width * height)
{
fprintf(stderr, "raster full before eoi code\n");
return 0;
}
*(*fill)++ = suffix[code];
firstchar = oldcode = code;
return 1;
}
if (code > avail)
{
fprintf(stderr, "code %d too large for %d\n", code, avail);
return 0;
}
incode = code;
if (code == avail)
{ /* the first code is always < avail */
*stackp++ = firstchar;
code = oldcode;
}
while (code > clear)
{
*stackp++ = suffix[code];
code = prefix[code];
}
*stackp++ = firstchar = suffix[code];
prefix[avail] = oldcode;
suffix[avail] = firstchar;
avail++;
if (((avail & codemask) == 0) && (avail < 4096))
{
codesize++;
codemask += avail;
}
oldcode = incode;
do
{
if (*fill >= raster + width * height)
{
fprintf(stderr, "raster full before eoi code\n");
return 0;
}
*(*fill)++ = *--stackp;
} while (stackp > stack);
return 1;
}
/*
* initcolors -
* Convert a color map (local or global) to arrays with R, G and B
* values.
*
*/
void initcolors(unsigned char colormap[COLSIZE][3], int ncolors)
{
register int i;
for (i = 0; i < ncolors; i++)
{
red[i] = gamtab[colormap[i][0]];
green[i] = gamtab[colormap[i][1]];
blue[i] = gamtab[colormap[i][2]];
}
}
void rasterize(int interleaved, char *mode)
{
register unsigned long row;
unsigned char *newras;
unsigned char *ras;
TIFF *tif;
tstrip_t strip;
tsize_t stripsize;
if ((newras = (unsigned char *)_TIFFmalloc(width * height + EXTRAFUDGE)) ==
NULL)
{
fprintf(stderr, "not enough memory for image\n");
return;
}
#define DRAWSEGMENT(offset, step) \
{ \
for (row = offset; row < height; row += step) \
{ \
_TIFFmemcpy(newras + row * width, ras, width); \
ras += width; \
} \
}
ras = raster;
if (interleaved)
{
DRAWSEGMENT(0, 8);
DRAWSEGMENT(4, 8);
DRAWSEGMENT(2, 4);
DRAWSEGMENT(1, 2);
}
else
DRAWSEGMENT(0, 1);
#undef DRAWSEGMENT
tif = TIFFOpen(imagename, mode);
if (!tif)
{
TIFFError(imagename, "Can not open output image");
exit(-1);
}
TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, (uint32_t)width);
TIFFSetField(tif, TIFFTAG_IMAGELENGTH, (uint32_t)height);
TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_PALETTE);
TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1);
TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP,
rowsperstrip = TIFFDefaultStripSize(tif, rowsperstrip));
TIFFSetField(tif, TIFFTAG_COMPRESSION, compression);
switch (compression)
{
case COMPRESSION_LZW:
case COMPRESSION_ADOBE_DEFLATE:
case COMPRESSION_DEFLATE:
if (predictor != 0)
TIFFSetField(tif, TIFFTAG_PREDICTOR, predictor);
break;
}
TIFFSetField(tif, TIFFTAG_COLORMAP, red, green, blue);
TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
strip = 0;
stripsize = TIFFStripSize(tif);
for (row = 0; row < height; row += rowsperstrip)
{
if (rowsperstrip > height - row)
{
rowsperstrip = height - row;
stripsize = TIFFVStripSize(tif, rowsperstrip);
}
if (TIFFWriteEncodedStrip(tif, strip, newras + row * width, stripsize) <
0)
break;
strip++;
}
TIFFClose(tif);
_TIFFfree(newras);
}
+367
View File
@@ -0,0 +1,367 @@
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#include "tif_config.h"
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef NEED_LIBPORT
#include "libport.h"
#endif
#include "rasterfile.h"
#include "tiffio.h"
#ifndef howmany
#define howmany(x, y) (((x) + ((y)-1)) / (y))
#endif
#define streq(a, b) (strcmp(a, b) == 0)
#define strneq(a, b, n) (strncmp(a, b, n) == 0)
static uint16_t compression = (uint16_t)-1;
static int jpegcolormode = JPEGCOLORMODE_RGB;
static int quality = 75; /* JPEG quality */
static uint16_t predictor = 0;
static void usage(void);
static int processCompressOptions(char *);
int main(int argc, char *argv[])
{
unsigned char *buf;
long row;
tsize_t linebytes, scanline;
TIFF *out;
FILE *in;
struct rasterfile h;
uint16_t photometric;
uint16_t config = PLANARCONFIG_CONTIG;
uint32_t rowsperstrip = (uint32_t)-1;
int c;
#if !HAVE_DECL_OPTARG
extern int optind;
extern char *optarg;
#endif
while ((c = getopt(argc, argv, "c:r:h")) != -1)
switch (c)
{
case 'c': /* compression scheme */
if (!processCompressOptions(optarg))
usage();
break;
case 'r': /* rows/strip */
rowsperstrip = atoi(optarg);
break;
case 'h':
usage();
/*NOTREACHED*/
}
if (argc - optind != 2)
usage();
in = fopen(argv[optind], "rb");
if (in == NULL)
{
fprintf(stderr, "%s: Can not open.\n", argv[optind]);
return (-1);
}
if (fread(&h, sizeof(h), 1, in) != 1)
{
fprintf(stderr, "%s: Can not read header.\n", argv[optind]);
fclose(in);
return (-2);
}
if (strcmp(h.ras_magic, RAS_MAGIC) == 0)
{
#ifndef WORDS_BIGENDIAN
TIFFSwabLong((uint32_t *)&h.ras_width);
TIFFSwabLong((uint32_t *)&h.ras_height);
TIFFSwabLong((uint32_t *)&h.ras_depth);
TIFFSwabLong((uint32_t *)&h.ras_length);
TIFFSwabLong((uint32_t *)&h.ras_type);
TIFFSwabLong((uint32_t *)&h.ras_maptype);
TIFFSwabLong((uint32_t *)&h.ras_maplength);
#endif
}
else if (strcmp(h.ras_magic, RAS_MAGIC_INV) == 0)
{
#ifdef WORDS_BIGENDIAN
TIFFSwabLong((uint32_t *)&h.ras_width);
TIFFSwabLong((uint32_t *)&h.ras_height);
TIFFSwabLong((uint32_t *)&h.ras_depth);
TIFFSwabLong((uint32_t *)&h.ras_length);
TIFFSwabLong((uint32_t *)&h.ras_type);
TIFFSwabLong((uint32_t *)&h.ras_maptype);
TIFFSwabLong((uint32_t *)&h.ras_maplength);
#endif
}
else
{
fprintf(stderr, "%s: Not a rasterfile.\n", argv[optind]);
fclose(in);
return (-3);
}
if ((h.ras_width <= 0) || (h.ras_width >= INT_MAX) || (h.ras_height <= 0) ||
(h.ras_height >= INT_MAX) || (h.ras_depth <= 0) ||
(h.ras_depth >= INT_MAX) || (h.ras_length <= 0) ||
(h.ras_length >= INT_MAX) || (h.ras_type <= 0) ||
(h.ras_maptype <= 0) || (h.ras_maplength <= 0) ||
(h.ras_maplength >= INT_MAX))
{
fprintf(stderr, "%s: Improper image header.\n", argv[optind]);
fclose(in);
return (-2);
}
if ((h.ras_depth != 1) && (h.ras_depth != 8) && (h.ras_depth != 24))
{
fprintf(stderr, "%s: Improper image depth (%d).\n", argv[optind],
h.ras_depth);
fclose(in);
return (-2);
}
out = TIFFOpen(argv[optind + 1], "w");
if (out == NULL)
{
fclose(in);
return (-4);
}
TIFFSetField(out, TIFFTAG_IMAGEWIDTH, (uint32_t)h.ras_width);
TIFFSetField(out, TIFFTAG_IMAGELENGTH, (uint32_t)h.ras_height);
TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, h.ras_depth > 8 ? 3 : 1);
TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, h.ras_depth > 1 ? 8 : 1);
TIFFSetField(out, TIFFTAG_PLANARCONFIG, config);
if (h.ras_maptype != RMT_NONE)
{
uint16_t *red;
register uint16_t *map;
register int i, j;
int mapsize;
buf = (unsigned char *)_TIFFmalloc(h.ras_maplength);
if (buf == NULL)
{
fprintf(stderr, "No space to read in colormap.\n");
fclose(in);
(void)TIFFClose(out);
return (-5);
}
if (fread(buf, h.ras_maplength, 1, in) != 1)
{
fprintf(stderr, "%s: Read error on colormap.\n", argv[optind]);
fclose(in);
(void)TIFFClose(out);
return (-6);
}
mapsize = 1 << h.ras_depth;
if (h.ras_maplength > mapsize * 3)
{
fprintf(stderr, "%s: Huh, %d colormap entries, should be %d?\n",
argv[optind], h.ras_maplength, mapsize * 3);
fclose(in);
(void)TIFFClose(out);
return (-7);
}
red = (uint16_t *)_TIFFmalloc(mapsize * 3 * sizeof(uint16_t));
if (red == NULL)
{
fprintf(stderr, "No space for colormap.\n");
fclose(in);
(void)TIFFClose(out);
return (-8);
}
map = red;
for (j = 0; j < 3; j++)
{
#define SCALE(x) (((x) * ((1L << 16) - 1)) / 255)
for (i = h.ras_maplength / 3; i-- > 0;)
*map++ = SCALE(*buf++);
if ((i = h.ras_maplength / 3) < mapsize)
{
i = mapsize - i;
_TIFFmemset(map, 0, i * sizeof(uint16_t));
map += i;
}
}
TIFFSetField(out, TIFFTAG_COLORMAP, red, red + mapsize,
red + 2 * mapsize);
photometric = PHOTOMETRIC_PALETTE;
if (compression == (uint16_t)-1)
compression = COMPRESSION_PACKBITS;
TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
}
else
{
/* XXX this is bogus... */
photometric =
h.ras_depth == 24 ? PHOTOMETRIC_RGB : PHOTOMETRIC_MINISBLACK;
if (compression == (uint16_t)-1)
compression = COMPRESSION_LZW;
TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
}
switch (compression)
{
case COMPRESSION_JPEG:
if (photometric == PHOTOMETRIC_RGB &&
jpegcolormode == JPEGCOLORMODE_RGB)
photometric = PHOTOMETRIC_YCBCR;
TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality);
TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode);
break;
case COMPRESSION_LZW:
case COMPRESSION_ADOBE_DEFLATE:
case COMPRESSION_DEFLATE:
if (predictor != 0)
TIFFSetField(out, TIFFTAG_PREDICTOR, predictor);
break;
}
TIFFSetField(out, TIFFTAG_PHOTOMETRIC, photometric);
linebytes = ((h.ras_depth * h.ras_width + 15) >> 3) & ~1;
scanline = TIFFScanlineSize(out);
if (scanline > linebytes)
{
buf = (unsigned char *)_TIFFmalloc(scanline);
_TIFFmemset(buf + linebytes, 0, scanline - linebytes);
}
else
buf = (unsigned char *)_TIFFmalloc(linebytes);
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,
TIFFDefaultStripSize(out, rowsperstrip));
for (row = 0; row < h.ras_height; row++)
{
if (fread(buf, linebytes, 1, in) != 1)
{
fprintf(stderr, "%s: scanline %ld: Read error.\n", argv[optind],
row);
break;
}
if (h.ras_type == RT_STANDARD && h.ras_depth == 24)
{
tsize_t cc = h.ras_width;
unsigned char *cp = buf;
#define SWAP(a, b) \
{ \
unsigned char t = (a); \
(a) = (b); \
(b) = t; \
}
do
{
SWAP(cp[0], cp[2]);
cp += 3;
} while (--cc);
}
if (TIFFWriteScanline(out, buf, row, 0) < 0)
break;
}
(void)TIFFClose(out);
fclose(in);
return (0);
}
static int processCompressOptions(char *opt)
{
if (streq(opt, "none"))
compression = COMPRESSION_NONE;
else if (streq(opt, "packbits"))
compression = COMPRESSION_PACKBITS;
else if (strneq(opt, "jpeg", 4))
{
char *cp = strchr(opt, ':');
compression = COMPRESSION_JPEG;
while (cp)
{
if (isdigit((int)cp[1]))
quality = atoi(cp + 1);
else if (cp[1] == 'r')
jpegcolormode = JPEGCOLORMODE_RAW;
else
usage();
cp = strchr(cp + 1, ':');
}
}
else if (strneq(opt, "lzw", 3))
{
char *cp = strchr(opt, ':');
if (cp)
predictor = atoi(cp + 1);
compression = COMPRESSION_LZW;
}
else if (strneq(opt, "zip", 3))
{
char *cp = strchr(opt, ':');
if (cp)
predictor = atoi(cp + 1);
compression = COMPRESSION_ADOBE_DEFLATE;
}
else
return (0);
return (1);
}
char *stuff[] = {
"usage: ras2tiff [options] input.ras output.tif",
"where options are:",
" -r # make each strip have no more than # rows",
"",
" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
" -c zip[:opts] compress output with deflate encoding",
" -c jpeg[:opts] compress output with JPEG encoding",
" -c packbits compress output with packbits encoding",
" -c none use no compression algorithm on output",
"",
"JPEG options:",
" # set compression quality level (0-100, default 75)",
" r output color image as RGB rather than YCbCr",
"For example, -c jpeg:r:50 to get JPEG-encoded RGB data with 50% comp. "
"quality",
"",
"LZW and deflate options:",
" # set predictor value",
"For example, -c lzw:2 to get LZW-encoded data with horizontal "
"differencing",
" -h this help message",
NULL};
static void usage(void)
{
char buf[BUFSIZ];
int i;
setbuf(stderr, buf);
fprintf(stderr, "%s\n\n", TIFFGetVersion());
for (i = 0; stuff[i] != NULL; i++)
fprintf(stderr, "%s\n", stuff[i]);
exit(-1);
}
+43
View File
@@ -0,0 +1,43 @@
#include "tiff.h"
/*
* Description of header for files containing raster images
*/
struct rasterfile
{
char ras_magic[4]; /* magic number */
int32_t ras_width; /* width (pixels) of image */
int32_t ras_height; /* height (pixels) of image */
int32_t ras_depth; /* depth (1, 8, or 24 bits) of pixel */
int32_t ras_length; /* length (bytes) of image */
int32_t ras_type; /* type of file; see RT_* below */
int32_t ras_maptype; /* type of colormap; see RMT_* below */
int32_t ras_maplength; /* length (bytes) of following map */
/* color map follows for ras_maplength bytes, followed by image */
};
#define RAS_MAGIC "\x59\xa6\x6a\x95"
#define RAS_MAGIC_INV "\x95\x6a\xa6\x59"
/* Sun supported ras_type's */
#define RT_OLD 0 /* Raw pixrect image in 68000 byte order */
#define RT_STANDARD 1 /* Raw pixrect image in 68000 byte order */
#define RT_BYTE_ENCODED 2 /* Run-length compression of bytes */
#define RT_EXPERIMENTAL 0xffff /* Reserved for testing */
/* Sun registered ras_maptype's */
#define RMT_RAW 2
/* Sun supported ras_maptype's */
#define RMT_NONE 0 /* ras_maplength is expected to be 0 */
#define RMT_EQUAL_RGB 1 /* red[ras_maplength/3],green[],blue[] */
/*
* NOTES:
* Each line of the image is rounded out to a multiple of 16 bits.
* This corresponds to the rounding convention used by the memory pixrect
* package (/usr/include/pixrect/memvar.h) of the SunWindows system.
* The ras_encoding field (always set to 0 by Sun's supported software)
* was renamed to ras_length in release 2.0. As a result, rasterfiles
* of type 0 generated by the old software claim to have 0 length; for
* compatibility, code reading rasterfiles must be prepared to compute the
* true length from the width, height, and depth fields.
*/
+346
View File
@@ -0,0 +1,346 @@
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#include <ctype.h>
#include <gl/image.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "tiffio.h"
#define streq(a, b) (strcmp(a, b) == 0)
#define strneq(a, b, n) (strncmp(a, b, n) == 0)
static short config = PLANARCONFIG_CONTIG;
static uint16_t compression = COMPRESSION_PACKBITS;
static uint16_t predictor = 0;
static uint16_t fillorder = 0;
static uint32_t rowsperstrip = (uint32_t)-1;
static int jpegcolormode = JPEGCOLORMODE_RGB;
static int quality = 75; /* JPEG quality */
static uint16_t photometric;
static void usage(void);
static int cpContig(IMAGE *, TIFF *);
static int cpSeparate(IMAGE *, TIFF *);
static int processCompressOptions(char *);
/* XXX image library has no prototypes */
extern IMAGE *iopen(const char *, const char *);
extern void iclose(IMAGE *);
extern void getrow(IMAGE *, short *, int, int);
int main(int argc, char *argv[])
{
IMAGE *in;
TIFF *out;
int c;
#if !HAVE_DECL_OPTARG
extern int optind;
extern char *optarg;
#endif
while ((c = getopt(argc, argv, "c:p:r:")) != -1)
switch (c)
{
case 'c': /* compression scheme */
if (!processCompressOptions(optarg))
usage();
break;
case 'f': /* fill order */
if (streq(optarg, "lsb2msb"))
fillorder = FILLORDER_LSB2MSB;
else if (streq(optarg, "msb2lsb"))
fillorder = FILLORDER_MSB2LSB;
else
usage();
break;
case 'p': /* planar configuration */
if (streq(optarg, "separate"))
config = PLANARCONFIG_SEPARATE;
else if (streq(optarg, "contig"))
config = PLANARCONFIG_CONTIG;
else
usage();
break;
case 'r': /* rows/strip */
rowsperstrip = atoi(optarg);
break;
case '?':
usage();
/*NOTREACHED*/
}
if (argc - optind != 2)
usage();
in = iopen(argv[optind], "r");
if (in == NULL)
return (-1);
out = TIFFOpen(argv[optind + 1], "w");
if (out == NULL)
return (-2);
TIFFSetField(out, TIFFTAG_IMAGEWIDTH, (uint32_t)in->xsize);
TIFFSetField(out, TIFFTAG_IMAGELENGTH, (uint32_t)in->ysize);
TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 8);
TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
if (in->zsize == 1)
photometric = PHOTOMETRIC_MINISBLACK;
else
photometric = PHOTOMETRIC_RGB;
switch (compression)
{
case COMPRESSION_JPEG:
if (photometric == PHOTOMETRIC_RGB &&
jpegcolormode == JPEGCOLORMODE_RGB)
photometric = PHOTOMETRIC_YCBCR;
TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality);
TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode);
break;
case COMPRESSION_LZW:
case COMPRESSION_ADOBE_DEFLATE:
case COMPRESSION_DEFLATE:
if (predictor != 0)
TIFFSetField(out, TIFFTAG_PREDICTOR, predictor);
break;
}
TIFFSetField(out, TIFFTAG_PHOTOMETRIC, photometric);
if (fillorder != 0)
TIFFSetField(out, TIFFTAG_FILLORDER, fillorder);
TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, in->zsize);
if (in->zsize > 3)
{
uint16_t v[1];
v[0] = EXTRASAMPLE_UNASSALPHA;
TIFFSetField(out, TIFFTAG_EXTRASAMPLES, 1, v);
}
TIFFSetField(out, TIFFTAG_MINSAMPLEVALUE, (uint16_t)in->min);
TIFFSetField(out, TIFFTAG_MAXSAMPLEVALUE, (uint16_t)in->max);
TIFFSetField(out, TIFFTAG_PLANARCONFIG, config);
if (config != PLANARCONFIG_SEPARATE)
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,
TIFFDefaultStripSize(out, rowsperstrip));
else /* force 1 row/strip for library limitation */
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, 1L);
if (in->name[0] != '\0')
TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, in->name);
if (config == PLANARCONFIG_CONTIG)
cpContig(in, out);
else
cpSeparate(in, out);
(void)iclose(in);
(void)TIFFClose(out);
return (0);
}
static int processCompressOptions(char *opt)
{
if (streq(opt, "none"))
compression = COMPRESSION_NONE;
else if (streq(opt, "packbits"))
compression = COMPRESSION_PACKBITS;
else if (strneq(opt, "jpeg", 4))
{
char *cp = strchr(opt, ':');
defcompression = COMPRESSION_JPEG;
while (cp)
{
if (isdigit((int)cp[1]))
quality = atoi(cp + 1);
else if (cp[1] == 'r')
jpegcolormode = JPEGCOLORMODE_RAW;
else
usage();
cp = strchr(cp + 1, ':');
}
}
else if (strneq(opt, "lzw", 3))
{
char *cp = strchr(opt, ':');
if (cp)
predictor = atoi(cp + 1);
compression = COMPRESSION_LZW;
}
else if (strneq(opt, "zip", 3))
{
char *cp = strchr(opt, ':');
if (cp)
predictor = atoi(cp + 1);
compression = COMPRESSION_ADOBE_DEFLATE;
}
else
return (0);
return (1);
}
static int cpContig(IMAGE *in, TIFF *out)
{
tdata_t buf = _TIFFmalloc(TIFFScanlineSize(out));
short *r = NULL;
int x, y;
if (in->zsize == 3)
{
short *g, *b;
r = (short *)_TIFFmalloc(3 * in->xsize * sizeof(short));
g = r + in->xsize;
b = g + in->xsize;
for (y = in->ysize - 1; y >= 0; y--)
{
uint8_t *pp = (uint8_t *)buf;
getrow(in, r, y, 0);
getrow(in, g, y, 1);
getrow(in, b, y, 2);
for (x = 0; x < in->xsize; x++)
{
pp[0] = r[x];
pp[1] = g[x];
pp[2] = b[x];
pp += 3;
}
if (TIFFWriteScanline(out, buf, in->ysize - y - 1, 0) < 0)
goto bad;
}
}
else if (in->zsize == 4)
{
short *g, *b, *a;
r = (short *)_TIFFmalloc(4 * in->xsize * sizeof(short));
g = r + in->xsize;
b = g + in->xsize;
a = b + in->xsize;
for (y = in->ysize - 1; y >= 0; y--)
{
uint8_t *pp = (uint8_t *)buf;
getrow(in, r, y, 0);
getrow(in, g, y, 1);
getrow(in, b, y, 2);
getrow(in, a, y, 3);
for (x = 0; x < in->xsize; x++)
{
pp[0] = r[x];
pp[1] = g[x];
pp[2] = b[x];
pp[3] = a[x];
pp += 4;
}
if (TIFFWriteScanline(out, buf, in->ysize - y - 1, 0) < 0)
goto bad;
}
}
else
{
uint8_t *pp = (uint8_t *)buf;
r = (short *)_TIFFmalloc(in->xsize * sizeof(short));
for (y = in->ysize - 1; y >= 0; y--)
{
getrow(in, r, y, 0);
for (x = in->xsize - 1; x >= 0; x--)
pp[x] = r[x];
if (TIFFWriteScanline(out, buf, in->ysize - y - 1, 0) < 0)
goto bad;
}
}
if (r)
_TIFFfree(r);
_TIFFfree(buf);
return (1);
bad:
if (r)
_TIFFfree(r);
_TIFFfree(buf);
return (0);
}
static int cpSeparate(IMAGE *in, TIFF *out)
{
tdata_t buf = _TIFFmalloc(TIFFScanlineSize(out));
short *r = (short *)_TIFFmalloc(in->xsize * sizeof(short));
uint8_t *pp = (uint8_t *)buf;
int x, y, z;
for (z = 0; z < in->zsize; z++)
{
for (y = in->ysize - 1; y >= 0; y--)
{
getrow(in, r, y, z);
for (x = 0; x < in->xsize; x++)
pp[x] = r[x];
if (TIFFWriteScanline(out, buf, in->ysize - y - 1, z) < 0)
goto bad;
}
}
_TIFFfree(r);
_TIFFfree(buf);
return (1);
bad:
_TIFFfree(r);
_TIFFfree(buf);
return (0);
}
char *stuff[] = {
"usage: sgi2tiff [options] input.rgb output.tif",
"where options are:",
" -r # make each strip have no more than # rows",
"",
" -p contig pack samples contiguously (e.g. RGBRGB...)",
" -p separate store samples separately (e.g. RRR...GGG...BBB...)",
"",
" -f lsb2msb force lsb-to-msb FillOrder for output",
" -f msb2lsb force msb-to-lsb FillOrder for output",
"",
" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
" -c zip[:opts] compress output with deflate encoding",
" -c jpeg[:opts]compress output with JPEG encoding",
" -c packbits compress output with packbits encoding",
" -c none use no compression algorithm on output",
"",
"JPEG options:",
" # set compression quality level (0-100, default 75)",
" r output color image as RGB rather than YCbCr",
"",
"LZW and deflate options:",
" # set predictor value",
"For example, -c lzw:2 to get LZW-encoded data with horizontal "
"differencing",
NULL};
static void usage(void)
{
char buf[BUFSIZ];
int i;
setbuf(stderr, buf);
for (i = 0; stuff[i] != NULL; i++)
fprintf(stderr, "%s\n", stuff[i]);
exit(-1);
}
+322
View File
@@ -0,0 +1,322 @@
/*
* Copyright (c) 1990-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <gl.h>
#include "tiffio.h"
typedef unsigned char unsigned char;
typedef unsigned long uint32_t;
#define streq(a, b) (strcmp(a, b) == 0)
#define strneq(a, b, n) (strncmp(a, b, n) == 0)
uint32_t rowsperstrip = (uint32_t)-1;
uint16_t compression = COMPRESSION_PACKBITS;
uint16_t config = PLANARCONFIG_CONTIG;
uint16_t predictor = 0;
int xmaxscreen;
int ymaxscreen;
uint16_t photometric = PHOTOMETRIC_RGB;
int jpegcolormode = JPEGCOLORMODE_RGB;
int quality = 75; /* JPEG quality */
static void usage(void);
static void tiffsv(char *, int, int, int, int);
int main(int argc, char *argv[])
{
int c;
#if !HAVE_DECL_OPTARG
extern int optind;
extern char *optarg;
#endif
while ((c = getopt(argc, argv, "c:p:r:")) != -1)
switch (c)
{
case 'b': /* save as b&w */
photometric = PHOTOMETRIC_MINISBLACK;
break;
case 'c': /* compression scheme */
if (streq(optarg, "none"))
compression = COMPRESSION_NONE;
else if (streq(optarg, "packbits"))
compression = COMPRESSION_PACKBITS;
else if (strneq(optarg, "jpeg", 4))
{
char *cp = strchr(optarg, ':');
if (cp && isdigit(cp[1]))
quality = atoi(cp + 1);
if (cp && strchr(cp, 'r'))
jpegcolormode = JPEGCOLORMODE_RAW;
compression = COMPRESSION_JPEG;
}
else if (strneq(optarg, "lzw", 3))
{
char *cp = strchr(optarg, ':');
if (cp)
predictor = atoi(cp + 1);
compression = COMPRESSION_LZW;
}
else
usage();
break;
case 'p': /* planar configuration */
if (streq(optarg, "separate"))
config = PLANARCONFIG_SEPARATE;
else if (streq(optarg, "contig"))
config = PLANARCONFIG_CONTIG;
else
usage();
break;
case 'r': /* rows/strip */
rowsperstrip = atoi(optarg);
break;
case '?':
usage();
/*NOTREACHED*/
}
if (argc - optind != 1 && argc - optind != 5)
usage();
xmaxscreen = getgdesc(GD_XPMAX) - 1;
ymaxscreen = getgdesc(GD_YPMAX) - 1;
foreground();
noport();
winopen("tiffsv");
if (argc - optind == 5)
tiffsv(argv[optind], atoi(argv[optind + 1]), atoi(argv[optind + 2]),
atoi(argv[optind + 3]), atoi(argv[optind + 4]));
else
tiffsv(argv[optind], 0, xmaxscreen, 0, ymaxscreen);
return (0);
}
char *stuff[] = {
"usage: tiffsv [options] outimage.tif [x1 x2 y1 y2] [-b]",
"where options are:",
" -p contig pack samples contiguously (e.g. RGBRGB...)",
" -p separate store samples separately (e.g. RRR...GGG...BBB...)",
"",
" -r # make each strip have no more than # rows",
"",
" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
" -c jpeg[:opts]compress output with JPEG encoding",
" -c packbits compress output with packbits encoding",
" -c none use no compression algorithm on output",
"",
"JPEG options:",
" # set compression quality level (0-100, default 75)",
" r output color image as RGB rather than YCbCr",
"",
"LZW options:",
" # set predictor value for Lempel-Ziv & Welch encoding",
"For example, -c lzw:2 to get LZW-encoded data with horizontal "
"differencing",
NULL};
static void usage(void)
{
char buf[BUFSIZ];
int i;
setbuf(stderr, buf);
for (i = 0; stuff[i] != NULL; i++)
fprintf(stderr, "%s\n", stuff[i]);
exit(-1);
}
static void svRGBSeparate(TIFF *tif, uint32_t *ss, int xsize, int ysize)
{
tsize_t stripsize = TIFFStripSize(tif);
unsigned char *rbuf = (unsigned char *)_TIFFmalloc(3 * stripsize);
unsigned char *gbuf = rbuf + stripsize;
unsigned char *bbuf = gbuf + stripsize;
register int y;
for (y = 0; y <= ysize; y += rowsperstrip)
{
unsigned char *rp, *gp, *bp;
register int x;
register uint32_t n;
n = rowsperstrip;
if (n > ysize - y + 1)
n = ysize - y + 1;
rp = rbuf;
gp = gbuf;
bp = bbuf;
do
{
for (x = 0; x <= xsize; x++)
{
uint32_t v = ss[x];
rp[x] = v;
gp[x] = v >> 8;
bp[x] = v >> 16;
}
rp += xsize + 1, gp += xsize + 1, bp += xsize + 1;
ss += xsize + 1;
} while (--n);
if (TIFFWriteEncodedStrip(tif, TIFFComputeStrip(tif, y, 0), rbuf,
stripsize) < 0)
break;
if (TIFFWriteEncodedStrip(tif, TIFFComputeStrip(tif, y, 1), gbuf,
stripsize) < 0)
break;
if (TIFFWriteEncodedStrip(tif, TIFFComputeStrip(tif, y, 2), bbuf,
stripsize) < 0)
break;
}
_TIFFfree(rbuf);
}
static void svRGBContig(TIFF *tif, uint32_t *ss, int xsize, int ysize)
{
register int x, y;
tsize_t stripsize = TIFFStripSize(tif);
unsigned char *strip = (unsigned char *)_TIFFmalloc(stripsize);
for (y = 0; y <= ysize; y += rowsperstrip)
{
register unsigned char *pp = strip;
register uint32_t n;
n = rowsperstrip;
if (n > ysize - y + 1)
n = ysize - y + 1;
do
{
for (x = 0; x <= xsize; x++)
{
uint32_t v = ss[x];
pp[0] = v;
pp[1] = v >> 8;
pp[2] = v >> 16;
pp += 3;
}
ss += xsize + 1;
} while (--n);
if (TIFFWriteEncodedStrip(tif, TIFFComputeStrip(tif, y, 0), strip,
stripsize) < 0)
break;
}
_TIFFfree(strip);
}
#undef RED
#undef GREEN
#undef BLUE
#define CVT(x) (((x)*255) / 100)
#define RED CVT(28) /* 28% */
#define GREEN CVT(59) /* 59% */
#define BLUE CVT(11) /* 11% */
static void svGrey(TIFF *tif, uint32_t *ss, int xsize, int ysize)
{
register int x, y;
unsigned char *buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(tif));
for (y = 0; y <= ysize; y++)
{
for (x = 0; x <= xsize; x++)
{
unsigned char *cp = (unsigned char *)&ss[x];
buf[x] = (RED * cp[3] + GREEN * cp[2] + BLUE * cp[1]) >> 8;
}
if (TIFFWriteScanline(tif, buf, (uint32_t)y, 0) < 0)
break;
ss += xsize + 1;
}
_TIFFfree(buf);
}
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ABS(x) ((x) < 0 ? -(x) : (x))
static void tiffsv(char *name, int x1, int x2, int y1, int y2)
{
TIFF *tif;
int xsize, ysize;
int xorg, yorg;
uint32_t *scrbuf;
xorg = MIN(x1, x2);
yorg = MIN(y1, y2);
if (xorg < 0)
xorg = 0;
if (yorg < 0)
yorg = 0;
xsize = ABS(x2 - x1);
ysize = ABS(y2 - y1);
if (xorg + xsize > xmaxscreen)
xsize = xmaxscreen - xorg;
if (yorg + ysize > ymaxscreen)
ysize = ymaxscreen - yorg;
tif = TIFFOpen(name, "w");
TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, (uint32_t)(xsize + 1));
TIFFSetField(tif, TIFFTAG_IMAGELENGTH, (uint32_t)(ysize + 1));
TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL,
photometric == PHOTOMETRIC_RGB ? 3 : 1);
TIFFSetField(tif, TIFFTAG_PLANARCONFIG, config);
TIFFSetField(tif, TIFFTAG_COMPRESSION, compression);
switch (compression)
{
case COMPRESSION_JPEG:
if (photometric == PHOTOMETRIC_RGB &&
jpegcolormode == JPEGCOLORMODE_RGB)
photometric = PHOTOMETRIC_YCBCR;
TIFFSetField(tif, TIFFTAG_JPEGQUALITY, quality);
TIFFSetField(tif, TIFFTAG_JPEGCOLORMODE, jpegcolormode);
break;
case COMPRESSION_LZW:
if (predictor != 0)
TIFFSetField(tif, TIFFTAG_PREDICTOR, predictor);
break;
}
TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photometric);
TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_BOTLEFT);
rowsperstrip = TIFFDefaultStripSize(tif, rowsperstrip);
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
scrbuf =
(uint32_t *)_TIFFmalloc((xsize + 1) * (ysize + 1) * sizeof(uint32_t));
readdisplay(xorg, yorg, xorg + xsize, yorg + ysize, scrbuf, RD_FREEZE);
if (photometric == PHOTOMETRIC_RGB)
{
if (config == PLANARCONFIG_SEPARATE)
svRGBSeparate(tif, scrbuf, xsize, ysize);
else
svRGBContig(tif, scrbuf, xsize, ysize);
}
else
svGrey(tif, scrbuf, xsize, ysize);
(void)TIFFClose(tif);
_TIFFfree((char *)scrbuf);
}
+148
View File
@@ -0,0 +1,148 @@
float ycbcrCoeffs[3] = {.299, .587, .114};
/* default coding range is CCIR Rec 601-1 with no headroom/footroom */
unsigned long refBlackWhite[6] = {0, 255, 128, 255, 128, 255};
#define LumaRed ycbcrCoeffs[0]
#define LumaGreen ycbcrCoeffs[1]
#define LumaBlue ycbcrCoeffs[2]
long eRtotal = 0;
long eGtotal = 0;
long eBtotal = 0;
long preveRtotal = 0;
long preveGtotal = 0;
long preveBtotal = 0;
unsigned long AbseRtotal = 0;
unsigned long AbseGtotal = 0;
unsigned long AbseBtotal = 0;
unsigned long eCodes = 0;
unsigned long preveCodes = 0;
unsigned long eBits = 0;
unsigned long preveBits = 0;
static void setupLumaTables();
static int abs(int v) { return (v < 0 ? -v : v); }
static double pct(int v, double range) { return (v * 100. / range); }
static void check(int R, int G, int B);
float D1, D2;
float D3, D4;
float D5, D6;
int main(int argc, char **argv)
{
int R, G, B;
if (argc > 1)
{
refBlackWhite[0] = 16;
refBlackWhite[1] = 235;
refBlackWhite[2] = 128;
refBlackWhite[3] = 240;
refBlackWhite[4] = 128;
refBlackWhite[5] = 240;
}
D3 = 2 - 2 * LumaRed;
D4 = 2 - 2 * LumaBlue;
D1 = 1. / D3;
D2 = 1. / D4;
D5 = D3 * LumaRed / LumaGreen;
D6 = D4 * LumaBlue / LumaGreen;
setupLumaTables();
for (R = 0; R < 256; R++)
{
for (G = 0; G < 256; G++)
for (B = 0; B < 256; B++)
check(R, G, B);
printf("[%3u] c %u/%u b %u/%u (R %u/%d/%u G %u/%d/%u B %u/%d/%u)\n", R,
eCodes - preveCodes, eCodes, eBits - preveBits, eBits,
abs(AbseRtotal - preveRtotal), eRtotal, AbseRtotal,
abs(AbseGtotal - preveGtotal), eGtotal, AbseGtotal,
abs(AbseBtotal - preveBtotal), eBtotal, AbseBtotal);
preveRtotal = AbseRtotal;
preveGtotal = AbseGtotal;
preveBtotal = AbseBtotal;
preveCodes = eCodes;
preveBits = eBits;
}
printf("%u total codes\n", 256 * 256 * 256);
printf("total error: %u codes %u bits (R %d/%u G %d/%u B %d/%u)\n", eCodes,
eBits, eRtotal, AbseRtotal, eGtotal, AbseGtotal, eBtotal,
AbseBtotal);
return (0);
}
float *lumaRed;
float *lumaGreen;
float *lumaBlue;
static float *setupLuma(float c)
{
float *v = (float *)_TIFFmalloc(256 * sizeof(float));
int i;
for (i = 0; i < 256; i++)
v[i] = c * i;
return (v);
}
static void setupLumaTables(void)
{
lumaRed = setupLuma(LumaRed);
lumaGreen = setupLuma(LumaGreen);
lumaBlue = setupLuma(LumaBlue);
}
static unsigned V2Code(float f, unsigned long RB, unsigned long RW, int CR)
{
unsigned int c = (unsigned int)((((f) * (RW - RB) / CR) + RB) + .5);
return (c > 255 ? 255 : c);
}
#define Code2V(c, RB, RW, CR) ((((c) - (int)RB) * (float)CR) / (float)(RW - RB))
#define CLAMP(f, min, max) \
(int)((f) + .5 < (min) ? (min) : (f) + .5 > (max) ? (max) : (f) + .5)
static void check(int R, int G, int B)
{
float Y, Cb, Cr;
int iY, iCb, iCr;
float rY, rCb, rCr;
float rR, rG, rB;
int eR, eG, eB;
Y = lumaRed[R] + lumaGreen[G] + lumaBlue[B];
Cb = (B - Y) * D2;
Cr = (R - Y) * D1;
iY = V2Code(Y, refBlackWhite[0], refBlackWhite[1], 255);
iCb = V2Code(Cb, refBlackWhite[2], refBlackWhite[3], 127);
iCr = V2Code(Cr, refBlackWhite[4], refBlackWhite[5], 127);
rCb = Code2V(iCb, refBlackWhite[2], refBlackWhite[3], 127);
rCr = Code2V(iCr, refBlackWhite[4], refBlackWhite[5], 127);
rY = Code2V(iY, refBlackWhite[0], refBlackWhite[1], 255);
rR = rY + rCr * D3;
rB = rY + rCb * D4;
rG = rY - rCb * D6 - rCr * D5;
eR = R - CLAMP(rR, 0, 255);
eG = G - CLAMP(rG, 0, 255);
eB = B - CLAMP(rB, 0, 255);
if (abs(eR) > 1 || abs(eG) > 1 || abs(eB) > 1)
{
printf("R %u G %u B %u", R, G, B);
printf(" Y %g Cb %g Cr %g", Y, Cb, Cr);
printf(" iY %u iCb %u iCr %u", iY, iCb, iCr);
printf("\n -> Y %g Cb %g Cr %g", rY, rCb, rCr);
printf(" R %g (%u) G %g (%u) B %g (%u) E=[%d %d %d])\n", rR,
CLAMP(rR, 0, 255), rG, CLAMP(rG, 0, 255), rB, CLAMP(rB, 0, 255),
eR, eG, eB);
}
eRtotal += eR;
eGtotal += eG;
eBtotal += eB;
AbseRtotal += abs(eR);
AbseGtotal += abs(eG);
AbseBtotal += abs(eB);
if (eR | eG | eB)
eCodes++;
eBits += abs(eR) + abs(eG) + abs(eB);
}
Executable
+31
View File
@@ -0,0 +1,31 @@
#!/bin/sh
retval=0
set -x
case `uname` in
Darwin*)
glibtoolize --force --copy || retval=$?
;;
*)
libtoolize --force --copy || retval=$?
;;
esac
aclocal -I ./m4 || retval=$?
autoheader || retval=$?
automake --foreign --add-missing --copy || retval=$?
autoconf || retval=$?
# Get latest config.guess and config.sub from upstream master since
# these are often out of date.
for file in config.guess config.sub
do
echo "$0: getting $file..."
wget -q --timeout=5 -O config/$file.tmp \
"https://git.savannah.gnu.org/cgit/config.git/plain/${file}" \
&& mv -f config/$file.tmp config/$file \
&& chmod a+x config/$file || retval=$?
rm -f config/$file.tmp
done
exit $retval
+23
View File
@@ -0,0 +1,23 @@
# CMake build for libtiff
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
+12 -12
View File
@@ -1,11 +1,8 @@
#! /bin/sh
# $Header: /usr/people/sam/tiff/dist/RCS/newversion,v 1.1 1994/12/17 18:27:58 sam Exp $
#
# TIFF Software
# Tag Image File Format (TIFF) Software
#
# Copyright (C) 2007, Andrey Kiselev <dron@ak4719.spb.edu>
#
# Copyright (c) 1994, 1995 Sam Leffler
# Copyright (c) 1994, 1995 Silicon Graphics, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and
# its documentation for any purpose is hereby granted without fee, provided
# that (i) the above copyright notices and this permission notice appear in
@@ -24,9 +21,12 @@
# 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.
#
rm -f tiff.version
awk '
$1 ~ /.*beta/ { print "define TIFF_VNUM " $0 }
$1 !~ /.*beta/{ print "define TIFF_VNUM \"" $0 " (release)\"" }
' ../VERSION > tiff.version
# Process this file with automake to produce Makefile.in.
EXTRA_DIST = \
CMakeLists.txt \
README
SUBDIRS =
+3
View File
@@ -0,0 +1,3 @@
This directory contains scripts and tools needed to build libtiff library
and its utilities in various environments.
+124
View File
@@ -0,0 +1,124 @@
#!/bin/sh
# This script is used for testing the build, primarily for use
# with GitLab CI, but may be used by hand as well.
set -e
set -x
# Test autoconf build
autoconf_build()
{
autoreconf -ivf
mkdir autoconf-build
cd autoconf-build
echo "Running ../configure --prefix=$(pwd)/../autoconf-install) ${opts}"
CFLAGS="-Wall -Wextra -Werror" ../configure --prefix=$(pwd)/../autoconf-install ${opts}
make
make install
make check
make distcheck
mkdir ../distribution
cp tiff-*.tar.* tiff*.zip ../distribution
}
# Test autoconf build (minimal; no distcheck)
autoconf_build_minimal()
{
autoreconf -ivf
mkdir autoconf-build
cd autoconf-build
echo "Running ../configure --prefix=$(pwd)/../autoconf-install) ${opts}"
CFLAGS="-Wall -Wextra -Werror" ../configure --prefix=$(pwd)/../autoconf-install ${opts}
make
make install
make check
}
# Test cmake build
cmake_build()
{
PATH="$(pwd)/tools/bin:$PATH"
if [ "$(uname -s)" = "Darwin" ]; then
PATH="$(pwd)/tools/CMake.app/Contents/bin:$PATH"
fi
mkdir cmake-build
cd cmake-build
opts="-Dfatal-warnings=ON"
para3=`echo "$3" | sed 's/./\L&/g'`
if [ "$para3" = "static" ]; then
opts2="-DBUILD_SHARED_LIBS:BOOL=OFF"
else
opts2=""
fi
echo "Running cmake -G "$1" -DCMAKE_UNITY_BUILD=ON -DCMAKE_BUILD_TYPE="$2" -DCMAKE_INSTALL_PREFIX=../cmake-install ${opts} ${opts2} .."
cmake -G "$1" -DCMAKE_UNITY_BUILD=ON -DCMAKE_BUILD_TYPE="$2" -DCMAKE_INSTALL_PREFIX=../cmake-install -DCMAKE_C_FLAGS="-Wall -Wextra -Werror" ${opts} ${opts2} ..
$COVERITY_BUILD cmake --build .
cmake --build . --target install
ctest -V
cd ..
if [ "$para3" = "static" ]; then
echo No test project build for STATIC CI/CD build - skipped -.
else
# Build test project using find_package(Tiff CONFIG)
mkdir cmake-test-build
cd cmake-test-build
cmake -G "$1" -DCMAKE_BUILD_TYPE="$2" "-DTiff_DIR=$PWD/../cmake-install/lib/cmake/tiff" -S ../build/test_cmake -B .
cmake --build .
cd ..
mkdir cmake-test-no-target-build
cd cmake-test-no-target-build
cmake -G "$1" -DCMAKE_BUILD_TYPE="$2" "-DTiff_DIR=$PWD/../cmake-install/lib/cmake/tiff" -S ../build/test_cmake_no_target -B .
cmake --build .
# Return to cmake-build for coverity_build()
cd ../cmake-build
fi
}
# Static-analysis with coverity
coverity_build()
{
curl -o /tmp/cov-analysis-linux64.tgz \
https://scan.coverity.com/download/linux64 \
--form project=$COVERITY_SCAN_PROJECT_NAME \
--form token=$COVERITY_SCAN_TOKEN
tar xfz /tmp/cov-analysis-linux64.tgz
COVERITY_BUILD="$(pwd)/cov-analysis-linux64-*/bin/cov-build --dir cov-int" cmake_build "$@"
tar cfz cov-int.tar.gz cov-int
curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME \
--form token=$COVERITY_SCAN_TOKEN \
--form email=$GITLAB_USER_EMAIL \
--form file=@cov-int.tar.gz \
--form version="`git describe --tags`" \
--form description="`git describe --tags` / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
}
build=$1
shift
case $build in
autoconf)
echo "Testing Autoconf build"
autoconf_build "$@"
;;
autoconf-minimal)
echo "Testing Autoconf build (minimal)"
autoconf_build_minimal "$@"
;;
cmake)
echo "Testing CMake build"
cmake_build "$@"
;;
coverity)
echo "Static analysis with Coverity"
coverity_build "$@"
;;
*)
echo "Invalid argument: \"$arg\"" >&2
exit 1
;;
esac
exit 0
+7
View File
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.9.0)
project(test)
find_package(Tiff CONFIG REQUIRED)
add_executable(test test.c)
target_link_libraries(test PRIVATE TIFF::tiff)
+7
View File
@@ -0,0 +1,7 @@
#include "tiffio.h"
int main()
{
TIFFGetVersion();
return 0;
}
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.9.0)
project(test)
find_package(Tiff CONFIG REQUIRED)
add_executable(test test.c)
target_include_directories(test PRIVATE ${TIFF_INCLUDE_DIR})
target_link_libraries(test PRIVATE ${TIFF_LIBRARIES})
+7
View File
@@ -0,0 +1,7 @@
#include "tiffio.h"
int main()
{
TIFFGetVersion();
return 0;
}
+32
View File
@@ -0,0 +1,32 @@
# Autotools compatibility
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# For autotools header compatibility
set(PACKAGE_NAME "LibTIFF Software")
set(PACKAGE_TARNAME "${PROJECT_NAME}")
set(PACKAGE_VERSION "${PROJECT_VERSION}${LIBTIFF_ALPHA_VERSION}")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "tiff@lists.osgeo.org")
+56
View File
@@ -0,0 +1,56 @@
# Read version information from configure.ac.
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# Get version from configure.ac
FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/configure.ac" configure REGEX "^LIBTIFF_.*=")
foreach(line ${configure})
foreach(var LIBTIFF_MAJOR_VERSION LIBTIFF_MINOR_VERSION LIBTIFF_MICRO_VERSION LIBTIFF_ALPHA_VERSION
LIBTIFF_CURRENT LIBTIFF_REVISION LIBTIFF_AGE)
if(NOT ${var} AND line MATCHES "^${var}=(.*)")
set(${var} "${CMAKE_MATCH_1}")
break()
endif()
endforeach()
endforeach()
# Package version
set(LIBTIFF_VERSION "${LIBTIFF_MAJOR_VERSION}.${LIBTIFF_MINOR_VERSION}.${LIBTIFF_MICRO_VERSION}")
set(LIBTIFF_VERSION_FULL "${LIBTIFF_VERSION}${LIBTIFF_ALPHA_VERSION}")
# Get release version from file VERSION
FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" LIBTIFF_RELEASE_VERSION)
# Package date - get it from file RELEASE-DATE
FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/RELEASE-DATE" LIBTIFF_RELEASE_DATE)
# Convert the libtool version variables to proper major and minor versions
math(EXPR SO_MAJOR "${LIBTIFF_CURRENT} - ${LIBTIFF_AGE}")
set(SO_MINOR "${LIBTIFF_AGE}")
set(SO_REVISION "${LIBTIFF_REVISION}")
# Library version (unlike libtool's baroque scheme, WYSIWYG here)
set(SO_COMPATVERSION "${SO_MAJOR}")
set(SO_VERSION "${SO_MAJOR}.${SO_MINOR}.${SO_REVISION}")
+32
View File
@@ -0,0 +1,32 @@
# C++ library option
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# C++ support
option(cxx "Enable C++ stream API building (requires C++ compiler)" ON)
set(CXX_SUPPORT FALSE)
if (cxx)
enable_language(CXX)
set(CXX_SUPPORT TRUE)
endif()
+124
View File
@@ -0,0 +1,124 @@
# Compiler feature checks
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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(CheckCCompilerFlag)
# These are annoyingly verbose, produce false positives or don't work
# nicely with all supported compiler versions, so are disabled unless
# explicitly enabled.
option(extra-warnings "Enable extra compiler warnings" OFF)
# This will cause the compiler to fail when an error occurs.
option(fatal-warnings "Compiler warnings are errors" OFF)
# Check if the compiler supports each of the following additional
# flags, and enable them if supported. This greatly improves the
# quality of the build by checking for a number of common problems,
# some of which are quite serious.
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
CMAKE_C_COMPILER_ID MATCHES "Clang")
set(test_flags
-Wall
-Winline
-Wformat-security
-Wpointer-arith
-Wdisabled-optimization
-Wno-unknown-pragmas
-fstrict-aliasing)
if(extra-warnings)
list(APPEND test_flags
-pedantic
-Wextra
-Wformat
-Wformat-overflow
-Wformat-nonliteral
-Wformat-signedness
-Wformat-truncation
-Wdeclaration-after-statement
-Wconversion
-Wsign-conversion
-Wnull-dereference
-Wdouble-promotion
-Wmisleading-indentation
-Wmissing-include-dirs
-Wswitch-default
-Wswitch-enum
-Wunused-local-typedefs
-Wunused-parameter
-Wuninitialized
-Warith-conversion
-Wbool-operation
-Wduplicated-branches
-Wduplicated-cond
-Wshadow
-Wunused-macros
-Wc99-c11-compat
-Wcast-qual
-Wcast-align
-Wwrite-strings
-Wdangling-else
-Wsizeof-array-div
-Wsizeof-pointer-div
-Wsizeof-pointer-memaccess
-Wlogical-op
-Wlogical-not-parentheses
-Wstrict-prototypes
-Wmissing-declarations
-Wredundant-decls
-Wno-int-to-pointer-cast
-Wfloat-equal
-Wfloat-conversion
-Wmissing-prototypes
-Wunreachable-code)
endif()
if(fatal-warnings)
list(APPEND test_flags
-Werror)
endif()
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
set(test_flags)
if(extra-warnings)
list(APPEND test_flags
/W4)
else()
list(APPEND test_flags
/W3)
endif()
if (fatal-warnings)
list(APPEND test_flags
/WX)
endif()
endif()
foreach(flag ${test_flags})
string(REGEX REPLACE "[^A-Za-z0-9]" "_" flag_var "${flag}")
set(test_c_flag "C_FLAG${flag_var}")
CHECK_C_COMPILER_FLAG(${flag} "${test_c_flag}")
if (${test_c_flag})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
endif (${test_c_flag})
endforeach(flag ${test_flags})
+45
View File
@@ -0,0 +1,45 @@
# Checks for deflate codec support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# ZLIB
set(ZLIB_SUPPORT FALSE)
find_package(ZLIB)
option(zlib "use zlib (required for Deflate compression)" ${ZLIB_FOUND})
if(zlib AND ZLIB_FOUND)
set(ZLIB_SUPPORT TRUE)
endif()
set(ZIP_SUPPORT ${ZLIB_SUPPORT})
# libdeflate
set(LIBDEFLATE_SUPPORT FALSE)
find_package(Deflate)
option(libdeflate "use libdeflate (optional for faster Deflate support, still requires zlib)" ${Deflate_FOUND})
if (libdeflate AND Deflate_FOUND AND ZIP_SUPPORT)
set(LIBDEFLATE_SUPPORT TRUE)
endif()
if(Deflate_FOUND AND NOT ZIP_SUPPORT)
message(WARNING "libdeflate available but zlib is not. libdeflate cannot be used")
endif()
+72
View File
@@ -0,0 +1,72 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindCMath
--------
Find the native CMath includes and library.
IMPORTED Targets
^^^^^^^^^^^^^^^^
This module defines :prop_tgt:`IMPORTED` target ``CMath::CMath``, if
CMath has been found.
Result Variables
^^^^^^^^^^^^^^^^
This module defines the following variables:
::
CMath_INCLUDE_DIRS - Where to find math.h
CMath_LIBRARIES - List of libraries when using CMath.
CMath_FOUND - True if CMath found.
#]=======================================================================]
include(CheckSymbolExists)
include(CheckLibraryExists)
check_symbol_exists(pow "math.h" CMath_HAVE_LIBC_POW)
find_library(CMath_LIBRARY NAMES m)
if(NOT CMath_HAVE_LIBC_POW)
set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${CMath_LIBRARY})
check_symbol_exists(pow "math.h" CMath_HAVE_LIBM_POW)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
endif()
set(CMath_pow FALSE)
if(CMath_HAVE_LIBC_POW OR CMath_HAVE_LIBM_POW)
set(CMath_pow TRUE)
endif()
set(CMath_INCLUDE_DIRS)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CMath REQUIRED_VARS CMath_pow)
if(CMath_FOUND)
if(NOT CMath_INCLUDE_DIRS)
set(CMath_INCLUDE_DIRS)
endif()
if(NOT CMath_LIBRARIES)
if (CMath_LIBRARY)
set(CMath_LIBRARIES ${CMath_LIBRARY})
endif()
endif()
if(NOT TARGET CMath::CMath)
if(CMath_LIBRARIES)
add_library(CMath::CMath UNKNOWN IMPORTED)
set_target_properties(CMath::CMath PROPERTIES
IMPORTED_LOCATION "${CMath_LIBRARY}")
else()
add_library(CMath::CMath INTERFACE IMPORTED)
endif()
endif()
endif()
+115
View File
@@ -0,0 +1,115 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindDeflate
--------
Find the native Deflate includes and library.
IMPORTED Targets
^^^^^^^^^^^^^^^^
This module defines :prop_tgt:`IMPORTED` target ``Deflate::Deflate``, if
Deflate has been found.
Result Variables
^^^^^^^^^^^^^^^^
This module defines the following variables:
::
Deflate_INCLUDE_DIRS - where to find deflate.h, etc.
Deflate_LIBRARIES - List of libraries when using deflate.
Deflate_FOUND - True if deflate found.
::
Deflate_VERSION_STRING - The version of deflate found (x.y.z)
Deflate_VERSION_MAJOR - The major version of deflate
Deflate_VERSION_MINOR - The minor version of deflate
Debug and Release variants are found separately.
#]=======================================================================]
# Standard names to search for
set(Deflate_NAMES deflate deflatestatic)
set(Deflate_NAMES_DEBUG deflated deflatestaticd)
find_path(Deflate_INCLUDE_DIR
NAMES libdeflate.h
PATH_SUFFIXES include)
set(Deflate_OLD_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
# Library has a "lib" prefix even on Windows.
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
# Allow Deflate_LIBRARY to be set manually, as the location of the deflate library
if(NOT Deflate_LIBRARY)
find_library(Deflate_LIBRARY_RELEASE
NAMES ${Deflate_NAMES}
PATH_SUFFIXES lib)
find_library(Deflate_LIBRARY_DEBUG
NAMES ${Deflate_NAMES_DEBUG}
PATH_SUFFIXES lib)
include(SelectLibraryConfigurations)
select_library_configurations(Deflate)
endif()
set(CMAKE_FIND_LIBRARY_PREFIXES "${Deflate_OLD_FIND_LIBRARY_PREFIXES}")
unset(Deflate_NAMES)
unset(Deflate_NAMES_DEBUG)
unset(Deflate_OLD_FIND_LIBRARY_PREFIXES)
mark_as_advanced(Deflate_INCLUDE_DIR)
if(Deflate_INCLUDE_DIR AND EXISTS "${Deflate_INCLUDE_DIR}/libdeflate.h")
file(STRINGS "${Deflate_INCLUDE_DIR}/libdeflate.h" Deflate_H REGEX "^#define[\t ]+LIBDEFLATE_VERSION_STRING[\t ]+.*")
string(REGEX REPLACE "^.*LIBDEFLATE_VERSION_STRING[\t ]+\"([0-9]+).*$" "\\1" Deflate_MAJOR_VERSION "${Deflate_H}")
string(REGEX REPLACE "^.*LIBDEFLATE_VERSION_STRING[\t ]\"[0-9]+\\.([0-9]+).*$" "\\1" Deflate_MINOR_VERSION "${Deflate_H}")
set(Deflate_VERSION_STRING "${Deflate_MAJOR_VERSION}.${Deflate_MINOR_VERSION}")
set(Deflate_VERSION_MAJOR "${Deflate_MAJOR_VERSION}")
set(Deflate_VERSION_MINOR "${Deflate_MINOR_VERSION}")
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Deflate
REQUIRED_VARS Deflate_LIBRARY Deflate_INCLUDE_DIR
VERSION_VAR Deflate_VERSION_STRING)
if(Deflate_FOUND)
set(Deflate_INCLUDE_DIRS ${Deflate_INCLUDE_DIR})
if(NOT Deflate_LIBRARIES)
set(Deflate_LIBRARIES ${Deflate_LIBRARY})
endif()
if(NOT TARGET Deflate::Deflate)
add_library(Deflate::Deflate UNKNOWN IMPORTED)
set_target_properties(Deflate::Deflate PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Deflate_INCLUDE_DIRS}")
if(Deflate_LIBRARY_RELEASE)
set_property(TARGET Deflate::Deflate APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(Deflate::Deflate PROPERTIES
IMPORTED_LOCATION_RELEASE "${Deflate_LIBRARY_RELEASE}")
endif()
if(Deflate_LIBRARY_DEBUG)
set_property(TARGET Deflate::Deflate APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(Deflate::Deflate PROPERTIES
IMPORTED_LOCATION_DEBUG "${Deflate_LIBRARY_DEBUG}")
endif()
if(NOT Deflate_LIBRARY_RELEASE AND NOT Deflate_LIBRARY_DEBUG)
set_target_properties(Deflate::Deflate PROPERTIES
IMPORTED_LOCATION "${Deflate_LIBRARY}")
endif()
endif()
endif()
+116
View File
@@ -0,0 +1,116 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindJBIG
--------
Find the native JBIG includes and library.
IMPORTED Targets
^^^^^^^^^^^^^^^^
This module defines :prop_tgt:`IMPORTED` target ``JBIG::JBIG``, if
JBIG has been found.
Result Variables
^^^^^^^^^^^^^^^^
This module defines the following variables:
::
JBIG_INCLUDE_DIRS - where to find jbig.h, etc.
JBIG_LIBRARIES - List of libraries when using jbig.
JBIG_FOUND - True if jbig found.
::
JBIG_VERSION_STRING - The version of jbig found (x.y.z)
JBIG_VERSION_MAJOR - The major version of jbig
JBIG_VERSION_MINOR - The minor version of jbig
Debug and Release variants are found separately.
#]=======================================================================]
# Standard names to search for
set(JBIG_NAMES jbig)
set(JBIG_NAMES_DEBUG jbigd)
find_path(JBIG_INCLUDE_DIR
NAMES jbig.h
PATH_SUFFIXES include)
set(JBIG_OLD_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
# Library has a "lib" prefix even on Windows.
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
# Allow JBIG_LIBRARY to be set manually, as the location of the jbig library
if(NOT JBIG_LIBRARY)
find_library(JBIG_LIBRARY_RELEASE
NAMES ${JBIG_NAMES}
PATH_SUFFIXES lib)
find_library(JBIG_LIBRARY_DEBUG
NAMES ${JBIG_NAMES_DEBUG}
PATH_SUFFIXES lib)
include(SelectLibraryConfigurations)
select_library_configurations(JBIG)
endif()
set(CMAKE_FIND_LIBRARY_PREFIXES "${JBIG_OLD_FIND_LIBRARY_PREFIXES}")
unset(JBIG_NAMES)
unset(JBIG_NAMES_DEBUG)
unset(JBIG_OLD_FIND_LIBRARY_PREFIXES)
mark_as_advanced(JBIG_INCLUDE_DIR)
if(JBIG_INCLUDE_DIR AND EXISTS "${JBIG_INCLUDE_DIR}/jbig.h")
file(STRINGS "${JBIG_INCLUDE_DIR}/jbig.h" JBIG_H REGEX "^#define JBG_VERSION *\"[^\"]*\"$")
string(REGEX REPLACE "^.*JBG_VERSION *\"([0-9]+).*$" "\\1" JBIG_MAJOR_VERSION "${JBIG_H}")
string(REGEX REPLACE "^.*JBG_VERSION *\"[0-9]+\\.([0-9]+).*$" "\\1" JBIG_MINOR_VERSION "${JBIG_H}")
set(JBIG_VERSION_STRING "${JBIG_MAJOR_VERSION}.${JBIG_MINOR_VERSION}")
set(JBIG_MAJOR_VERSION "${JBIG_VERSION_MAJOR}")
set(JBIG_MINOR_VERSION "${JBIG_VERSION_MINOR}")
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JBIG
REQUIRED_VARS JBIG_LIBRARY JBIG_INCLUDE_DIR
VERSION_VAR JBIG_VERSION_STRING)
if(JBIG_FOUND)
set(JBIG_INCLUDE_DIRS ${JBIG_INCLUDE_DIR})
if(NOT JBIG_LIBRARIES)
set(JBIG_LIBRARIES ${JBIG_LIBRARY})
endif()
if(NOT TARGET JBIG::JBIG)
add_library(JBIG::JBIG UNKNOWN IMPORTED)
set_target_properties(JBIG::JBIG PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${JBIG_INCLUDE_DIRS}")
if(JBIG_LIBRARY_RELEASE)
set_property(TARGET JBIG::JBIG APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(JBIG::JBIG PROPERTIES
IMPORTED_LOCATION_RELEASE "${JBIG_LIBRARY_RELEASE}")
endif()
if(JBIG_LIBRARY_DEBUG)
set_property(TARGET JBIG::JBIG APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(JBIG::JBIG PROPERTIES
IMPORTED_LOCATION_DEBUG "${JBIG_LIBRARY_DEBUG}")
endif()
if(NOT JBIG_LIBRARY_RELEASE AND NOT JBIG_LIBRARY_DEBUG)
set_target_properties(JBIG::JBIG PROPERTIES
IMPORTED_LOCATION "${JBIG_LIBRARY}")
endif()
endif()
endif()
+142
View File
@@ -0,0 +1,142 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindJPEG
--------
Find the Joint Photographic Experts Group (JPEG) library (``libjpeg``)
Imported targets
^^^^^^^^^^^^^^^^
.. versionadded:: 3.12
This module defines the following :prop_tgt:`IMPORTED` targets:
``JPEG::JPEG``
The JPEG library, if found.
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project:
``JPEG_FOUND``
If false, do not try to use JPEG.
``JPEG_INCLUDE_DIRS``
where to find jpeglib.h, etc.
``JPEG_LIBRARIES``
the libraries needed to use JPEG.
``JPEG_VERSION``
.. versionadded:: 3.12
the version of the JPEG library found
Cache variables
^^^^^^^^^^^^^^^
The following cache variables may also be set:
``JPEG_INCLUDE_DIRS``
where to find jpeglib.h, etc.
``JPEG_LIBRARY_RELEASE``
where to find the JPEG library (optimized).
``JPEG_LIBRARY_DEBUG``
where to find the JPEG library (debug).
.. versionadded:: 3.12
Debug and Release variand are found separately.
Obsolete variables
^^^^^^^^^^^^^^^^^^
``JPEG_INCLUDE_DIR``
where to find jpeglib.h, etc. (same as JPEG_INCLUDE_DIRS)
``JPEG_LIBRARY``
where to find the JPEG library.
#]=======================================================================]
find_path(JPEG_INCLUDE_DIR jpeglib.h)
set(jpeg_names ${JPEG_NAMES} jpeg jpeg-static libjpeg libjpeg-static turbojpeg turbojpeg-static)
foreach(name ${jpeg_names})
list(APPEND jpeg_names_debug "${name}d")
endforeach()
if(NOT JPEG_LIBRARY)
find_library(JPEG_LIBRARY_RELEASE NAMES ${jpeg_names} NAMES_PER_DIR)
find_library(JPEG_LIBRARY_DEBUG NAMES ${jpeg_names_debug} NAMES_PER_DIR)
include(SelectLibraryConfigurations)
select_library_configurations(JPEG)
mark_as_advanced(JPEG_LIBRARY_RELEASE JPEG_LIBRARY_DEBUG)
endif()
unset(jpeg_names)
unset(jpeg_names_debug)
if(JPEG_INCLUDE_DIR)
file(GLOB _JPEG_CONFIG_HEADERS_FEDORA "${JPEG_INCLUDE_DIR}/jconfig*.h")
file(GLOB _JPEG_CONFIG_HEADERS_DEBIAN "${JPEG_INCLUDE_DIR}/*/jconfig.h")
set(_JPEG_CONFIG_HEADERS
"${JPEG_INCLUDE_DIR}/jpeglib.h"
${_JPEG_CONFIG_HEADERS_FEDORA}
${_JPEG_CONFIG_HEADERS_DEBIAN})
foreach (_JPEG_CONFIG_HEADER IN LISTS _JPEG_CONFIG_HEADERS)
if (NOT EXISTS "${_JPEG_CONFIG_HEADER}")
continue ()
endif ()
file(STRINGS "${_JPEG_CONFIG_HEADER}"
jpeg_lib_version REGEX "^#define[\t ]+JPEG_LIB_VERSION[\t ]+.*")
if (NOT jpeg_lib_version)
continue ()
endif ()
string(REGEX REPLACE "^#define[\t ]+JPEG_LIB_VERSION[\t ]+([0-9]+).*"
"\\1" JPEG_VERSION "${jpeg_lib_version}")
break ()
endforeach ()
unset(jpeg_lib_version)
unset(_JPEG_CONFIG_HEADER)
unset(_JPEG_CONFIG_HEADERS)
unset(_JPEG_CONFIG_HEADERS_FEDORA)
unset(_JPEG_CONFIG_HEADERS_DEBIAN)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(JPEG
REQUIRED_VARS JPEG_LIBRARY JPEG_INCLUDE_DIR
VERSION_VAR JPEG_VERSION)
if(JPEG_FOUND)
set(JPEG_LIBRARIES ${JPEG_LIBRARY})
set(JPEG_INCLUDE_DIRS "${JPEG_INCLUDE_DIR}")
if(NOT TARGET JPEG::JPEG)
add_library(JPEG::JPEG UNKNOWN IMPORTED)
if(JPEG_INCLUDE_DIRS)
set_target_properties(JPEG::JPEG PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${JPEG_INCLUDE_DIRS}")
endif()
if(EXISTS "${JPEG_LIBRARY}")
set_target_properties(JPEG::JPEG PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${JPEG_LIBRARY}")
endif()
if(EXISTS "${JPEG_LIBRARY_RELEASE}")
set_property(TARGET JPEG::JPEG APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(JPEG::JPEG PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
IMPORTED_LOCATION_RELEASE "${JPEG_LIBRARY_RELEASE}")
endif()
if(EXISTS "${JPEG_LIBRARY_DEBUG}")
set_property(TARGET JPEG::JPEG APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(JPEG::JPEG PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
IMPORTED_LOCATION_DEBUG "${JPEG_LIBRARY_DEBUG}")
endif()
endif()
endif()
mark_as_advanced(JPEG_LIBRARY JPEG_INCLUDE_DIR)
+100
View File
@@ -0,0 +1,100 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindLerc
--------
Find the native Lerc includes and library.
IMPORTED Targets
^^^^^^^^^^^^^^^^
This module defines :prop_tgt:`IMPORTED` target ``LERC::LERC``, if
LERC has been found.
Result Variables
^^^^^^^^^^^^^^^^
This module defines the following variables:
::
LERC_INCLUDE_DIRS - where to find Lerc_c_api.h, etc.
LERC_LIBRARIES - List of libraries when using LERC.
LERC_FOUND - True if LERC found.
LERC_VERSION_STRING - version number as a string (ex: "4.0.1")
#]=======================================================================]
# Standard names to search for
set(LERC_NAMES LercLib Lerc)
find_path(LERC_INCLUDE_DIR
NAMES Lerc_c_api.h
PATH_SUFFIXES include)
# Allow LERC_LIBRARY to be set manually, as the location of the deflate library
if(NOT LERC_LIBRARY)
find_library(LERC_LIBRARY_RELEASE
NAMES ${LERC_NAMES}
PATH_SUFFIXES lib)
include(SelectLibraryConfigurations)
select_library_configurations(LERC)
endif()
unset(LERC_NAMES)
mark_as_advanced(LERC_INCLUDE_DIR)
if(LERC_INCLUDE_DIR AND EXISTS "${LERC_INCLUDE_DIR}/Lerc_c_api.h")
file(STRINGS "${LERC_INCLUDE_DIR}/Lerc_c_api.h" LERC_H REGEX "^#define[\t ]+LERC_VERSION_[A-Z]+[\t ]+[0-9]+")
string(REGEX REPLACE "^.*#define[\t ]+LERC_VERSION_MAJOR[\t ]+([0-9]+).*$" "\\1" LERC_VERSION_MAJOR "${LERC_H}")
string(REGEX REPLACE "^.*#define[\t ]+LERC_VERSION_MINOR[\t ]+([0-9]+).*$" "\\1" LERC_VERSION_MINOR "${LERC_H}")
string(REGEX REPLACE "^.*#define[\t ]+LERC_VERSION_PATCH[\t ]+([0-9]+).*$" "\\1" LERC_VERSION_PATCH "${LERC_H}")
set(LERC_VERSION_STRING "${LERC_VERSION_MAJOR}.${LERC_VERSION_MINOR}.${LERC_VERSION_PATCH}")
unset(LERC_H)
unset(LERC_VERSION_MAJOR)
unset(LERC_VERSION_MINOR)
unset(LERC_VERSION_PATCH)
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LERC
REQUIRED_VARS LERC_LIBRARY LERC_INCLUDE_DIR
VERSION_VAR LERC_VERSION_STRING)
if(LERC_FOUND)
set(LERC_INCLUDE_DIRS ${LERC_INCLUDE_DIR})
if(NOT LERC_LIBRARIES)
set(LERC_LIBRARIES ${LERC_LIBRARY})
endif()
if(NOT TARGET LERC::LERC)
add_library(LERC::LERC UNKNOWN IMPORTED)
set_target_properties(LERC::LERC PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LERC_INCLUDE_DIRS}")
if(LERC_LIBRARY_RELEASE)
set_property(TARGET LERC::LERC APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(LERC::LERC PROPERTIES
IMPORTED_LOCATION_RELEASE "${LERC_LIBRARY_RELEASE}")
endif()
if(LERC_LIBRARY_DEBUG)
set_property(TARGET LERC::LERC APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(LERC::LERC PROPERTIES
IMPORTED_LOCATION_DEBUG "${LERC_LIBRARY_DEBUG}")
endif()
if(NOT LERC_LIBRARY_RELEASE AND NOT LERC_LIBRARY_DEBUG)
set_target_properties(LERC::LERC PROPERTIES
IMPORTED_LOCATION "${LERC_LIBRARY}")
endif()
endif()
endif()
+91
View File
@@ -0,0 +1,91 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindWebP
--------
Find the native WebP includes and library.
IMPORTED Targets
^^^^^^^^^^^^^^^^
This module defines :prop_tgt:`IMPORTED` target ``WebP::webp``, if
WebP has been found.
Result Variables
^^^^^^^^^^^^^^^^
This module defines the following variables:
::
WebP_INCLUDE_DIRS - where to find webp/*.h, etc.
WebP_LIBRARIES - List of libraries when using webp.
WebP_FOUND - True if webp found.
Debug and Release variants are found separately.
#]=======================================================================]
# Standard names to search for
set(WebP_NAMES webp)
set(WebP_NAMES_DEBUG webpd)
find_path(WebP_INCLUDE_DIR
NAMES webp/decode.h
PATH_SUFFIXES include)
# Allow WebP_LIBRARY to be set manually, as the location of the webp library
if(NOT WebP_LIBRARY)
find_library(WebP_LIBRARY_RELEASE
NAMES ${WebP_NAMES}
PATH_SUFFIXES lib)
find_library(WebP_LIBRARY_DEBUG
NAMES ${WebP_NAMES_DEBUG}
PATH_SUFFIXES lib)
include(SelectLibraryConfigurations)
select_library_configurations(WebP)
endif()
unset(WebP_NAMES)
unset(WebP_NAMES_DEBUG)
mark_as_advanced(WebP_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WebP
REQUIRED_VARS WebP_LIBRARY WebP_INCLUDE_DIR)
if(WebP_FOUND)
set(WebP_INCLUDE_DIRS ${WebP_INCLUDE_DIR})
if(NOT WebP_LIBRARIES)
set(WebP_LIBRARIES ${WebP_LIBRARY})
endif()
if(NOT TARGET WebP::webp)
add_library(WebP::webp UNKNOWN IMPORTED)
set_target_properties(WebP::webp PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${WebP_INCLUDE_DIRS}")
if(WebP_LIBRARY_RELEASE)
set_property(TARGET WebP::webp APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(WebP::webp PROPERTIES
IMPORTED_LOCATION_RELEASE "${WebP_LIBRARY_RELEASE}")
endif()
if(WebP_LIBRARY_DEBUG)
set_property(TARGET WebP::webp APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(WebP::webp PROPERTIES
IMPORTED_LOCATION_DEBUG "${WebP_LIBRARY_DEBUG}")
endif()
if(NOT WebP_LIBRARY_RELEASE AND NOT WebP_LIBRARY_DEBUG)
set_target_properties(WebP::webp PROPERTIES
IMPORTED_LOCATION "${WebP_LIBRARY}")
endif()
endif()
endif()
+107
View File
@@ -0,0 +1,107 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindZSTD
--------
Find the native ZSTD includes and library.
IMPORTED Targets
^^^^^^^^^^^^^^^^
This module defines :prop_tgt:`IMPORTED` target ``ZSTD::ZSTD``, if
ZSTD has been found.
Result Variables
^^^^^^^^^^^^^^^^
This module defines the following variables:
::
ZSTD_INCLUDE_DIRS - where to find zstd.h, etc.
ZSTD_LIBRARIES - List of libraries when using zstd.
ZSTD_FOUND - True if zstd found.
::
ZSTD_VERSION_STRING - The version of zstd found (x.y.z)
ZSTD_VERSION_MAJOR - The major version of zstd
ZSTD_VERSION_MINOR - The minor version of zstd
Debug and Release variants are found separately.
#]=======================================================================]
# Standard names to search for
set(ZSTD_NAMES zstd zstd_static)
set(ZSTD_NAMES_DEBUG zstdd zstd_staticd)
find_path(ZSTD_INCLUDE_DIR
NAMES zstd.h
PATH_SUFFIXES include)
# Allow ZSTD_LIBRARY to be set manually, as the location of the zstd library
if(NOT ZSTD_LIBRARY)
find_library(ZSTD_LIBRARY_RELEASE
NAMES ${ZSTD_NAMES}
PATH_SUFFIXES lib)
find_library(ZSTD_LIBRARY_DEBUG
NAMES ${ZSTD_NAMES_DEBUG}
PATH_SUFFIXES lib)
include(SelectLibraryConfigurations)
select_library_configurations(ZSTD)
endif()
unset(ZSTD_NAMES)
unset(ZSTD_NAMES_DEBUG)
mark_as_advanced(ZSTD_INCLUDE_DIR)
if(ZSTD_INCLUDE_DIR AND EXISTS "${ZSTD_INCLUDE_DIR}/zstd.h")
file(STRINGS "${ZSTD_INCLUDE_DIR}/zstd.h" ZSTD_H REGEX "^#define ZSTD_VERSION_.*$")
string(REGEX REPLACE "^.*ZSTD_VERSION_MAJOR *([0-9]+).*$" "\\1" ZSTD_MAJOR_VERSION "${ZSTD_H}")
string(REGEX REPLACE "^.*ZSTD_VERSION_MINOR *([0-9]+).*$" "\\1" ZSTD_MINOR_VERSION "${ZSTD_H}")
string(REGEX REPLACE "^.*ZSTD_VERSION_RELEASE *([0-9]+).*$" "\\1" ZSTD_PATCH_VERSION "${ZSTD_H}")
set(ZSTD_VERSION_STRING "${ZSTD_MAJOR_VERSION}.${ZSTD_MINOR_VERSION}.${ZSTD_PATCH_VERSION}")
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZSTD
REQUIRED_VARS ZSTD_LIBRARY ZSTD_INCLUDE_DIR
VERSION_VAR ZSTD_VERSION_STRING)
if(ZSTD_FOUND)
set(ZSTD_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR})
if(NOT ZSTD_LIBRARIES)
set(ZSTD_LIBRARIES ${ZSTD_LIBRARY})
endif()
if(NOT TARGET ZSTD::ZSTD)
add_library(ZSTD::ZSTD UNKNOWN IMPORTED)
set_target_properties(ZSTD::ZSTD PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIRS}")
if(ZSTD_LIBRARY_RELEASE)
set_property(TARGET ZSTD::ZSTD APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(ZSTD::ZSTD PROPERTIES
IMPORTED_LOCATION_RELEASE "${ZSTD_LIBRARY_RELEASE}")
endif()
if(ZSTD_LIBRARY_DEBUG)
set_property(TARGET ZSTD::ZSTD APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(ZSTD::ZSTD PROPERTIES
IMPORTED_LOCATION_DEBUG "${ZSTD_LIBRARY_DEBUG}")
endif()
if(NOT ZSTD_LIBRARY_RELEASE AND NOT ZSTD_LIBRARY_DEBUG)
set_target_properties(ZSTD::ZSTD PROPERTIES
IMPORTED_LOCATION "${ZSTD_LIBRARY}")
endif()
endif()
endif()
+126
View File
@@ -0,0 +1,126 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
Findliblzma
-----------
Find LZMA compression algorithm headers and library.
Imported Targets
^^^^^^^^^^^^^^^^
.. versionadded:: 3.14
This module defines :prop_tgt:`IMPORTED` target ``liblzma::liblzma``, if
liblzma has been found.
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project:
``liblzma_FOUND``
True if liblzma headers and library were found.
``LIBLZMA_INCLUDE_DIRS``
Directory where liblzma headers are located.
``LIBLZMA_LIBRARIES``
Lzma libraries to link against.
``LIBLZMA_HAS_AUTO_DECODER``
True if lzma_auto_decoder() is found (required).
``LIBLZMA_HAS_EASY_ENCODER``
True if lzma_easy_encoder() is found (required).
``LIBLZMA_HAS_LZMA_PRESET``
True if lzma_lzma_preset() is found (required).
``LIBLZMA_VERSION_MAJOR``
The major version of lzma
``LIBLZMA_VERSION_MINOR``
The minor version of lzma
``LIBLZMA_VERSION_PATCH``
The patch version of lzma
``LIBLZMA_VERSION_STRING``
version number as a string (ex: "5.0.3")
#]=======================================================================]
find_path(LIBLZMA_INCLUDE_DIR lzma.h )
if(NOT LIBLZMA_LIBRARY)
find_library(LIBLZMA_LIBRARY_RELEASE NAMES lzma liblzma NAMES_PER_DIR PATH_SUFFIXES lib)
find_library(LIBLZMA_LIBRARY_DEBUG NAMES lzmad liblzmad NAMES_PER_DIR PATH_SUFFIXES lib)
include(SelectLibraryConfigurations)
select_library_configurations(LIBLZMA)
else()
file(TO_CMAKE_PATH "${LIBLZMA_LIBRARY}" LIBLZMA_LIBRARY)
endif()
if(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
file(STRINGS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h" LIBLZMA_HEADER_CONTENTS REGEX "#define LZMA_VERSION_[A-Z]+ [0-9]+")
string(REGEX REPLACE ".*#define LZMA_VERSION_MAJOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MAJOR "${LIBLZMA_HEADER_CONTENTS}")
string(REGEX REPLACE ".*#define LZMA_VERSION_MINOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MINOR "${LIBLZMA_HEADER_CONTENTS}")
string(REGEX REPLACE ".*#define LZMA_VERSION_PATCH ([0-9]+).*" "\\1" LIBLZMA_VERSION_PATCH "${LIBLZMA_HEADER_CONTENTS}")
set(LIBLZMA_VERSION_STRING "${LIBLZMA_VERSION_MAJOR}.${LIBLZMA_VERSION_MINOR}.${LIBLZMA_VERSION_PATCH}")
unset(LIBLZMA_HEADER_CONTENTS)
endif()
# We're using new code known now as XZ, even library still been called LZMA
# it can be found in http://tukaani.org/xz/
# Avoid using old codebase
if (LIBLZMA_LIBRARY)
include(CheckLibraryExists)
set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
set(CMAKE_REQUIRED_QUIET ${liblzma_FIND_QUIETLY})
if(NOT LIBLZMA_LIBRARY_RELEASE AND NOT LIBLZMA_LIBRARY_DEBUG)
set(LIBLZMA_LIBRARY_check ${LIBLZMA_LIBRARY})
elseif(LIBLZMA_LIBRARY_RELEASE)
set(LIBLZMA_LIBRARY_check ${LIBLZMA_LIBRARY_RELEASE})
elseif(LIBLZMA_LIBRARY_DEBUG)
set(LIBLZMA_LIBRARY_check ${LIBLZMA_LIBRARY_DEBUG})
endif()
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY_check} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER)
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY_check} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER)
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY_check} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET)
unset(LIBLZMA_LIBRARY_check)
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(liblzma REQUIRED_VARS LIBLZMA_LIBRARY
LIBLZMA_INCLUDE_DIR
LIBLZMA_HAS_AUTO_DECODER
LIBLZMA_HAS_EASY_ENCODER
LIBLZMA_HAS_LZMA_PRESET
VERSION_VAR LIBLZMA_VERSION_STRING
)
mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
if (liblzma_FOUND)
set(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
set(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})
if(NOT TARGET liblzma::liblzma)
add_library(liblzma::liblzma UNKNOWN IMPORTED)
set_target_properties(liblzma::liblzma PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${LIBLZMA_INCLUDE_DIR}
IMPORTED_LINK_INTERFACE_LANGUAGES C)
if(LIBLZMA_LIBRARY_RELEASE)
set_property(TARGET liblzma::liblzma APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(liblzma::liblzma PROPERTIES
IMPORTED_LOCATION_RELEASE "${LIBLZMA_LIBRARY_RELEASE}")
endif()
if(LIBLZMA_LIBRARY_DEBUG)
set_property(TARGET liblzma::liblzma APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(liblzma::liblzma PROPERTIES
IMPORTED_LOCATION_DEBUG "${LIBLZMA_LIBRARY_DEBUG}")
endif()
if(NOT LIBLZMA_LIBRARY_RELEASE AND NOT LIBLZMA_LIBRARY_DEBUG)
set_target_properties(liblzma::liblzma PROPERTIES
IMPORTED_LOCATION "${LIBLZMA_LIBRARY}")
endif()
endif()
endif ()
+36
View File
@@ -0,0 +1,36 @@
# Checks for headers
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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(CheckIncludeFile)
check_include_file(assert.h HAVE_ASSERT_H)
check_include_file(fcntl.h HAVE_FCNTL_H)
check_include_file(io.h HAVE_IO_H)
check_include_file(strings.h HAVE_STRINGS_H)
check_include_file(sys/time.h HAVE_SYS_TIME_H)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(unistd.h HAVE_UNISTD_H)
+46
View File
@@ -0,0 +1,46 @@
# Options to enable and disable internal codecs
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
option(ccitt "support for CCITT Group 3 & 4 algorithms" ON)
set(CCITT_SUPPORT ${ccitt})
option(packbits "support for Macintosh PackBits algorithm" ON)
set(PACKBITS_SUPPORT ${packbits})
option(lzw "support for LZW algorithm" ON)
set(LZW_SUPPORT ${lzw})
option(thunder "support for ThunderScan 4-bit RLE algorithm" ON)
set(THUNDER_SUPPORT ${thunder})
option(next "support for NeXT 2-bit RLE algorithm" ON)
set(NEXT_SUPPORT ${next})
option(logluv "support for LogLuv high dynamic range algorithm" ON)
set(LOGLUV_SUPPORT ${logluv})
option(mdi "support for Microsoft Document Imaging" ON)
set(MDI_SUPPORT ${mdi})
+47
View File
@@ -0,0 +1,47 @@
# Checks for JBIG codec support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# JBIG-KIT
set(JBIG_SUPPORT FALSE)
find_package(JBIG)
if(JBIG_FOUND)
set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARIES})
check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
endif()
option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ${JBIG_FOUND})
if (jbig AND JBIG_FOUND)
set(JBIG_SUPPORT TRUE)
endif()
+84
View File
@@ -0,0 +1,84 @@
# Checks for JPEG codec support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# JPEG
set(JPEG_SUPPORT FALSE)
find_package(JPEG)
option(jpeg "use libjpeg (required for JPEG compression)" ${JPEG_FOUND})
if (jpeg AND JPEG_FOUND)
set(JPEG_SUPPORT TRUE)
endif()
# Old-jpeg
set(OJPEG_SUPPORT FALSE)
option(old-jpeg "support for Old JPEG compression (read-only)" ${JPEG_SUPPORT})
if (old-jpeg AND JPEG_SUPPORT)
set(OJPEG_SUPPORT TRUE)
endif()
if (JPEG_SUPPORT)
# Check for jpeg12_read_scanlines() which has been added in libjpeg-turbo 2.2
# for dual 8/12 bit mode.
include(CheckCSourceCompiles)
include(CMakePushCheckState)
cmake_push_check_state(RESET)
set(CMAKE_REQUIRED_INCLUDES "${JPEG_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES "${JPEG_LIBRARIES}")
check_c_source_compiles(
"
#include <stddef.h>
#include <stdio.h>
#include \"jpeglib.h\"
int main()
{
jpeg_read_scanlines(0,0,0);
jpeg12_read_scanlines(0,0,0);
return 0;
}
"
HAVE_JPEGTURBO_DUAL_MODE_8_12)
cmake_pop_check_state()
endif()
if (NOT HAVE_JPEGTURBO_DUAL_MODE_8_12)
# 12-bit jpeg mode in a dedicated libjpeg12 library
set(JPEG12_INCLUDE_DIR JPEG12_INCLUDE_DIR-NOTFOUND CACHE PATH "Include directory for 12-bit libjpeg")
set(JPEG12_LIBRARY JPEG12_LIBRARY-NOTFOUND CACHE FILEPATH "12-bit libjpeg library")
set(JPEG_DUAL_MODE_8_12 FALSE)
if (JPEG12_INCLUDE_DIR AND JPEG12_LIBRARY)
set(JPEG12_LIBRARIES ${JPEG12_LIBRARY})
set(JPEG12_FOUND TRUE)
else()
set(JPEG12_FOUND FALSE)
endif()
option(jpeg12 "enable libjpeg 8/12-bit dual mode (requires separate 12-bit libjpeg build)" ${JPEG12_FOUND})
if (jpeg12 AND JPEG12_FOUND)
set(JPEG_DUAL_MODE_8_12 TRUE)
set(LIBJPEG_12_PATH "${JPEG12_INCLUDE_DIR}/jpeglib.h")
endif()
endif()
+32
View File
@@ -0,0 +1,32 @@
# Checks for LERC codec support
#
# Copyright © 2021 Antonio Valentino <antonio.valentino@tiscali.it>
# Written by Antonio Valentino <antonio.valentino@tiscali.it>
#
# 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.
# libLerc
set(LERC_SUPPORT FALSE)
find_package(LERC)
option(lerc "use libLerc (required for LERC compression)" ${LERC_FOUND})
if (lerc AND LERC_FOUND AND ZIP_SUPPORT)
set(LERC_SUPPORT TRUE)
endif()
+34
View File
@@ -0,0 +1,34 @@
# Checks for LZMA codec support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# liblzma2
set(LZMA_SUPPORT FALSE)
find_package(liblzma)
option(lzma "use liblzma (required for LZMA2 compression)" ${LIBLZMA_FOUND})
if (lzma AND LIBLZMA_FOUND)
set(LZMA_SUPPORT TRUE)
endif()
+32
View File
@@ -0,0 +1,32 @@
# Large file support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# Permission to use, copy, modify, distribute, and sell this software and
# its documentation for any purpose is hereby granted without fee, provided
# that (i) the above copyright notices and this permission notice appear in
# all copies of the software and related documentation, and (ii) the names of
# Sam Leffler and Silicon Graphics may not be used in any advertising or
# publicity relating to the software without the specific, prior written
# permission of Sam Leffler and Silicon Graphics.
#
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
if (UNIX OR MINGW)
# This might not catch every possibility catered for by
# Autoconf AC_SYS_LARGEFILE.
add_definitions(-D_FILE_OFFSET_BITS=64)
set(FILE_OFFSET_BITS 64)
endif()
+62
View File
@@ -0,0 +1,62 @@
# C library features
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# Strip chopping
option(strip-chopping "strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of specified size to reduce memory usage)" ON)
set(TIFF_DEFAULT_STRIP_SIZE 8192 CACHE STRING "default size of the strip in bytes (when strip chopping is enabled)")
set(STRIPCHOP_DEFAULT)
if(strip-chopping)
set(STRIPCHOP_DEFAULT TRUE)
if(TIFF_DEFAULT_STRIP_SIZE)
set(STRIP_SIZE_DEFAULT "${TIFF_DEFAULT_STRIP_SIZE}")
endif()
endif()
set(TIFF_MAX_DIR_COUNT 1048576 CACHE STRING "Maximum number of TIFF directories that libtiff can browse through")
# Defer loading of strip/tile offsets
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
option(chunky-strip-read "enable reading large strips in chunks for TIFFReadScanline() (experimental)" OFF)
set(CHUNKY_STRIP_READ_SUPPORT ${chunky-strip-read})
# SUBIFD support
set(SUBIFD_SUPPORT 1)
# Default handling of ASSOCALPHA support.
option(extrasample-as-alpha "the RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don't mark the alpha properly" ON)
if(extrasample-as-alpha)
set(DEFAULT_EXTRASAMPLE_AS_ALPHA 1)
endif()
# Default handling of YCbCr subsampling support.
# See Bug 168 in Bugzilla, and JPEGFixupTestSubsampling() for details.
option(check-ycbcr-subsampling "enable picking up YCbCr subsampling info from the JPEG data stream to support files lacking the tag" ON)
if (check-ycbcr-subsampling)
set(CHECK_JPEG_YCBCR_SUBSAMPLING 1)
endif()
+50
View File
@@ -0,0 +1,50 @@
# Check linker capabilities
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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(CheckCSourceCompiles)
option(ld-version-script "Enable linker version script" ON)
# Check if LD supports linker scripts.
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" "VERS_1 {
global: sym;
};
VERS_2 {
global: sym;
} VERS_1;
")
set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
check_c_source_compiles("int main(void){return 0;}" HAVE_LD_VERSION_SCRIPT)
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
if (ld-version-script AND HAVE_LD_VERSION_SCRIPT)
set(HAVE_LD_VERSION_SCRIPT TRUE)
else()
set(HAVE_LD_VERSION_SCRIPT FALSE)
endif()
+50
View File
@@ -0,0 +1,50 @@
# Checks for OpenGL and GLUT support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# OpenGL and GLUT
set(OpenGL_GL_PREFERENCE LEGACY)
find_package(OpenGL COMPONENTS OpenGL)
find_package(GLUT)
set(OPENGL_SUPPORT FALSE)
set(HAVE_OPENGL FALSE)
if(OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND)
set(HAVE_OPENGL TRUE)
endif()
# Purely to satisfy the generated headers:
check_include_file(GL/gl.h HAVE_GL_GL_H)
check_include_file(GL/glu.h HAVE_GL_GLU_H)
check_include_file(GL/glut.h HAVE_GL_GLUT_H)
check_include_file(GLUT/glut.h HAVE_GLUT_GLUT_H)
check_include_file(OpenGL/gl.h HAVE_OPENGL_GL_H)
check_include_file(OpenGL/glu.h HAVE_OPENGL_GLU_H)
option(tiff-opengl "use OpenGL (required for tiffgt viewer)" ${HAVE_OPENGL})
if (tiff-opengl AND HAVE_OPENGL)
set(OPENGL_SUPPORT TRUE)
endif()
+33
View File
@@ -0,0 +1,33 @@
# Checks for PixarLog codec support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# Option for Pixar log-format algorithm
# Pixar log format
set(PIXARLOG_SUPPORT FALSE)
option(pixarlog "support for Pixar log-format algorithm (requires Zlib)" ${ZLIB_SUPPORT})
if(pixarlog AND ZLIB_SUPPORT)
set(PIXARLOG_SUPPORT TRUE)
endif()
+69
View File
@@ -0,0 +1,69 @@
# pkg-config support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# Post-process lib files into linker flags
function(set_libs_private out_var)
set(tiff_libs_private "")
foreach(lib IN LISTS ARGN)
get_filename_component(name "${lib}" NAME)
foreach(prefix IN LISTS CMAKE_FIND_LIBRARY_PREFIXES)
if(NOT("${prefix}" STREQUAL "") AND name MATCHES "^${prefix}")
string(REGEX REPLACE "^${prefix}" "" name "${name}")
break()
endif()
endforeach()
foreach(suffix IN LISTS CMAKE_FIND_LIBRARY_SUFFIXES)
if(NOT("${suffix}" STREQUAL "") AND name MATCHES "${suffix}$")
string(REGEX REPLACE "${suffix}$" "" name "${name}")
break()
endif()
endforeach()
string(APPEND tiff_libs_private " -l${name}")
endforeach()
set(${out_var} "${tiff_libs_private}" PARENT_SCOPE)
endfunction()
# Generate pkg-config file
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix "\${prefix}")
if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}")
set(libdir "${CMAKE_INSTALL_LIBDIR}")
else()
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
endif()
if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
set(includedir "${CMAKE_INSTALL_INCLUDEDIR}")
else()
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
endif()
set_libs_private(tiff_libs_private ${tiff_libs_private_list})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libtiff-4.pc.in
${CMAKE_CURRENT_BINARY_DIR}/libtiff-4.pc @ONLY)
# Install pkg-config file
if (tiff-install)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libtiff-4.pc
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif()
+36
View File
@@ -0,0 +1,36 @@
# Processor capability checks
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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(TestBigEndian)
# CPU endianness
test_big_endian(HOST_BIG_ENDIAN)
if(HOST_BIG_ENDIAN)
add_definitions(-DWORDS_BIGENDIAN)
endif()
# IEEE floating point
set(HAVE_IEEEFP 1)
+47
View File
@@ -0,0 +1,47 @@
# Release support
#
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# Add target tiff_release to update the version information in the root files
# VERSION and RELEASE-DATE.
add_custom_target(tiff_release
COMMAND ${CMAKE_COMMAND}
"-DSOURCE_DIR:PATH=${PROJECT_SOURCE_DIR}"
"-DLIBTIFF_VERSION=${PROJECT_VERSION}"
"-DLIBTIFF_BASIC_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
"-DLIBTIFF_BASIC_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}"
-P "${CMAKE_CURRENT_LIST_DIR}/ReleaseScript.cmake"
COMMENT "Releasing ${PROJECT_NAME} ${PROJECT_VERSION} ...")
# Version information is taken from configure.ac
# Note: Single command "cmake --build . --target tiff_release"
# does not work correctly, because version information is taken from CMakeCache.txt,
# which is not updated by cmake --build.
# Therefore, force CMake re-configure if configure.ac has changed.
# By the way, release-date and VERSION will not change but only when --targt tiff_release is called.
set_property(
DIRECTORY
APPEND
PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/configure.ac
)
+42
View File
@@ -0,0 +1,42 @@
# Release support
#
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# Update release date to current date
string(TIMESTAMP LIBTIFF_RELEASE_DATE "%Y%m%d")
# Update version information in all relevant files
message(STATUS "Setting release version to ${LIBTIFF_VERSION}")
message(STATUS "Setting release date to ${LIBTIFF_RELEASE_DATE}")
# Only needed here, for manual build of target tiff_release
# because otherwise tiffvers.h is generated when building all targets.
configure_file(${LIBTIFF_BASIC_SOURCE_DIR}/libtiff/tiffvers.h.cmake.in
${LIBTIFF_BASIC_BINARY_DIR}/libtiff/tiffvers.h
@ONLY)
# Write version information and release date to root files.
FILE(WRITE ${LIBTIFF_BASIC_SOURCE_DIR}/VERSION "${LIBTIFF_VERSION}" \n)
FILE(WRITE ${LIBTIFF_BASIC_SOURCE_DIR}/RELEASE-DATE "${LIBTIFF_RELEASE_DATE}" \n)
message(STATUS "Files tiffvers.h, VERSION and RELEASE-DATE updated.")
+93
View File
@@ -0,0 +1,93 @@
# #%L
# OME Files C++ libraries (cmake build infrastructure)
# %%
# Copyright © 2015 Open Microscopy Environment:
# - Massachusetts Institute of Technology
# - National Institutes of Health
# - University of Dundee
# - Board of Regents of the University of Wisconsin-Madison
# - Glencoe Software, Inc.
# %%
# 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDERS 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.
#
# The views and conclusions contained in the software and documentation are
# those of the authors and should not be interpreted as representing official
# policies, either expressed or implied, of any organization.
# #L%
find_package(Python3 COMPONENTS Interpreter)
# Sphinx documentation generator
find_program(SPHINX_BUILD sphinx-build)
if (SPHINX_BUILD)
message(STATUS "Looking for sphinx-build - ${SPHINX_BUILD}")
else()
message(STATUS "Looking for sphinx-build - not found")
endif()
set(SPHINX_DEFAULT OFF)
if(SPHINX_BUILD)
set(SPHINX_DEFAULT ON)
endif()
option(sphinx "Enable sphinx manual page and HTML documentation" ${SPHINX_DEFAULT})
option(sphinx-linkcheck "Check sphinx documentation links by default" OFF)
set(BUILD_SPHINX ${sphinx})
set(SPHINX_LIST_DIR ${CMAKE_CURRENT_LIST_DIR})
function(sphinx_manpages srcdir builddir manvar)
execute_process(COMMAND "${Python3_EXECUTABLE}" -B ${SPHINX_LIST_DIR}/list-manpages.py
"${srcdir}" "${builddir}"
RESULT_VARIABLE sphinx_man_fail
OUTPUT_VARIABLE MAN_PAGES)
if (sphinx_man_fail)
message(WARNING "Failed to get generated sphinx manual pages from ${confdir}")
endif()
string(REPLACE "\n" ";" MAN_PAGES "${MAN_PAGES}")
set(${manvar} "${MAN_PAGES}" PARENT_SCOPE)
message(STATUS "Sphinx manual pages: ${MAN_PAGES}")
endfunction(sphinx_manpages)
function(sphinx_manpage_dependencies srcdir depvar)
execute_process(COMMAND "${Python3_EXECUTABLE}" -B ${SPHINX_LIST_DIR}/list-manpage-dependencies.py
"${srcdir}"
RESULT_VARIABLE sphinx_dep_fail
OUTPUT_VARIABLE SPHINX_MAN_DEPENDENCIES)
if (sphinx_dep_fail)
message(WARNING "Failed to get Sphinx dependencies from ${confdir}")
endif()
string(REPLACE "\n" ";" SPHINX_MAN_DEPENDENCIES "${SPHINX_MAN_DEPENDENCIES}")
set(${depvar} "${SPHINX_MAN_DEPENDENCIES}" PARENT_SCOPE)
endfunction(sphinx_manpage_dependencies)
function(sphinx_dependencies srcdir depvar)
file(GLOB_RECURSE CRUDE_SPHINX_DEPENDENCIES "${srcdir}/*.rst")
foreach(file ${CRUDE_SPHINX_DEPENDENCIES})
string(FIND "${file}" "_build" FILE_MATCH)
if(FILE_MATCH EQUAL -1)
list(APPEND SPHINX_DEPENDENCIES "${file}")
endif()
endforeach()
set(${depvar} "${SPHINX_DEPENDENCIES}" PARENT_SCOPE)
endfunction(sphinx_dependencies)
+87
View File
@@ -0,0 +1,87 @@
# Check "local" sphinx links, using files in the build tree and in the
# install tree (other components)
message(STATUS "Checking internal links")
set(failed OFF)
file(STRINGS "${OUTPUT}" output)
file(REMOVE "${OUTPUT}.new")
foreach(line IN LISTS output)
# Parse the filename, link type, link and anchor from each line
string(REGEX MATCH "^.*: \\[.*\\] .*" line_match "${line}")
string(REGEX MATCH "^.*: \\[.*\\] .*#.*" anchor_match "${line}")
if(line_match)
string(REGEX REPLACE "^(.*): \\[(.*)\\] (.*)" "\\1" filename "${line}")
string(REGEX REPLACE "^(.*): \\[(.*)\\] (.*)" "\\2" type "${line}")
if(anchor_match)
string(REGEX REPLACE "^(.*): \\[(.*)\\] (.*)#(.*)" "\\3" link "${line}")
string(REGEX REPLACE "^(.*): \\[(.*)\\] (.*)#(.*)" "\\4" link "${anchor}")
else()
string(REGEX REPLACE "^(.*): \\[(.*)\\] (.*)" "\\3" link "${line}")
unset(anchor)
endif()
# Only check local links
if(type STREQUAL "local")
# Compute path relative to our install path
file(RELATIVE_PATH relpath "/" "/${SPHINX_INSTALL_PATH}/${link}")
# Check sphinx link in the install tree
unset(linkfile)
if(EXISTS "${EXTERNAL_REFERENCE}/${relpath}")
set(linkfile "${EXTERNAL_REFERENCE}/${relpath}")
endif()
# Check sphinx link in the build tree
if(EXISTS "${INTERNAL_REFERENCE}/${link}")
set(linkfile "${INTERNAL_REFERENCE}/${link}")
endif()
# Check doxygen link in the install tree
if(EXISTS "${DOXYGEN_REFERENCE}/${link}")
set(linkfile "${DOXYGEN_REFERENCE}/${link}")
endif()
# Check doxygen link in the build tree
if(DOXYGEN_REFERENCE AND DOXYGEN_INSTALL_PATH)
string(REGEX REPLACE "^${DOXYGEN_INSTALL_PATH}/(.*)" "\\1" doxygen_path "${relpath}")
if(EXISTS "${DOXYGEN_REFERENCE}/${doxygen_path}")
set(linkfile "${DOXYGEN_REFERENCE}/${doxygen_path}")
endif()
endif()
# Check link and any anchor. If the link does not exist, or the
# anchor does not exist, set the link type to broken when
# rewriting the output file with our test results.
if(linkfile)
if(anchor)
file(STRINGS "${linkfile}" anchor_matches REGEX "<a +class=\"anchor\" +id=\"${anchor}\"")
if(anchor_matches)
file(APPEND "${OUTPUT}.new" "${filename}: [${type}] ${link}#${anchor}\n")
else()
set(failed ON)
file(APPEND "${OUTPUT}.new" "${filename}: [broken] ${link}#${anchor}\n")
message(STATUS "Broken link: ${filename}: ${link}#${anchor}")
endif()
else()
file(APPEND "${OUTPUT}.new" "${filename}: [${type}] ${link}\n")
endif()
else()
set(failed ON)
file(APPEND "${OUTPUT}.new" "${filename}: [broken] ${link}\n")
message(STATUS "Broken link: ${filename}: ${link}")
endif()
else()
if(type STREQUAL "broken")
set(failed ON)
message(STATUS "Broken link: ${filename}: ${link}")
endif()
file(APPEND "${OUTPUT}.new" "${filename}: [${type}] ${link}\n")
endif()
else()
file(APPEND "${OUTPUT}.new" "${line}\n")
endif()
endforeach()
file(RENAME "${OUTPUT}.new" "${OUTPUT}")
if(failed)
message(FATAL_ERROR "Broken links detected")
endif()
+43
View File
@@ -0,0 +1,43 @@
# Checks for symbols
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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(CheckSymbolExists)
# Check for getopt
check_symbol_exists(getopt "unistd.h;stdio.h" HAVE_GETOPT)
check_symbol_exists(optarg "getopt.h" HAVE_DECL_OPTARG)
if (HAVE_DECL_OPTARG)
set(HAVE_DECL_OPTARG 1)
else()
set(HAVE_DECL_OPTARG 0)
endif()
# Check for mmap
check_symbol_exists(mmap "sys/mman.h" HAVE_MMAP)
# Check for setmode
check_symbol_exists(setmode "unistd.h" HAVE_SETMODE)
+27
View File
@@ -0,0 +1,27 @@
if(NOT "@BUILD_SHARED_LIBS@")
# TODO: import dependencies
endif()
function(set_variable_from_rel_or_absolute_path var root rel_or_abs_path)
if(IS_ABSOLUTE "${rel_or_abs_path}")
set(${var} "${rel_or_abs_path}" PARENT_SCOPE)
else()
set(${var} "${root}/${rel_or_abs_path}" PARENT_SCOPE)
endif()
endfunction()
# Tell the user project where to find our headers and libraries
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
get_filename_component(_ROOT "${_DIR}/@PROJECT_ROOT_DIR@" ABSOLUTE)
# Use _ROOT as prefix here for the possibility of relocation after installation.
set_variable_from_rel_or_absolute_path("TIFF_INCLUDE_DIR" "${_ROOT}" "@CMAKE_INSTALL_INCLUDEDIR@")
set(TIFF_INCLUDE_DIRS ${TIFF_INCLUDE_DIR})
set(TIFF_LIBRARIES TIFF::tiff)
if(NOT TARGET TIFF::tiff)
include("${CMAKE_CURRENT_LIST_DIR}/TiffTargets.cmake")
endif()
unset (_ROOT)
unset (_DIR)
+54
View File
@@ -0,0 +1,54 @@
# Check type sizes
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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("CheckTypeSize")
set(CMAKE_EXTRA_INCLUDE_FILES_SAVE ${CMAKE_EXTRA_INCLUDE_FILES})
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} "stddef.h")
check_type_size("size_t" SIZEOF_SIZE_T)
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES_SAVE})
# C99 fixed-size integer types
set(TIFF_INT8_T "int8_t")
set(TIFF_UINT8_T "uint8_t")
set(TIFF_INT16_T "int16_t")
set(TIFF_UINT16_T "uint16_t")
set(TIFF_INT32_T "int32_t")
set(TIFF_UINT32_T "uint32_t")
set(TIFF_INT64_T "int64_t")
set(TIFF_UINT64_T "uint64_t")
# size_t and TIFF signed size-type
if(SIZEOF_SIZE_T EQUAL 4)
set(TIFF_SSIZE_T "int32_t")
elseif(SIZEOF_SIZE_T EQUAL 8)
set(TIFF_SSIZE_T "int64_t")
else()
message(FATAL_ERROR "Unsupported size_t size ${SIZEOF_SIZE_T}; please add support")
endif()
+35
View File
@@ -0,0 +1,35 @@
# Checks for WebP codec support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# libwebp
set(WEBP_SUPPORT FALSE)
find_package(WebP)
option(webp "use libwebp (required for WEBP compression)" ${WebP_FOUND})
if (webp AND WebP_FOUND)
set(WEBP_SUPPORT TRUE)
endif()
+47
View File
@@ -0,0 +1,47 @@
# Windows support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# Permission to use, copy, modify, distribute, and sell this software and
# its documentation for any purpose is hereby granted without fee, provided
# that (i) the above copyright notices and this permission notice appear in
# all copies of the software and related documentation, and (ii) the names of
# Sam Leffler and Silicon Graphics may not be used in any advertising or
# publicity relating to the software without the specific, prior written
# permission of Sam Leffler and Silicon Graphics.
#
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
if(MSVC)
# Debug postfix
set(CMAKE_DEBUG_POSTFIX "d")
# disable deprecation warnings
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
# suppress deprecation warning for MSVC POSIX names
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
# Don't warn about use of deprecated functions
add_compile_options(/wd4996)
endif()
# Win32 file I/O
set(win32_io_default OFF)
if(WIN32)
set(win32_io_default ON)
endif()
option(win32-io "Use Win32 I/O" ${win32_io_default})
set(USE_WIN32_FILEIO ${win32-io})
+64
View File
@@ -0,0 +1,64 @@
# Checks for LZMA codec support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
# libzstd
set(ZSTD_SUPPORT FALSE)
set(ZSTD_USABLE FALSE)
find_package(ZSTD)
if(ZSTD_FOUND)
if(TARGET zstd::libzstd_shared)
add_library(ZSTD::ZSTD ALIAS zstd::libzstd_shared)
set(ZSTD_HAVE_DECOMPRESS_STREAM ON)
elseif(TARGET zstd::libzstd_static)
add_library(ZSTD::ZSTD ALIAS zstd::libzstd_static)
set(ZSTD_HAVE_DECOMPRESS_STREAM ON)
endif()
if(NOT DEFINED ZSTD_HAVE_DECOMPRESS_STREAM)
set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ZSTD_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${ZSTD_LIBRARIES})
check_symbol_exists(ZSTD_decompressStream "zstd.h" ZSTD_HAVE_DECOMPRESS_STREAM)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
endif()
set(ZSTD_RECENT_ENOUGH ${ZSTD_HAVE_DECOMPRESS_STREAM})
if (ZSTD_RECENT_ENOUGH)
set(ZSTD_USABLE TRUE)
else()
message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0")
endif()
endif()
option(zstd "use libzstd (required for ZSTD compression)" ${ZSTD_USABLE})
if (zstd AND ZSTD_USABLE)
set(ZSTD_SUPPORT TRUE)
endif()
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env python
# Find manual page dependencies
# argv1 = doc dir containing conf.py
import importlib.util
import os.path
import pathlib
import sys
if __name__ == "__main__":
if len(sys.argv) != 2:
sys.exit("Usage: %s sphinx-srcdir" % (sys.argv[0]))
conf_dir = os.path.abspath(sys.argv[1])
conf_path = os.path.join(conf_dir, 'conf.py')
spec = importlib.util.spec_from_file_location('conf', conf_path)
conf = importlib.util.module_from_spec(spec)
spec.loader.exec_module(conf)
if hasattr(conf, 'man_pages'):
for man in conf.man_pages:
man_path = os.path.join(sys.argv[1], "{}{}".format(man[0], '.rst'))
man_path_posix = pathlib.PureWindowsPath(man_path).as_posix()
print(man_path_posix)
print(pathlib.PureWindowsPath(conf_path).as_posix())
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env python
# Find manual pages to be generated
# argv1 = doc dir containing conf.py
# argv2 = manpage directory to contain generated manpages
import importlib.util
import os.path
import pathlib
import sys
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: {} sphinx-srcdir sphinx-builddir".format(sys.argv[0]), file=sys.stderr)
sys.exit(2)
conf_dir = os.path.abspath(sys.argv[1])
conf_path = os.path.join(conf_dir, 'conf.py')
spec = importlib.util.spec_from_file_location('conf', conf_path)
conf = importlib.util.module_from_spec(spec)
spec.loader.exec_module(conf)
if hasattr(conf, 'man_pages'):
for man in conf.man_pages:
man_path = os.path.join(sys.argv[2], "%s.%s" % (man[1], man[4]))
man_path_posix = pathlib.PureWindowsPath(man_path).as_posix()
print(man_path_posix)
else:
print("No man_pages array in {}".format(conf_path), file=sys.stderr)
sys.exit(3)
-473
View File
@@ -1,473 +0,0 @@
#!/bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
#
# 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
# (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.
#
# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# 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.
# Written by Per Bothner <bothner@cygnus.com>.
# The master version of this file is at the FSF in /home/gd/gnu/lib.
#
# 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.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit system type (host/target name).
#
# Only a few systems have been added to this list; please add others
# (but try to keep the structure clean).
#
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
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
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
alpha:OSF1:V*:*)
# After 1.2, OSF1 uses "V1.3" for uname -r.
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'`
exit 0 ;;
alpha:OSF1:*:*)
# 1.2 uses "1.2" for uname -r.
echo alpha-dec-osf${UNAME_RELEASE}
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
Pyramid*:OSx*:*:*)
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit 0 ;;
sun4*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:*:*)
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit 0 ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
mips:*:5*:RISCos)
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit 0 ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit 0 ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit 0 ;;
AViiON:dgux:*:*)
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit 0 ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit 0 ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit 0 ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit 0 ;;
*:IRIX*:*:*)
echo mips-sgi-irix${UNAME_RELEASE}
exit 0 ;;
i[34]86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
sed 's/^ //' << EOF >dummy.c
#include <sys/systemcfg.h>
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
*:AIX:*:4)
if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if grep bos410 /usr/include/stdio.h >/dev/null 2>&1; then
IBM_REV=4.1
elif grep bos411 /usr/include/stdio.h >/dev/null 2>&1; then
IBM_REV=4.1.1
else
IBM_REV=4.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit 0 ;;
*:BOSX:*:*)
echo rs6000-bull-bosx
exit 0 ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit 0 ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit 0 ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[3478]??:HP-UX:*:*)
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/7?? | 9000/8?7 ) HP_ARCH=hppa1.1 ;;
9000/8?? ) HP_ARCH=hppa1.0 ;;
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >dummy.c
#include <unistd.h>
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?7:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit 0 ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
hp7??:OSF1:*:* | hp8?7:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit 0 ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit 0 ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit 0 ;;
CRAY*X-MP:UNICOS:*:*)
echo xmp-cray-unicos
exit 0 ;;
CRAY*Y-MP:UNICOS:*:*)
echo ymp-cray-unicos
exit 0 ;;
CRAY-2:UNICOS:*:*)
echo cray2-cray-unicos
exit 0 ;;
hp3[0-9][05]:NetBSD:*:*)
echo m68k-hp-netbsd${UNAME_RELEASE}
exit 0 ;;
i[34]86:BSD/386:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
i[34]86:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux
exit 0 ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
i[34]86:DYNIX/ptx:4*:*)
echo i386-sequent-sysv4
exit 0 ;;
i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*)
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
else
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i[34]86:*:3.2:*)
if /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
elif test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
else
echo ${UNAME_MACHINE}-unknown-sysv32
fi
exit 0 ;;
Intel:Mach:3*:*)
echo i386-unknown-mach3
exit 0 ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit 0 ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit 0 ;;
M680[234]0:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0)
uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4.3 && exit 0 ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
m680[234]0:LynxOS:2.2*:*)
echo m68k-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i[34]86:LynxOS:2.2*:*)
echo i386-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.2*:*)
echo sparc-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
rs6000:LynxOS:2.2*:*)
echo rs6000-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
cat >dummy.c <<EOF
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
printf ("m68k-sony-newsos\n"); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix"); 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`;
printf ("%s-next-nextstep%s\n", __ARCHITECTURE__, version==2 ? "2" : "3");
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-unknown-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_)
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
#if !defined (ultrix)
printf ("vax-dec-bsd\n"); exit (0);
#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-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
# 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 0 ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
c34*)
echo c34-convex-bsd
exit 0 ;;
c38*)
echo c38-convex-bsd
exit 0 ;;
c4*)
echo c4-convex-bsd
exit 0 ;;
esac
fi
#echo '(Unable to guess system type)' 1>&2
exit 1
-132
View File
@@ -1,132 +0,0 @@
# $Header: /usr/people/sam/tiff/RCS/config.site,v 1.7 1995/10/10 01:03:54 sam Exp $
#
# TIFF Software
#
# Copyright (c) 1990-1995 Sam Leffler
# Copyright (c) 1991-1995 Silicon Graphics, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and
# its documentation for any purpose is hereby granted without fee, provided
# that (i) the above copyright notices and this permission notice appear in
# all copies of the software and related documentation, and (ii) the names of
# Sam Leffler and Silicon Graphics may not be used in any advertising or
# publicity relating to the software without the specific, prior written
# permission of Sam Leffler and Silicon Graphics.
#
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
#
#
# This file holds site-specific configuration parameters.
#
# Nothing is defined in here by default, the definitions
# commented out below serve as documentation for what you
# can set in this file or a config.local file.
#
# Note that you do not need to set anything here unless you
# want to override the auto-configuration behaviour and/or
# interactive prompting done by the configure script.
#
#
# Package controls.
#
#DSO="auto" # auto|IRIX configure DSO support for system
#JPEG="no" # yes|no configure JPEG support
#ZIP="no" # yes|no configure Deflate support
#LIBGL="auto" # yes|no|auto configure IRIS GL-based tools
#LIBIMAGE="auto" # yes|no|auto configure SGI RGB image tools
#
# Directory parameters.
#
#DIR_BIN="/usr/local/bin" # directory for tools
#DIR_LIB="/usr/local/lib" # directory for libraries
#DIR_INC="/usr/local/include" # directory for include files
#DIR_MAN="/usr/local/man" # directory for manual pages
#
# JPEG-specific parameters; used when JPEG support is enabled.
#
# NB: JPEG support requires release 5 or later of the IJG code,
# which you can find on the Internet at ftp.uu.net:/graphics/jpeg/.
#
#DIRS_LIBINC="$DIRS_LIBINC ../jpeg" # directory for JPEG include files
#LIBJPEG="-L ../jpeg -ljpeg" # JPEG library to load
#
# Deflate-specific parameters; used when Deflate support is enabled.
#
# NB: Deflate support requires version 0.92 or later of the zlib
# library written by Jean-loup Gailly and Mark Adler. Starting
# with about 0.95 the library is called libz.a (previously it was
# libgz.a). The library was last found at
#
# ftp://ftp.uu.net/graphics/png/code/zlib-0.93.tar.gz
#
# Look for it also at ftp://ftp.uu.net/pub/archiving/zip/zlib.
#
#DIRS_LIBINC="$DIRS_LIBINC ../zlib" # directory for zlib include files
#LIBGZ="-L ../zlib -lz" # libgz library to load
#
# Miscellaneous parameters.
#
#FILLORDER="MS2LSB" # bit order of cpu (MSB2LSB/LSB2MSB)
#MANSCHEME="sysv-source-cat-strip" # manual page installation scheme
#
# Parameters used when building the software.
#
# Note that configure has several ENVOPTS built into it that are
# set according to the target. This is done to help naive folks.
#
# Beware of changing the INSTALL definition; you *must* have an
# install script that emulates the Silicon Graphics install program!
#
#AR="/bin/ar" # pathname of suitable ar program
#AROPTS="rc" # options to ar for creating archive
#CC="gcc" # name/pathname of C compiler
#ENVOPTS="-Aa" # options for getting ANSI C
#GCOPTS="-g" # options to pass C compiler
#LIBPORT='${PORT}/libport.a' # library with emulation code
#MACHDEPLIBS="" # extra libraries for linking
#PORTFUNCS="" # non-standard functions to emulate
#RANLIB=":" # pathname of suitable ranlib program
#
# Dynamic Shared Object (DSO) support.
#
# Beware that adding new support for DSOs may require some
# modifications to the */Makefile.dso files.
#
#DSOSUF="so" # DSO filename suffix
#DSOOPTS="-shared -rdata_shared" # options for building DSOs
#
# Makefile construction parameters.
#
# These should not normally be set; configure will
# deduce the appropriate syntax to use for includes.
#
#SETMAKE='MAKE = ${MAKE}' # define if make does not setup $MAKE
#
# General system stuff used by the distribution.
#
#CHMOD="/etc/chmod" # pathname of suitable chmod program
#INSTALL='${SHELL} ${PORT}/install.sh' # SGI install program/emulator
#LN="/bin/ln" # pathname of suitable ln program
#LN_S="-s" # option to ${LN} to create symlink
#MV_F="-f" # option to ${MV} to force operation
#SED="/bin/sed" # pathname of suitable sed program
#STRIP="/bin/strip" # strip program used by install.sh
Vendored
-793
View File
@@ -1,793 +0,0 @@
#!/bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
# 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
# (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.
#
# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
# 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.
# 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.
# 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.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
# First pass through any local machine types.
case $1 in
*local*)
echo $1
exit 0
;;
*)
;;
esac
# Separate what the user gave into CPU-COMPANY and OS (if any).
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
os=
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-lynx)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i[345]86 | i860 | m68k | m68000 | m88k | ns32k | arm | pyramid \
| tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
| alpha | we32k | ns16k | clipper | sparclite | i370 | sh \
| powerpc | sparc64 | 1750a | dsp16xx | mips64 | mipsel \
| pdp11 | mips64el | mips64orion | mips64orionel )
basic_machine=$basic_machine-unknown
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
vax-* | tahoe-* | i[345]86-* | i860-* | m68k-* | m68000-* | m88k-* \
| sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
| hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
| pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
| pdp11-* | sh-* | powerpc-* | sparc64-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* )
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-cbm
;;
amigados)
basic_machine=m68k-cbm
os=-amigados
;;
amigaunix | amix)
basic_machine=m68k-cbm
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | ymp)
basic_machine=ymp-cray
os=-unicos
;;
cray2)
basic_machine=cray2-cray
os=-unicos
;;
crds | unos)
basic_machine=m68k-crds
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
os=-mvs
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i[345]86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
os=-sysv32
;;
i[345]86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
os=-sysv4
;;
i[345]86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
os=-sysv
;;
i[345]86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
os=-solaris2
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
miniframe)
basic_machine=m68000-convergent
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
np1)
basic_machine=np1-gould
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium-*)
# We will change tis to say i586 once there has been
# time for various packages to start to recognize that.
basic_machine=i486-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
ps2)
basic_machine=i386-ibm
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
xmp)
basic_machine=xmp-cray
os=-unicos
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
mips)
basic_machine=mips-mips
;;
romp)
basic_machine=romp-ibm
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sparc)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# -solaris* is a basic system type, with this one exception.
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# 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[345]* \
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigados* | -msdos* | -newsos* | -unicos* | -aos* \
| -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
| -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -ptx* | -coff* | -winnt*)
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-ctix* | -uts*)
os=-sysv
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-xenix)
os=-xenix
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
*-acorn)
os=-riscix1.2
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-ibm)
os=-aix
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigados
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-masscomp)
os=-rtu
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-lynxos*)
vendor=lynx
;;
-aix*)
vendor=ibm
;;
-hpux*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
Vendored
-1634
View File
File diff suppressed because it is too large. Load diff
+1280
View File
File diff suppressed because it is too large. Load diff
+27
View File
@@ -0,0 +1,27 @@
# CMake build for libtiff
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
add_subdirectory(addtiffo)
add_subdirectory(dbs)
add_subdirectory(iptcutil)
+31
View File
@@ -0,0 +1,31 @@
# Tag Image File Format (TIFF) Software
#
# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
#
# Permission to use, copy, modify, distribute, and sell this software and
# its documentation for any purpose is hereby granted without fee, provided
# that (i) the above copyright notices and this permission notice appear in
# all copies of the software and related documentation, and (ii) the names of
# Sam Leffler and Silicon Graphics may not be used in any advertising or
# publicity relating to the software without the specific, prior written
# permission of Sam Leffler and Silicon Graphics.
#
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# Process this file with automake to produce Makefile.in.
EXTRA_DIST = \
CMakeLists.txt \
README
SUBDIRS = addtiffo dbs iptcutil mfs pds ras stream tags win_dib
+2
View File
@@ -0,0 +1,2 @@
This directory contains various contributions from libtiff users.
-79
View File
@@ -1,79 +0,0 @@
Building the Software on an Acorn RISC OS system
The directory contrib/acorn contains support for compiling the library under
Acorn C/C++ under Acorn's RISC OS 3.10 or above. Subsequent pathnames will
use the Acorn format: The full-stop or period character is a pathname
delimeter, and the slash character is not interpreted; the reverse position
from Unix. Thus "libtiff/tif_acorn.c" becomes "libtiff.tif_acorn/c".
This support was contributed by Peter Greenham.
(peterg@angmulti.demon.co.uk).
Installing LibTIFF:
LIBTIFF uses several files which have names longer than the normal RISC OS
maximum of ten characters. This complicates matters. Maybe one day Acorn will
address the problem and implement long filenames properly. Until then this
gets messy, especially as I'm trying to do this with obeyfiles and not have
to include binaries in this distribution.
First of all, ensure you have Truncate configured on (type *Configure
Truncate On) Although it is, of course, preferable to have long filenames,
LIBTIFF can be installed with short filenames, and it will compile and link
without problems. However, getting it there is more problematic.
contrib.acorn.install is an installation obeyfile which will create a normal
Acorn-style library from the source (ie: with c, h and o folders etc.), but
needs the distribution library to have been unpacked into a location which is
capable of supporting long filenames, even if only temporarily.
My recommendation, until Acorn address this problem properly, is to use Jason
Tribbeck's LongFilenames , or any other working system that gives you long
filenames, like a nearby NFS server for instance.
If you are using Longfilenames, even if only temporarily to install LIBTIFF,
unpack the TAR into a RAMDisc which has been longfilenamed (ie: *addlongfs
ram) and then install from there to the hard disk. Unfortunately
Longfilenames seems a bit unhappy about copying a bunch of long-named files
across the same filing system, but is happy going between systems. You'll
need to create a ramdisk of about 2Mb.
Now you can run the installation script I've supplied (in contrib.acorn),
which will automate the process of installing LIBTIFF as an Acorn-style
library. The syntax is as follows:
install <source_dir> <dest_dir>
Install will then create <dest_dir> and put the library in there. For
example, having used LongFilenames on the RAMDisk and unpacked the library
into there, you can then type:
Obey RAM::RamDisc0.$.contrib.acorn.install RAM::RamDisc0.$ ADFS::4.$.LIBTIFF
It doesn't matter if the destination location can cope with long filenames or
not. The filenames will be truncated if necessary (*Configure Truncate On if
you get errors) and all will be well.
Compiling LibTIFF:
Once the LibTIFF folder has been created and the files put inside, making the
library should be just a matter of running 'SetVars' to set the appropriate
system variables, then running 'Makefile'.
OSLib
OSLib is a comprehensive API for RISC OS machines, written by Jonathan
Coxhead of Acorn Computers (although OSLib is not an official Acorn product).
Using the OSLib SWI veneers produces code which is more compact and more
efficient than code written using _kernel_swi or _swi. The Acorn port of
LibTIFF can take advantage of this if present. Edit the Makefile and go to
the Static dependencies section. The first entry is:
# Static dependencies:
@.o.tif_acorn: @.c.tif_acorn
cc $(ccflags) -o @.o.tif_acorn @.c.tif_acorn
Change the cc line to:
cc $(ccflags) -DINCLUDE_OSLIB -o @.o.tif_acorn @.c.tif_acorn
Remember, however, that OSLib is only recommended for efficiency's sake. It
is not required.
-3
View File
@@ -1,3 +0,0 @@
Set LibTIFF$Dir <Obey$Dir>
Set LibTIFF$Path <LibTIFF$Dir>.
Set C$Path <C$Path>,LibTIFF:
-175
View File
@@ -1,175 +0,0 @@
RISC OS Conversion log
======================
mkversion.c
~~~~~~~~~~~
The RISC OS command-line does not allow the direct creation of the version.h
file in the proper manner. To remedy this in such a way that the version
header is made at compiletime, I wrote this small program. It is fully
portable, so should work quite happily for any other platform that might need
it.
msg3states.c
~~~~~~~~~~~~
Needed getopt.c from the port folder, then compiled and worked fine.
tiff.h
~~~~~~
====1====
The symbol _MIPS_SZLONG, if not defined, causes a compiler error. Fixed by
ensuring it does exist. This looks to me like this wouldn't be an
Acorn-specific problem. The new code fragment is as follows:
#ifndef _MIPS_SZLONG
#define _MIPS_SZLONG 32
#endif
#if defined(__alpha) || _MIPS_SZLONG == 64
tiffcomp.h
~~~~~~~~~~
====1====
#if !defined(__MWERKS__) && !defined(THINK_C)
#include <sys/types.h>
#endif
Acorn also doesn't have this header so:
#if !defined(__MWERKS__) && !defined(THINK_C) && !defined(__acorn)
#include <sys/types.h>
#endif
====2====
#ifdef VMS
#include <file.h>
#include <unixio.h>
#else
#include <fcntl.h>
#endif
This seems to indicate that fcntl.h is included on all systems except
VMS. Odd, because I've never heard of it before. Sure it's in the ANSI
definition? Anyway, following change:
#ifdef VMS
#include <file.h>
#include <unixio.h>
#else
#ifndef __acorn
#include <fcntl.h>
#endif
#endif
This will probably change when I find out what it wants from fcntl.h!
====3====
#if defined(__MWERKS__) || defined(THINK_C) || defined(applec)
#include <stdlib.h>
#define BSDTYPES
#endif
Added RISC OS to above thus:
#if defined(__MWERKS__) || defined(THINK_C) || defined(applec) || defined(__acorn)
#include <stdlib.h>
#define BSDTYPES
#endif
====4====
/*
* The library uses the ANSI C/POSIX SEEK_*
* definitions that should be defined in unistd.h
* (except on VMS where they are in stdio.h and
* there is no unistd.h).
*/
#ifndef SEEK_SET
#if !defined(VMS) && !defined (applec) && !defined(THINK_C) && !defined(__MWERKS__)
#include <unistd.h>
#endif
RISC OS is like VMS and Mac in this regard. So changed to:
/*
* The library uses the ANSI C/POSIX SEEK_*
* definitions that should be defined in unistd.h
* (except on VMS or the Mac or RISC OS, where they are in stdio.h and
* there is no unistd.h).
*/
#ifndef SEEK_SET
#if !defined(VMS) && !defined (applec) && !defined(THINK_C) && !defined(__MWERKS__) && !defined(__acorn)
#include <unistd.h>
#endif
#endif
====5====
NB: HAVE_IEEEFP is defined in tiffconf.h, not tiffcomp.h as mentioned
in libtiff.README. (Note written on original port from 3.4beta004)
Acorn C/C++ claims to accord with IEEE 754, so no change (yet) to
tiffconf.h.
====6====
Unsure about whether this compiler supports inline functions. Will
leave it on for the time being and see if it works! (Likely if
everything else does.)
... Seems to be OK ...
====7====
Added to the end:
/*
* osfcn.h is part of C++Lib on Acorn C/C++, and as such can't be used
* on C alone. For that reason, the relevant functions have been
* implemented by myself in tif_acorn.c, and the elements from the header
* included here.
*/
#ifdef __acorn
#ifdef __cplusplus
#include <osfcn.h>
#else
#include "kernel.h"
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
#define O_APPEND 8
#define O_CREAT 0x200
#define O_TRUNC 0x400
typedef long off_t;
extern int open(const char *name, int flags, int mode);
extern int close(int fd);
extern int write(int fd, const char *buf, int nbytes);
extern int read(int fd, char *buf, int nbytes);
extern off_t lseek(int fd, off_t offset, int whence);
#endif
#endif
===============================================================================
tif_acorn.c
~~~~~~~~~~~
Created file tif_acorn.c, copied initially from tif_unix.c
Documented internally where necessary.
Note that I have implemented the low-level file-handling functions normally
found in osfcn.h in here, and put the header info at the bottom of
tiffcomp.h. This is further documented from a RISC OS perspective inside the
file.
===============================================================================
-124
View File
@@ -1,124 +0,0 @@
If "%0" = "" Then Error Syntax: install |<source_dir> |<dest_dir>
If "%1" = "" Then Error Syntax: install |<source_dir> |<dest_dir>
Set LibTiffInstall$Dir %0
Set LibTiff$Dir %1
Set Alias$CPY Copy <LibTiffInstall$Dir>.%%0 <LibTiff$Dir>.%%1 ~C~DF~NQRV
CDir <LibTiff$Dir>
CDir <LibTiff$Dir>.c
CDir <LibTiff$Dir>.h
CDir <LibTiff$Dir>.o
CPY COPYRIGHT COPYRIGHT
CPY README README
CPY VERSION VERSION
CPY contrib.acorn.SetVars SetVars
CPY port.getopt/c c.getopt
CPY libtiff.Makefile/acorn Makefile
CPY libtiff.mkg3states/c c.mkg3states
CPY libtiff.mkspans/c c.mkspans
CPY libtiff.mkversion/c c.mkversion
CPY libtiff.tif_acorn/c c.tif_acorn
CPY libtiff.tif_aux/c c.tif_aux
CPY libtiff.tif_close/c c.tif_close
CPY libtiff.tif_codec/c c.tif_codec
CPY libtiff.tif_compress/c c.tif_compre
CPY libtiff.tif_dir/c c.tif_dir
CPY libtiff.tif_dirinfo/c c.tif_dirinf
CPY libtiff.tif_dirread/c c.tif_dirrea
CPY libtiff.tif_dirwrite/c c.tif_dirwri
CPY libtiff.tif_dumpmode/c c.tif_dumpmo
CPY libtiff.tif_error/c c.tif_error
CPY libtiff.tif_fax3/c c.tif_fax3
CPY libtiff.tif_flush/c c.tif_flush
CPY libtiff.tif_getimage/c c.tif_getima
CPY libtiff.tif_jpeg/c c.tif_jpeg
CPY libtiff.tif_lzw/c c.tif_lzw
CPY libtiff.tif_next/c c.tif_next
CPY libtiff.tif_open/c c.tif_open
CPY libtiff.tif_packbits/c c.tif_packbi
CPY libtiff.tif_predict/c c.tif_predic
CPY libtiff.tif_print/c c.tif_print
CPY libtiff.tif_read/c c.tif_read
CPY libtiff.tif_strip/c c.tif_strip
CPY libtiff.tif_swab/c c.tif_swab
CPY libtiff.tif_thunder/c c.tif_thunde
CPY libtiff.tif_tile/c c.tif_tile
CPY libtiff.tif_version/c c.tif_versio
CPY libtiff.tif_warning/c c.tif_warnin
CPY libtiff.tif_write/c c.tif_write
CPY libtiff.tif_zip/c c.tif_zip
CPY libtiff.t4/h h.t4
CPY libtiff.tiff/h h.tiff
CPY libtiff.tiffcomp/h h.tiffcomp
CPY libtiff.tiffconf/h h.tiffconf
CPY libtiff.tiffio/h h.tiffio
CPY libtiff.tiffiop/h h.tiffiop
CPY libtiff.tif_dir/h h.tif_dir
CPY libtiff.tif_fax3/h h.tif_fax3
CPY libtiff.tif_predict/h h.tif_predic
SetType <LibTiff$Dir>.COPYRIGHT Text
SetType <LibTiff$Dir>.README Text
SetType <LibTiff$Dir>.VERSION Text
SetType <LibTiff$Dir>.SetVars Obey
SetType <LibTiff$Dir>.Makefile fe1
SetType <LibTiff$Dir>.c.getopt Text
SetType <LibTiff$Dir>.c.mkg3states Text
SetType <LibTiff$Dir>.c.mkspans Text
SetType <LibTiff$Dir>.c.mkversion Text
SetType <LibTiff$Dir>.c.tif_acorn Text
SetType <LibTiff$Dir>.c.tif_aux Text
SetType <LibTiff$Dir>.c.tif_close Text
SetType <LibTiff$Dir>.c.tif_codec Text
SetType <LibTiff$Dir>.c.tif_compre Text
SetType <LibTiff$Dir>.c.tif_dir Text
SetType <LibTiff$Dir>.c.tif_dirinf Text
SetType <LibTiff$Dir>.c.tif_dirrea Text
SetType <LibTiff$Dir>.c.tif_dirwri Text
SetType <LibTiff$Dir>.c.tif_dumpmo Text
SetType <LibTiff$Dir>.c.tif_error Text
SetType <LibTiff$Dir>.c.tif_fax3 Text
SetType <LibTiff$Dir>.c.tif_flush Text
SetType <LibTiff$Dir>.c.tif_getima Text
SetType <LibTiff$Dir>.c.tif_jpeg Text
SetType <LibTiff$Dir>.c.tif_lzw Text
SetType <LibTiff$Dir>.c.tif_next Text
SetType <LibTiff$Dir>.c.tif_open Text
SetType <LibTiff$Dir>.c.tif_packbi Text
SetType <LibTiff$Dir>.c.tif_predic Text
SetType <LibTiff$Dir>.c.tif_print Text
SetType <LibTiff$Dir>.c.tif_read Text
SetType <LibTiff$Dir>.c.tif_strip Text
SetType <LibTiff$Dir>.c.tif_swab Text
SetType <LibTiff$Dir>.c.tif_thunde Text
SetType <LibTiff$Dir>.c.tif_tile Text
SetType <LibTiff$Dir>.c.tif_versio Text
SetType <LibTiff$Dir>.c.tif_warnin Text
SetType <LibTiff$Dir>.c.tif_write Text
SetType <LibTiff$Dir>.c.tif_zip Text
SetType <LibTiff$Dir>.h.t4 Text
SetType <LibTiff$Dir>.h.tiff Text
SetType <LibTiff$Dir>.h.tiffcomp Text
SetType <LibTiff$Dir>.h.tiffconf Text
SetType <LibTiff$Dir>.h.tiffio Text
SetType <LibTiff$Dir>.h.tiffiop Text
SetType <LibTiff$Dir>.h.tif_dir Text
SetType <LibTiff$Dir>.h.tif_fax3 Text
SetType <LibTiff$Dir>.h.tif_predic Text
Unset Alias$CPY
Unset LibTiffInstall$Dir
| Now attempt to restore longfilename status. If it causes an error, OK.
Set Alias$RN Rename <LibTiff$Dir>.%%0 <LibTiff$Dir>.%%1
Unset LibTiff$Dir
RN c.tif_compre c.tif_compress
RN c.tif_dirinf c.tif_dirinfo
RN c.tif_dirrea c.tif_dirread
RN c.tif_dirwri c.tif_dirwrite
RN c.tif_dumpmo c.tif_dumpmode
RN c.tif_getima c.tif_getimage
RN c.tif_packbi c.tif_packbits
RN c.tif_predic c.tif_predict
RN c.tif_thunde c.tif_thunder
RN c.tif_versio c.tif_version
RN c.tif_warnin c.tif_warning
RN h.tif_predic h.tif_predict
Unset Alias$RN
Echo All done!
+32
View File
@@ -0,0 +1,32 @@
# CMake build for libtiff
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Written by Roger Leigh <rleigh@codelibre.net>
#
# 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.
add_executable(addtiffo addtiffo.c tif_overview.c tif_ovrcache.c tif_ovrcache.h)
target_link_libraries(addtiffo tiff tiff_port)
if(WEBP_SUPPORT AND EMSCRIPTEN)
# Emscripten is pretty finnicky about linker flags.
# It needs --shared-memory if and only if atomics or bulk-memory is used.
target_link_options(addtiffo PUBLIC "-Wl,--shared-memory")
endif()
+40
View File
@@ -0,0 +1,40 @@
# Tag Image File Format (TIFF) Software
#
# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
#
# Permission to use, copy, modify, distribute, and sell this software and
# its documentation for any purpose is hereby granted without fee, provided
# that (i) the above copyright notices and this permission notice appear in
# all copies of the software and related documentation, and (ii) the names of
# Sam Leffler and Silicon Graphics may not be used in any advertising or
# publicity relating to the software without the specific, prior written
# permission of Sam Leffler and Silicon Graphics.
#
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# Process this file with automake to produce Makefile.in.
LIBTIFF = $(top_builddir)/libtiff/libtiff.la
EXTRA_DIST = \
CMakeLists.txt \
README
if TIFF_CONTRIB
noinst_PROGRAMS = addtiffo
endif
addtiffo_SOURCES = addtiffo.c tif_overview.c tif_ovrcache.c tif_ovrcache.h
addtiffo_LDADD = $(LIBTIFF)
AM_CPPFLAGS = -I$(top_srcdir)/libtiff
+142
View File
@@ -0,0 +1,142 @@
addtiffo 1.0
============
The addtiffo utility is used to add overview pyramids to an existing
TIFF or GeoTIFF file. Some applications can take advantage of these
overviews to accelerate overview display performance of large rasters.
This release of addtiffo is primarily intended for compatibility testing
with applications, and to see if there is interest in a cleaner release
of the capability ... perhaps incorporation into the libtiff tools
distribution.
Please feel free to contact me with questions, or problems.
warmerda@home.com
http://home.gdal.org/~warmerda/
Usage
-----
Usage: addtiffo [-r {average/nearest} [-subifd]
tiff_filename [resolution_reductions]
Example:
% addtiffo abc.tif 2 4 8 16
The numeric arguments are the list of reduction factors to
generate. In this example a 1/2, 1/4 1/8 and 1/16
Limitations
-----------
See tif_overview.cpp for up to date details.
o Currently only images with bits_per_sample of a multiple of eight
will work.
o The code will attempt to use the same kind of compression,
photometric interpretation, and organization as the source image, but
it doesn't copy geotiff tags to the reduced resolution images.
o Reduced resolution overviews for multi-sample files will currently
always be generated as PLANARCONFIG_SEPARATE. This could be fixed
reasonable easily if needed to improve compatibility with other
packages. Many don't properly support PLANARCONFIG_SEPARATE.
o Overviews are always written as appended IFDs, rather than using the
``tree of tree's'' approach using the SUBIFD tag. I wanted to implement
both, but it isn't currently easy to add a SUBIFD tag to an existing
main tiff IFD with libtiff. I hope to try this again later.
TIFF File Tags
--------------
The results of running addtiffo on a 1024x1024 tiled greyscale file
with the arguments ``2 4 8 16'' is to add four additional TIFF directories
appended on the file with the SUBFILETYPE flag to 0x1 indicating the extra
items are reduced resolution images.
The tiffinfo output of such a file might look like this:
TIFF Directory at offset 0x118008
Image Width: 1024 Image Length: 1024
Tile Width: 256 Tile Length: 112
Bits/Sample: 8
Compression Scheme: none
Photometric Interpretation: min-is-black
Samples/Pixel: 1
Planar Configuration: single image plane
TIFF Directory at offset 0x15e1d2
Subfile Type: reduced-resolution image (1 = 0x1)
Image Width: 512 Image Length: 512
Tile Width: 256 Tile Length: 112
Bits/Sample: 8
Compression Scheme: none
Photometric Interpretation: min-is-black
Samples/Pixel: 1
Planar Configuration: separate image planes
TIFF Directory at offset 0x1732b8
Subfile Type: reduced-resolution image (1 = 0x1)
Image Width: 256 Image Length: 256
Tile Width: 256 Tile Length: 112
Bits/Sample: 8
Compression Scheme: none
Photometric Interpretation: min-is-black
Samples/Pixel: 1
Planar Configuration: separate image planes
TIFF Directory at offset 0x17a366
Subfile Type: reduced-resolution image (1 = 0x1)
Image Width: 128 Image Length: 128
Tile Width: 128 Tile Length: 112
Bits/Sample: 8
Compression Scheme: none
Photometric Interpretation: min-is-black
Samples/Pixel: 1
Planar Configuration: separate image planes
TIFF Directory at offset 0x17b40c
Subfile Type: reduced-resolution image (1 = 0x1)
Image Width: 64 Image Length: 64
Tile Width: 64 Tile Length: 64
Bits/Sample: 8
Compression Scheme: none
Photometric Interpretation: min-is-black
Samples/Pixel: 1
Planar Configuration: separate image planes
Building
--------
You will need a C compiler. You will need to have libtiff already
built and installed. The provided Makefile should work on most Unix systems.
A similar file will be needed for Windows, but is not provided.
The CFLAGS and LIBS macros in the Makefile will have to be updated to
point to the correct location of the libtiff include files, and library.
Credits
-------
o Intergraph Corporation for partially funding the work.
o Global Geomatics for partially funding reorganization of the overview
building ability as a separate utility.
o Orrin Long, and Ed Grissom of Intergraph for explaining what needed to
be done.
o Max Martinez of Erdas for his discussion of external overviews.
o Atlantis Scientific who supported adding averaging, and some other
generalizations.
o Frank Warmerdam for writing the bulk of the code.
o Sam Leffler since this only exists because of his libtiff.
+174
View File
@@ -0,0 +1,174 @@
/******************************************************************************
* Project: GeoTIFF Overview Builder
* Purpose: Mainline for building overviews in a TIFF file.
* Author: Frank Warmerdam, warmerdam@pobox.com
*
******************************************************************************
* Copyright (c) 1999, Frank Warmerdam
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
******************************************************************************
*
* $Log: addtiffo.c,v $
* Revision 1.8 2015-05-30 20:30:27 bfriesen
* * contrib/addtiffo/addtiffo.c (main): Possibly address Coverity
* 1024226 "Untrusted value as argument".
*
* Revision 1.7 2010-06-08 18:55:15 bfriesen
* * contrib: Add an emacs formatting mode footer to all source files
* so that emacs can be effectively used.
*
* Revision 1.6 2005/12/16 05:59:55 fwarmerdam
* Major upgrade to support YCbCr subsampled jpeg images
*
* Revision 1.4 2004/09/21 13:31:23 dron
* Add missed include string.h.
*
* Revision 1.3 2000/04/18 22:48:31 warmerda
* Added support for averaging resampling
*
* Revision 1.2 2000/01/28 15:36:38 warmerda
* pass TIFF handle instead of filename to overview builder
*
* Revision 1.1 1999/08/17 01:47:59 warmerda
* New
*
* Revision 1.1 1999/03/12 17:46:32 warmerda
* New
*
* Revision 1.2 1999/02/11 22:27:12 warmerda
* Added multi-sample support
*
* Revision 1.1 1999/02/11 18:12:30 warmerda
* New
*/
#include "tiffio.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void TIFFBuildOverviews(TIFF *, int, int *, int, const char *,
int (*)(double, void *), void *);
/************************************************************************/
/* main() */
/************************************************************************/
int main(int argc, char **argv)
{
int anOverviews[100]; /* TODO: un-hardwire array length, flexible allocate
*/
int nOverviewCount = 0;
int bUseSubIFD = 0;
TIFF *hTIFF;
const char *pszResampling = "nearest";
/* -------------------------------------------------------------------- */
/* Usage: */
/* -------------------------------------------------------------------- */
if (argc < 2)
{
printf("Usage: addtiffo [-r {nearest,average,mode}]\n"
" tiff_filename [resolution_reductions]\n"
"\n"
"Example:\n"
" %% addtiffo abc.tif 2 4 8 16\n");
return (1);
}
while (argv[1][0] == '-')
{
if (strcmp(argv[1], "-subifd") == 0)
{
bUseSubIFD = 1;
argv++;
argc--;
}
else if (strcmp(argv[1], "-r") == 0)
{
argv += 2;
argc -= 2;
pszResampling = *argv;
}
else
{
fprintf(stderr, "Incorrect parameters\n");
return (1);
}
}
/* TODO: resampling mode parameter needs to be encoded in an integer from
* this point on */
/* -------------------------------------------------------------------- */
/* Collect the user requested reduction factors. */
/* -------------------------------------------------------------------- */
while (nOverviewCount < argc - 2 && nOverviewCount < 100)
{
anOverviews[nOverviewCount] = atoi(argv[nOverviewCount + 2]);
if ((anOverviews[nOverviewCount] <= 0) ||
((anOverviews[nOverviewCount] > 1024)))
{
fprintf(stderr, "Incorrect parameters\n");
return (1);
}
nOverviewCount++;
}
/* -------------------------------------------------------------------- */
/* Default to four overview levels. It would be nicer if it */
/* defaulted based on the size of the source image. */
/* -------------------------------------------------------------------- */
/* TODO: make it default based on the size of the source image */
if (nOverviewCount == 0)
{
nOverviewCount = 4;
anOverviews[0] = 2;
anOverviews[1] = 4;
anOverviews[2] = 8;
anOverviews[3] = 16;
}
/* -------------------------------------------------------------------- */
/* Build the overview. */
/* -------------------------------------------------------------------- */
hTIFF = TIFFOpen(argv[1], "r+");
if (hTIFF == NULL)
{
fprintf(stderr, "TIFFOpen(%s) failed.\n", argv[1]);
return (1);
}
TIFFBuildOverviews(hTIFF, nOverviewCount, anOverviews, bUseSubIFD,
pszResampling, NULL, NULL);
TIFFClose(hTIFF);
/* -------------------------------------------------------------------- */
/* Optionally test for memory leaks. */
/* -------------------------------------------------------------------- */
#ifdef DBMALLOC
malloc_dump(1);
#endif
return (0);
}
+931
View File
@@ -0,0 +1,931 @@
/******************************************************************************
* tif_overview.c,v 1.9 2005/05/25 09:03:16 dron Exp
*
* Project: TIFF Overview Builder
* Purpose: Library function for building overviews in a TIFF file.
* Author: Frank Warmerdam, warmerdam@pobox.com
*
* Notes:
* o Currently only images with bits_per_sample of a multiple of eight
* will work.
*
* o The downsampler currently just takes the top left pixel from the
* source rectangle. Eventually sampling options of averaging, mode, and
* ``center pixel'' should be offered.
*
* o The code will attempt to use the same kind of compression,
* photometric interpretation, and organization as the source image, but
* it doesn't copy geotiff tags to the reduced resolution images.
*
* o Reduced resolution overviews for multi-sample files will currently
* always be generated as PLANARCONFIG_SEPARATE. This could be fixed
* reasonable easily if needed to improve compatibility with other
* packages. Many don't properly support PLANARCONFIG_SEPARATE.
*
******************************************************************************
* Copyright (c) 1999, Frank Warmerdam
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
******************************************************************************
*/
/* TODO: update notes in header above */
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "tif_ovrcache.h"
#include "tiffio.h"
#ifndef FALSE
#define FALSE 0
#define TRUE 1
#endif
#ifndef MAX
#define MIN(a, b) ((a < b) ? a : b)
#define MAX(a, b) ((a > b) ? a : b)
#endif
#define TIFF_DIR_MAX 65534
void TIFFBuildOverviews(TIFF *, int, int *, int, const char *,
int (*)(double, void *), void *);
/************************************************************************/
/* TIFF_WriteOverview() */
/* */
/* Create a new directory, without any image data for an overview. */
/* Returns offset of newly created overview directory, but the */
/* current directory is reset to be the one in used when this */
/* function is called. */
/************************************************************************/
uint32_t TIFF_WriteOverview(TIFF *hTIFF, uint32_t nXSize, uint32_t nYSize,
int nBitsPerPixel, int nPlanarConfig, int nSamples,
int nBlockXSize, int nBlockYSize, int bTiled,
int nCompressFlag, int nPhotometric,
int nSampleFormat, unsigned short *panRed,
unsigned short *panGreen, unsigned short *panBlue,
int bUseSubIFDs, int nHorSubsampling,
int nVerSubsampling)
{
toff_t nBaseDirOffset;
toff_t nOffset;
tdir_t iNumDir;
(void)bUseSubIFDs;
nBaseDirOffset = TIFFCurrentDirOffset(hTIFF);
TIFFCreateDirectory(hTIFF);
/* -------------------------------------------------------------------- */
/* Setup TIFF fields. */
/* -------------------------------------------------------------------- */
TIFFSetField(hTIFF, TIFFTAG_IMAGEWIDTH, nXSize);
TIFFSetField(hTIFF, TIFFTAG_IMAGELENGTH, nYSize);
if (nSamples == 1)
TIFFSetField(hTIFF, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
else
TIFFSetField(hTIFF, TIFFTAG_PLANARCONFIG, nPlanarConfig);
TIFFSetField(hTIFF, TIFFTAG_BITSPERSAMPLE, nBitsPerPixel);
TIFFSetField(hTIFF, TIFFTAG_SAMPLESPERPIXEL, nSamples);
TIFFSetField(hTIFF, TIFFTAG_COMPRESSION, nCompressFlag);
TIFFSetField(hTIFF, TIFFTAG_PHOTOMETRIC, nPhotometric);
TIFFSetField(hTIFF, TIFFTAG_SAMPLEFORMAT, nSampleFormat);
if (bTiled)
{
TIFFSetField(hTIFF, TIFFTAG_TILEWIDTH, nBlockXSize);
TIFFSetField(hTIFF, TIFFTAG_TILELENGTH, nBlockYSize);
}
else
TIFFSetField(hTIFF, TIFFTAG_ROWSPERSTRIP, nBlockYSize);
TIFFSetField(hTIFF, TIFFTAG_SUBFILETYPE, FILETYPE_REDUCEDIMAGE);
if (nPhotometric == PHOTOMETRIC_YCBCR || nPhotometric == PHOTOMETRIC_ITULAB)
{
TIFFSetField(hTIFF, TIFFTAG_YCBCRSUBSAMPLING, nHorSubsampling,
nVerSubsampling);
/* TODO: also write YCbCrPositioning and YCbCrCoefficients tag identical
* to source IFD */
}
/* TODO: add command-line parameter for selecting jpeg compression quality
* that gets ignored when compression isn't jpeg */
/* -------------------------------------------------------------------- */
/* Write color table if one is present. */
/* -------------------------------------------------------------------- */
if (panRed != NULL)
{
TIFFSetField(hTIFF, TIFFTAG_COLORMAP, panRed, panGreen, panBlue);
}
/* -------------------------------------------------------------------- */
/* Write directory, and return byte offset. */
/* -------------------------------------------------------------------- */
if (TIFFWriteCheck(hTIFF, bTiled, "TIFFBuildOverviews") == 0)
return 0;
if (!TIFFWriteDirectory(hTIFF))
return 0;
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);
TIFFSetSubDirectory(hTIFF, nBaseDirOffset);
return nOffset;
}
/************************************************************************/
/* TIFF_GetSourceSamples() */
/************************************************************************/
static void TIFF_GetSourceSamples(double *padfSamples, unsigned char *pabySrc,
int nPixelBytes, int nSampleFormat,
uint32_t nXSize, uint32_t nYSize,
int nPixelOffset, int nLineOffset)
{
uint32_t iXOff, iYOff;
int iSample;
iSample = 0;
for (iYOff = 0; iYOff < nYSize; iYOff++)
{
for (iXOff = 0; iXOff < nXSize; iXOff++)
{
unsigned char *pabyData;
pabyData = pabySrc + iYOff * nLineOffset + iXOff * nPixelOffset;
if (nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 1)
{
padfSamples[iSample++] = *pabyData;
}
else if (nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 2)
{
padfSamples[iSample++] = ((uint16_t *)pabyData)[0];
}
else if (nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 4)
{
padfSamples[iSample++] = ((uint32_t *)pabyData)[0];
}
else if (nSampleFormat == SAMPLEFORMAT_INT && nPixelBytes == 2)
{
padfSamples[iSample++] = ((int16_t *)pabyData)[0];
}
else if (nSampleFormat == SAMPLEFORMAT_INT && nPixelBytes == 32)
{
padfSamples[iSample++] = ((int32_t *)pabyData)[0];
}
else if (nSampleFormat == SAMPLEFORMAT_IEEEFP && nPixelBytes == 4)
{
padfSamples[iSample++] = ((float *)pabyData)[0];
}
else if (nSampleFormat == SAMPLEFORMAT_IEEEFP && nPixelBytes == 8)
{
padfSamples[iSample++] = ((double *)pabyData)[0];
}
}
}
}
/************************************************************************/
/* TIFF_SetSample() */
/************************************************************************/
static void TIFF_SetSample(unsigned char *pabyData, int nPixelBytes,
int nSampleFormat, double dfValue)
{
if (nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 1)
{
*pabyData = (unsigned char)MAX(0, MIN(255, dfValue));
}
else if (nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 2)
{
*((uint16_t *)pabyData) = (uint16_t)MAX(0, MIN(65535, dfValue));
}
else if (nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 4)
{
*((uint32_t *)pabyData) = (uint32_t)dfValue;
}
else if (nSampleFormat == SAMPLEFORMAT_INT && nPixelBytes == 2)
{
*((int16_t *)pabyData) = (int16_t)MAX(-32768, MIN(32767, dfValue));
}
else if (nSampleFormat == SAMPLEFORMAT_INT && nPixelBytes == 32)
{
*((int32_t *)pabyData) = (int32_t)dfValue;
}
else if (nSampleFormat == SAMPLEFORMAT_IEEEFP && nPixelBytes == 4)
{
*((float *)pabyData) = (float)dfValue;
}
else if (nSampleFormat == SAMPLEFORMAT_IEEEFP && nPixelBytes == 8)
{
*((double *)pabyData) = dfValue;
}
}
/************************************************************************/
/* TIFF_DownSample() */
/* */
/* Down sample a tile of full res data into a window of a tile */
/* of downsampled data. */
/************************************************************************/
static void TIFF_DownSample(unsigned char *pabySrcTile, uint32_t nBlockXSize,
uint32_t nBlockYSize, int nPixelSkewBits,
int nBitsPerPixel, unsigned char *pabyOTile,
uint32_t nOBlockXSize, uint32_t nOBlockYSize,
uint32_t nTXOff, uint32_t nTYOff, int nOMult,
int nSampleFormat, const char *pszResampling)
{
uint32_t i, j;
int k, nPixelBytes = (nBitsPerPixel) / 8;
int nPixelGroupBytes = (nBitsPerPixel + nPixelSkewBits) / 8;
unsigned char *pabySrc, *pabyDst;
double *padfSamples;
size_t tpadfSamples_size, padfSamples_size;
assert(nBitsPerPixel >= 8);
/* sizeof(double) * nOMult * nOMult */
tpadfSamples_size = nOMult * nOMult;
if ((nOMult != 0) && (tpadfSamples_size / nOMult == (size_t)nOMult))
{
padfSamples_size = tpadfSamples_size;
tpadfSamples_size = padfSamples_size * sizeof(double);
if ((tpadfSamples_size / padfSamples_size) == sizeof(double))
padfSamples_size = tpadfSamples_size;
else
padfSamples_size = 0;
}
else
{
padfSamples_size = 0;
}
if (padfSamples_size == 0)
{
/* TODO: This is an error condition */
return;
}
padfSamples = (double *)malloc(padfSamples_size);
/* ==================================================================== */
/* Loop over scanline chunks to process, establishing where the */
/* data is going. */
/* ==================================================================== */
for (j = 0; j * nOMult < nBlockYSize; j++)
{
if (j + nTYOff >= nOBlockYSize)
break;
pabyDst = pabyOTile + ((j + nTYOff) * nOBlockXSize + nTXOff) *
nPixelBytes * nPixelGroupBytes;
/* --------------------------------------------------------------------
*/
/* Handler nearest resampling ... we don't even care about the */
/* data type, we just do a bytewise copy. */
/* --------------------------------------------------------------------
*/
if (strncmp(pszResampling, "nearest", 4) == 0 ||
strncmp(pszResampling, "NEAR", 4) == 0)
{
pabySrc = pabySrcTile + j * nOMult * nBlockXSize * nPixelGroupBytes;
for (i = 0; i * nOMult < nBlockXSize; i++)
{
if (i + nTXOff >= nOBlockXSize)
break;
/*
* For now use simple subsampling, from the top left corner
* of the source block of pixels.
*/
for (k = 0; k < nPixelBytes; k++)
pabyDst[k] = pabySrc[k];
pabyDst += nPixelBytes * nPixelGroupBytes;
pabySrc += nOMult * nPixelGroupBytes;
}
}
/* --------------------------------------------------------------------
*/
/* Handle the case of averaging. For this we also have to */
/* handle each sample format we are concerned with. */
/* --------------------------------------------------------------------
*/
else if (strncmp(pszResampling, "averag", 6) == 0 ||
strncmp(pszResampling, "AVERAG", 6) == 0)
{
pabySrc = pabySrcTile + j * nOMult * nBlockXSize * nPixelGroupBytes;
for (i = 0; i * nOMult < nBlockXSize; i++)
{
double dfTotal;
uint32_t nXSize, nYSize, iSample;
if (i + nTXOff >= nOBlockXSize)
break;
nXSize = MIN((uint32_t)nOMult, nBlockXSize - i);
nYSize = MIN((uint32_t)nOMult, nBlockYSize - j);
TIFF_GetSourceSamples(
padfSamples, pabySrc, nPixelBytes, nSampleFormat, nXSize,
nYSize, nPixelGroupBytes, nPixelGroupBytes * nBlockXSize);
dfTotal = 0;
for (iSample = 0; iSample < nXSize * nYSize; iSample++)
{
dfTotal += padfSamples[iSample];
}
TIFF_SetSample(pabyDst, nPixelBytes, nSampleFormat,
dfTotal / (nXSize * nYSize));
pabySrc += nOMult * nPixelGroupBytes;
pabyDst += nPixelBytes;
}
}
}
free(padfSamples);
}
/************************************************************************/
/* TIFF_DownSample_Subsampled() */
/************************************************************************/
static void TIFF_DownSample_Subsampled(
unsigned char *pabySrcTile, int nSample, uint32_t nBlockXSize,
uint32_t nBlockYSize, unsigned char *pabyOTile, uint32_t nOBlockXSize,
uint32_t nOBlockYSize, uint32_t nTXOff, uint32_t nTYOff, int nOMult,
const char *pszResampling, int nHorSubsampling, int nVerSubsampling)
{
/* TODO: test with variety of subsampling values, and incovinient tile/strip
* sizes */
int nSampleBlockSize;
int nSourceSampleRowSize;
int nDestSampleRowSize;
uint32_t nSourceX, nSourceY;
uint32_t nSourceXSec, nSourceYSec;
uint32_t nSourceXSecEnd, nSourceYSecEnd;
uint32_t nDestX, nDestY;
int nSampleOffsetInSampleBlock;
unsigned int nCummulator;
unsigned int nCummulatorCount;
nSampleBlockSize = nHorSubsampling * nVerSubsampling + 2;
nSourceSampleRowSize =
((nBlockXSize + nHorSubsampling - 1) / nHorSubsampling) *
nSampleBlockSize;
nDestSampleRowSize =
((nOBlockXSize + nHorSubsampling - 1) / nHorSubsampling) *
nSampleBlockSize;
if (strncmp(pszResampling, "nearest", 4) == 0 ||
strncmp(pszResampling, "NEAR", 4) == 0)
{
if (nSample == 0)
{
for (nSourceY = 0, nDestY = nTYOff; nSourceY < nBlockYSize;
nSourceY += nOMult, nDestY++)
{
if (nDestY >= nOBlockYSize)
break;
for (nSourceX = 0, nDestX = nTXOff; nSourceX < nBlockXSize;
nSourceX += nOMult, nDestX++)
{
if (nDestX >= nOBlockXSize)
break;
*(pabyOTile +
(nDestY / nVerSubsampling) * nDestSampleRowSize +
(nDestY % nVerSubsampling) * nHorSubsampling +
(nDestX / nHorSubsampling) * nSampleBlockSize +
(nDestX % nHorSubsampling)) =
*(pabySrcTile +
(nSourceY / nVerSubsampling) * nSourceSampleRowSize +
(nSourceY % nVerSubsampling) * nHorSubsampling +
(nSourceX / nHorSubsampling) * nSampleBlockSize +
(nSourceX % nHorSubsampling));
}
}
}
else
{
nSampleOffsetInSampleBlock =
nHorSubsampling * nVerSubsampling + nSample - 1;
for (nSourceY = 0, nDestY = (nTYOff / nVerSubsampling);
nSourceY < (nBlockYSize / nVerSubsampling);
nSourceY += nOMult, nDestY++)
{
if (nDestY * nVerSubsampling >= nOBlockYSize)
break;
for (nSourceX = 0, nDestX = (nTXOff / nHorSubsampling);
nSourceX < (nBlockXSize / nHorSubsampling);
nSourceX += nOMult, nDestX++)
{
if (nDestX * nHorSubsampling >= nOBlockXSize)
break;
*(pabyOTile + nDestY * nDestSampleRowSize +
nDestX * nSampleBlockSize + nSampleOffsetInSampleBlock) =
*(pabySrcTile + nSourceY * nSourceSampleRowSize +
nSourceX * nSampleBlockSize +
nSampleOffsetInSampleBlock);
}
}
}
}
else if (strncmp(pszResampling, "averag", 6) == 0 ||
strncmp(pszResampling, "AVERAG", 6) == 0)
{
if (nSample == 0)
{
for (nSourceY = 0, nDestY = nTYOff; nSourceY < nBlockYSize;
nSourceY += nOMult, nDestY++)
{
if (nDestY >= nOBlockYSize)
break;
for (nSourceX = 0, nDestX = nTXOff; nSourceX < nBlockXSize;
nSourceX += nOMult, nDestX++)
{
if (nDestX >= nOBlockXSize)
break;
nSourceXSecEnd = nSourceX + nOMult;
if (nSourceXSecEnd > nBlockXSize)
nSourceXSecEnd = nBlockXSize;
nSourceYSecEnd = nSourceY + nOMult;
if (nSourceYSecEnd > nBlockYSize)
nSourceYSecEnd = nBlockYSize;
nCummulator = 0;
for (nSourceYSec = nSourceY; nSourceYSec < nSourceYSecEnd;
nSourceYSec++)
{
for (nSourceXSec = nSourceX;
nSourceXSec < nSourceXSecEnd; nSourceXSec++)
{
nCummulator += *(pabySrcTile +
(nSourceYSec / nVerSubsampling) *
nSourceSampleRowSize +
(nSourceYSec % nVerSubsampling) *
nHorSubsampling +
(nSourceXSec / nHorSubsampling) *
nSampleBlockSize +
(nSourceXSec % nHorSubsampling));
}
}
nCummulatorCount = (nSourceXSecEnd - nSourceX) *
(nSourceYSecEnd - nSourceY);
*(pabyOTile +
(nDestY / nVerSubsampling) * nDestSampleRowSize +
(nDestY % nVerSubsampling) * nHorSubsampling +
(nDestX / nHorSubsampling) * nSampleBlockSize +
(nDestX % nHorSubsampling)) =
((nCummulator + (nCummulatorCount >> 1)) /
nCummulatorCount);
}
}
}
else
{
nSampleOffsetInSampleBlock =
nHorSubsampling * nVerSubsampling + nSample - 1;
for (nSourceY = 0, nDestY = (nTYOff / nVerSubsampling);
nSourceY < (nBlockYSize / nVerSubsampling);
nSourceY += nOMult, nDestY++)
{
if (nDestY * nVerSubsampling >= nOBlockYSize)
break;
for (nSourceX = 0, nDestX = (nTXOff / nHorSubsampling);
nSourceX < (nBlockXSize / nHorSubsampling);
nSourceX += nOMult, nDestX++)
{
if (nDestX * nHorSubsampling >= nOBlockXSize)
break;
nSourceXSecEnd = nSourceX + nOMult;
if (nSourceXSecEnd > (nBlockXSize / nHorSubsampling))
nSourceXSecEnd = (nBlockXSize / nHorSubsampling);
nSourceYSecEnd = nSourceY + nOMult;
if (nSourceYSecEnd > (nBlockYSize / nVerSubsampling))
nSourceYSecEnd = (nBlockYSize / nVerSubsampling);
nCummulator = 0;
for (nSourceYSec = nSourceY; nSourceYSec < nSourceYSecEnd;
nSourceYSec++)
{
for (nSourceXSec = nSourceX;
nSourceXSec < nSourceXSecEnd; nSourceXSec++)
{
nCummulator +=
*(pabySrcTile +
nSourceYSec * nSourceSampleRowSize +
nSourceXSec * nSampleBlockSize +
nSampleOffsetInSampleBlock);
}
}
nCummulatorCount = (nSourceXSecEnd - nSourceX) *
(nSourceYSecEnd - nSourceY);
*(pabyOTile + nDestY * nDestSampleRowSize +
nDestX * nSampleBlockSize + nSampleOffsetInSampleBlock) =
((nCummulator + (nCummulatorCount >> 1)) /
nCummulatorCount);
}
}
}
}
}
/************************************************************************/
/* TIFF_ProcessFullResBlock() */
/* */
/* Process one block of full res data, downsampling into each */
/* of the overviews. */
/************************************************************************/
void TIFF_ProcessFullResBlock(TIFF *hTIFF, int nPlanarConfig, int bSubsampled,
int nHorSubsampling, int nVerSubsampling,
int nOverviews, int *panOvList, int nBitsPerPixel,
int nSamples, TIFFOvrCache **papoRawBIs,
uint32_t nSXOff, uint32_t nSYOff,
unsigned char *pabySrcTile, uint32_t nBlockXSize,
uint32_t nBlockYSize, int nSampleFormat,
const char *pszResampling)
{
int iOverview, iSample;
for (iSample = 0; iSample < nSamples; iSample++)
{
/*
* We have to read a tile/strip for each sample for
* PLANARCONFIG_SEPARATE. Otherwise, we just read all the samples
* at once when handling the first sample.
*/
if (nPlanarConfig == PLANARCONFIG_SEPARATE || iSample == 0)
{
if (TIFFIsTiled(hTIFF))
{
TIFFReadEncodedTile(hTIFF,
TIFFComputeTile(hTIFF, nSXOff, nSYOff, 0,
(tsample_t)iSample),
pabySrcTile, TIFFTileSize(hTIFF));
}
else
{
TIFFReadEncodedStrip(
hTIFF, TIFFComputeStrip(hTIFF, nSYOff, (tsample_t)iSample),
pabySrcTile, TIFFStripSize(hTIFF));
}
}
/*
* Loop over destination overview layers
*/
for (iOverview = 0; iOverview < nOverviews; iOverview++)
{
TIFFOvrCache *poRBI = papoRawBIs[iOverview];
unsigned char *pabyOTile;
uint32_t nTXOff, nTYOff, nOXOff, nOYOff, nOMult;
uint32_t nOBlockXSize = poRBI->nBlockXSize;
uint32_t nOBlockYSize = poRBI->nBlockYSize;
int nSkewBits, nSampleByteOffset;
/*
* Fetch the destination overview tile
*/
nOMult = panOvList[iOverview];
nOXOff = (nSXOff / nOMult) / nOBlockXSize;
nOYOff = (nSYOff / nOMult) / nOBlockYSize;
if (bSubsampled)
{
pabyOTile = TIFFGetOvrBlock_Subsampled(poRBI, nOXOff, nOYOff);
/*
* Establish the offset into this tile at which we should
* start placing data.
*/
nTXOff = (nSXOff - nOXOff * nOMult * nOBlockXSize) / nOMult;
nTYOff = (nSYOff - nOYOff * nOMult * nOBlockYSize) / nOMult;
#ifdef DBMALLOC
malloc_chain_check(1);
#endif
TIFF_DownSample_Subsampled(
pabySrcTile, iSample, nBlockXSize, nBlockYSize, pabyOTile,
poRBI->nBlockXSize, poRBI->nBlockYSize, nTXOff, nTYOff,
nOMult, pszResampling, nHorSubsampling, nVerSubsampling);
#ifdef DBMALLOC
malloc_chain_check(1);
#endif
}
else
{
pabyOTile = TIFFGetOvrBlock(poRBI, nOXOff, nOYOff, iSample);
/*
* Establish the offset into this tile at which we should
* start placing data.
*/
nTXOff = (nSXOff - nOXOff * nOMult * nOBlockXSize) / nOMult;
nTYOff = (nSYOff - nOYOff * nOMult * nOBlockYSize) / nOMult;
/*
* Figure out the skew (extra space between ``our samples'') and
* the byte offset to the first sample.
*/
assert((nBitsPerPixel % 8) == 0);
if (nPlanarConfig == PLANARCONFIG_SEPARATE)
{
nSkewBits = 0;
nSampleByteOffset = 0;
}
else
{
nSkewBits = nBitsPerPixel * (nSamples - 1);
nSampleByteOffset = (nBitsPerPixel / 8) * iSample;
}
/*
* Perform the downsampling.
*/
#ifdef DBMALLOC
malloc_chain_check(1);
#endif
TIFF_DownSample(pabySrcTile + nSampleByteOffset, nBlockXSize,
nBlockYSize, nSkewBits, nBitsPerPixel,
pabyOTile, poRBI->nBlockXSize,
poRBI->nBlockYSize, nTXOff, nTYOff, nOMult,
nSampleFormat, pszResampling);
#ifdef DBMALLOC
malloc_chain_check(1);
#endif
}
}
}
}
/************************************************************************/
/* TIFF_BuildOverviews() */
/* */
/* Build the requested list of overviews. Overviews are */
/* maintained in a bunch of temporary files and then these are */
/* written back to the TIFF file. Only one pass through the */
/* source TIFF file is made for any number of output */
/* overviews. */
/************************************************************************/
void TIFFBuildOverviews(TIFF *hTIFF, int nOverviews, int *panOvList,
int bUseSubIFDs, const char *pszResampleMethod,
int (*pfnProgress)(double, void *), void *pProgressData)
{
TIFFOvrCache **papoRawBIs;
uint32_t nXSize, nYSize, nBlockXSize, nBlockYSize;
uint16_t nBitsPerPixel, nPhotometric, nCompressFlag, nSamples,
nPlanarConfig, nSampleFormat;
int bSubsampled;
uint16_t nHorSubsampling, nVerSubsampling;
int bTiled, nSXOff, nSYOff, i;
unsigned char *pabySrcTile;
uint16_t *panRedMap, *panGreenMap, *panBlueMap;
TIFFErrorHandler pfnWarning;
(void)pfnProgress;
(void)pProgressData;
/* -------------------------------------------------------------------- */
/* Get the base raster size. */
/* -------------------------------------------------------------------- */
TIFFGetField(hTIFF, TIFFTAG_IMAGEWIDTH, &nXSize);
TIFFGetField(hTIFF, TIFFTAG_IMAGELENGTH, &nYSize);
TIFFGetField(hTIFF, TIFFTAG_BITSPERSAMPLE, &nBitsPerPixel);
/* TODO: nBitsPerPixel seems misnomer and may need renaming to
* nBitsPerSample */
TIFFGetField(hTIFF, TIFFTAG_SAMPLESPERPIXEL, &nSamples);
TIFFGetFieldDefaulted(hTIFF, TIFFTAG_PLANARCONFIG, &nPlanarConfig);
TIFFGetFieldDefaulted(hTIFF, TIFFTAG_PHOTOMETRIC, &nPhotometric);
TIFFGetFieldDefaulted(hTIFF, TIFFTAG_COMPRESSION, &nCompressFlag);
TIFFGetFieldDefaulted(hTIFF, TIFFTAG_SAMPLEFORMAT, &nSampleFormat);
if (nPhotometric == PHOTOMETRIC_YCBCR || nPhotometric == PHOTOMETRIC_ITULAB)
{
if (nBitsPerPixel != 8 || nSamples != 3 ||
nPlanarConfig != PLANARCONFIG_CONTIG ||
nSampleFormat != SAMPLEFORMAT_UINT)
{
/* TODO: use of TIFFError is inconsistent with use of fprintf in
* addtiffo.c, sort out */
TIFFErrorExt(
TIFFClientdata(hTIFF), "TIFFBuildOverviews",
"File `%s' has an unsupported subsampling configuration.\n",
TIFFFileName(hTIFF));
/* If you need support for this particular flavor, please contact
* either Frank Warmerdam warmerdam@pobox.com Joris Van Damme
* info@awaresystems.be
*/
return;
}
bSubsampled = 1;
TIFFGetField(hTIFF, TIFFTAG_YCBCRSUBSAMPLING, &nHorSubsampling,
&nVerSubsampling);
/* TODO: find out if maybe TIFFGetFieldDefaulted is better choice for
* YCbCrSubsampling tag */
}
else
{
if (nBitsPerPixel < 8)
{
/* TODO: use of TIFFError is inconsistent with use of fprintf in
* addtiffo.c, sort out */
TIFFErrorExt(
TIFFClientdata(hTIFF), "TIFFBuildOverviews",
"File `%s' has samples of %d bits per sample. Sample\n"
"sizes of less than 8 bits per sample are not supported.\n",
TIFFFileName(hTIFF), nBitsPerPixel);
return;
}
bSubsampled = 0;
nHorSubsampling = 1;
nVerSubsampling = 1;
}
/* -------------------------------------------------------------------- */
/* Turn off warnings to avoid a lot of repeated warnings while */
/* rereading directories. */
/* -------------------------------------------------------------------- */
pfnWarning = TIFFSetWarningHandler(NULL);
/* -------------------------------------------------------------------- */
/* Get the base raster block size. */
/* -------------------------------------------------------------------- */
if (TIFFGetField(hTIFF, TIFFTAG_ROWSPERSTRIP, &(nBlockYSize)))
{
nBlockXSize = nXSize;
bTiled = FALSE;
}
else
{
TIFFGetField(hTIFF, TIFFTAG_TILEWIDTH, &nBlockXSize);
TIFFGetField(hTIFF, TIFFTAG_TILELENGTH, &nBlockYSize);
bTiled = TRUE;
}
/* -------------------------------------------------------------------- */
/* Capture the palette if there is one. */
/* -------------------------------------------------------------------- */
if (TIFFGetField(hTIFF, TIFFTAG_COLORMAP, &panRedMap, &panGreenMap,
&panBlueMap))
{
uint16_t *panRed2, *panGreen2, *panBlue2;
int nColorCount = 1 << nBitsPerPixel;
panRed2 = (uint16_t *)_TIFFmalloc(2 * nColorCount);
panGreen2 = (uint16_t *)_TIFFmalloc(2 * nColorCount);
panBlue2 = (uint16_t *)_TIFFmalloc(2 * nColorCount);
memcpy(panRed2, panRedMap, 2 * nColorCount);
memcpy(panGreen2, panGreenMap, 2 * nColorCount);
memcpy(panBlue2, panBlueMap, 2 * nColorCount);
panRedMap = panRed2;
panGreenMap = panGreen2;
panBlueMap = panBlue2;
}
else
{
panRedMap = panGreenMap = panBlueMap = NULL;
}
/* -------------------------------------------------------------------- */
/* Initialize overviews. */
/* -------------------------------------------------------------------- */
papoRawBIs = (TIFFOvrCache **)_TIFFmalloc(nOverviews * sizeof(void *));
for (i = 0; i < nOverviews; i++)
{
uint32_t nOXSize, nOYSize, nOBlockXSize, nOBlockYSize;
toff_t nDirOffset;
nOXSize = (nXSize + panOvList[i] - 1) / panOvList[i];
nOYSize = (nYSize + panOvList[i] - 1) / panOvList[i];
nOBlockXSize = MIN(nBlockXSize, nOXSize);
nOBlockYSize = MIN(nBlockYSize, nOYSize);
if (bTiled)
{
if ((nOBlockXSize % 16) != 0)
nOBlockXSize = nOBlockXSize + 16 - (nOBlockXSize % 16);
if ((nOBlockYSize % 16) != 0)
nOBlockYSize = nOBlockYSize + 16 - (nOBlockYSize % 16);
}
nDirOffset = TIFF_WriteOverview(
hTIFF, nOXSize, nOYSize, nBitsPerPixel, nPlanarConfig, nSamples,
nOBlockXSize, nOBlockYSize, bTiled, nCompressFlag, nPhotometric,
nSampleFormat, panRedMap, panGreenMap, panBlueMap, bUseSubIFDs,
nHorSubsampling, nVerSubsampling);
papoRawBIs[i] = TIFFCreateOvrCache(hTIFF, nDirOffset);
}
if (panRedMap != NULL)
{
_TIFFfree(panRedMap);
_TIFFfree(panGreenMap);
_TIFFfree(panBlueMap);
}
/* -------------------------------------------------------------------- */
/* Allocate a buffer to hold a source block. */
/* -------------------------------------------------------------------- */
if (bTiled)
pabySrcTile = (unsigned char *)_TIFFmalloc(TIFFTileSize(hTIFF));
else
pabySrcTile = (unsigned char *)_TIFFmalloc(TIFFStripSize(hTIFF));
/* -------------------------------------------------------------------- */
/* Loop over the source raster, applying data to the */
/* destination raster. */
/* -------------------------------------------------------------------- */
for (nSYOff = 0; nSYOff < (int)nYSize; nSYOff += nBlockYSize)
{
for (nSXOff = 0; nSXOff < (int)nXSize; nSXOff += nBlockXSize)
{
/*
* Read and resample into the various overview images.
*/
TIFF_ProcessFullResBlock(
hTIFF, nPlanarConfig, bSubsampled, nHorSubsampling,
nVerSubsampling, nOverviews, panOvList, nBitsPerPixel, nSamples,
papoRawBIs, nSXOff, nSYOff, pabySrcTile, nBlockXSize,
nBlockYSize, nSampleFormat, pszResampleMethod);
}
}
_TIFFfree(pabySrcTile);
/* -------------------------------------------------------------------- */
/* Cleanup the rawblockedimage files. */
/* -------------------------------------------------------------------- */
for (i = 0; i < nOverviews; i++)
{
TIFFDestroyOvrCache(papoRawBIs[i]);
}
if (papoRawBIs != NULL)
_TIFFfree(papoRawBIs);
TIFFSetWarningHandler(pfnWarning);
}
Loaded 100 of 757 files, more files were not shown because too many files have changed in this diff. Show more