Compare commits

...
195 Commits
Author SHA1 Message Date
Even Rouault 5fe20d0e9a Merge branch '4.7.1_preparation' into 'master'
Prepare for 4.7.1 release

See merge request libtiff/libtiff!762
2025-09-12 11:21:38 +00:00
Even Rouault 56dc5d3643 Prepare for 4.7.1 release 2025-09-11 12:57:46 +02:00
Even Rouault cbdd9d2125 Merge branch 'raw2tiff-742' into 'master'
raw2tiff: close input file before exit; issue #742

See merge request libtiff/libtiff!761
2025-09-11 09:45:32 +00:00
Lee Howard b143627531 raw2tiff: close input file before exit; issue #742 2025-09-07 20:59:44 -07:00
Even Rouault 57dd777d7f Merge branch 'doc_add_LZW_BSD_license_to_LICENSE_md_issue_431' into 'master'
Add BSD license for Lempel-Ziv & Welch compression (tif_lzw.c) to LICENSE.md

Closes #431

See merge request libtiff/libtiff!760
2025-09-06 10:27:24 +00:00
Even Rouault dbe6a90580 Merge branch 'formatting_issues' into 'master'
Fix formatting issues

See merge request libtiff/libtiff!759
2025-09-05 22:58:31 +00:00
Even Rouault 8e6f386c49 Fix formatting issues 2025-09-05 23:59:18 +02:00
Even Rouault e159dadb88 Merge branch 'tiff2pdf-741' into 'master'
avoid null pointer dereference, tiff2pdf #741

See merge request libtiff/libtiff!758
2025-09-05 21:46:51 +00:00
Lee Howard e9d46c62f8 tiff2pdf: avoid null pointer dereference
Fixes #741
2025-09-05 21:46:51 +00:00
Even Rouault 09f53a86cf Merge branch 'tiffcrop-740' into 'master'
avoid buffer overflow in tiffcrop #740

See merge request libtiff/libtiff!757
2025-09-05 21:46:03 +00:00
Lee Howard 88cf9dbb48 tiffcrop: avoid buffer overflow
Fixes #740
2025-09-05 21:46:03 +00:00
Even Rouault 0511296c94 Merge branch 'tiffmedian-735' into 'master'
close tiffmedian input file - #735

See merge request libtiff/libtiff!756
2025-09-05 21:45:23 +00:00
Lee Howard a061d98081 tiffmedian: close input file
Fixes #735
2025-09-05 21:45:23 +00:00
Even Rouault 9401a882aa Merge branch 'tiffcrop-734' into 'master'
Tiffcrop 734

See merge request libtiff/libtiff!755
2025-09-05 21:44:50 +00:00
Lee Howard 4d28af5fe6 tiffcrop: avoid nullptr dereference
Fixes #734
2025-09-05 21:44:49 +00:00
Even Rouault 515e4f2bc2 Merge branch 'tiffdither-733' into 'master'
avoid out-of-bounds read identified in #733

See merge request libtiff/libtiff!754
2025-09-05 21:44:06 +00:00
Lee Howard 62f39af062 tiffdither: avoid out-of-bounds read identified in #733 2025-09-05 21:44:06 +00:00
Even Rouault 072957460f Merge branch 'tiffcrop-721' into 'master'
fix double-free and memory leak exposed by issue #721

See merge request libtiff/libtiff!753
2025-09-05 21:42:35 +00:00
Lee Howard 0ac97aa7a5 tiffcrop: fix double-free and memory leak exposed by issue #721 2025-09-05 21:42:35 +00:00
Su_Laus a0b623c780 Add BSD license for Lempel-Ziv & Welch compression (tif_lzw.c) to LICENSE.md
Closes #431
2025-09-04 21:54:05 +02:00
Even Rouault b9907aa479 Merge branch 'fix_54_read_CCITT_FAX_group3_without_EOL' into 'master'
tif_fax3: For fax group 3 data if no EOL is detected, reading is retried without synchronisation for EOLs.

Closes #54

LibTIFF can write (encode) faxes of group 3 1d without EOL, but cannot read (decode) such files. This function has been added.

See merge request libtiff/libtiff!752
2025-09-04 15:17:47 +00:00
Su Laus a566b83b13 tif_fax3: For fax group 3 data if no EOL is detected, reading is retried without synchronisation for EOLs.
Closes #54

LibTIFF can write (encode) faxes of group 3 1d without EOL, but cannot read (decode) such files. This function has been added.
2025-09-04 15:17:46 +00:00
Even Rouault 4eb791fea0 Merge branch 'no-public-fix' into 'master'
tiffio.h: fix compilation with LOGLUV_PUBLIC=0

See merge request libtiff/libtiff!748
2025-09-04 15:03:45 +00:00
Even Rouault 85f2ac8e0b Merge branch 'doc_returnvalue_mapproc_issue_#12' into 'master'
doc: update TIFFOpen.rst with the return values of mapproc and unmapproc.

Closes #12

See merge request libtiff/libtiff!749
2025-08-19 19:08:45 +00:00
Even Rouault 6dcd2c25ee Merge branch 'tiffcp_preset_level' into 'master'
tiffcp: fix setting compression level for lossless codecs

Closes #730

See merge request libtiff/libtiff!750
2025-08-19 19:08:17 +00:00
Jan Musinsky c2b7837a8c tiffcp: fix setting compression level for lossless codecs
Closes #730
2025-08-19 19:08:17 +00:00
Su_Laus f5c18577de doc: update TIFFOpen.rst with the return values of mapproc and unmapproc.
Closes #12
2025-08-17 21:53:33 +02:00
Tim Blechmann c7ea716f16 tiffio.h: fix compilation with LOGLUV_PUBLIC=0
LOGLUV_PUBLIC can be used to compile some functions with hidden
visibility.
However this functionality was broken (in clang), as LOGLUV_PUBLIC was
defined to 1 if it wasn't defined, as the extern declarations were still
visible by the compiler leading to "static declaration follows
non-static declaration" errors.
Changing the header from #ifdef to #if fixes the issue.
2025-08-12 16:59:50 +08:00
Even Rouault 0ce7d7766c Merge branch 'fix_728_729_tiffcmp_memory_leak' into 'master'
tiffcmp: fix memory leak when second file cannot be opened. fix #728, #729

Closes #728 and #729

See merge request libtiff/libtiff!747
2025-08-11 09:39:50 +00:00
Su_Laus ed141286a3 tiffcmp: fix memory leak when second file cannot be opened.
Closes #728, #729
2025-08-08 21:35:30 +02:00
Even Rouault bac73dc5ca Merge branch 'fix-issue-720' into 'master'
add assert for TIFFReadCustomDirectory infoarray check

See merge request libtiff/libtiff!744
2025-08-08 19:32:13 +00:00
Even Rouault b4da2ac82f Merge branch 'fix_718_tiff2ps_defer_strile_load' into 'master'
tiff2ps: check return of TIFFGetFiled()  to fix #718

Closes #718

See merge request libtiff/libtiff!746
2025-08-08 19:31:44 +00:00
Su_Laus 6ba36f159f tiff2ps: check return of TIFFGetFiled() for TIFFTAG_STRIPBYTECOUNTS and TIFFTAG_TILEBYTECOUNTS to avoid NULL pointer dereference.
Closes #718
2025-08-02 18:55:54 +02:00
lxy 67c1cab666 add assert for TIFFReadCustomDirectory infoarray check 2025-07-29 19:46:05 +08:00
Even Rouault e92f761ea4 Merge branch 'tif_jpeg_12_bit_bug_JPEGDecodeRaw_fix_717' into 'master'
tif_jpeg: Fix bug in JPEGDecodeRaw() if JPEG_LIB_MK1_OR_12BIT is defined.

Closes #717

See merge request libtiff/libtiff!743
2025-07-11 16:10:13 +00:00
Su_Laus e34eaa8eff tif_jpeg: Fix bug in JPEGDecodeRaw() if JPEG_LIB_MK1_OR_12BIT is defined for 8/12bit dual mode, introduced in libjpeg-turbo 2.2, which was actually released as 3.0.
Closes #717
2025-07-11 17:01:08 +02:00
Even Rouault d2dc308fdc Merge branch 'tiffdump_coverity_fix' into 'master'
tiffdump: Fix coverity scan issue CID 1373365 tainted divisor.

See merge request libtiff/libtiff!742
2025-07-10 19:05:58 +00:00
Su_Laus 6086925a5b tiffdump: Fix coverity scan issue CID 1373365: Passing tainted expression *datamem to PrintData, which uses it as a divisor or modulus. 2025-07-06 17:43:55 +02:00
Even Rouault c5cccfb4f6 Merge branch 'tiffcrop_coverity_scan_update' into 'master'
tiffcrop: Fix coverity scan issue CID 1655232

See merge request libtiff/libtiff!741
2025-07-04 22:06:49 +00:00
Su_Laus 5e11d05c18 tiffcrop: Fix coverity scan issue CID 1655232: Uninitialized variables (UNINIT) Using uninitialized value "crop.selections". 2025-07-02 20:41:22 +02:00
Even Rouault 4011893a4e Merge branch 'fix_716_tiffcrop_memory_leak_on_error_exit' into 'master'
tiffcrop: close files and release memory on error exit, fix #716

Closes #716

See merge request libtiff/libtiff!740
2025-07-02 06:42:29 +00:00
Su_Laus e1d3346169 Close open TIFF files and release allocated buffers in tiffcrop before exiting in case of error to avoid memory leaks. 2025-06-27 23:16:05 +02:00
Even Rouault 02c6feb42b Merge branch 'fix_714' into 'master'
JPEGEncodeRaw(): error out if a previous scanline failed to be written, to...

Closes #714

See merge request libtiff/libtiff!739
2025-06-26 10:36:11 +00:00
Even Rouault 4d8c7527d3 JPEGEncodeRaw(): error out if a previous scanline failed to be written, to avoid out-of-bounds access
Fixes #714
2025-06-25 19:32:45 +02:00
Even Rouault 8635958dc7 Merge branch 'improve_TIFFReadRGBAImage' into 'master'
Improve TIFFReadRGBAImage and avoid buffer overflows.

See merge request libtiff/libtiff!738
2025-06-25 17:15:21 +00:00
Su Laus 6816940248 Improve TIFFReadRGBAImage and avoid buffer overflows.
* Raster width can now be larger than image width.
* Only image data are copied to raster buffer if tiles are padded.
* Avoid buffer overflow if col_offset \> 0.
* If row_offset \> 0 do not try to read after last row - avoiding warnings.
* Feature "col_offset" and "row_offset" now works as expected.
2025-06-25 17:15:21 +00:00
Even Rouault e54aa4b57f Merge branch 'thumbnail-715' into 'master'
Fix for thumbnail issue #715

See merge request libtiff/libtiff!737
2025-06-25 17:14:18 +00:00
Lee Howard e8de4dc1f9 Fix for thumbnail issue #715 2025-06-25 17:14:18 +00:00
Even Rouault 803d8dbec5 Merge branch 'issue-711' into 'master'
Fix for issue #711

See merge request libtiff/libtiff!735
2025-06-25 17:04:13 +00:00
Lee Howard 118805c02f TIFFUnlinkDirectory() and TIFFWriteDirectorySec(): clear tif_rawcp when clearing tif_rawdata
Fix for issue #711
2025-06-25 17:04:13 +00:00
Even Rouault a7590ca213 Merge branch 'tiff_itrunc_rand' into 'master'
tiff_itrunc(): don't use rand() to please Coverity Scan

See merge request libtiff/libtiff!733
2025-06-25 17:01:03 +00:00
Even Rouault 292a2490b2 tiff_itrunc(): don't use rand() to please Coverity Scan 2025-06-12 15:02:55 +02:00
Even Rouault 0f5b81947b Merge branch 'tiff-static' into 'master'
Add build option tiff-static, fixes #709

Closes #709

See merge request libtiff/libtiff!731
2025-06-12 09:51:08 +00:00
Demetrius flavious e47dce81cd CMake: Add build option tiff-static, fixes #709 2025-06-12 09:51:08 +00:00
Even Rouault d1c0719e00 Merge branch 'fix_704_TIFFReadRGBAImage_crash' into 'master'
tif_getimage.c: Fix buffer underflow crash for less raster rows at TIFFReadRGBAImageOriented()

Closes #704

See merge request libtiff/libtiff!732
2025-06-11 19:45:19 +00:00
Su Laus 3e0dcf0ec6 tif_getimage.c: Fix buffer underflow crash for less raster rows at TIFFReadRGBAImageOriented() 2025-06-11 19:45:19 +00:00
Even Rouault 14da830be4 Merge branch 'coverity_fixes' into 'master'
tif_zip.c: changes to please Coverity Scan

See merge request libtiff/libtiff!730
2025-06-06 14:23:33 +00:00
Even Rouault ecbe2cf216 tif_zip.c: changes to please Coverity Scan 2025-06-06 14:23:33 +00:00
Even Rouault 8aac9d95af Merge branch 'mkg3states' into 'master'
Move mkg3states under libtiff/tools, fixes #708

Closes #708

See merge request libtiff/libtiff!728
2025-06-03 17:49:14 +00:00
Even Rouault e75f78c141 Merge branch 'fix_MSVC_warnings_in_some_tools' into 'master'
Fixing MSVC compiler warnings in some tools.

See merge request libtiff/libtiff!729
2025-06-03 17:47:49 +00:00
Su Laus 67fd283d27 Fixing MSVC compiler warnings in some tools. 2025-06-03 17:47:49 +00:00
Lior Lahav 0a3bfa04a9 Move mkg3states under libtiff/tools, fixes #708 2025-05-27 14:22:17 +03:00
Even Rouault 7d65dfe021 Merge branch 'cmake3.10' into 'master'
Fixed: CMake 4.0 warning when minimum required version is < 3.10

See merge request libtiff/libtiff!726
2025-05-25 19:59:34 +00:00
Even Rouault 2fe99e10f1 Merge branch 'fix_MSVC_warnings_in_some_test_progs' into 'master'
Fixing MSVC compiler warnings in some test programs.

See merge request libtiff/libtiff!725
2025-05-25 19:59:15 +00:00
Su Laus a4310ab85e Fixing MSVC compiler warnings in some test programs. 2025-05-25 19:59:15 +00:00
Even Rouault 25880744f3 Merge branch 'predict_speedup' into 'master'
tif_predict.c: speed-up decompression in some cases

See merge request libtiff/libtiff!724
2025-05-25 19:58:37 +00:00
Even Rouault fe10872e53 Merge branch 'tiffmedian-707' into 'master'
Tiffmedian 707

See merge request libtiff/libtiff!727
2025-05-25 11:57:28 +00:00
Lee Howard ecc4ddbf1f conflict resolution 2025-05-24 21:38:09 -07:00
Lee Howard ce46f002ec Fix tiffmedian bug #707 2025-05-24 21:25:16 -07:00
Lior Lahav ff5997ea12 Fixed: CMake 4.0 warning when minimum required version is < 3.10 2025-05-24 23:29:48 +03:00
Even Rouault 89eecc280f tif_predict.c: speed-up decompression in some cases
- Predictor=2 on Byte datatype with some loop unrolling
- Predictor=3 on Float32 datatype with some loop unrolling and SSE2 in the interleaving phae

Tested on:
- https://rockyweb.usgs.gov/vdelivery/Datasets/Staged/Elevation/1m/Projects/WA_FEMAHQ_2018_D18/TIFF/USGS_1M_10_x56y512_WA_FEMAHQ_2018_D18.tif
  USGS_1M_10_x56y512_WA_FEMAHQ_2018_D18.tif: 10012x10012, single band, Float32, LZW-compressed, Predictor=3, 316 MiB

- and hillshade_predict.tif: 10012x10012, single band, Byte, ZSTD-compressed, Predictor=2, 63 MiB
  (result of gdaldem hillshade USGS_1M_10_x56y512_WA_FEMAHQ_2018_D18.tif hillshade_predict.tif -co COMPRESS=ZSTD -co PREDICTOR=2)

master:
```
$ hyperfine --warmup 2 -- "gdal raster convert hillshade_predict.tif foo --of mem -q"
Benchmark #1: gdal raster convert hillshade_predict.tif foo --of mem -q
  Time (mean ± σ):     512.1 ms ±   2.0 ms    [User: 413.1 ms, System: 98.3 ms]
  Range (min … max):   509.6 ms … 516.4 ms

$ hyperfine --warmup 2 --  "gdal raster convert USGS_1M_10_x56y512_WA_FEMAHQ_2018_D18.tif foo --of mem"
Benchmark #1: gdal raster convert USGS_1M_10_x56y512_WA_FEMAHQ_2018_D18.tif foo --of mem
  Time (mean ± σ):      2.126 s ±  0.027 s    [User: 1.844 s, System: 0.280 s]
  Range (min … max):    2.098 s …  2.194 s
```

this PR:
```
$ hyperfine --warmup 2 -- "gdal raster convert hillshade_predict.tif foo --of mem"
Benchmark #1: gdal raster convert hillshade_predict.tif foo --of mem
  Time (mean ± σ):     384.3 ms ±   1.9 ms    [User: 285.1 ms, System: 98.3 ms]
  Range (min … max):   381.6 ms … 387.4 ms

$ hyperfine --warmup 2 --  "gdal raster convert USGS_1M_10_x56y512_WA_FEMAHQ_2018_D18.tif foo --of mem"
Benchmark #1: gdal raster convert USGS_1M_10_x56y512_WA_FEMAHQ_2018_D18.tif foo --of mem
  Time (mean ± σ):      1.489 s ±  0.004 s    [User: 1.201 s, System: 0.286 s]
  Range (min … max):    1.484 s …  1.498 s
```
2025-05-23 13:19:34 +02:00
Even Rouault 0b80e677a2 Merge branch 'tiffdither-703' into 'master'
Don't skip the first line of the input image.  Addresses issue #703

Closes #703

See merge request libtiff/libtiff!723
2025-05-22 10:14:35 +00:00
Lee Howard 78397815cd tiffdither/tiffmedian: Don't skip the first line of the input image. Addresses issue #703 2025-05-22 10:14:35 +00:00
Even Rouault babfe37160 Merge branch 'fix_682_tiff2rgba_size_t_overflow' into 'master'
tiff2rgba: fix #682 buffer overflow

Closes #682

See merge request libtiff/libtiff!722
2025-05-22 10:13:28 +00:00
Even Rouault c312774121 Merge branch 'fix_MSVC_warnings_in_addtiffo' into 'master'
Fixing MSVC compiler warnings in addtiffo.

See merge request libtiff/libtiff!717
2025-05-22 10:12:32 +00:00
Su Laus a16c51a28e Fixing MSVC compiler warnings in addtiffo. 2025-05-22 10:12:32 +00:00
Lee Howard 3994cf3b3b Don't skip the first line of the input image. Addresses issue #703 2025-05-19 10:53:30 -07:00
Su_Laus 1d594d5fc1 tiff2rgba: fix some "a partial expression can generate an overflow before it is assigned to a broader type" warnings.
Closes #682
2025-05-17 20:41:54 +02:00
Even Rouault b4c5eb7e17 Merge branch 'master' into 'master'
oss-fuzz: fix memory leak in fuzz target

See merge request libtiff/libtiff!721
2025-05-11 12:00:24 +00:00
Yuntong Zhang 9daf3da323 oss-fuzz: fix memory leak in fuzz target
Fixes: https://issues.oss-fuzz.com/issues/385176300
2025-05-11 19:29:47 +08:00
Even Rouault 2bf2848cf5 Merge branch 'spelling' into 'master'
Spelling fixes.

See merge request libtiff/libtiff!720
2025-05-02 18:00:04 +00:00
Kurt Schwehr 01089de169 Spelling fixes.
Most found with codespell version 2.4.1.
2025-05-02 17:36:53 +00:00
Even Rouault ffad0bc578 Merge branch 'configure-ac-syntax-ac-2-71' into 'master'
configure.ac: Syntax updates for Autoconf 2.71

See merge request libtiff/libtiff!719
2025-04-30 21:36:51 +00:00
Bob Friesenhahn 56f641129c Merge branch 'defines' into 'master'
Move several defines into tif_config.h

See merge request libtiff/libtiff!664
2025-04-29 21:51:44 +00:00
Bob Friesenhahn bf73d790f7 Merge branch '672-simplify-and-soften-autogen-sh' into 'master'
Resolve "Build fails when https://git.savannah.gnu.org/ is down"

Closes #672

See merge request libtiff/libtiff!718
2025-04-29 21:32:48 +00:00
Bob Friesenhahn 503219da43 autogen.sh: Enable verbose wget 2025-04-29 14:06:13 -05:00
Bob Friesenhahn 82b8411c8c configure.ac: Syntax updates for Autoconf 2.71 2025-04-29 13:49:21 -05:00
Bob Friesenhahn a5a163f06a autogen.sh: Re-implement based on autoreconf. Failure to update config.guess/config.sub does not return error. 2025-04-29 10:31:38 -05:00
Even Rouault fa06f02aab Merge branch 'fix_698' into 'master'
LZWDecode(): avoid nullptr dereference when trying to read again after...

Closes #698

See merge request libtiff/libtiff!716
2025-04-19 19:49:37 +00:00
Even Rouault 0fcd2a642b Merge branch 'fix-684' into 'master'
Fix for buffer underflow

Closes #684

See merge request libtiff/libtiff!713
2025-04-18 12:33:51 +00:00
Timothy Lyanguzov dd3def4006 Fix for buffer underflow 2025-04-18 12:33:50 +00:00
Even Rouault 0272e97d06 LZWDecode(): avoid nullptr dereference when trying to read again after end-of-information marker has been found with remaining output bytes (fixes #698) 2025-04-18 14:30:59 +02:00
Even Rouault 0d6509eb70 Merge branch 'correct_not_HAVE_IEEEFP_issue_699' into 'master'
Correct passing arguments to TIFFCvtIEEEFloatToNative().. if HAVE_IEEEFP is not defined.

See merge request libtiff/libtiff!715
2025-04-18 12:09:32 +00:00
Su_Laus d71308116f Correct passing arguments to TIFFCvtIEEEFloatToNative() and TIFFCvtIEEEDoubleToNative() if HAVE_IEEEFP is not defined.
See #699
2025-04-17 21:07:43 +02:00
Even Rouault 3a081531ba Merge branch 'integer_overflow_gtTileContig_issue_79' into 'master'
Update some integer overflow checks in tif_getimage.c

Closes #79

See merge request libtiff/libtiff!711
2025-04-16 20:13:19 +00:00
Su_Laus 639a014af9 Update some integer overflow checks in tif_getimage.c
Closes #79
2025-04-14 20:56:31 +02:00
Even Rouault 88895cd02b Merge branch 'fix_issue_5_write_buffer_overwriting_compression_with_prediction' into 'master'
tif_predict.c: Don’t overwrite input buffer of TIFFWriteScanline() if prediction.

Closes #5

See merge request libtiff/libtiff!712
2025-04-14 08:04:52 +00:00
Su_Laus d5711831e5 tif_predict.c: Don’t overwrite input buffer of TIFFWriteScanline() if "prediction" is enabled. Use extra working buffer in PredictorEncodeRow().
Closes #5
2025-04-13 19:01:00 +02:00
Even Rouault ec20ee993a Merge branch 'doc_remove_dead_awaresystems_link' into 'master'
doc: Remove dead links to no more existing Awaresystems web-site.

See merge request libtiff/libtiff!705
2025-04-10 22:30:39 +00:00
Even Rouault 13d41b167f Merge branch 'notes_for_allocating_TIFFYCbCrToRGB_structure_issue_681' into 'master'
doc: Added hints for correct allocation of TIFFYCbCrtoRGB structure and its associated buffers.

Closes #681

See merge request libtiff/libtiff!709
2025-04-10 22:28:45 +00:00
Even Rouault 9315cc3397 Merge branch 'doc_add_multi_page_reference_issue_43' into 'master'
doc: Added chapter to "Using the TIFF Library" for multi page

Closes #43

See merge request libtiff/libtiff!710
2025-04-10 22:26:13 +00:00
Su_Laus 142f912a69 doc: Added chapter to "Using the TIFF Library" with links to handling multi-page TIFF and custom directories.
Closes #43
2025-04-10 21:47:44 +02:00
Su_Laus fe5a2810de doc: Added hints for correct allocation of TIFFYCbCrtoRGB structure and its associated buffers.
Closes #681
2025-04-09 20:52:27 +02:00
Su_Laus ea0dc4a8f2 Replace some last links and remove last todos. 2025-04-03 18:43:35 +02:00
Even Rouault 03b66fd95f Merge branch 'CheckReachedCounters_static' into 'master'
tif_fax3.c: add missing static qualifier in front of CheckReachedCounters() (master only)

See merge request libtiff/libtiff!708
2025-04-02 11:08:58 +00:00
Even Rouault 698115e819 tif_fax3.c: add missing static qualifier in front of CheckReachedCounters() (master only) 2025-04-02 13:08:32 +02:00
Su_Laus 6fd6986c09 References to codec libraries updated and missing codec compile defines (tiffconf.h) added. 2025-04-01 21:48:45 +02:00
Even Rouault 33433b0090 Merge branch 'fix-676' into 'master'
Fix memory leak in _TIFFSetDefaultCompressionState

Closes #676

See merge request libtiff/libtiff!707
2025-04-01 13:28:48 +00:00
Timothy Lyanguzov 25f53b9933 Fix memory leak in _TIFFSetDefaultCompressionState
`_TIFFSetDefaultCompressionState` does not clean up before setting default state

follow up for !563
fixes #676

Signed-off-by: Timothy Lyanguzov <timothy.lyanguzov@sap.com>
2025-04-02 00:24:05 +13:00
Even Rouault 3016bce2c3 Merge branch 'tiffcp_integer_overflow_check_issue_546' into 'master'
tiffcp: Improve non-secure integer overflow check. Closes #546

Closes #546

See merge request libtiff/libtiff!698
2025-03-31 20:34:52 +00:00
Su_Laus 05c9a45472 Improve non-secure integer overflow check (comparison of division result with multiplicant) at compiler optimisation in tiffcp, rgb2ycbcr and tiff2rgba.
Closes #546
2025-03-31 21:27:06 +02:00
Even Rouault 4e1b837946 Merge branch 'zlib_solo' into 'master'
zip: Provide zlib allocation functions.

See merge request libtiff/libtiff!706
2025-03-28 09:50:23 +00:00
Even Rouault e9cb627e29 Merge branch 'fix_670_tif_fax3_EOL_error_count_reached' into 'master'
tif_fax3.c: error out after a number of times end-of-line or unexpected code words

Closes #670

See merge request libtiff/libtiff!703
2025-03-28 09:48:49 +00:00
Even Rouault 8bd0d494b8 Merge branch 'fix-test-tiffcrop-tiffcp-32bpp-None-jpeg-race' into 'master'
test: Fix race condition in {tiffcrop,tiffcp}-32bpp-None-jpeg.sh tests

See merge request libtiff/libtiff!701
2025-03-28 09:47:26 +00:00
Even Rouault c082666e17 Merge branch 'doc_update_TIFFSetWriteOffset' into 'master'
doc: Clarify TIFFSetWriteOffset() only sets offset for image data and not for IFD data.

See merge request libtiff/libtiff!699
2025-03-28 09:46:48 +00:00
Even Rouault bcf7eac34d Merge branch 'coverity_fixes_in_tools' into 'master'
Silence some Coverity Scan warnigs and mark already dismissed ones.

See merge request libtiff/libtiff!696
2025-03-28 09:42:21 +00:00
Nikolay Sivov e5be40ee28 zip: Provide zlib allocation functions.
Otherwise for zlib built with -DZ_SOLO inflating will fail.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2025-03-25 14:03:27 +01:00
Su_Laus aad5b70b37 Updating BigTIFF specification and some miscelaneous editions. 2025-03-23 21:26:33 +01:00
Su_Laus f308b319be doc: Remove dead links to no more existing Awaresystems web-site. 2025-03-20 17:34:07 +01:00
Roger Leigh 8164e15eec Merge branch 'bugfix/issue_674-export_tiffxx_cmake_target' into 'master'
Export tiffxx cmake target (issue #674)

See merge request libtiff/libtiff!704
2025-03-19 07:12:41 +00:00
Daniel Moreno 4622d2f5a3 Export tiffxx cmake target (issue #674) 2025-03-18 18:10:45 -04:00
Su_Laus 6c8b10ca3f tif_fax3.c: error out after a number of times end-of-line or unexpected bad code words have been reached.
Closes #670
2025-03-04 17:59:18 +01:00
Bob Friesenhahn 1d277003a0 Merge branch 'fix_665_memory_leak' into 'master'
Fix memory leak of issue # 665 (td_stripbytecount_p and td_stripoffset_p in TIFFSetupStrips())

Closes #665

See merge request libtiff/libtiff!697
2025-03-03 22:35:17 +00:00
Su Laus df2764ca3f Fix memory leak of issue # 665 (td_stripbytecount_p and td_stripoffset_p in TIFFSetupStrips()) 2025-03-03 22:35:16 +00:00
Gabi Falk efadbbd874 test: Fix race condition in {tiffcrop,tiffcp}-32bpp-None-jpeg.sh tests
These tests used the same output path, which could cause failures
when run in parallel.  These were the only tests with a conflicting
outfile= parameter.

Link: https://bugs.gentoo.org/943020
2025-02-26 15:00:00 +00:00
Bob Friesenhahn 38efe34ede Merge branch 'doc_re_entrancy_and_thread_safety_see_667' into 'master'
doc: Update documentation on re-entrancy and thread safety.

Closes #667

See merge request libtiff/libtiff!700
2025-02-25 22:13:34 +00:00
Su Laus 2d9071e849 doc: Update documentation on re-entrancy and thread safety. 2025-02-25 22:13:34 +00:00
Su_Laus 1625c3114b doc/functions/TIFFWriteDirectory.rst: Clarify TIFFSetWriteOffset() only sets offset for image data and not for IFD data. 2025-02-23 19:25:34 +01:00
Su_Laus 14b2d89909 Silence some Coverity Scan warnigs and mark already dismissed ones.
Guard all code related to CHUNKY_STRIP_READ_SUPPORT.
2025-02-16 21:57:15 +01:00
Even Rouault 4333ed5dd5 Merge branch 'doc_remove_deprecated_type_definitions' into 'master'
doc: Update the documentation to reflect deprecated typedefs

See merge request libtiff/libtiff!694
2025-02-11 11:56:33 +00:00
Su Laus 250bd8afce doc: Update the documentation to reflect deprecated typedefs 2025-02-11 11:56:33 +00:00
Su_Laus 0c732d9c0a Silence some Coverity Scan warnigs and mark already dismissed ones. 2025-02-09 20:18:53 +01:00
Su Laus fcd4c86c49 Merge branch 'patch-1' into 'master'
Doc: Fix return type of TIFFReadEncodedTile()

See merge request libtiff/libtiff!693
2025-01-30 19:46:29 +00:00
Mark Riehm f3a6521f45 Doc: Fix return type of TIFFReadEncodedTile() 2025-01-25 18:20:18 +00:00
Even Rouault e00ac465d1 Merge branch 'coverity_1638738' into 'master'
TIFFSetSubDirectory(): check _TIFFCheckDirNumberAndOffset() return

See merge request libtiff/libtiff!692
2025-01-14 22:04:21 +00:00
Even Rouault 0d70d63634 TIFFSetSubDirectory(): check _TIFFCheckDirNumberAndOffset() return
Fix Coverity Scan:
```
    CID 1638738:  Error handling issues  (CHECKED_RETURN)
    Calling "_TIFFCheckDirNumberAndOffset" without checking return value (as is done elsewhere 4 out of 5 times).
```
2025-01-12 19:30:47 +01:00
Even Rouault 4ac1b20576 Merge branch 'remove_get_field_type_from_structure' into 'master'
Remove get_field_type form TIFFField structure because it is not used anymore

See merge request libtiff/libtiff!691
2025-01-12 16:01:40 +00:00
Su_Laus 042d50e1b3 Remove get_field_type form TIFFField structure because it is not used anymore and rename other parameter to set_get_field_type. 2025-01-09 17:21:35 +01:00
Even Rouault 673347a742 Merge branch 'doc_update_adding_new_tags_fix_642' into 'master'
doc: Update "Defining New TIFF Tags" description. See also #642.

Closes #642

See merge request libtiff/libtiff!655
2025-01-06 18:40:25 +00:00
Su Laus fc963427c3 doc: Update "Defining New TIFF Tags" description. See also #642. 2025-01-06 18:40:24 +00:00
Even Rouault c4fc25bdcc Merge branch 'fax_encode_sample_per_pixel_warning' into 'master'
tif_fax3.c: Error out for CCITT fax encoding if SamplesPerPixel is not equal 1 and PlanarConfiguration = Contiguous

Closes #26

See merge request libtiff/libtiff!687
2025-01-01 20:37:55 +00:00
Su Laus 7eace5c973 tif_fax3.c: Error out for CCITT fax encoding if SamplesPerPixel is not equal 1 and PlanarConfiguration = Contiguous 2025-01-01 20:37:55 +00:00
Even Rouault f515f425e1 Merge branch 'fix_663' into 'master'
_TIFFVSetField(): fix potential use of unallocated memory (out-of-bounds read...

Closes #663

See merge request libtiff/libtiff!689
2024-12-31 11:33:01 +00:00
Even Rouault f6f1391bab _TIFFVSetField(): fix potential use of unallocated memory (out-of-bounds read / nullptr dereference) in case of out-of-memory situation when dealing with custom tags
Fixes #663
2024-12-30 15:21:51 +01:00
Even Rouault 2c467d30af Merge branch 'master' into 'master'
Improved oss-fuzz fuzzer tiff_read_rgba_fuzzer.cc

See merge request libtiff/libtiff!688
2024-12-30 13:47:47 +00:00
Fabio Gritti 0aea4676e8 Improved oss-fuzz fuzzer tiff_read_rgba_fuzzer.cc 2024-12-30 13:47:47 +00:00
Even Rouault e6bc557f1d Merge branch 'LINKER_LANGUAGE' into 'master'
Set LINKER_LANGUAGE for C targets with C++ deps

See merge request libtiff/libtiff!685
2024-12-30 13:37:16 +00:00
Even Rouault 9e8897b5ed Merge branch 'merge_multiple_functions_implemented_twice_#154' into 'master'
Merge several functions implemented twice in different modules, see #154

Closes #154

See merge request libtiff/libtiff!681
2024-12-30 13:36:53 +00:00
Su Laus 81375b4afe Merge several functions implemented twice in different modules, see #154 2024-12-30 13:36:53 +00:00
Alyssa Ross e6f3d60187 Set LINKER_LANGUAGE for C targets with C++ deps
When C and C++ code are being linked together, a C++ compiler has to
be used.  In my experience, this doesn't always cause problems, but it
tends to when doing static builds.

Without this change, I got build failures when I had lerc enabled:

cd /build/source/build/tools && /nix/store/6941y72hx1k8rxiygm4iin16i4zhcdqr-cmake-3.30.5/bin/cmake -E cmake_link_script CMakeFiles/fax2ps.dir/link.txt --verbose=1
/nix/store/gb7zjcg4fh1mnd5qp4pkrlib55w6j42l-aarch64-unknown-linux-musl-gcc-wrapper-13.3.0/bin/aarch64-unknown-linux-musl-gcc  -Wall -Winline -Wformat-security -Wpointer-arith -Wdisabled-optimization -Wno-unknown-pragmas -fstrict-aliasing -O3 -DNDEBUG CMakeFiles/fax2ps.dir/fax2ps.c.o -o fax2ps  ../libtiff/libtiff.a -Wl,-Bdynamic /nix/store/n49vspyhaga9pabpqqcwm9rlam7r4152-zlib-static-aarch64-unknown-linux-musl-1.3.1/lib/libz.a /nix/store/k71jx85iin8bvgqs1viq263qp186nb9h-libdeflate-static-aarch64-unknown-linux-musl-1.22/lib/libdeflate.a /nix/store/kp6hkjfjdmd94crz6claldi5hg9z8r87-libjpeg-turbo-static-aarch64-unknown-linux-musl-3.0.4/lib/libjpeg.a /nix/store/h2f1h8bri9d0mvdrvn5ad94hy31dan2s-lerc-static-aarch64-unknown-linux-musl-4.0.0/lib/libLerc.a /nix/store/hjf3h5prgfdadv3wsj4172sdxrnycgba-xz-static-aarch64-unknown-linux-musl-5.6.3/lib/liblzma.a /nix/store/qh8h4fdsvhj75xliiqb71qrynnng51p2-zstd-static-aarch64-unknown-linux-musl-1.5.6/lib/libzstd.a /nix/store/002ykljzr16pfxnijq7x8hr4nbicg745-libwebp-static-aarch64-unknown-linux-musl-1.4.0/lib/libwebp.a /nix/store/002ykljzr16pfxnijq7x8hr4nbicg745-libwebp-static-aarch64-unknown-linux-musl-1.4.0/lib/libsharpyuv.a /nix/store/dnm541qbzfanx6r0kqbc2p4xfjiwl4sf-musl-static-aarch64-unknown-linux-musl-1.2.5/lib/libm.a -Wl,-Bstatic
/nix/store/ncvpwrpay6vvh9wwc6fq28lb9hip7chc-aarch64-unknown-linux-musl-binutils-2.43.1/bin/aarch64-unknown-linux-musl-ld: /nix/store/h2f1h8bri9d0mvdrvn5ad94hy31dan2s-lerc-static-aarch64-unknown-linux-musl-4.0.0/lib/libLerc.a(Lerc.cpp.o): in function `std::vector<unsigned char, std::allocator<unsigned char> >::operator=(std::vector<unsigned char, std::allocator<unsigned char> > const&) [clone .isra.0]':
(.text+0x140): undefined reference to `operator new(unsigned long)'
/nix/store/ncvpwrpay6vvh9wwc6fq28lb9hip7chc-aarch64-unknown-linux-musl-binutils-2.43.1/bin/aarch64-unknown-linux-musl-ld: (.text+0x16c): undefined reference to `operator delete(void*, unsigned long)'
/nix/store/ncvpwrpay6vvh9wwc6fq28lb9hip7chc-aarch64-unknown-linux-musl-binutils-2.43.1/bin/aarch64-unknown-linux-musl-ld: (.text+0x26c): undefined reference to `std::__throw_bad_alloc()'
/nix/store/ncvpwrpay6vvh9wwc6fq28lb9hip7chc-aarch64-unknown-linux-musl-binutils-2.43.1/bin/aarch64-unknown-linux-musl-ld: /nix/store/h2f1h8bri9d0mvdrvn5ad94hy31dan2s-lerc-static-aarch64-unknown-linux-musl-4.0.0/lib/libLerc.a(Lerc.cpp.o): in function `LercNS::Lerc::GetRanges(unsigned char const*, unsigned int, int, LercNS::Lerc2::HeaderInfo const&, double*, double*, unsigned long)':
(.text+0x10a0): undefined reference to `operator delete(void*, unsigned long)'
/nix/store/ncvpwrpay6vvh9wwc6fq28lb9hip7chc-aarch64-unknown-linux-musl-binutils-2.43.1/bin/aarch64-unknown-linux-musl-ld: (.text+0x10b4): undefined reference to `operator delete(void*, unsigned long)'
/nix/store/ncvpwrpay6vvh9wwc6fq28lb9hip7chc-aarch64-unknown-linux-musl-binutils-2.43.1/bin/aarch64-unknown-linux-musl-ld: (.text+0x10c8): undefined reference to `operator delete(void*, unsigned long)'
/nix/store/ncvpwrpay6vvh9wwc6fq28lb9hip7chc-aarch64-unknown-linux-musl-binutils-2.43.1/bin/aarch64-unknown-linux-musl-ld: (.text+0x10ec): undefined reference to `operator delete(void*, unsigned long)'
/nix/store/ncvpwrpay6vvh9wwc6fq28lb9hip7chc-aarch64-unknown-linux-musl-binutils-2.43.1/bin/aarch64-unknown-linux-musl-ld: (.text+0x1100): undefined reference to `operator delete(void*, unsigned long)'
/nix/store/ncvpwrpay6vvh9wwc6fq28lb9hip7chc-aarch64-unknown-linux-musl-binutils-2.43.1/bin/aarch64-unknown-linux-musl-ld: /nix/store/h2f1h8bri9d0mvdrvn5ad94hy31dan2s-lerc-static-aarch64-unknown-linux-musl-4.0.0/lib/libLerc.a(Lerc.cpp.o):(.text+0x1114): more undefined references to `operator delete(void*, unsigned long)' follow
/nix/store/ncvpwrpay6vvh9wwc6fq28lb9hip7chc-aarch64-unknown-linux-musl-binutils-2.43.1/bin/aarch64-unknown-linux-musl-ld: /nix/store/h2f1h8bri9d0mvdrvn5ad94hy31dan2s-lerc-static-aarch64-unknown-linux-musl-4.0.0/lib/libLerc.a(Lerc.cpp.o): in function `bool LercNS::Lerc::Convert<signed char>(LercNS::CntZImage const&, signed char*, unsigned char*, bool)':
[1808 more lines of this ommitted]
collect2: error: ld returned 1 exit status
2024-12-19 16:20:46 +01:00
Even Rouault c474fb8a4e Merge branch 'read_only' into 'master'
Take into account PACKBITS_READ_ONLY, LZW_READ_ONLY, and LERC_READ_ONLY macros

See merge request libtiff/libtiff!683
2024-12-17 14:11:49 +00:00
Even Rouault 1b9252f152 Merge branch 'libtiff_predictor_3_inverted_endianness_write_fix' into 'master'
fix writing a Predictor=3 file with non-native endianness

See merge request libtiff/libtiff!684
2024-12-17 14:11:32 +00:00
Even Rouault f12dfbd463 fix writing a Predictor=3 file with non-native endianness 2024-12-17 05:11:30 +01:00
Even Rouault 6885ac0a3c Take into account PACKBITS_READ_ONLY, LZW_READ_ONLY, and LERC_READ_ONLY macros
to disable compiling write-support for those codecs.
Also add missing casts in LERC codec.
2024-12-17 02:24:43 +01:00
Even Rouault 280232e02b Merge branch 'tif_lzw_packbits_null' into 'master'
tif_lzw.c / tif_packbits.c: use NULL instead of 0

See merge request libtiff/libtiff!682
2024-12-16 00:31:23 +00:00
Even Rouault 2e7cbc82e5 tif_lzw.c / tif_packbits.c: use NULL instead of 0 2024-12-16 00:50:48 +01:00
Even Rouault 59fe2f3c8d Merge branch 'manpage_TIFFRGBAImage_#67_different_output_unassociated_alpha' into 'master'
manpage: doc/functions/TIFFRGBAImage.rst note added about un-associated alpha handling

Closes #67

See merge request libtiff/libtiff!679
2024-12-09 19:40:07 +00:00
Su Laus a8e96e6504 manpage: doc/functions/TIFFRGBAImage.rst note added about un-associated alpha handling 2024-12-09 19:40:07 +00:00
Even Rouault ead511b2c9 Merge branch 'tiff2pdf_division_by_zero_#654' into 'master'
tiff2pdf: check h_samp and v_samp for range 1 to 4 to avoid division by zero.

Closes #654

See merge request libtiff/libtiff!680
2024-12-09 19:28:55 +00:00
Su_Laus 1131c06841 tiff2pdf: check h_samp and v_samp for range 1 to 4 to avoid division by zero.
Closes #654
2024-12-07 21:03:51 +01:00
Even Rouault cf020332ec Merge branch 'master' into 'master'
CMake CMP0074 new policy.

See merge request libtiff/libtiff!678
2024-12-05 12:28:49 +00:00
榆柳松 2b6b70183d CMake CMP0074 new policy. 2024-12-04 17:45:59 +08:00
Even Rouault 7b22c1d92b Merge branch 'manpage_TIFFReadRGBAImage_orientation_fault' into 'master'
doc: TIFFReadRGBAImage.rst note about incorrect saving in raster for some TIFF orientations (5 to 8).

Closes #76 and #77

See merge request libtiff/libtiff!675
2024-12-03 23:55:50 +00:00
Even Rouault ae8538435b Merge branch 'TIFFRGBAImageOK_remove_unnecessary_calls' into 'master'
Remove unnecessary calls to TIFFRGBAImageOK() in tif_getimage.c

Closes #175

See merge request libtiff/libtiff!677
2024-12-03 23:55:37 +00:00
Su_Laus 520b0de907 Remove unnecessary calls to TIFFRGBAImageOK() in tif_getimage.c
Closes #175
2024-12-03 20:14:15 +01:00
Roger Leigh da0fde79d6 Merge branch 'master' into 'master'
Rename cxx to tiff-cxx

See merge request libtiff/libtiff!676
2024-11-30 09:17:56 +00:00
榆柳松 fc202ff1df Rename cxx to tiff-cxx,avoid overly mundane names. 2024-11-30 15:32:38 +08:00
Su_Laus c1d998262a manpage: doc/functions/TIFFRGBAImage.rst note added for incorrect saving of images with TIFF orientation from 5 (LeftTop) to 8 (LeftBottom) in the raster. 2024-11-29 00:00:02 +01:00
Even Rouault e8233c42f2 Merge branch 'fix_test_directory_for_big_endian_machines' into 'master'
Update test/test_directory.c not to fail on big-endian machines. Fix memory leaks

Closes #652 et #656

See merge request libtiff/libtiff!673
2024-11-19 18:34:02 +00:00
Su Laus ea6f6bd7bc Update test/test_directory.c not to fail on big-endian machines. Fix memory leaks
Closes #652 et #656
2024-11-19 18:34:02 +00:00
Even Rouault 97aa7f403e Merge branch 'tiffdither_multi_page' into 'master'
tiffdither: process all pages in input TIFF file

See merge request libtiff/libtiff!674
2024-11-08 17:23:11 +00:00
Marco Rullo 43e154894d tiffdither: process all pages in input TIFF file 2024-11-08 17:23:10 +00:00
Even Rouault 382a2eb68d Merge branch 'unknown_tag_warnings' into 'master'
No longer emit warnings about unknown tags by default, and add...

See merge request libtiff/libtiff!463
2024-10-30 18:11:47 +00:00
Even Rouault 50d393086d tiffinfo: add a -W switch to warn about unknown tags 2024-10-29 01:09:03 +01:00
Even Rouault 2d80b3bf89 No longer emit warnings about unknown tags by default, and add TIFFOpenOptionsSetWarnAboutUnknownTags() for explicit control 2024-10-29 01:09:03 +01:00
Even Rouault 0faef2b82d Merge branch 'COMPRESSION_JXL_DNG_1_7' into 'master'
tiff.h: add COMPRESSION_JXL_DNG_1_7=52546 as used for JPEGXL compression in...

See merge request libtiff/libtiff!672
2024-10-28 21:33:21 +00:00
Even Rouault 7cc3a06c28 Merge branch '532_MergeFields_with_FIELD_IGNORE' into 'master'
Issue #532: Updating TIFFMergeFieldInfo() with read_count=write_count=0 for FIELD_IGNORE.

Closes #532

See merge request libtiff/libtiff!668
2024-10-26 22:56:26 +00:00
Su Laus 634bce6706 Issue #532: Updating TIFFMergeFieldInfo() with read_count=write_count=0 for FIELD_IGNORE.
Updating TIFFMergeFieldInfo() with read_count=write_count=0 for FIELD_IGNORE.   
Improving handling when field_name = NULL.

Closes #532

There was a regression in v4.7.0 related to re-opened issue https://gitlab.com/libtiff/libtiff/-/issues/532#note_2134433038 and following discussion.
2024-10-26 22:56:26 +00:00
Even Rouault 81435b7fa3 tiff.h: add COMPRESSION_JXL_DNG_1_7=52546 as used for JPEGXL compression in the DNG 1.7 specification 2024-10-27 00:04:52 +02:00
Even Rouault 43eb249300 Merge branch 'fix_651_bis' into 'master'
CMake: fix build with LLVM/Clang 17+

Closes #651

See merge request libtiff/libtiff!671
2024-10-23 18:27:37 +00:00
Even Rouault be8466a442 Merge branch 'remove_useless_cmake_minimum_required' into 'master'
doc/CMakeLists.txt: remove useless cmake_minimum_required()

See merge request libtiff/libtiff!670
2024-10-21 14:12:12 +00:00
Daniel E @diizzyy 0dbcfc5bd2 CMake: fix build with LLVM/Clang 17+
Fixes #651
2024-10-20 22:45:18 +02:00
Even Rouault d1279f0f9c doc/CMakeLists.txt: remove useless cmake_minimum_required()
There's already one in top CMakeLists.txt (at 3.9.0 currently)

Newer CMake versions throw this warning with current 3.2.0:
```
CMake Deprecation Warning at doc/CMakeLists.txt:27 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
```
2024-10-20 18:50:27 +02:00
Even Rouault e8ef85398f Merge branch 'tif_jpeg_65535' into 'master'
tif_jpeg.c: use JPEG_MAX_DIMENSION constant instead of hard-coded 65535 value

See merge request libtiff/libtiff!658
2024-10-13 09:46:25 +00:00
Even Rouault 106593b350 Merge branch 'fix_gdal_10875' into 'master'
TIFFDefaultTransferFunction(): give up beyond td_bitspersample = 24

See merge request libtiff/libtiff!665
2024-10-05 17:05:45 +00:00
Even Rouault 3dddadcda3 Merge branch 'ppm2tiff_fix_#467_10bit_packwords' into 'master'
ppm2tiff: Fix bug in `pack_words` trailing bytes

Closes #467

See merge request libtiff/libtiff!666
2024-10-05 17:05:32 +00:00
Even Rouault 631897af01 Merge branch 'master' into 'master'
Fix issue #649 in fax2ps caused by regression in commit...

Closes #649

See merge request libtiff/libtiff!667
2024-10-05 17:05:15 +00:00
Lee Howard 2ebfffb0e8 Check TIFFTAG_TILELENGTH and TIFFTAGTILEWIDTH for valid input, addresses issue #650 2024-10-05 09:45:30 -07:00
Lee Howard 7be20ccaab Fix issue #649 in fax2ps caused by regression in commit https://gitlab.com/libtiff/libtiff/-/commit/28c38d648b64a66c3218778c4745225fe3e3a06d where TIFFTAG_FAXFILLFUNC is being used rather than an output buffer. 2024-09-27 11:21:57 -07:00
Su_Laus f29d27bc9e ppm2tiff: Fix bug in pack_words trailing bytes, where last two bytes of each line were written wrongly.
Closes #467.
2024-09-27 17:28:46 +02:00
Even Rouault 340834ac68 TIFFDefaultTransferFunction(): give up beyond td_bitspersample = 24
This function tries to allocate (1 << td_bitspersample) bytes which may
results in denial of services if td_bitspersample is too large.

Fixes https://github.com/OSGeo/gdal/issues/10875
2024-09-26 13:42:30 +02:00
Benjamin Gilbert dc769d5871 Define HAVE_JPEGTURBO_DUAL_MODE_8_12 in tif_config.h
Remove special-case Autotools and CMake code to define it on the
compiler command line.
2024-09-21 13:24:16 -07:00
Benjamin Gilbert ce85ec85f0 Define LERC_STATIC in tif_config.h
Remove special-case Autotools and CMake code to define it on the
compiler command line.
2024-09-21 13:23:04 -07:00
Benjamin Gilbert 5a4e05aad2 CMake: set WORDS_BIGENDIAN via #cmakedefine
Autotools sets WORDS_BIGENDIAN via tif_config.h, but the CMake equivalent
in tif_config.h.cmake.in is a no-op; CMake passes the define on the
compiler command line instead.  For consistency, have CMake set the define
via tif_config.h.
2024-09-21 13:22:08 -07:00
Even Rouault de441ecdaa tif_jpeg.c: use JPEG_MAX_DIMENSION constant instead of hard-coded 65535 value 2024-09-08 17:59:03 +02:00
164 changed files with 5704 additions and 1545 deletions
+22 -4
View File
@@ -24,10 +24,15 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
cmake_minimum_required(VERSION 3.9.0)
cmake_minimum_required(VERSION 3.10)
# Default policy is from 3.9.0
cmake_policy(VERSION 3.9.0)
# Default policy is from 3.10
cmake_policy(VERSION 3.10)
if(POLICY CMP0074)
# Allow find_package() to use the ZLIB_ROOT variable, if available.
cmake_policy(SET CMP0074 NEW)
endif()
# Find CMake modules in cmake/
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
@@ -50,6 +55,13 @@ else()
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
endif()
if (BUILD_SHARED_LIBS)
set(TIFF_STATIC_LIBS_DEFAULT FALSE)
else()
set(TIFF_STATIC_LIBS_DEFAULT TRUE)
endif()
option(tiff-static "build TIFF static libraries" ${TIFF_STATIC_LIBS_DEFAULT})
option(tiff-tools "build TIFF tools" ON)
option(tiff-tests "build TIFF tests" ON)
option(tiff-contrib "build TIFF contrib" ON)
@@ -57,6 +69,12 @@ option(tiff-docs "build TIFF documentation" ON)
option(tiff-deprecated "build TIFF deprecated features" OFF)
option(tiff-install "install TIFF targets" ${TIFF_INSTALL_DEFAULT})
if (tiff-static)
set(TIFF_BUILD_LIB_VALUE STATIC)
else()
set(TIFF_BUILD_LIB_VALUE SHARED)
endif()
# Disable deprecated features to ensure clean build
if (tiff-deprecated)
add_definitions(-DTIFF_DISABLE_DEPRECATED)
@@ -225,7 +243,7 @@ message(STATUS " LZMA2 support: Requested:${lzma} Availabi
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 " C++ support: ${tiff-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}")
+1299 -20
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -44,7 +44,7 @@ Notes on releasing.
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.
Easiest 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.
+26
View File
@@ -21,3 +21,29 @@ 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.
# Lempel-Ziv & Welch Compression (tif_lzw.c) license
The code of tif_lzw.c is derived from the compress program whose code is
derived from software contributed to Berkeley by James A. Woods,
derived from original work by Spencer Thomas and Joseph Orost.
The original Berkeley copyright notice appears below in its entirety:
Copyright (c) 1985, 1986 The Regents of the University of California.
All rights reserved.
This code is derived from software contributed to Berkeley by
James A. Woods, derived from original work by Spencer Thomas
and Joseph Orost.
Redistribution and use in source and binary forms are permitted
provided that the above copyright notice and this paragraph are
duplicated in all such forms and that any documentation,
advertising materials, and other materials related to such
distribution and use acknowledge that the software was developed
by the University of California, Berkeley. The name of the
University may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+1 -1
View File
@@ -1 +1 @@
20240911
20250911
+1 -1
View File
@@ -1 +1 @@
4.7.0
4.7.1
+7 -15
View File
@@ -4,27 +4,19 @@ 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=$?
autoreconf --install --force || retval=$?
# Get latest config.guess and config.sub from upstream master since
# these are often out of date.
# these are often out of date. This requires network connectivity and
# sometimes the site is down, a failure here does not result in
# failure of the whole script.
for file in config.guess config.sub
do
echo "$0: getting $file..."
wget -q --timeout=5 -O config/$file.tmp \
wget --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=$?
&& chmod a+x config/$file
rm -f config/$file.tmp
done
+1
View File
@@ -4,4 +4,5 @@ project(test)
find_package(Tiff CONFIG REQUIRED)
add_executable(test test.c)
set_target_properties(test PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(test PRIVATE TIFF::tiff)
@@ -5,4 +5,5 @@ find_package(Tiff CONFIG REQUIRED)
add_executable(test test.c)
target_include_directories(test PRIVATE ${TIFF_INCLUDE_DIR})
set_target_properties(test PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(test PRIVATE ${TIFF_LIBRARIES})
+2 -2
View File
@@ -24,9 +24,9 @@
# OF THIS SOFTWARE.
# C++ support
option(cxx "Enable C++ stream API building (requires C++ compiler)" ON)
option(tiff-cxx "Enable C++ stream API building (requires C++ compiler)" ON)
set(CXX_SUPPORT FALSE)
if (cxx)
if (tiff-cxx)
enable_language(CXX)
set(CXX_SUPPORT TRUE)
endif()
+1 -1
View File
@@ -40,7 +40,7 @@ if (old-jpeg AND JPEG_SUPPORT)
endif()
if (JPEG_SUPPORT)
# Check for jpeg12_read_scanlines() which has been added in libjpeg-turbo 2.2
# Check for jpeg12_read_scanlines() which has been added in libjpeg-turbo 3.0
# for dual 8/12 bit mode.
include(CheckCSourceCompiles)
include(CMakePushCheckState)
+4
View File
@@ -25,8 +25,12 @@
# libLerc
set(LERC_SUPPORT FALSE)
set(LERC_STATIC 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)
if(NOT BUILD_SHARED_LIBS)
set(LERC_STATIC TRUE)
endif()
endif()
+6 -1
View File
@@ -39,7 +39,12 @@ VERS_2 {
} 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")
if (CMAKE_VERSION GREATER_EQUAL 3.29 AND CMAKE_C_COMPILER_LINKER_ID STREQUAL "LLD" AND CMAKE_C_COMPILER_LINKER_VERSION GREATER_EQUAL 17)
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -Wl,--undefined-version "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
else()
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
endif()
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")
+3 -1
View File
@@ -29,7 +29,9 @@ include(TestBigEndian)
# CPU endianness
test_big_endian(HOST_BIG_ENDIAN)
if(HOST_BIG_ENDIAN)
add_definitions(-DWORDS_BIGENDIAN)
set(WORDS_BIGENDIAN TRUE)
else()
set(WORDS_BIGENDIAN FALSE)
endif()
# IEEE floating point
+14 -19
View File
@@ -24,8 +24,8 @@ dnl OF THIS SOFTWARE.
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.64)
AC_INIT([LibTIFF Software],[4.7.0],[tiff@lists.osgeo.org],[tiff])
AC_PREREQ([2.69])
AC_INIT([LibTIFF Software],[4.7.1],[tiff@lists.osgeo.org],[tiff])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(m4)
AC_LANG(C)
@@ -41,7 +41,7 @@ dnl Versioning.
dnl Don't fill the ALPHA_VERSION field, if not applicable.
LIBTIFF_MAJOR_VERSION=4
LIBTIFF_MINOR_VERSION=7
LIBTIFF_MICRO_VERSION=0
LIBTIFF_MICRO_VERSION=1
LIBTIFF_ALPHA_VERSION=
LIBTIFF_VERSION=$LIBTIFF_MAJOR_VERSION.$LIBTIFF_MINOR_VERSION.$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION
dnl This (LIBTIFF_RELEASE_DATE) is used to set the #define TIFFLIB_VERSION in tiffvers.h.
@@ -77,9 +77,9 @@ dnl 5. If any interfaces have been added since the last public release, then
dnl increment age.
dnl 6. If any interfaces have been removed since the last public release,
dnl then set age to 0.
LIBTIFF_CURRENT=7
LIBTIFF_CURRENT=8
LIBTIFF_REVISION=0
LIBTIFF_AGE=1
LIBTIFF_AGE=2
LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE
# This is a special hack for OpenBSD and MirOS systems. The dynamic linker
@@ -104,8 +104,8 @@ AC_SUBST(LIBTIFF_VERSION_INFO)
AC_SUBST(LIBTIFF_RELEASE_DATE)
dnl Checks for programs.
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_CC
AM_PROG_CC_C_O # Necessary if objects are placed in subdirectories.
dnl We want warnings. As many warnings as possible.
VL_PROG_CC_WARNINGS()
@@ -192,7 +192,7 @@ AC_C_CONST
AC_C_BIGENDIAN
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
dnl If the `fseeko' function is available, define `HAVE_FSEEKO'. Define
@@ -614,12 +614,12 @@ dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(old-jpeg,
AS_HELP_STRING([--disable-old-jpeg],
[disable support for Old JPEG compresson (read-only, enabled by default)]),
[disable support for Old JPEG compression (read-only, enabled by default)]),
[HAVE_OJPEG=${enableval}], [HAVE_OJPEG=yes])
if test "$HAVE_JPEG" = "yes" -a "$HAVE_OJPEG" = "yes" ; then
AC_DEFINE(OJPEG_SUPPORT, 1,
[Support Old JPEG compresson (read-only)])
[Support Old JPEG compression (read-only)])
else
HAVE_OJPEG=no
fi
@@ -687,14 +687,6 @@ dnl Check for liblerc.
dnl ---------------------------------------------------------------------------
HAVE_LERC=no
STATIC_LERC=no
if test "$enable_static" = "no"; then
static_lerc=no
else
static_lerc=yes
fi
AM_CONDITIONAL([STATIC_LERC], [ test "$static_lerc" = yes ])
AC_ARG_ENABLE(lerc,
AS_HELP_STRING([--disable-lerc],
@@ -746,6 +738,9 @@ if test "$HAVE_LERC" = "yes" ; then
LIBDIR="-R $with_lerc_lib_dir $LIBDIR"
fi
if test "$enable_static" != "no"; then
AC_DEFINE([LERC_STATIC], 1, [Define to 1 when building a static libtiff with LERC enabled.])
fi
fi
AM_CONDITIONAL(HAVE_LERC, test "$HAVE_LERC" = 'yes')
@@ -1262,7 +1257,7 @@ LOC_MSG([ Pixar log-format algorithm: ${HAVE_PIXARLOG}])
LOC_MSG([ JPEG support: ${HAVE_JPEG}])
LOC_MSG([ Old JPEG support: ${HAVE_OJPEG}])
if test "$HAVE_JPEGTURBO_DUAL_MODE_8_12" = "yes"; then
LOC_MSG([ JPEG 8/12 bit dual mode: ${HAVE_JPEGTURBO_DUAL_MODE_8_12} (libjpeg turbo >= 2.2 dual mode)])
LOC_MSG([ JPEG 8/12 bit dual mode: ${HAVE_JPEGTURBO_DUAL_MODE_8_12} (libjpeg turbo >= 3.0 dual mode)])
else
LOC_MSG([ JPEG 8/12 bit dual mode: ${HAVE_JPEG12}])
fi
+1
View File
@@ -23,6 +23,7 @@
# OF THIS SOFTWARE.
add_executable(addtiffo addtiffo.c tif_overview.c tif_ovrcache.c tif_ovrcache.h)
set_target_properties(addtiffo PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(addtiffo tiff tiff_port)
if(WEBP_SUPPORT AND EMSCRIPTEN)
+3 -1
View File
@@ -165,7 +165,7 @@ uint32_t TIFF_WriteOverview(TIFF *hTIFF, uint32_t nXSize, uint32_t nYSize,
TIFFSetSubDirectory(hTIFF, nBaseDirOffset);
return nOffset;
return (uint32_t)nOffset;
}
/************************************************************************/
@@ -617,6 +617,8 @@ void TIFF_ProcessFullResBlock(TIFF *hTIFF, int nPlanarConfig, int bSubsampled,
}
else
{
/* Silence Coverity Scan warning about checking return. */
/* coverity[check_return:SUPPRESS] */
TIFFReadEncodedStrip(
hTIFF, TIFFComputeStrip(hTIFF, nSYOff, (tsample_t)iSample),
pabySrcTile, TIFFStripSize(hTIFF));
+72 -14
View File
@@ -100,9 +100,9 @@ TIFFOvrCache *TIFFCreateOvrCache(TIFF *hTIFF, toff_t nDirOffset)
/* -------------------------------------------------------------------- */
psCache->pabyRow1Blocks =
(unsigned char *)_TIFFmalloc(psCache->nBytesPerRow);
(unsigned char *)_TIFFmalloc((tmsize_t)psCache->nBytesPerRow);
psCache->pabyRow2Blocks =
(unsigned char *)_TIFFmalloc(psCache->nBytesPerRow);
(unsigned char *)_TIFFmalloc((tmsize_t)psCache->nBytesPerRow);
if (psCache->pabyRow1Blocks == NULL || psCache->pabyRow2Blocks == NULL)
{
@@ -118,8 +118,8 @@ TIFFOvrCache *TIFFCreateOvrCache(TIFF *hTIFF, toff_t nDirOffset)
return NULL;
}
_TIFFmemset(psCache->pabyRow1Blocks, 0, psCache->nBytesPerRow);
_TIFFmemset(psCache->pabyRow2Blocks, 0, psCache->nBytesPerRow);
_TIFFmemset(psCache->pabyRow1Blocks, 0, (tmsize_t)psCache->nBytesPerRow);
_TIFFmemset(psCache->pabyRow2Blocks, 0, (tmsize_t)psCache->nBytesPerRow);
psCache->nBlockOffset = 0;
@@ -153,20 +153,78 @@ static void TIFFWriteOvrRow(TIFFOvrCache *psCache)
/* -------------------------------------------------------------------- */
if (TIFFIsByteSwapped(psCache->hTIFF))
{
uint64_t n;
if (psCache->nBitsPerPixel == 16)
{
n = (psCache->nBytesPerBlock * psCache->nSamples) / 2;
#ifdef SIZEOF_SIZE_T
#if SIZEOF_SIZE_T <= 4
if (n > INT32_MAX)
#else
if (n > INT64_MAX)
#endif
#else
#pragma message( \
"---- Error: SIZEOF_SIZE_T not defined. Generate a compile error. ----")
SIZEOF_SIZE_T
#endif
{
TIFFErrorExt(TIFFClientdata(psCache->hTIFF),
"TIFFWriteOvrRow()",
"Integer overflow of number of 'short' to swap");
n = 0;
}
TIFFSwabArrayOfShort((uint16_t *)psCache->pabyRow1Blocks,
(psCache->nBytesPerBlock * psCache->nSamples) /
2);
(tmsize_t)n);
}
else if (psCache->nBitsPerPixel == 32)
{
n = (psCache->nBytesPerBlock * psCache->nSamples) / 4;
#ifdef SIZEOF_SIZE_T
#if SIZEOF_SIZE_T <= 4
if (n > INT32_MAX)
#else
if (n > INT64_MAX)
#endif
#else
#pragma message( \
"---- Error: SIZEOF_SIZE_T not defined. Generate a compile error. ----")
SIZEOF_SIZE_T
#endif
{
TIFFErrorExt(TIFFClientdata(psCache->hTIFF),
"TIFFWriteOvrRow()",
"Integer overflow of number of 'long' to swap");
n = 0;
}
TIFFSwabArrayOfLong((uint32_t *)psCache->pabyRow1Blocks,
(psCache->nBytesPerBlock * psCache->nSamples) /
4);
(tmsize_t)n);
}
else if (psCache->nBitsPerPixel == 64)
TIFFSwabArrayOfDouble(
(double *)psCache->pabyRow1Blocks,
(psCache->nBytesPerBlock * psCache->nSamples) / 8);
{
n = (psCache->nBytesPerBlock * psCache->nSamples) / 8;
#ifdef SIZEOF_SIZE_T
#if SIZEOF_SIZE_T <= 4
if (n > INT32_MAX)
#else
if (n > INT64_MAX)
#endif
#else
#pragma message( \
"---- Error: SIZEOF_SIZE_T not defined. Generate a compile error. ----")
SIZEOF_SIZE_T
#endif
{
TIFFErrorExt(TIFFClientdata(psCache->hTIFF),
"TIFFWriteOvrRow()",
"Integer overflow of number of 'double' to swap");
n = 0;
}
TIFFSwabArrayOfDouble((double *)psCache->pabyRow1Blocks,
(tmsize_t)n);
}
}
/* -------------------------------------------------------------------- */
@@ -262,7 +320,7 @@ static void TIFFWriteOvrRow(TIFFOvrCache *psCache)
psCache->pabyRow1Blocks = psCache->pabyRow2Blocks;
psCache->pabyRow2Blocks = pabyData;
_TIFFmemset(pabyData, 0, psCache->nBytesPerRow);
_TIFFmemset(pabyData, 0, (tmsize_t)psCache->nBytesPerRow);
psCache->nBlockOffset++;
@@ -286,7 +344,7 @@ unsigned char *TIFFGetOvrBlock(TIFFOvrCache *psCache, int iTileX, int iTileY,
int iSample)
{
long nRowOffset;
toff_t nRowOffset;
if (iTileY > psCache->nBlockOffset + 1)
TIFFWriteOvrRow(psCache);
@@ -318,7 +376,7 @@ unsigned char *TIFFGetOvrBlock_Subsampled(TIFFOvrCache *psCache, int iTileX,
int iTileY)
{
int nRowOffset;
toff_t nRowOffset;
if (iTileY > psCache->nBlockOffset + 1)
TIFFWriteOvrRow(psCache);
+4
View File
@@ -23,15 +23,19 @@
# OF THIS SOFTWARE.
add_executable(tiff-bi tiff-bi.c)
set_target_properties(tiff-bi PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(tiff-bi tiff tiff_port)
add_executable(tiff-grayscale tiff-grayscale.c)
set_target_properties(tiff-grayscale PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(tiff-grayscale tiff tiff_port CMath::CMath)
add_executable(tiff-palette tiff-palette.c)
set_target_properties(tiff-palette PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(tiff-palette tiff tiff_port)
add_executable(tiff-rgb tiff-rgb.c)
set_target_properties(tiff-rgb PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(tiff-rgb tiff tiff_port CMath::CMath)
if(WEBP_SUPPORT AND EMSCRIPTEN)
+1
View File
@@ -23,4 +23,5 @@
# OF THIS SOFTWARE.
add_executable(iptcutil iptcutil.c)
set_target_properties(iptcutil PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(iptcutil tiff tiff_port)
+3
View File
@@ -296,6 +296,9 @@ int formatIPTC(FILE *ifile, FILE *ofile)
else
fprintf(ofile, "%d#%d=", (unsigned int)dataset,
(unsigned int)recnum);
/* Silence Coverity Scan warning about tainted_data: Passing tainted
* expression *str to formatString, which uses it as an offset. */
/* coverity[tainted_data:SUPPRESS] */
formatString(ofile, str, taglen);
free(str);
+62 -13
View File
@@ -83,34 +83,83 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
TIFFClose(tif);
return 0;
}
/* another hack to work around an OOM in tif_fax3.c */
uint32_t tilewidth = 0;
uint32_t imagewidth = 0;
TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tilewidth);
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &imagewidth);
tilewidth = __TIFFSafeMultiply(uint32_t, tilewidth, 2);
imagewidth = __TIFFSafeMultiply(uint32_t, imagewidth, 2);
if (tilewidth * 2 > MAX_SIZE || imagewidth * 2 > MAX_SIZE ||
tilewidth == 0 || imagewidth == 0)
if (TIFFIsTiled(tif))
{
TIFFClose(tif);
return 0;
/* another hack to work around an OOM in tif_fax3.c */
uint32_t tilewidth = 0;
uint32_t imagewidth = 0;
TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tilewidth);
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &imagewidth);
tilewidth = __TIFFSafeMultiply(uint32_t, tilewidth, 2);
imagewidth = __TIFFSafeMultiply(uint32_t, imagewidth, 2);
if (tilewidth * 2 > MAX_SIZE || imagewidth * 2 > MAX_SIZE ||
tilewidth == 0 || imagewidth == 0)
{
TIFFClose(tif);
return 0;
}
}
else
{
// check the size of the non-tiled image
uint32_t rowsize = 0;
TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &rowsize);
uint32_t stripsize = TIFFStripSize(tif);
rowsize = __TIFFSafeMultiply(uint32_t, rowsize, 2);
stripsize = __TIFFSafeMultiply(uint32_t, stripsize, 2);
if (rowsize * 2 > MAX_SIZE || stripsize * 2 > MAX_SIZE ||
rowsize == 0 || stripsize == 0)
{
TIFFClose(tif);
return 0;
}
}
uint32_t size = __TIFFSafeMultiply(uint32_t, w, h);
if (size > MAX_SIZE || size == 0)
{
TIFFClose(tif);
return 0;
}
raster = (uint32_t *)_TIFFmalloc(size * sizeof(uint32_t));
int ret = 0;
if (raster != NULL)
{
TIFFReadRGBAImage(tif, w, h, raster, 0);
if (!TIFFIsTiled(tif))
{
// Allocate a buffer to hold one scanline
tsize_t scanlineSize = TIFFScanlineSize(tif);
void *buffer = _TIFFmalloc(scanlineSize);
if (!buffer)
{
fprintf(stderr, "Memory allocation failed\n");
ret = 1;
goto cleanup;
}
// Read each scanline
for (uint32_t row = 0; row < h; row++)
{
if (TIFFReadScanline(tif, buffer, row, 0) < 0)
{
_TIFFfree(buffer);
ret = 1;
goto cleanup;
}
}
_TIFFfree(buffer);
}
cleanup:
_TIFFfree(raster);
}
TIFFClose(tif);
return 0;
return ret;
}
#ifdef STANDALONE
@@ -190,4 +239,4 @@ int main(int argc, char *argv[])
return nRet;
}
#endif
#endif
+2 -2
View File
@@ -12,7 +12,7 @@
Load the TIFF data from the file into memory. Return
a pointer to a valid DIB (or NULL for errors).
Uses the TIFFRGBA interface to libtiff.lib to convert
most file formats to a useable form. We just keep the 32 bit
most file formats to a usable form. We just keep the 32 bit
form of the data to display, rather than optimizing for the
display.
@@ -291,7 +291,7 @@ DECLAREContigPutFunc(putContig1bitTile);
static int getStripContig1Bit(TIFFRGBAImage *img, uint32_t *uraster, uint32_t w,
uint32_t h);
// typdef struct TIFFDibImage {
// typedef struct TIFFDibImage {
// TIFFRGBAImage tif;
// dibinstalled;
// } TIFFDibImage ;
+1 -1
View File
@@ -85,7 +85,7 @@ HDIB LoadTIFFinDIB(LPSTR lpFileName)
TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &RowsPerStrip);
TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &PhotometricInterpretation);
LineSize = TIFFScanlineSize(tif); // Number of byte in ine line
LineSize = TIFFScanlineSize(tif); // Number of byte in one line
SamplePerPixel = (int)(LineSize / imageWidth);
-2
View File
@@ -24,8 +24,6 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
cmake_minimum_required(VERSION 3.2.0)
include(Sphinx)
if (BUILD_SPHINX AND SPHINX_BUILD)
+1
View File
@@ -124,6 +124,7 @@ rst_sources = \
releases/v4.5.1.rst \
releases/v4.6.0.rst \
releases/v4.7.0.rst \
releases/v4.7.1.rst \
rfcs/index.rst \
rfcs/rfc1_psc.rst \
rfcs/rfc2_restoring_needed_tools.rst \
+77 -23
View File
@@ -20,7 +20,7 @@ This structure looks like this:
::
typedef struct {
ttag_t field_tag; /* field's tag */
uint32_t field_tag; /* field's tag */
short field_readcount; /* read count / TIFF_VARIABLE / TIFF_VARIABLE2 / TIFF_SPP */
short field_writecount; /* write count / TIFF_VARIABLE / TIFF_VARIABLE2 */
TIFFDataType field_type; /* type of associated data */
@@ -31,7 +31,7 @@ This structure looks like this:
} TIFFFieldInfo;
.. c:member:: ttag_t TIFFFieldInfo.field_tag
.. c:member:: uint32_t TIFFFieldInfo.field_tag
The tag number. For instance 277 for the
SamplesPerPixel tag. Builtin tags will generally have a ``#define`` in
@@ -229,27 +229,81 @@ architecture can then be avoided.
Adding New Builtin Tags
-----------------------
A similar approach is taken to the above. However, the :c:struct:`TIFFFieldInfo`
should be added to the :c:expr:`tiffFieldInfo[]` list in :file:`tif_dirinfo.c`.
Ensure that new tags are added in sorted order by the tag number.
A similar approach is taken to the above. However, the :c:struct:`_TIFFField`
information should be added to the :c:expr:`tiffFields[]` list in
:file:`tif_dirinfo.c`. This :c:struct:`_TIFFField` structure is like
TIFFFieldInfo structure but has additional members:
Normally new built-in tags should be defined with :c:macro:`FIELD_CUSTOM`; however, if
it is desirable for the tag value to have it's own field in the :c:struct:`TIFFDirectory`
structure, then you will need to ``#define`` a new :c:macro:`FIELD_` value for it, and
add appropriate handling as follows:
The tags in the :c:expr:`tiffFields[]` list need not to be in sorted
order by the tag number. Sorting is done when setting up the
:c:expr:`TIFFFieldArray` at IFD initialization.
.. highlight:: c
::
typedef struct _TIFFField {
uint32_t field_tag; /* field's tag */
short field_readcount; /* read count / TIFF_VARIABLE / TIFF_VARIABLE2 / TIFF_SPP */
short field_writecount; /* write count / TIFF_VARIABLE / TIFF_VARIABLE2 */
TIFFDataType field_type; /* type of associated data */
uint32_t field_anonymous; /* if true, this is a unknown / anonymous tag */
TIFFSetGetFieldType set_field_type; /* type to be passed to TIFFSetField and TIFFGetField */
TIFFSetGetFieldType get_field_type; /* not used */
unsigned short field_bit; /* bit in fieldsset bit vector */
unsigned char field_oktochange; /* if true, can change while writing */
unsigned char field_passcount; /* if true, pass dir count on set */
char *field_name; /* ASCII name */
TIFFFieldArray *field_subfields; /* if field points to child ifds, child ifd field definition array */
};
.. c:member:: uint32_t _TIFFField.field_anonymous
Used internally to indicate auto-registered tags.
See :c:func:`TIFFFieldIsAnonymous`.
.. c:member:: TIFFSetGetFieldType _TIFFField.set_field_type
| The enummeration identifier gives a hint and defines the `vararg`
parameters passed to :c:func:`TIFFSetField` and :c:func:`TIFFGetField`.
| For example :c:enum:`TIFF_SETGET_UINT64` defines a single
``uint64_t`` parameter to be passed to `TIFFSetField()` and
`TIFFGetField()`, respectively.
| To distinguish the three different array types, there are three
strings before the value type within the enummeration identifier
(e.g. TIFF_SETGET_C0_UINT64):
| "**_C0_**" for fixed arrays and thus no count parameter is required
for TIFFSetField() and TIFFGetField(), respectively.
The array length is constant and given by `field_readcount` or
`field_writecount`, respectively.
| "**_C16_**" and "**_C32_**" are for variable arrays with ``uint16_t``
or ``uint32_t`` count parameter required for TIFFSetField() and
TIFFGetField(), respectively. But then, `field_readcount` and
`field_writecount` has to be set to -1 for _C16_ and -3 for _C32_,
respectively.
.. c:member:: TIFFSetGetFieldType _TIFFField.get_field_type
Currently, this parameter is not used for TIFFGetField().
Nevertheless, it is set as a copy of set_field_type or set to
`TIFF_SETGET_UNDEFINED`.
Normally new built-in tags should be defined with :c:macro:`FIELD_CUSTOM`
and then only two points need to be done:
#. Define the tag in :file:`tiff.h`.
#. Add a field to the directory structure in :file:`tif_dir.h`
and define a ``FIELD_*`` bit (also update the definition of
#. Add an entry in the :c:expr:`tiffFields[]` array list defined at the
top of :file:`tif_dirinfo.c`.
However, if it is desirable for the tag value to have its own field in
the :c:struct:`TIFFDirectory` structure, then you will also need to
``#define`` a new :c:macro:`FIELD_` value for it, and add appropriate
handling as follows:
#. Add a field to the :c:struct:`TIFFDirectory` structure in :file:`tif_dir.h`
and define a ``FIELD_*`` bit number (also update the definition of
:c:macro:`FIELD_CODEC` to reflect your addition).
#. Add an entry in the :c:struct:`TIFFFieldInfo` array defined at the top of
:file:`tif_dirinfo.c`.
.. note::
Note that you must keep this array sorted by tag
number and that the widest variant entry for a tag should come
first (e.g. :c:macro:`LONG` before :c:macro:`SHORT`).
#. Add entries in :c:func:`_TIFFVSetField` and :c:func:`_TIFFVGetField`
for the new tag.
#. (*optional*) If the value associated with the tag is not a scalar value
@@ -259,7 +313,7 @@ add appropriate handling as follows:
:c:func:`TIFFWriteDirectory`. You're best off finding a similar tag and
cribbing code.
#. Add support to :c:func:`TIFFPrintDirectory` in :file:`tif_print.c`
to print the tag's value.
to print the tag's value.
If you want to maintain portability, beware of making assumptions
about data types. Use the typedefs (:c:type:`uint16_t`, etc. when dealing with
@@ -311,6 +365,6 @@ algorithm is used* follow these steps:
Note that space has been allocated in the ``FIELD_*`` bit space for
codec-private tags. Define your bits as ``FIELD_CODEC+<offset>`` to
keep them away from the core tags. If you need more tags than there
is room for, just increase :c:macro:`FIELD_SETLONGS` at the top of
:file:`tiffiop.h`.
keep them away from the core tags. If you need more tags than there
is room for, just increase :c:macro:`td_fieldsset` at the top of
:file:`tif_dir.h`.
+1 -1
View File
@@ -105,7 +105,7 @@ The default generator for UNIX is ``Unix Makefiles``, and on Windows is
``NMake Makefiles`` or ``MSBuild`` depending upon the setup.
Run :command:`cmake --help` to list all the
generators available for your platform. For example, to use the Ninja
`build system <https://martine.github.io/ninja/>`_ on UNIX or
`build system <https://ninja-build.org/>`_ on UNIX or
Windows:
.. code-block:: shell
+1 -1
View File
@@ -25,7 +25,7 @@ ext_source_user = None
# -- Project information -----------------------------------------------------
project = 'LibTIFF'
copyright = '1988-2022, LibTIFF contributors'
copyright = '1988-2025, LibTIFF contributors'
author = 'LibTIFF contributors'
# The full version, including alpha/beta/rc tags
+2 -1
View File
@@ -66,7 +66,7 @@ Furthermore, a **custom defined data structure** *user_data* for the
error handler can be given along.
Please refer to :doc:`/functions/TIFFOpenOptions` for how to setup the
application-specific handler introduced with libtiff 4.5.
application-specific handler introduced with ``libtiff`` 4.5.
Note
----
@@ -101,5 +101,6 @@ See also
:doc:`TIFFWarning` (3tiff),
:doc:`TIFFOpen` (3tiff),
:doc:`/functions/TIFFOpenOptions`,
:doc:`libtiff` (3tiff),
printf (3)
+4 -4
View File
@@ -11,13 +11,13 @@ Synopsis
#include <tiffio.h>
#include <stdarg.h>
.. c:function:: int TIFFGetField(TIFF* tif, ttag_t tag, ...)
.. c:function:: int TIFFGetField(TIFF* tif, uint32_t tag, ...)
.. c:function:: int TIFFVGetField(TIFF* tif, ttag_t tag, va_list ap)
.. c:function:: int TIFFVGetField(TIFF* tif, uint32_t tag, va_list ap)
.. c:function:: int TIFFGetFieldDefaulted(TIFF* tif, ttag_t tag, ...)
.. c:function:: int TIFFGetFieldDefaulted(TIFF* tif, uint32_t tag, ...)
.. c:function:: int TIFFVGetFieldDefaulted(TIFF* tif, ttag_t tag, va_list ap)
.. c:function:: int TIFFVGetFieldDefaulted(TIFF* tif, uint32_t tag, va_list ap)
Description
-----------
+12 -5
View File
@@ -28,12 +28,12 @@ Synopsis
.. c:function:: int TIFFSetMode(TIFF* tif, int mode)
.. c:type:: tsize_t (*TIFFReadWriteProc)(thandle_t, tdata_t, tsize_t)
.. c:type:: tmsize_t (*TIFFReadWriteProc)(thandle_t, void *, tmsize_t)
.. c:type:: toff_t (*TIFFSeekProc)(thandle_t, toff_t, int)
.. c:type:: int (*TIFFCloseProc)(thandle_t)
.. c:type:: toff_t (*TIFFSizeProc)(thandle_t)
.. c:type:: int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*)
.. c:type:: void (*TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t)
.. c:type:: int (*TIFFMapFileProc)(thandle_t, void **base, toff_t *size)
.. c:type:: void (*TIFFUnmapFileProc)(thandle_t, void *base, toff_t size)
.. c:function:: TIFF* TIFFClientOpen(const char* filename, const char* mode, thandle_t clientdata, TIFFReadWriteProc readproc, TIFFReadWriteProc writeproc, TIFFSeekProc seekproc, TIFFCloseProc closeproc, TIFFSizeProc sizeproc, TIFFMapFileProc mapproc, TIFFUnmapFileProc unmapproc)
@@ -62,7 +62,7 @@ If an existing file is opened for writing, all previous data is
overwritten.
If a file is opened for reading, the first TIFF directory in the file
is automatically read.
is automatically read.
If a file is opened for writing or appending, a default directory
is automatically created for writing subsequent data.
This directory has all the default values specified in TIFF Revision 6.0:
@@ -96,7 +96,7 @@ file should be closed using its file descriptor *fd*.
:c:func:`TIFFOpenExt` (added in libtiff 4.5) is like :c:func:`TIFFOpen`,
but options, such as re-entrant error and warning handlers and a limit in byte
that libtiff internal memory allocation functions are allowed to request per call
may be passed with the *opts* argument. The *opts* argument may be NULL.
may be passed with the *opts* argument. The *opts* argument may be NULL.
Refer to :doc:`TIFFOpenOptions` for allocating and filling the *opts* argument
parameters. The allocated memory for :c:type:`TIFFOpenOptions`
can be released straight after successful execution of the related
@@ -130,6 +130,13 @@ memory; c.f. :c:func:`mmap` (2) and :c:func:`munmap` (2).
The *clientdata* parameter is an opaque "handle" passed to the client-specified
routines passed as parameters to :c:func:`TIFFClientOpen`.
.. note::
In contrast to the return values of :c:func:`mmap` (2) and :c:func:`munmap` (2),
the return values of *mapproc* and *unmapproc* must be:
TRUE for success and FALSE to indicate an error.
``libtiff`` built in functions :c:func:`_tiffMapProc` and :c:func:`_tiffUnmapProc`
can be found in tif_unix.c as well as in tif_win32.c.
:c:func:`TIFFClientOpenExt` (added in libtiff 4.5) is like :c:func:`TIFFClientOpen`,
but options argument *opts* like for :c:func:`TIFFOpenExt` can be passed.
+7
View File
@@ -24,6 +24,8 @@ Synopsis
.. c:function:: void TIFFOpenOptionsSetWarningHandlerExtR(TIFFOpenOptions* opts, TIFFErrorHandlerExtR handler, void* warnhandler_user_data)
.. c:function:: void TIFFOpenOptionsSetWarnAboutUnknownTags(TIFFOpenOptions *opts, int warn_about_unknown_tags)
Description
-----------
@@ -71,6 +73,11 @@ The *errorhandler_user_data* argument may be NULL.
:c:func:`TIFFOpenOptionsSetErrorHandlerExtR` but for the warning handler,
which is invoked through :c:func:`TIFFWarningExtR`
:c:func:`TIFFOpenOptionsSetWarnAboutUnknownTags` sets whether libtiff should
emit a warning when encountering a unknown tag. This function has been added in
libtiff 4.7.1 and the default value is FALSE (change of behaviour compared to
earlier versions).
Example
-------
+26 -5
View File
@@ -28,7 +28,7 @@ Description
The routines described here provide a high-level interface through which
TIFF images may be read into memory.
Images may be strip- or tile-based and have a variety of different
characteristics: bits/sample, samples/pixel, photometric, etc.
characteristics: bits/sample, samples/pixel, photometric, orientation, etc.
Decoding state is encapsulated in a :c:type:`TIFFRGBAImage`
structure making it possible to capture state for multiple images
and quickly switch between them.
@@ -59,7 +59,7 @@ If the raster dimensions are smaller than the image, the image data
is cropped to the raster bounds.
If the raster height is greater than that of the image, then the
image data are placed in the lower part of the raster.
(Note that the raster is assume to be organized such that the pixel
(Note that the raster is assumed to be organized such that the pixel
at location (*x*, *y*) is *raster* [ *y* × *width* + *x* ];
with the raster origin in the *lower-left hand corner*.)
@@ -87,7 +87,7 @@ Alternate raster formats
To use the core support for reading and processing TIFF images, but
write the resulting raster data in a different format one need only
override the "put methods" used to store raster data.
These methods are are defined in the :c:type:`TIFFRGBAImage`
These methods are defined in the :c:type:`TIFFRGBAImage`
structure and initially setup by :c:func:`TIFFRGBAImageBegin`
to point to routines that pack raster data in the default
ABGR pixel format.
@@ -144,16 +144,36 @@ Details of doing this are a bit involved, it is best to make a copy
of an existing get method and modify it to suit the needs of an
application.
.. _TIFFRGBAImage_Restriction_Notes:
Notes
-----
Samples must be either 1, 2, 4, 8, or 16 bits.
In C++ the *stopOnError* parameter defaults to 0.
``SamplesPerPixel`` must be either 1, 2, 4, 8, or 16 bits.
Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
``SamplesPerPixel`` -``ExtraSamples``).
``SamplesPerPixel`` minus ``ExtraSamples``).
Palette image colormaps that appear to be incorrectly written
as 8-bit values are automatically scaled to 16-bits.
Within the :c:type:`TIFFRGBAImage` structure the TIFF orientation
and also the required orientation in the raster can be defined.
However, the lower level :c:func:`TIFFRGBAImageGet` functions
- also called by :c:func:`TIFFReadRGBAImage` and :c:func:`TIFFReadRGBAImageOriented` -
can mirror the image orientations across both axes, but cannot rotate them.
Therefore, images with a TIFF orientation of 5 (LeftTop) to 8 (LeftBottom)
are not stored correctly in the raster, as this would require an additional
rotation of 90 degrees and an exchange of width and height dimension.
If an alpha channel is used in an image, there are two common representations
that are available: straight (unassociated) alpha and premultiplied (associated)
alpha, which is specified by the value of ExtraSamples tag.
For files with unassociated alpha, the :c:func:`TIFFRGBAImage` reading routines
multiply the RGB values by the alpha channel values before saving them in the raster.
The other TIFFReadxxx (like :c:func:`TIFFReadScanline`) functions do not do this.
Return values
-------------
@@ -231,4 +251,5 @@ See also
:doc:`TIFFReadRGBAImage` (3tiff),
:doc:`TIFFReadRGBAStrip` (3tiff),
:doc:`TIFFReadRGBATile` (3tiff),
:doc:`TIFFcolor` (3tiff),
:doc:`libtiff` (3tiff)
+1 -1
View File
@@ -10,7 +10,7 @@ Synopsis
#include <tiffio.h>
.. c:function:: int TIFFReadEncodedTile(TIFF* tif, ttile_t tile, tdata_t buf, tsize_t size)
.. c:function:: tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32_t tile, void *buf, tmsize_t size)
Description
-----------
+3 -9
View File
@@ -79,18 +79,12 @@ image have been requested.
Notes
-----
In C++ the *stopOnError* parameter defaults to 0.
``SamplesPerPixel`` must be either 1, 2, 4, 8, or 16 bits.
Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
``SamplesPerPixel`` minus ``ExtraSamples``).
Palettte image colormaps that appear to be incorrectly written
as 8-bit values are automatically scaled to 16-bits.
:c:func:`IFFReadRGBAImage` is just a wrapper around the more general
:doc:`TIFFRGBAImage` facilities.
For general notes see
:ref:`TIFFRGBImage notes <TIFFRGBAImage_Restriction_Notes>`.
Return values
-------------
+4 -8
View File
@@ -24,7 +24,7 @@ The raster is assumed to be an array of ``ImageWidth`` × ``RowsPerStrip``
(:c:macro:`TIFFTAG_IMAGEWIDTH`) and ``RowsPerStrip`` is the maximum lines
in a strip (:c:macro:`TIFFTAG_ROWSPERSTRIP`).
:c:func:`TIFFReadRGBAStripExt` provides the paramater `stop_on_error`.
:c:func:`TIFFReadRGBAStripExt` provides the parameter `stop_on_error`.
Its behaviour is described at :doc:`TIFFReadRGBAImage`.
The *row* value should be the row of the first row in the strip
@@ -48,13 +48,6 @@ are converted to RGBA values.
Notes
-----
Samples must be either 1, 2, 4, 8, or 16 bits.
Colorimetric samples/pixel must be either 1, 3, or 4 (i.e. ``SamplesPerPixel``
- ``ExtraSamples``).
Palette image colormaps that appear to be incorrectly written as 8-bit values
are automatically scaled to 16-bits.
:c:func:`TIFFReadRGBAStrip` is just a wrapper around the more general
:doc:`TIFFRGBAImage` facilities. It's main advantage over the similar
:c:func:`TIFFReadRGBAImage` function is that for large images a single
@@ -62,6 +55,9 @@ buffer capable of holding the whole image doesn't need to be allocated,
only enough for one strip. The :c:func:`TIFFReadRGBATile` function
does a similar operation for tiled images.
For general notes see
:ref:`TIFFRGBImage notes <TIFFRGBAImage_Restriction_Notes>`.
Return values
-------------
+3 -7
View File
@@ -50,13 +50,6 @@ types are converted to RGBA values.
Notes
-----
Samples must be either 1, 2, 4, 8, or 16 bits.
Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
``SamplesPerPixel`` - ``ExtraSamples``).
Palette image colormaps that appear to be incorrectly written as 8-bit
values are automatically scaled to 16-bits.
:c:func:`TIFFReadRGBATile` is just a wrapper around the more general
:doc:`TIFFRGBAImage` facilities. It's main advantage over the similar
:c:func:`TIFFReadRGBAImage` function is that for large images a single
@@ -64,6 +57,9 @@ buffer capable of holding the whole image doesn't need to be allocated,
only enough for one tile. The :c:func:`TIFFReadRGBAStrip` function
does a similar operation for stripped images.
For general notes see
:ref:`TIFFRGBImage notes <TIFFRGBAImage_Restriction_Notes>`.
Return values
-------------
+1 -1
View File
@@ -10,7 +10,7 @@ Synopsis
#include <tiffio.h>
.. c:function:: tsize_t TIFFReadRawStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size)
.. c:function:: tmsize_t TIFFReadRawStrip(TIFF* tif, uint32_t strip, void *buf, tmsize_t size)
Description
-----------
+1 -1
View File
@@ -10,7 +10,7 @@ Synopsis
#include <tiffio.h>
.. c:function:: tsize_t TIFFReadRawTile(TIFF* tif, ttile_t tile, tdata_t buf, tsize_t size)
.. c:function:: tmsize_t TIFFReadRawTile(TIFF* tif, uint32_t tile, void *buf, tmsize_t size)
Description
-----------
+1 -1
View File
@@ -10,7 +10,7 @@ Synopsis
#include <tiffio.h>
.. c:function:: int TIFFReadScanline(TIFF* tif, tdata_t buf, uint32_t row, tsample_t sample)
.. c:function:: int TIFFReadScanline(TIFF* tif, void *buf, uint32_t row, uint16_t sample)
Description
-----------
+1 -1
View File
@@ -10,7 +10,7 @@ Synopsis
#include <tiffio.h>
.. c:function:: tsize_t TIFFReadTile(TIFF* tif, tdata_t buf, uint32_t x, uint32_t y, uint32_t z, tsample_t sample)
.. c:function:: tmsize_t TIFFReadTile(TIFF* tif, void *buf, uint32_t x, uint32_t y, uint32_t z, uint16_t sample)
Description
-----------
+1 -1
View File
@@ -22,7 +22,7 @@ contents with :c:func:`TIFFReadDirectory`. The parameter *dirnum*
specifies the subfile/directory as an integer number, with the first
directory numbered zero.
:c:func:`TIFFSetDirectory()` only works with main-IFD chains because
allways starts with the first main-IFD and thus is able to reset
always starts with the first main-IFD and thus is able to reset
the SubIFD reading chain to the main-IFD chain.
:c:func:`TIFFSetSubDirectory` acts like :c:func:`TIFFSetDirectory`,
+2 -2
View File
@@ -11,9 +11,9 @@ Synopsis
#include <tiffio.h>
#include <stdarg.h>"
.. c:function:: int TIFFSetField(TIFF* tif, ttag_t tag, ...)
.. c:function:: int TIFFSetField(TIFF* tif, uint32_t tag, ...)
.. c:function:: int TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap)
.. c:function:: int TIFFVSetField(TIFF* tif, uint32_t tag, va_list ap)
.. c:function:: int TIFFUnsetField(TIFF* tif, uint32_t tag)
+1 -1
View File
@@ -27,7 +27,7 @@ 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) :c:func:`TIFFOpen` flag,
the loading of strile offset/bytecount is defered.
the loading of strile offset/bytecount is deferred.
In that mode, the ``StripOffsets`` / ``StripByteCounts`` or
``TileOffsets`` / ``TileByteCounts`` arrays are only loaded when first
accessed. This can speed-up the opening of files stored on the network
+5 -1
View File
@@ -65,6 +65,9 @@ or :c:func:`TIFFClientOpenExt`.
Furthermore, a **custom defined data structure** *user_data* for the
warning handler can be given along.
Please refer to :doc:`/functions/TIFFOpenOptions` for how to setup the
application-specific handler introduced with ``libtiff`` 4.5.
Note
----
@@ -87,7 +90,7 @@ Return values
returns a reference to the previous warning handler function.
:c:func:`TIFFWarningHandlerExtR` returns an integer as "stop" to control the call
of furhter warning handler functions within :c:func:`TIFFWarningExtR`:
of further warning handler functions within :c:func:`TIFFWarningExtR`:
- 0: both functions :c:func:`TIFFWarningHandler` and :c:func:`TIFFWarningHandlerExt` are called.
- non-zero: no further warning message function is called.
@@ -97,5 +100,6 @@ See also
:doc:`TIFFError` (3tiff),
:doc:`TIFFOpen` (3tiff),
:doc:`/functions/TIFFOpenOptions`,
:doc:`libtiff` (3tiff),
printf (3)
+3 -1
View File
@@ -57,7 +57,9 @@ is incomplete, but you will at least get all the valid data in the file
before that. When the file is complete, just use
:c:func:`TIFFWriteDirectory` as usual to finish it off cleanly.
The :c:func:`TIFFSetWriteOffset` sets the current write offset.
The :c:func:`TIFFSetWriteOffset` sets the current write offset for image data
(i.e.pixels). The offset for writing the directory (:ref:`IFD <ImageFileDirectory>`)
data is not affected.
This should only be used to set the offset to a known previous location
(very carefully), or to 0 so that the next write gets appended to the end
of the file.
+1 -1
View File
@@ -10,7 +10,7 @@ Synopsis
#include <tiffio.h>
.. c:function:: tsize_t TIFFWriteEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size)
.. c:function:: tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32_t strip, void *buf, tmsize_t size)
Description
-----------
+1 -1
View File
@@ -10,7 +10,7 @@ Synopsis
#include <tiffio.h>
.. c:function:: tsize_t TIFFWriteEncodedTile(TIFF* tif, ttile_t tile, tdata_t buf, tsize_t size)
.. c:function:: tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32_t tile, void *buf, tmsize_t size)
Description
-----------
+1 -1
View File
@@ -10,7 +10,7 @@ Synopsis
#include <tiffio.h>
.. c:function:: tsize_t TIFFWriteRawStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size)
.. c:function:: tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32_t strip, void *buf, tmsize_t size)
Description
-----------
+1 -1
View File
@@ -10,7 +10,7 @@ Synopsis
#include <tiffio.h>
.. c:function:: tsize_t TIFFWriteRawTile(TIFF* tif, ttile_t tile, tdata_t buf, tsize_tsize)
.. c:function:: tmsize_t TIFFWriteRawTile(TIFF* tif, uint32_t tile, void *buf, tmsize_t size)
Description
-----------
+1 -1
View File
@@ -10,7 +10,7 @@ Synopsis
#include <tiffio.h>
.. c:function:: int TIFFWriteScanline(TIFF* tif, tdata_t buf, uint32_t row, tsample_t sample)
.. c:function:: int TIFFWriteScanline(TIFF* tif, void *buf, uint32_t row, uint16_t sample)
Description
-----------
+1 -1
View File
@@ -12,7 +12,7 @@ Synopsis
TIFFWriteTile \- encode and write a tile of data to an open TIFF file
.. c:function:: tsize_t TIFFWriteTile(TIFF* tif, tdata_t buf, uint32_t x, uint32_t y, uint32_t z, tsample_t sample)
.. c:function:: tmsize_t TIFFWriteTile(TIFF* tif, void *buf, uint32_t x, uint32_t y, uint32_t z, uint16_t sample)
Description
-----------
+2 -2
View File
@@ -11,8 +11,8 @@ Synopsis
#include <tiffio.h>
.. c:function:: int TIFFReadBufferSetup(TIFF* tif, tdata_t buffer, tsize_t size)
.. c:function:: int TIFFWriteBufferSetup(TIFF* tif, tdata_t buffer, tsize_t size)
.. c:function:: int TIFFReadBufferSetup(TIFF* tif, void *buffer, tmsize_t size)
.. c:function:: int TIFFWriteBufferSetup(TIFF* tif, void *buffer, tmsize_t size)
Description
-----------
+11 -4
View File
@@ -31,9 +31,16 @@ itself. In particular, these routines used in the :doc:`TIFFRGBAImage`
interface.
:c:func:`TIFFYCbCrToRGBInit` used to initialize *YCbCr* to *RGB*
conversion state. Allocating and freeing of the *ycbcr* structure
belongs to programmer. :c:struct:`TIFFYCbCrToRGB` is defined in
:file:`tiffio.h` as:
conversion state.
.. note::
The calling program is responsible for allocating and releasing the required
buffer for the structure :c:struct:`TIFFYCbCrToRGB` and its required tables,
pointed to by *ycbcr*. The pointers to these tables are stored in the
structure :c:struct:`TIFFYCbCrToRGB`, which is located at the beginning
of that buffer. Thus, this memory has to be allocated as shown in the example below.
:c:struct:`TIFFYCbCrToRGB` is defined in :file:`tiffio.h` as:
::
@@ -64,7 +71,7 @@ understand the the technique:
uint16_t hs, vs;
/* Initialize structures */
ycbcr = (TIFFYCbCrToRGB*)
TIFFYCbCrToRGB *ycbcr = (TIFFYCbCrToRGB*)
_TIFFmalloc(TIFFroundup(sizeof(TIFFYCbCrToRGB), sizeof(long))
+ 4*256*sizeof(TIFFRGBValue)
+ 2*256*sizeof(int)
+6 -6
View File
@@ -10,17 +10,17 @@ Synopsis
#include <tiffio.h>
.. c:function:: tdata_t _TIFFmalloc(tsize_t size)
.. c:function:: void *_TIFFmalloc(tmsize_t size)
.. c:function:: tdata_t _TIFFrealloc(tdata_t buffer, tsize_t size)
.. c:function:: void *_TIFFrealloc(void *buffer, tmsize_t size)
.. c:function:: void _TIFFfree(tdata_t buffer)
.. c:function:: void _TIFFfree(void *buffer)
.. c:function:: void _TIFFmemset(tdata_t s, int c, tsize_t n)
.. c:function:: void _TIFFmemset(void *s, int c, tmsize_t n)
.. c:function:: void _TIFFmemcpy(tdata_t dest, const tdata_t src, tsize_t n)
.. c:function:: void _TIFFmemcpy(void *dest, const void *src, tmsize_t n)
.. c:function:: int _TIFFmemcmp(const tdata_t s1, const tdata_ts2, tsize_t n)
.. c:function:: int _TIFFmemcmp(const void *s1, const void *s2, tmsize_t n)
.. c:function:: void* _TIFFCheckMalloc(TIFF* tif, tmsize_t nmemb, tmsize_t elem_size, const char* what)
+2 -2
View File
@@ -20,9 +20,9 @@ Synopsis
.. c:function:: uint32_t TIFFCurrentRow(TIFF* tif)
.. c:function:: tstrip_t TIFFCurrentStrip(TIFF* tif)
.. c:function:: uint32_t TIFFCurrentStrip(TIFF* tif)
.. c:function:: ttile_t TIFFCurrentTile(TIFF* tif)
.. c:function:: uint32_t TIFFCurrentTile(TIFF* tif)
.. c:function:: int TIFFFileno(TIFF* tif)
+2 -2
View File
@@ -10,11 +10,11 @@ Synopsis
#include <tiffio.h>
.. c:function:: tsize_t TIFFRasterScanlineSize(TIFF* tif)
.. c:function:: tmsize_t TIFFRasterScanlineSize(TIFF* tif)
.. c:function:: uint64_t TIFFRasterScanlineSize64(TIFF* tif)
.. c:function:: tsize_t TIFFScanlineSize(TIFF* tif)
.. c:function:: tmsize_t TIFFScanlineSize(TIFF* tif)
.. c:function:: uint64_t TIFFScanlineSize64(TIFF* tif)
+2 -2
View File
@@ -24,9 +24,9 @@ Synopsis
.. c:function:: uint64_t TIFFRawStripSize64(TIFF* tif, uint32_t strip)
.. c:function:: tstrip_t TIFFComputeStrip(TIFF* tif, uint32_t row, tsample_t sample)
.. c:function:: uint32_t TIFFComputeStrip(TIFF* tif, uint32_t row, uint16_t sample)
.. c:function:: tstrip_t TIFFNumberOfStrips(TIFF* tif)
.. c:function:: uint32_t TIFFNumberOfStrips(TIFF* tif)
.. c:function:: int TIFFSetupStrips(TIFF* tif)
+6 -6
View File
@@ -12,23 +12,23 @@ Synopsis
.. c:function:: void TIFFDefaultTileSize(TIFF* tif, uint32_t* tw, uint32_t* th)
.. c:function:: tsize_t TIFFTileSize(TIFF* tif)
.. c:function:: tmsize_t TIFFTileSize(TIFF* tif)
.. c:function:: uint64_t TIFFTileSize64(TIFF* tif)
.. c:function:: tsize_t TIFFTileRowSize(TIFF* tif)
.. c:function:: tmsize_t TIFFTileRowSize(TIFF* tif)
.. c:function:: uint64_t TIFFTileRowSize64(TIFF* tif)
.. c:function:: tsize_t TIFFVTileSize(TIFF* tif, uint32_t nrows)
.. c:function:: tmsize_t TIFFVTileSize(TIFF* tif, uint32_t nrows)
.. c:function:: uint64_t TIFFVTileSize64(TIFF* tif, uint32_t nrows)
.. c:function:: ttile_t TIFFComputeTile(TIFF* tif, uint32_t x, uint32_t y, uint32_t z, tsample_t sample)
.. c:function:: uint32_t TIFFComputeTile(TIFF* tif, uint32_t x, uint32_t y, uint32_t z, uint16_t sample)
.. c:function:: int TIFFCheckTile(TIFF* tif, uint32_t x, uint32_t y, uint32_t z, tsample_t sample)
.. c:function:: int TIFFCheckTile(TIFF* tif, uint32_t x, uint32_t y, uint32_t z, uint16_t sample)
.. c:function:: ttile_t TIFFNumberOfTiles(TIFF* tif)
.. c:function:: uint32_t TIFFNumberOfTiles(TIFF* tif)
Description
-----------
+22 -11
View File
@@ -55,6 +55,8 @@ fields are defined differently on a per-sample basis
``Compression``
tag is not defined on a per-sample basis, so this is immaterial).
.. _DataTypes:
Data types
----------
@@ -69,16 +71,25 @@ definitions or through parameters passed through the varargs interfaces.
::
typedef uint32_t ttag_t; // directory tag
typedef uint32_t tdir_t; // directory index
typedef uint16_t tsample_t; // sample number
typedef uint32_t tstrip_t; // strip number
typedef uint32_t ttile_t; // tile number
typedef int64_t tmsize_t; // signed size type (int32_t on 32-bit platforms)
typedef tmsize_t tsize_t; // i/o size in bytes
typedef void* tdata_t; // image data ref
typedef void* thandle_t; // client data handle
typedef uint64_t toff_t; // file offset
typedef int64_t tmsize_t; /* signed size type (int32_t on 32-bit platforms) */
typedef void* thandle_t; /* client data handle */
typedef uint64_t toff_t; /* file offset */
typedef uint32_t tdir_t; /* directory index */
The following typedefs are deprecated and should be replaced by their
defining counterparts.
.. highlight:: c
::
typedef uint32_t ttag_t; /* directory tag */
typedef uint16_t tsample_t; /* sample number */
typedef uint32_t tstrile_t; /* strip or tile number */
typedef tstrile_t tstrip_t; /* strip number */
typedef tstrile_t ttile_t; /* tile number */
typedef tmsize_t tsize_t; /* i/o size in bytes */
typedef void *tdata_t; /* image data ref */
Note that
:c:type:`tstrip_t`,
@@ -534,7 +545,7 @@ will work.
* - :c:func:`TIFFYCbCrToRGBInit`
- initialize YCbCr to RGB conversion state
.. list-table:: *Libtiff auxillary functions*
.. list-table:: *Libtiff auxiliary functions*
:widths: 5 20
:header-rows: 1
+2 -1
View File
@@ -13,7 +13,8 @@ The images are kept in a separate archive that should be located in
the same directory as this software.
The latest archive of test images is located at
`<https://download.osgeo.org/libtiff/pics-3.8.0.tar.gz>`_.
`<https://download.osgeo.org/libtiff/pics-3.8.0.tar.gz>`_,
or at `<https://gitlab.com/libtiff/libtiff-pics>`_.
There are two other good sources for TIFF test images:
the contributed software :file:`contrib/dbs` includes several
+1 -2
View File
@@ -10,11 +10,10 @@ LibTIFF - TIFF Library and Utilities
===================== =====================================
Home Page #1 http://www.simplesystems.org/libtiff/
Home Page #2 https://libtiff.gitlab.io/libtiff/
Latest Stable Release v4.7.0
Latest Stable Release v4.7.1
Primary Download Site `download.osgeo.org <https://download.osgeo.org/libtiff/>`_
Mailing List `tiff@lists.osgeo.org <tiff@lists.osgeo.org>`_
List subscription http://lists.osgeo.org/mailman/listinfo/tiff/
List archive http://www.awaresystems.be/imaging/tiff/tml.html
Source repository https://gitlab.com/libtiff/libtiff
===================== =====================================
+59 -97
View File
@@ -63,8 +63,9 @@ Support for JPEG compression is controlled by :c:macro:`JPEG_SUPPORT`.
The JPEG codec that comes with LibTIFF is designed for
use with release 5 or later of the Independent JPEG Group's freely
available software distribution.
This software can be retrieved from the directory
`<ftp://ftp.uu.net/graphics/jpeg>`_.
This software can be retrieved from
`<https://ijg.org/>`_ or as an alternative from `<https://libjpeg-turbo.org/>`_.
.. note::
@@ -76,23 +77,22 @@ Experimental support for the deflate algorithm is controlled by
The deflate codec that comes with LibTIFF is designed
for use with version 0.99 or later of the freely available
``libz`` library written by Jean-loup Gailly and Mark Adler.
The data format used by this library is described
in the files
`<ftp://ftp.uu.net/pub/archiving/zip/doc/zlib-3.1.doc>`_,
and
`<ftp://ftp.uu.net/pub/archiving/zip/doc/deflate-1.1.doc>`_,
available in the directory
`<ftp://ftp.uu.net/pub/archiving/zip/doc>`_..
The library can be retried from the directory
`<ftp://ftp.uu.net/pub/archiving/zip/zlib>`_
(or try `<ftp://quest.jpl.nasa.gov/beta/zlib/>`_).
.. warning::
The data format used by the zlib library is described by RFCs (Request for
Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
(zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
**The deflate algorithm is experimental. Do not expect
to exchange files using this compression scheme;
it is included only because the similar, and more common,
LZW algorithm is claimed to be governed by licensing restrictions.**
The ``libz`` library can be fetched from `<https://www.zlib.net/>`_,
and ``libdeflate`` from `<https://github.com/ebiggers/libdeflate>`_
Other codec libraries supported by LibTIFF are:
* JBIG: `<https://www.cl.cam.ac.uk/~mgk25/jbigkit/>`_
* ESRI Lerc: `<https://github.com/Esri/lerc>`_
* LZMA2: `<https://tukaani.org/xz/>`_
* | ZSTD: info at `<https://facebook.github.io/zstd/>`_
| and can be retrieved from `<https://github.com/facebook/zstd>`_
* WebP: `<https://developers.google.com/speed/webp>`_
By default :file:`tiffconf.h` defines
:c:macro:`COLORIMETRY_SUPPORT`,
@@ -100,7 +100,6 @@ By default :file:`tiffconf.h` defines
and
:c:macro:`CMYK_SUPPORT`.
.. list-table:: :file:`tiffconf.h` defines
:widths: 5 20
:header-rows: 1
@@ -125,18 +124,49 @@ and
* - :c:macro:`OJPEG_SUPPORT`
- obsolete JPEG scheme defined in the 6.0 spec (compression 6)
(requires JPEG library with old JPEG support)
* - :c:macro:`JPEG_SUPPORT`
- current JPEG scheme defined in TTN2 (compression 7)
(requires JPEG library)
* - :c:macro:`JBIG_SUPPORT`
- current JBIG (compression 9=T85, 10=43 and 34661=ISO)
(requires JBIG-KIT library)
* - :c:macro:`LERC_SUPPORT`
- current LERC (compression 34887)
(requires LERC and Zlib library)
* - :c:macro:`ZIP_SUPPORT`
- experimental Deflate scheme (compression 32946)
(requires Zlib)
* - :c:macro:`LIBDEFLATE_SUPPORT`
- support libdeflate enhanced compression (compression 32946)
(requires libdeflate and Zlib)
* - :c:macro:`LZMA_SUPPORT`
- Lempel–Ziv–Markov chain algorithm (LZMA2) (compression 34925)
(requires liblzma)
* - :c:macro:`ZSTD_SUPPORT`
- ZStandard (ZSTD) deflate like scheme
(compression 50000 - not registered in Adobe-maintained registry)
(requires zstd library)
* - :c:macro:`WEBP_SUPPORT`
- WebP raster graphic compression support
(compression 50001 - not registered in Adobe-maintained registry)
(requires webp library)
* - :c:macro:`PIXARLOG_SUPPORT`
- Pixar's compression scheme for high-resolution color images (compression 32909)
- Pixar's compression scheme for high-resolution color images
(compression 32909) (requires Zlib)
* - :c:macro:`SGILOG_SUPPORT`
- SGI's compression scheme for high-resolution color images (compression 34676 and 34677)
- SGI's compression scheme for high-resolution color images
(compression 34676 and 34677)
* - :c:macro:`COLORIMETRY_SUPPORT`
- support for the TIFF 6.0 colorimetry tags
@@ -275,86 +305,18 @@ purely by fiddling with the following machine-dependent typedefs:
- 32-bit signed integer
- :file:`tiff.h`
* - :c:type:`dblparam_t`
- promoted type for floats
- :file:`tiffcomp.h`
* - :c:type:`uint64_t`
- 64-bit unsigned integer
- :file:`tiff.h`
(to clarify :c:type:`dblparam_t`, it is the type that float parameters are
promoted to when passed by value in a function call.)
The following typedefs are used throughout the library and interfaces
to refer to certain objects whose size is dependent on the TIFF image
structure:
.. list-table:: TIFF image typedefs
:widths: 10 10 10
:header-rows: 1
* - Typedef
- Type
- Description
* - :c:type:`int64_t`
- 64-bit signed integer
- :file:`tiff.h`
* - :c:type:`ttag_t`
- :c:expr:`unsigned int`
- directory tag
* - :c:type:`tdir_t`
- :c:type:`uint16_t`
- directory index
* - :c:type:`tsample_t`
- :c:type:`uint16_t`
- sample number
* - :c:type:`tstrip_t`
- :c:type:`uint32_t`
- strip number
* - :c:type:`ttile_t`
- :c:type:`uint32_t`
- tile number
* - :c:type:`tsize_t`
- :c:type:`int32_t`
- i/o size in bytes
* - :c:type:`tdata_t`
- :c:expr:`void *`
- image data ref
* - :c:type:`thandle_t`
- :c:expr:`void *`
- client data handle
* - :c:type:`toff_t`
- :c:type:`int32_t`
- file offset (should be off_t)
* - :c:type:`tidata_t`
- :c:expr:`unsigned char *`
- internal image data
Note that :c:type:`tstrip_t`, :c:type:`ttile_t`, and :c:type:`tsize_t`
are constrained to be
no more than 32-bit quantities by 32-bit fields they are stored
in in the TIFF image. Likewise :c:type:`tsample_t` is limited by the 16-bit
field used to store the ``SamplesPerPixel`` tag. :c:type:`tdir_t`
constrains
the maximum number of IFDs that may appear in an image and may
be an arbitrary size (without penalty). :c:type:`ttag_t` must be either
:c:expr:`int`, :c:expr:`unsigned int`, pointer, or :c:expr:`double`
because the library uses a varargs
interface and ANSI C restricts the type of the parameter before an
ellipsis to be a promoted type. :c:type:`toff_t` is defined as
:c:type:`int32_t` because
TIFF file offsets are (unsigned) 32-bit quantities. A signed
value is used because some interfaces return -1 on error (sigh).
Finally, note that :c:type:`tidata_t` is used internally to the library to
manipulate internal data. User-specified data references are
passed as opaque handles and only cast at the lowest layers where
their type is presumed.
Most of the previously used type definitions that refer to
specific objects are deprecated.
For more information about typedefs see :ref:`Data Types <DataTypes>`.
General Comments
----------------
+57 -26
View File
@@ -30,14 +30,6 @@ Detailed information on the interfaces to the library are given in
the :doc:`functions` that accompany this software.
An alphabetic list of all the public functions with a brief description can be found at :ref:`list_of_routines`
.. warning::
The following hyperlink does no more work, at least no libtiff introduction:
Michael Still has also written a useful introduction to libtiff for the
IBM DeveloperWorks site available at
`<http://www.ibm.com/developerworks/linux/library/l-libtiff>`_.
How to tell which version you have
----------------------------------
@@ -492,7 +484,7 @@ is assumed to be organized in strips, the following might be used:
TIFF* tif = TIFFOpen("myfile.tif", "r");
if (tif) {
uint32_t imagelength;
tdata_t buf;
void *buf;
uint32_t row;
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &imagelength);
@@ -519,7 +511,7 @@ to handle either case one might use the following instead:
TIFF* tif = TIFFOpen("myfile.tif", "r");
if (tif) {
uint32_t imagelength;
tdata_t buf;
void *buf;
uint32_t row;
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &imagelength);
@@ -528,10 +520,10 @@ to handle either case one might use the following instead:
if (config == PLANARCONFIG_CONTIG) {
for (row = 0; row < imagelength; row++)
TIFFReadScanline(tif, buf, row, 0);
} else if (config == planarconfig_separate) {
} else if (config == PLANARCONFIG_SEPARATE) {
uint16_t s, nsamples;
tiffgetfield(tif, tifftag_samplesperpixel, &nsamples);
TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &nsamples);
for (s = 0; s < nsamples; s++)
for (row = 0; row < imagelength; row++)
TIFFReadScanline(tif, buf, row, s);
@@ -574,12 +566,12 @@ A simple example of reading an image by strips is:
{
TIFF* tif = TIFFOpen("myfile.tif", "r");
if (tif) {
tdata_t buf;
tstrip_t strip;
void *buf;
uint32_t strip;
buf = _TIFFmalloc(TIFFStripSize(tif));
for (strip = 0; strip < tiffnumberofstrips(tif); strip++)
tiffreadencodedstrip(tif, strip, buf, (tsize_t) -1);
for (strip = 0; strip < TIFFNumberOfStrips(tif); strip++)
TIFFReadEncodedStrip(tif, strip, buf, (tmsize_t) -1);
_TIFFfree(buf);
TIFFClose(tif);
}
@@ -609,15 +601,15 @@ a file:
{
TIFF* tif = TIFFOpen("myfile.tif", "r");
if (tif) {
tdata_t buf;
tstrip_t strip;
uint32_t* bc;
void *buf;
uint32_t strip;
uint32_t *bc;
uint32_t stripsize;
TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc);
stripsize = bc[0];
buf = _TIFFmalloc(stripsize);
for (strip = 0; strip < tiffnumberofstrips(tif); strip++) {
for (strip = 0; strip < TIFFNumberOfStrips(tif); strip++) {
if (bc[strip] > stripsize) {
buf = _TIFFrealloc(buf, bc[strip]);
stripsize = bc[strip];
@@ -666,7 +658,7 @@ code of the following sort might be used:
uint32_t imageWidth, imageLength;
uint32_t tileWidth, tileLength;
uint32_t x, y;
tdata_t buf;
void *buf;
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &imageWidth);
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &imageLength);
@@ -675,7 +667,7 @@ code of the following sort might be used:
buf = _TIFFmalloc(TIFFTileSize(tif));
for (y = 0; y < imagelength; y += tilelength)
for (x = 0; x < imagewidth; x += tilewidth)
tiffreadtile(tif, buf, x, y, 0);
TIFFReadTile(tif, buf, x, y, 0);
_TIFFfree(buf);
TIFFClose(tif);
}
@@ -696,17 +688,56 @@ and written with :c:func:`TIFFWriteEncodedTile` or
{
TIFF* tif = TIFFOpen("myfile.tif", "r");
if (tif) {
tdata_t buf;
ttile_t tile;
void *buf;
uint32_t tile;
buf = _TIFFmalloc(TIFFTileSize(tif));
for (tile = 0; tile < tiffnumberoftiles(tif); tile++)
tiffreadencodedtile(tif, tile, buf, (tsize_t) -1);
for (tile = 0; tile < TIFFNumberOfTiles(tif); tile++)
TIFFReadEncodedTile(tif, tile, buf, (tmsize_t) -1);
_TIFFfree(buf);
TIFFClose(tif);
}
}
Re-entrancy and Thread Safety
-----------------------------
``Libtiff`` contains no static state except for the registered error /
warning handler.
All data for an opened TIFF file is encapsulated via the TIFF handle
returned by :c:func:`TIFFOpen`. Only the error handlers
:c:func:`TIFFError` and :c:func:`TIFFErrorExt`,
(as well as :c:func:`TIFFWarning` and :c:func:`TIFFWarningExt`)
use TIFF handle independent, common error handler functions.
:c:func:`TIFFErrorHandlerExtR` and :c:func:`TIFFWarningHandlerExtR`
(introduced in ``libtiff`` 4.5) offer the option of registering
a separate error handler for each TIFF handle.
This error handler is called via the TIFF handle and is therefore
re-entrant, which means that it is naturally thread-safe.
These handlers can already be set before opening a TIFF file using the
:c:func:`TIFFOpenOptionsSetErrorHandlerExtR` and
:c:func:`TIFFOpenOptionsSetWarningHandlerExtR` functions, respectively.
This allows multiple TIFF files to be processed simultaneously
with multiple threads, with each thread having its own TIFF file.
It is not possible (safe) to edit a single TIFF file with multiple
threads at the same time.
Multi Page / Multi Image TIFF
-----------------------------
TIFF images can contain more than one image or page and each image can
have sub-images. Furthermore, additional information about an image
can be put into *custom* TIFF directories, such as EXIF or GPS.
Writing TIFF files with more than one directory (IFD) is not easy
because some side effects need to be known.
How to read and write multi page TIFF files using ``libtiff`` is explained
in :doc:`/multi_page`.
For custom directories refer to :doc:`/functions/TIFFCustomDirectory`.
Other Stuff
-----------
+2 -2
View File
@@ -18,7 +18,7 @@ There are two mechanisms for storing multiple images in a TIFF file:
- such as a subsampled version of the parent image.
SubIFD chains are rarely supported.
For SubIFD refer also to
`Adobe PageMaker® 6.0 TIFF Technical Notes <https://www.awaresystems.be/imaging/tiff/specification/TIFFPM6.pdf>`_
`Adobe PageMaker® 6.0 TIFF Technical Notes <https://download.osgeo.org/libtiff/doc/TIFFPM6.pdf>`_
.. _SubIFDAccess:
@@ -209,5 +209,5 @@ See also
:doc:`terms`,
:doc:`/functions/TIFFSetDirectory` (3tiff),
:doc:`/functions/TIFFWriteDirectory` (3tiff),
`Adobe PageMaker® 6.0 TIFF Technical Notes <https://www.awaresystems.be/imaging/tiff/specification/TIFFPM6.pdf>`_,
`Adobe PageMaker® 6.0 TIFF Technical Notes <https://download.osgeo.org/libtiff/doc/TIFFPM6.pdf>`_,
`Example from StackOverflow <https://stackoverflow.com/questions/11959617/in-a-tiff-create-a-sub-ifd-with-thumbnail-libtiff>`_
+1 -1
View File
@@ -19,7 +19,7 @@ Previously, the project used
to track bugs. All remaining tickets in that bugzilla instance were
migrated to GitLab issues, and this system should no longer be used.
All bugs filed in a older bugzilla at
`RemoteSensing.org <http://bugzilla.remotesensing.org/>`_ (pre-April 2008)
'RemoteSensing.org (bugzilla.remotesensing.org)' (pre-April 2008)
have unfortunately been lost.
+6 -4
View File
@@ -21,7 +21,9 @@ Posts to the list are only accepted from members of the list.
Archive
-------
A `Long Term Archive <http://www.awaresystems.be/imaging/tiff/tml.html>`_
including recent messages, and most messages back to 1993,
with search capabilities is available. This archive has been prepared
and hosted by `AWare Systems <http://www.awaresystems.be>`_.
A Long Term Archive
including most messages from April 2024 back to 1993 has been archived in a text file archive
that can be download: `TML.zip <https://download.osgeo.org/libtiff/old/TML.zip>`_
or `TML.tar.xz <https://download.osgeo.org/libtiff/old/TML.tar.xz>`_.
There is no archive for the mailing list messages anymore.
+1 -2
View File
@@ -14,6 +14,5 @@ As of April 2024, the project has been placed in the hands of a Project Steering
- Even Rouault (@rouault)
Note that discussion of proposals to the PSC take place on the libtiff mailing list
(tiff@lists.osgeo.org, requiring subscription at https://lists.osgeo.org/mailman/listinfo/tiff,
archived at https://www.awaresystems.be/imaging/tiff/tml.html),
(tiff@lists.osgeo.org, requiring subscription at https://lists.osgeo.org/mailman/listinfo/tiff),
and input from all subscribers is welcome. A list of past :ref:`rfcs` is available for review.
+1
View File
@@ -7,6 +7,7 @@ LibTIFF releases.
:maxdepth: 1
:titlesonly:
v4.7.1
v4.7.0
v4.6.0
v4.5.1
+1 -1
View File
@@ -67,5 +67,5 @@ Contributed software changes
* :file:`contrib/dbs/xtiff` was made to compile
* :file:`contrib/mac-mpw` is new support for compiling the software on
a Macintosh under MPW
* :file:`contrib/tags` is information on how to use the tag extenion
* :file:`contrib/tags` is information on how to use the tag extension
facilities; consult :file:`contrib/tags/README` for details
+1 -1
View File
@@ -48,7 +48,7 @@ Library changes
* Fixes to avoid undefined behaviour of signed types (C
standard compliance).
* Fixes to avoid possible isses when casting to unsigned char.
* Fixes to avoid possible issues when casting to unsigned char.
* Fixes to avoid undefined behaviour with shifts.
* Fix generation of output with 16 bit or 32 bit integer, when
byte swapping is needed, in horizontal predictor (:bugzilla:`2521`).
+1 -1
View File
@@ -342,7 +342,7 @@ Tools changes
* :file:`tools/tiffdump.c` (:c:func:`ReadDirectory`): Remove :c:type:`uint32` cast to
:c:func:`_TIFFmalloc` argument which resulted in Coverity report.
Added more mutiplication overflow checks.
Added more multiplication overflow checks.
Contributed software changes
----------------------------
+2 -2
View File
@@ -245,13 +245,13 @@ Library changes
* :file:`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
is needed to properly work with the latest changes in
tif_read.c in CHUNKY_STRIP_READ_SUPPORT mode.
* :file:`libtiff/tif_pixarlog.c`: :c:func:`PixarLogDecode`: resync :c:member:`tif_rawcp`
with :c:member:`next_in` and :c:member:`tif_rawcc` with :c:member:`avail_in` at beginning and end
of function, similarly to what is done in :c:func:`LZWDecode`. Likely
needed so that it works properly with latest chnges in
needed so that it works properly with latest changes in
:file:`tif_read.c` in :c:macro:`CHUNKY_STRIP_READ_SUPPORT` mode. But untested...
* :file:`libtiff/tif_getimage.c`: :c:func:`initYCbCrConversion`: add basic
+1 -1
View File
@@ -77,7 +77,7 @@ Tools changes
* :program:`tiffsplit`: exit with :c:macro:`EXIT_FAILURE` if there are extra args on the command line
* :program:`tiffcmp`: fix comparaison with pixels that are fractional number of bytes (#53)
* :program:`tiffcmp`: fix comparison with pixels that are fractional number of bytes (#53)
Contributed software changes
----------------------------
+1 -1
View File
@@ -44,7 +44,7 @@ New/improved functionalities:
* :c:func:`TIFFIsBigTiff` function added.
* Functions :c:func:`TIFFFieldSetGetSize` and :c:func:`TIFFieldSetGetCountSize` added.
* :c:func:`LZWDecode`: major speed improvements (~30% faster)
* Predictor 2 (horizontal differenciation): support 64-bit
* Predictor 2 (horizontal differentiation): support 64-bit
* Support libjpeg 9d
Bug fixes:
+2 -2
View File
@@ -96,7 +96,7 @@ Bug fixes:
* tif_ojpeg.c: checking for division by zero (fixes :issue:`554`).
* LZWDecode(): avoid crash when trying to read again from a strip whith
* LZWDecode(): avoid crash when trying to read again from a strip with
a missing end-of-information marker (fixes :issue:`548`).
* Fixed runtime error: applying zero offset to null pointer
@@ -126,7 +126,7 @@ Bug fixes:
* :file:`tif_ojpeg.c`: fix :issue:`554` by checking for division by zero
in OJPEGWriteHeaderInfo().
* LZWDecode(): avoid crash when trying to read again from a strip whith
* LZWDecode(): avoid crash when trying to read again from a strip with
a missing end-of-information marker (:issue:`548`).
Documentation
+1 -1
View File
@@ -189,7 +189,7 @@ Bug fixes:
- thumbnail: address Coverity scan issues
- tiffcp: Add check for limitMalloc return to fix Coverity 1603334
- tiffcp: preserve TIFFTAG_REFERENCEBLACKWHITE when doing YCbCr JPEG -> YCbCr JPEG
- tiffcp: replace PHOTOMETRIC_YCBCR with PHOTOMETRIC_RGB when outputing to compression != JPEG (refs :issue:`571`)
- tiffcp: replace PHOTOMETRIC_YCBCR with PHOTOMETRIC_RGB when outputting to compression != JPEG (refs :issue:`571`)
- tiffcp: do not copy tags YCBCRCOEFFICIENTS, YCBCRSUBSAMPLING, YCBCRPOSITIONING,
REFERENCEBLACKWHITE. Only set YCBCRSUBSAMPLING when generating YCbCr JPEG
- tiffcp: Check also codec of input image, not only from output image (fixes :issue:`606`)
+273
View File
@@ -0,0 +1,273 @@
Changes in TIFF v4.7.1
======================
.. table:: References
:widths: auto
====================== ==========================================
Current Version v4.7.1 (:tag:`v4.7.1`)
Previous Version :doc:`v4.7.0 <v4.7.0>`
Primary Download Site `<https://download.osgeo.org/libtiff/>`_
Home HTTP Site #1 `<http://www.simplesystems.org/libtiff/>`_
Home HTTP Site #2 `<https://libtiff.gitlab.io/libtiff/>`_
====================== ==========================================
This document provides a summary of significant changes made to the
software between the *previous* and *current* versions (see
above). A fully-detailed change summary is provided by the :file:`ChangeLog` file
included in the release package and by the Git commit history.
Major changes
-------------
None
Software configuration changes
------------------------------
* Define HAVE_JPEGTURBO_DUAL_MODE_8_12 and LERC_STATIC in tif_config.h.
* CMake: define WORDS_BIGENDIAN via tif_config.h
* doc/CMakeLists.txt: remove useless cmake_minimum_required()
* CMake: fix build with LLVM/Clang 17 (fixes :issue:`651`)
* CMake: set CMP0074 new policy
* Set LINKER_LANGUAGE for C targets with C deps
* Export tiffxx cmake target (fixes :issue:`674`)
* autogen.sh: Enable verbose wget.
* configure.ac: Syntax updates for Autoconf 2.71
* autogen.sh: Re-implement based on autoreconf. Failure to update
config.guess/config.sub does not return error (fixes :issue:`672`)
* CMake: fix CMake 4.0 warning when minimum required version is < 3.10.
* CMake: Add build option tiff-static (fixes :issue:`709`)
Library changes
---------------
New/improved functionalities:
* Add TIFFOpenOptionsSetWarnAboutUnknownTags() for explicit control about
emitting warnings for unknown tags. No longer emit warnings about unknown
tags by default
* tif_predict.c: speed-up decompression in some cases.
API/ABI breaks:
* None
Bug fixes:
* tif_fax3: For fax group 3 data if no EOL is detected, reading is retried
without synchronisation for EOLs. (fixes :issue:`54`)
* Updating TIFFMergeFieldInfo() with read_count=write_count=0 for FIELD_IGNORE.
Updating TIFFMergeFieldInfo() with read_count=write_count=0 for FIELD_IGNORE.
Improving handling when field_name = NULL.
(fixes :issue:`532`)
* tiff.h: add COMPRESSION_JXL_DNG_1_7=52546 as used for JPEGXL compression in
the DNG 1.7 specification
* TIFFWriteDirectorySec: Increment string length for ASCII tags for codec tags
defined with FIELD_xxx bits, as it is done for FIELD_CUSTOM tags.
(fixes :issue:`648`)
* Do not error out on a tag whose tag count value is zero, just issue a warning.
Fix parsing a private tag 0x80a6 (fixes :issue:`647`)
* TIFFDefaultTransferFunction(): give up beyond td_bitspersample = 24
(Fixes https://github.com/OSGeo/gdal/issues/10875)
* tif_getimage.c: Remove unnecessary calls to TIFFRGBAImageOK()
(fixes :issue:`175`)
* Fix writing a Predictor=3 file with non-native endianness
* _TIFFVSetField(): fix potential use of unallocated memory (out-of-bounds
read / nullptr dereference) in case of out-of-memory situation when dealing
with custom tags (fixes :issue:`663`)
* tif_fax3.c: Error out for CCITT fax encoding if SamplesPerPixel is not equal
1 and PlanarConfiguration = Contiguous (fixes :issue:`26`)
* tif_fax3.c: error out after a number of times end-of-line or unexpected bad
code words have been reached. (fixes :issue:`670`)
* Fix memory leak in TIFFSetupStrips() (fixes :issue:`665`)
* tif_zip.c: Provide zlib allocation functions.
Otherwise for zlib built with -DZ_SOLO inflating will fail.
* Fix memory leak in _TIFFSetDefaultCompressionState. (fixes :issue:`676`)
* tif_predict.c: Don’t overwrite input buffer of TIFFWriteScanline() if
"prediction" is enabled. Use extra working buffer in PredictorEncodeRow().
(fixes :issue:`5`)
* tif_getimage.c: update some integer overflow checks (fixes :issue:`79`)
* tif_getimage.c: Fix buffer underflow crash for less raster rows at
TIFFReadRGBAImageOriented() (fixes :issue:`704`)
* TIFFReadRGBAImage(): several fixes to avoid buffer overflows.
* Correct passing arguments to TIFFCvtIEEEFloatToNative() and
TIFFCvtIEEEDoubleToNative() if HAVE_IEEEFP is not defined. (fixes
:issue:`699`)
* LZWDecode(): avoid nullptr dereference when trying to read again after EOI
marker has been found with remaining output bytes (fixes :issue:`698`)
* TIFFSetSubDirectory(): check _TIFFCheckDirNumberAndOffset() return.
* TIFFUnlinkDirectory() and TIFFWriteDirectorySec(): clear tif_rawcp when
clearing tif_rawdata (fixes :issue:`711`)
* JPEGEncodeRaw(): error out if a previous scanline failed to be written, to
avoid out-of-bounds access (fixes :issue:`714`)
* tif_jpeg: Fix bug in JPEGDecodeRaw() if JPEG_LIB_MK1_OR_12BIT is defined for
8/12bit dual mode, introduced in libjpeg-turbo 2.2, which was actually
released as 3.0. (fixes :issue:`717`)
* add assert for TIFFReadCustomDirectory infoarray check.
Other changes:
* tif_jpeg.c: use JPEG_MAX_DIMENSION constant instead of hard-coded 65535 value
* tif_lzw.c / tif_packbits.c: use NULL instead of 0.
* Take into account PACKBITS_READ_ONLY, LZW_READ_ONLY, and LERC_READ_ONLY
macros to disable compiling write-support for those codecs.
* tif_lerc.c: add missing casts
* Merge several functions implemented twice in different modules.
(see :issue:`154`)
* Remove get_field_type form TIFFField structure because it is not used
anymore and rename other parameter to set_get_field_type
* Silence some Coverity Scan warnigs and mark already dismissed ones.
* References to codec libraries updated and missing codec compile defines
(tiffconf.h) added.
* Move mkg3states under libtiff/tools. (fixes :issue:`708`)
* tiff_itrunc(): don't use rand() to please Coverity Scan.
* tiffio.h: fix compilation with LOGLUV_PUBLIC=0
* LICENSE.md: Add BSD license for Lempel-Ziv & Welch compression (tif_lzw.c)
(fixes :issue:`431`)
Documentation
-------------
* TIFFRGBAImage.rst note added for incorrect saving of images with TIFF
orientation from 5 (LeftTop) to 8 (LeftBottom) in the raster.
* TIFFRGBAImage.rst note added about un-associated alpha handling
(fixes :issue:`67`)
* Update "Defining New TIFF Tags" description. (fixes :issue:`642`)
* Fix return type of TIFFReadEncodedTile()
* Update the documentation to reflect deprecated typedefs.
* TIFFWriteDirectory.rst: Clarify TIFFSetWriteOffset() only sets offset for
image data and not for IFD data.
* Update documentation on re-entrancy and thread safety.
* Remove dead links to no more existing Awaresystems web-site.
* Updating BigTIFF specification and some miscelaneous editions.
* Replace some last links and remove last todos.
* Added hints for correct allocation of TIFFYCbCrtoRGB structure and its
associated buffers. (fixes :issue:`681`)
* Added chapter to "Using the TIFF Library" with links to handling multi-page
TIFF and custom directories. (fixes :issue:`43`)
* update TIFFOpen.rst with the return values of mapproc and unmapproc.
(fixes :issue:`12`)
Tools changes
-------------
New/improved functionality:
* tiffinfo: add a -W switch to warn about unknown tags.
* tiffdither: process all pages in input TIFF file.
Bug fixes:
* ppm2tiff: Fix bug in `pack_words` trailing bytes, where last two bytes of
each line were written wrongly. (fixes :issue:`467`)
* fax2ps: fix regression of commit 28c38d648b64a66c3218778c4745225fe3e3a06d
where TIFFTAG_FAXFILLFUNC is being used rather than an output buffer
(fixes :issue:`649`)
* tiff2pdf: Check TIFFTAG_TILELENGTH and TIFFTAGTILEWIDTH (fixes :issue:`650`)
* tiff2pdf: check h_samp and v_samp for range 1 to 4 to avoid division by
zero. (fixes :issue:`654`)
* tiff2pdf: avoid null pointer dereference. (fixes :issue:`741`)
* Improve non-secure integer overflow check (comparison of division result
with multiplicant) at compiler optimisation in tiffcp, rgb2ycbcr and tiff2rgba. (fixes :issue:`546`)
* tiff2rgba: fix some "a partial expression can generate an overflow before it
is assigned to a broader type" warnings. (fixes :issue:`682`)
* tiffdither/tiffmedian: Don't skip the first line of the input image.
(fixes :issue:`703`)
* tiffdither: avoid out-of-bounds read identified in :issue:`733`
* tiffmedian: error out if TIFFReadScanline() fails (fixes :issue:`707`)
* tiffmedian: close input file. (fixes :issue:`735`)
* thumbail: avoid potential out of bounds access (fixes :issue:`715`)
* tiffcrop: close open TIFF files and release allocated buffers before exiting
in case of error to avoid memory leaks. (fixes :issue:`716`)
* tiffcrop: fix double-free and memory leak exposed by :issue:`721`
* tiffcrop: avoid buffer overflow. (fixes :issue:`740`)
* tiffcrop: avoid nullptr dereference. (fixes :issue:`734`)
* tiffdump: Fix coverity scan issue CID 1373365: Passing tainted expression
\*datamem to PrintData, which uses it as a divisor or modulus.
* tiff2ps: check return of TIFFGetFiled() for TIFFTAG_STRIPBYTECOUNTS and
TIFFTAG_TILEBYTECOUNTS to avoid NULL pointer dereference.
(fixes :issue:`718`)
* tiffcmp: fix memory leak when second file cannot be opened.
(fixes :issue:`718` and :issue:`729`)
* tiffcp: fix setting compression level for lossless codecs.
(fixes :issue:`730`)
* raw2tiff: close input file before exit (fixes :issue:`742`)
Changes to contributed and unsupported tools
--------------------------------------------
* addtiffo: Fixing MSVC compiler warnings
* Improved oss-fuzz fuzzer tiff_read_rgba_fuzzer.cc.
* oss-fuzz: fix memory leak in fuzz target.
+1 -1
View File
@@ -104,4 +104,4 @@ authored by Frank Warmerdam.
Voting history
--------------
Adopted by +1 vote from all above mentionned initial members of the PSC.
Adopted by +1 vote from all above mentioned initial members of the PSC.
-2
View File
@@ -49,8 +49,6 @@ Proposed procedure
References to previous contributions to the discussion
------------------------------------------------------
https://gitlab.com/libtiff/libtiff/-/issues/580 and related merge request,
https://www.asmail.be/msg0054917226.html,
https://www.asmail.be/msg0055015786.html,
https://gitlab.com/libtiff/libtiff/-/merge_requests/569,
and discussion in https://gitlab.com/libtiff/libtiff/-/merge_requests/581
+200 -54
View File
@@ -1,27 +1,15 @@
BigTIFF Design
==============
This design details a 64-bit (larger than 4GB) TIFF format specification.
The classic TIFF file format uses 32bit offsets and, as such, is limited to 4 gigabytes.
The **BigTIFF** design details a 64-bit (larger than 4GB) TIFF format specification.
The design is based on a proposal by Steve Carlsen of Adobe, with input
from various other parties.
Overview of BigTIFF Extension
-----------------------------
Briefly
-------
* Version = 43
* 8-byte offset to first IFD
* Value/Offset fields are 8 bytes
* 8-byte offset to the next IFD
* add ``TIFFType`` of ``LONG8``, an 8 byte (unsigned) int
* ``StripOffsets`` and ``TileOffsets`` and ``ByteCounts`` can be LONG8
More Detail
-----------
* The Version ID, in header bytes 2-3, formerly decimal 42, now changes to **43**
* The Version ID, in header bytes 2-3, formerly decimal 42, changes to **43** for BigTIFF.
* Header bytes 4-5 contain the decimal number **8**.
* If there is some other number here, a reader should give up.
@@ -38,53 +26,211 @@ More Detail
* All values must begin at an 8-byte-aligned address.
* 8-byte offset to the Next_IFD, at the end of an IFD.
* To keep IFD entries 8-byte-aligned, we begin with an 8-byte (instead of 2-byte) count of the number of directory entries.
* Add ``TIFFTypes`` of ``LONG8`` (= 16), an 8 byte (unsigned) int, and ``SLONG8`` (= 17).
* Add ``TIFFType`` ``IFD8`` (=18) an 8byte IFD offset.
* ``StripOffsets`` and ``TileOffsets`` and ``ByteCounts`` may be ``LONG8`` or the traditionally allowed ``LONG`` or ``SHORT``.
* To keep IFD entries 8-byte-aligned, we begin with an 8-byte
(instead of 2-byte) count of the number of directory entries.
* Add ``TIFFDataTypes`` of ``TIFF_LONG8`` (= 16), an 8-byte unsigned int,
and ``TIFF_SLONG8`` (= 17), an 8-byte signed int.
* Add ``TIFFDataType`` ``TIFF_IFD8`` (=18) an 8-byte IFD offset.
* ``StripOffsets`` and ``TileOffsets`` and ``ByteCounts`` may be ``TIFF_LONG8``
or the traditionally allowed ``TIFF_LONG`` or ``TIFF_SHORT``.
* The proposed extension is :file:`.tf8`, and call it "8-Byte TIFF".
* The proposed extension is :file:`.tf8` or :file:`.btf`, and call it "BigTIFF".
Otherwise, it's just like "original TIFF." ("TIFF Classic?")
Otherwise, it's just like "original TIFF" or "classic TIFF".
BigTIFF Structures compared to Classic TIFF
-------------------------------------------
Open Issues
-----------
TIFF and BigTIFF File Header
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* What to call the new format
Here's the classic TIFF file header ...
* ChrisCox -- I don't think end users will understand what "8-byte TIFF" means
* AndreyKiselev - 23 Sep 2004 -- What about TIFF64? "64" is a widely used buzzword and should be directly associated with the 64-bit offsets and 64-bit architectures.
.. list-table:: Classic File Header
:widths: auto
:header-rows: 1
:align: left
:width: 90%
* What 3 character file extension to use (gotta be DOS compatible)
* What 4 character file type to use (for Macintosh)
* What MIME type to use
* - Offset
- Datatype
- Value
* - 0
- UInt16
- Byte order indication
* - 2
- UInt16
- Version number (always 42)
* - 4
- UInt32
- Offset to first IFD
And this is the **BigTIFF** file header ...
.. list-table:: BigTIFF File Header
:widths: auto
:header-rows: 1
:align: left
:width: 90%
* - Offset
- Datatype
- Value
* - 0
- UInt16
- Byte order indication
* - 2
- UInt16
- Version number, always **43** for BigTIFF
* - 4
- UInt16
- | Bytesize of offsets.
| Always 8 in BigTIFF, it provides a nice way to move to 16-byte pointers some day.
| If there is some other value here, a reader should give up.
* - 6
- UInt16
- | Reserved, always 0.
| If there is some other value here, a reader should give up.
* - 8
- UInt64
- Offset to first IFD
The last members in both variants of the structure point to the first IFD
(Image File Directory).
This IFD can be located anywhere in the file. Every 'page' in a multi-page TIFF,
classic TIFF or BigTIFF, is represented by exactly one IFD.
TIFF and BigTIFF Image File Directory Structure
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Here's a more detailed view of the classic IFD ...
.. list-table:: Classic IFD
:widths: auto
:header-rows: 1
:align: left
* - Offset
- Datatype
- Value
* - 0
- UInt16
- Number of tags in IFD
* - 2 + x * 12
- Tag structure
- Tag data
* - 2 + (Number of tags in IFD) * 12
- UInt32
- | Offset to next IFD, if there is a next IFD,
| 0 otherwise.
And this is how the IFD looks like in the **BigTIFF** file format ...
.. list-table:: BigTIFF IFD
:widths: auto
:header-rows: 1
:align: left
* - Offset
- Datatype
- Value
* - 0
- UInt64
- Number of tags in IFD
* - 8 + x * 20
- Tag structure
- Tag data
* - 8 + (Number of tags in IFD) * 20
- UInt64
- | Offset to next IFD, if there is a next IFD,
| 0 otherwise.
TIFF and BigTIFF Tag Structure
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The tags in this IFD should be sorted by code, in both classic TIFF and BigTIFF.
Every tag takes up exactly 12 bytes in classic TIFF, and looks like this ...
.. list-table:: Classic Tag Structure
:widths: auto
:header-rows: 1
:align: left
* - Offset
- Datatype
- Value
* - 0
- UInt16
- Tag identifying code
* - 2
- UInt16
- Datatype of tag data
* - 4
- UInt32
- Number of values
* - 8
- | x * tag data datatype
| or UInt32 offset
- | Tag data
| or offset to tag data
This same tag structure, in **BigTIFF**, takes up 20 bytes, and looks like this ...
.. list-table:: BigTIFF Tag Structure
:widths: auto
:header-rows: 1
:align: left
* - Offset
- Datatype
- Value
* - 0
- UInt16
- Tag identifying code
* - 2
- UInt16
- Datatype of tag data
* - 4
- UInt64
- Number of values
* - 12
- | x * tag data datatype
| or UInt64 offset
- | Tag data
| or offset to tag data
The same rule for 'inlining' the tag data applies to both classic TIFF and BigTIFF,
only the threshold size differs.
In classic TIFF, the tag data was written inside the tag structure, in the IFD,
if its size was smaller than or equal to 4 bytes. Otherwise, it's written elsewhere,
and pointed to.
In BigTIFF, the tag data is written inside the tag structure, in the IFD,
if its size is smaller than or equal to 8 bytes.
Other miscellaneous details
---------------------------
Amongst the suggested file extensions are 'tif', 'tf8' and 'btf'.
Three datatypes are added to classic TIFF:
- ``TIFF_LONG8`` = 16, being unsigned 8-byte (64-bit) integer
- ``TIFF_SLONG8`` = 17, being signed 8-byte (64-bit) integer
- ``TIFF_IFD8`` = 18, being a new unsigned 8-byte (64-bit) IFD offset.
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.
Likewise, tags that point to other IFDs, like e.g. the SubIFDs tag, are now allowed
to have the datatype ``TIFF_IFD8`` in BigTIFF. Again, the old datatypes TIFF_IFD,
and the hardly recommendable ``TIFF_LONG``, are still valid, too.
Samples
-------
BigTIFF sample file BigTIFFSamples.zip contains a series of 8 different BigTIFF files.
Especially note the BigTIFFSamples.html file in this zip, documenting their characteristics.
`Example files <http://www.awaresystems.be/imaging/tiff/bigtiff/BigTIFFSamples.zip>`_
from Joris Van Damme.
That sample file from Joris Van Damme can still be found at the Wayback Machine:
`BigTIFF Example files <https://web.archive.org/web/20240329145231/https://www.awaresystems.be/imaging/tiff/bigtiff/BigTIFFSamples.zip>`_
Changes
-------
* ``TIFFType`` 13 is ``ttIFD``, 14 is assigned to ``ttUnicode``, and 15 is assigned to ``ttComplex``. So, I changed the types for ``ttLong8`` and ``ttSLong8`` to 16 and 17, respectively.
* AndreyKiselev - 23 Sep 2004 -- Where are these fields defined? Is there any new Technical Note or something? And what is encoding behind the word "Unicode"?
* ChrisCox - 27 Sep 2004 -- They are in the Adobe TIFF definitions. I am still working on releasing updated TIFF documentation.
* Added list of open issues.
* settle on version 43
* cleanup
* ``TIFFType`` 18 (8 byte IFD) added.
* Clarified that fields which may be ``LONG8`` can also be one of the old supported types.
See also
--------
`AWare Systems' informal overview of the BigTIFF proposal <http://www.awaresystems.be/imaging/tiff/bigtiff.html>`_.
+8 -7
View File
@@ -2,22 +2,23 @@ LibTIFF Coverage of the BigTIFF Specification
=============================================
Since LibTIFF version 4.0.0, the BigTIFF format specification has been implemented within LibTIFF.
BigTIFF is a backward-compatible extension to the `TIFF <http://www.awaresystems.be/imaging/tiff.html>`_
file format.
BigTIFF is a backward-compatible extension to the TIFF file format.
BigTIFF logically extends the original TIFF file format (referred to as 'ClassicTIFF' from now on).
The BigTIFF specification is the result of work by a variety of parties on the LibTIFF mailing list, including
the then current LibTIFF maintainers, Joris Van Damme and Adobe staff. The BigTIFF specification has not yet
been officially approved by the TIFF specification owner (Adobe), but implementation within LibTIFF
could accelerate that process. For more information on the BigTIFF file format, we recommend AWare Systems'
`BigTIFF page <http://www.awaresystems.be/imaging/tiff/bigtiff.html>`_.
could accelerate that process. For more information on the BigTIFF file format, for example see :doc:`bigtiff`.
Another overview and some further links can be found at
`<https://www.loc.gov/preservation/digital/formats/fdd/fdd000328.shtml>`_.
BigTIFF is especially useful for people and vendors that are confronted with very large images, and
still seek to use an open, simple, and extendable format. This requirement is frequently encountered in the
geospatial field, but also concerns large format scanners, medical imaging and other fields.
The LibTiff BigTIFF support was made possible by four sponsors funding the project. The programming work was
primarily done by `Joris Van Damme (AWare Systems) <http://www.awaresystems.be/index.html>`_.
primarily done by Joris Van Damme (AWare Systems) from 2004 to 2008.
The sponsors for the BigTIFF support work in LibTIFF, in alphabetical order:
.. list-table:: Sponsors
@@ -35,7 +36,7 @@ The sponsors for the BigTIFF support work in LibTIFF, in alphabetical order:
* - .. image:: bigtiffpr_images/leica.png
:width: 100%
:alt: Leica Geosystems Geospatial Imaging
- `Leica Geosystems Geospatial Imaging <http://gi.leica-geosystems.com/default.aspx>`_ offers a
- 'Leica Geosystems Geospatial Imaging' offers a
range of workflow solutions for photogrammetry, mapping, remote sensing, catalog management and exploitation
of geospatial imagery. Enterprise organizations use this imagery as the basis for generating information for
both education and decision making processes. Those who use Leica Geosystems products every day trust them
@@ -51,7 +52,7 @@ The sponsors for the BigTIFF support work in LibTIFF, in alphabetical order:
* - .. image:: bigtiffpr_images/weogeo.png
:width: 100%
:alt: WeoGeo
- `WeoGeo <http://www.weogeo.com/>`_ is a web-based data management resource for the geospatial
- 'WeoGeo' is a web-based data management resource for the geospatial
industry that allows the free market exchange of mapping related imagery products, featuring an innovative
solution that efficiently manages digital mapping files of any size. With an intuitive user interface
and the scalable power of Amazon Web Services (AWS), geospatial professionals can view, sort, search,
+4 -1
View File
@@ -179,7 +179,10 @@ proposal given in TIFF Technical Note #2.
The following table shows the tags that are recognized
and how they are used by the library. If no use is indicated,
then the library reads and writes the tag, but does not use it internally.
For the meaning of the tags look in https://www.awaresystems.be/imaging/tiff/tifftags.html
Apart of the TIFF 6.0 specification the meaning of tags can be found on various places
in the internet. For example:
https://www.loc.gov/preservation/digital/formats/content/tiff_tags.shtml
:file:`libtiff` supports also many private tags allocated for organizations that wish to
store additional information in a TIFF file.
+7 -17
View File
@@ -5,34 +5,24 @@ TIFF File Format Specification
:width: 139
:alt: jim
A copy of the 6.0 specification is available from Adobe at
`<http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf>`_
or from the libtiff
ftp site at `<https://download.osgeo.org/libtiff/doc/TIFF6.pdf>`_.
| A copy of the 6.0 specification is available from the libtiff
ftp site at `<https://download.osgeo.org/libtiff/doc/TIFF6.pdf>`_.
| Other places are `<https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pdf>`_
and `<https://www.loc.gov/preservation/digital/formats/fdd/fdd000022.shtml>`_
Draft :doc:`technote2` covers problems
with the TIFF 6.0 design for embedding JPEG-compressed data in TIFF, and
with the TIFF 6.0 design for embedding JPEG-compressed data in TIFF, and
describes an alternative.
Other Adobe information on TIFF can be retrieved from
`<http://partners.adobe.com/public/developer/tiff/index.html>`_.
Joris Van Damme maintains a list of known tags and their descriptions and
definitions. It is available online at
`<http://www.awaresystems.be/imaging/tiff/tifftags.html>`_.
There is a FAQ, related both to TIFF format and libtiff library:
`<http://www.awaresystems.be/imaging/tiff/faq.html>`_.
The LibTIFF coverage of the TIFF 6.0 specification is detailed in :doc:`coverage`.
A design for a TIFF variation supporting files larger than 4GB is detailed in :doc:`bigtiff`.
The LibTIFF coverage of the TIFF 6.0 specification is detailed in :doc:`coverage`.
.. toctree::
:maxdepth: 1
:titlesonly:
technote2
bigtiff
coverage
bigtiff
coverage-bigtiff
+5 -5
View File
@@ -138,7 +138,7 @@ means that the control logic must know a great deal more about JPEG details
than we would like. The parsing and reconstruction of the markers also
represents a fair amount of unnecessary work.
Quite a few implementors have proposed writing "TIFF/JPEG" files in which
Quite a few implementers have proposed writing "TIFF/JPEG" files in which
a standard JPEG datastream is simply dumped into the file and pointed to
by JPEGInterchangeFormat. To avoid parsing the JPEG datastream, they
suggest not writing the JPEG auxiliary fields (JPEGxxTables etc) nor even
@@ -149,7 +149,7 @@ is arguably not TIFF at all, since *all* TIFF-reading applications expect
to find strip or tile pointers. A subset implementation that is not
upward-compatible with the full spec is clearly unacceptable. However,
the frequency with which this idea has come up makes it clear that
implementors find the existing Section 22 too complex.
implementers find the existing Section 22 too complex.
Overview of the solution
@@ -260,7 +260,7 @@ will provide additional ``PhotometricInterpretation`` values and a more general
way of defining subsampling, so as to allow more flexibility in
JPEG-compressed files. But that issue is not addressed in this Tech Note.
Implementors should note that many popular JPEG codecs
Implementers should note that many popular JPEG codecs
(compressor/decompressors) provide automatic color conversion and
downsampling, so that the application may supply full-size RGB data which
is nonetheless converted to downsampled YCbCr. This is an implementation
@@ -556,7 +556,7 @@ single-datastream files. Support for tiled TIFF files is strongly
recommended but not required.
Other recommendations for implementors
Other recommendations for implementers
--------------------------------------
The TIFF tag ``Compression=7`` guarantees only that the compressed data is
@@ -621,7 +621,7 @@ Compression Standard", Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
This textbook is by far the most complete exposition of JPEG in existence.
It includes the full text of the ISO JPEG standards (DIS 10918-1 and draft
DIS 10918-2). No would-be JPEG implementor should be without it.
DIS 10918-2). No would-be JPEG implementer should be without it.
[3] ISO/IEC IS 10918-1, "Digital Compression and Coding of Continuous-tone
Still Images, Part 1: Requirements and guidelines", February 1994.
+4
View File
@@ -55,6 +55,10 @@ Options
Set the initial TIFF directory to *#*.
.. option:: -W
Warn about unknown tags.
See also
--------
+12 -23
View File
@@ -49,7 +49,7 @@ set(tiff_private_HEADERS
${CMAKE_CURRENT_BINARY_DIR}/tif_config.h)
add_library(tiff libtiff.def)
add_library(tiff ${TIFF_BUILD_LIB_VALUE} libtiff.def)
add_library(TIFF::tiff ALIAS tiff)
target_sources(tiff PRIVATE
@@ -150,9 +150,7 @@ endif()
if(JPEG_SUPPORT)
target_link_libraries(tiff PRIVATE JPEG::JPEG)
string(APPEND tiff_requires_private " libjpeg")
if(HAVE_JPEGTURBO_DUAL_MODE_8_12)
target_compile_definitions(tiff PRIVATE HAVE_JPEGTURBO_DUAL_MODE_8_12)
elseif(JPEG_DUAL_MODE_8_12)
if(JPEG_DUAL_MODE_8_12 AND NOT HAVE_JPEGTURBO_DUAL_MODE_8_12)
target_include_directories(tiff PRIVATE ${JPEG12_INCLUDE_DIR})
target_link_libraries(tiff PRIVATE ${JPEG12_LIBRARIES})
endif()
@@ -164,9 +162,6 @@ endif()
if(LERC_SUPPORT)
target_link_libraries(tiff PRIVATE LERC::LERC)
if(LERC_VERSION_STRING VERSION_GREATER_EQUAL "4.0")
if(NOT BUILD_SHARED_LIBS)
set_target_properties(tiff PROPERTIES COMPILE_DEFINITIONS LERC_STATIC)
endif()
string(APPEND tiff_requires_private " Lerc")
else()
list(APPEND tiff_libs_private_list "${LERC_LIBRARY}")
@@ -201,8 +196,13 @@ if(NOT CYGWIN)
set_target_properties(tiff PROPERTIES VERSION ${SO_VERSION})
endif()
if(HAVE_LD_VERSION_SCRIPT)
set_target_properties(tiff PROPERTIES LINK_FLAGS
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libtiff.map")
if (CMAKE_VERSION GREATER_EQUAL 3.29 AND CMAKE_C_COMPILER_LINKER_ID STREQUAL "LLD" AND CMAKE_C_COMPILER_LINKER_VERSION GREATER_EQUAL 17)
set_target_properties(tiff PROPERTIES LINK_FLAGS
"-Wl,--undefined-version -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libtiff.map")
else()
set_target_properties(tiff PROPERTIES LINK_FLAGS
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libtiff.map")
endif()
endif()
if(tiff-install)
@@ -242,7 +242,7 @@ if(CXX_SUPPORT)
if (WIN32 AND NOT MINGW)
add_library(tiffxx STATIC ../placeholder.h)
else()
add_library(tiffxx ../placeholder.h)
add_library(tiffxx ${TIFF_BUILD_LIB_VALUE} ../placeholder.h)
endif()
add_library(TIFF::CXX ALIAS tiffxx)
@@ -265,7 +265,7 @@ if(CXX_SUPPORT)
endif()
if(tiff-install)
install(TARGETS tiffxx
install(TARGETS tiffxx EXPORT TiffTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
@@ -273,17 +273,6 @@ if(CXX_SUPPORT)
install(FILES ${tiffxx_HEADERS}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
endif()
endif()
if(NOT CMAKE_CROSSCOMPILING)
add_executable(tiff_mkg3states ../placeholder.h)
target_sources(tiff_mkg3states PRIVATE mkg3states.c tif_fax3.h)
target_link_libraries(tiff_mkg3states tiff tiff_port)
add_custom_target(tiff_faxtable
DEPENDS tiff_mkg3states
COMMAND ${CMAKE_COMMAND} -E rm "tif_fax3sm.c"
COMMAND tiff_mkg3states -b -c const "tif_fax3sm.c"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
endif()
-26
View File
@@ -138,29 +138,3 @@ libtiffxx_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libtiffxx.map
endif
libtiffxx_la_LIBADD = $(LIBTIFF)
libtiffxx_la_DEPENDENCIES = libtiff.la
#
# The finite state machine tables used by the G3/G4 decoders
# are generated by the mkg3states program. On systems without
# make these rules have to be manually carried out.
#
noinst_PROGRAMS = mkg3states
mkg3states_SOURCES = mkg3states.c tif_fax3.h
mkg3states_LDADD = $(LIBPORT)
faxtable: mkg3states
(rm -f tif_fax3sm.c && ./mkg3states -b -c const tif_fax3sm.c)
if STATIC_LERC
extra_CPPFLAGS = -DLERC_STATIC
else
extra_CPPFLAGS =
endif
if HAVE_JPEGTURBO_DUAL_MODE_8_12
JPEGTURBO_CPPFLAGS = -DHAVE_JPEGTURBO_DUAL_MODE_8_12
else
JPEGTURBO_CPPFLAGS =
endif
AM_CPPFLAGS = -I$(top_srcdir)/libtiff -I$(top_srcdir)/port $(extra_CPPFLAGS) $(JPEGTURBO_CPPFLAGS)
+1
View File
@@ -88,6 +88,7 @@ EXPORTS TIFFAccessTagMethods
TIFFOpenOptionsSetMaxCumulatedMemAlloc
TIFFOpenOptionsSetMaxSingleMemAlloc
TIFFOpenOptionsSetErrorHandlerExtR
TIFFOpenOptionsSetWarnAboutUnknownTags
TIFFOpenOptionsSetWarningHandlerExtR
TIFFPrintDirectory
TIFFRGBAImageBegin
+4
View File
@@ -218,3 +218,7 @@ LIBTIFF_4.5 {
LIBTIFF_4.6.1 {
TIFFOpenOptionsSetMaxCumulatedMemAlloc;
} LIBTIFF_4.5;
LIBTIFF_4.7.1 {
TIFFOpenOptionsSetWarnAboutUnknownTags;
} LIBTIFF_4.6.1;
+4 -1
View File
@@ -131,7 +131,10 @@ static int TIFFDefaultTransferFunction(TIFF *tif, TIFFDirectory *td)
tmsize_t i, n, nbytes;
tf[0] = tf[1] = tf[2] = 0;
if (td->td_bitspersample >= sizeof(tmsize_t) * 8 - 2)
// Do not try to generate a default TransferFunction beyond 24 bits.
// This otherwise leads to insane amounts, resulting in denial of service
// See https://github.com/OSGeo/gdal/issues/10875
if (td->td_bitspersample > 24)
return 0;
n = ((tmsize_t)1) << td->td_bitspersample;
-1
View File
@@ -48,7 +48,6 @@ void TIFFCleanup(TIFF *tif)
*/
if (tif->tif_mode != O_RDONLY)
TIFFFlush(tif);
(*tif->tif_cleanup)(tif);
TIFFFreeDirectory(tif);
_TIFFCleanupIFDOffsetAndNumberMaps(tif);
+8 -2
View File
@@ -80,11 +80,17 @@
#cmakedefine HAVE_UNISTD_H 1
/* 8/12 bit libjpeg dual mode enabled */
#cmakedefine JPEG_DUAL_MODE_8_12 1 1
#cmakedefine JPEG_DUAL_MODE_8_12 1
/* 8/12 bit dual mode JPEG built into libjpeg-turbo 3.0+ */
#cmakedefine HAVE_JPEGTURBO_DUAL_MODE_8_12 1
/* Support LERC compression */
#cmakedefine LERC_SUPPORT 1
/* Define to 1 when building a static libtiff with LERC enabled. */
#cmakedefine LERC_STATIC
/* 12bit libjpeg primary include file with path */
#define LIBJPEG_12_PATH "@LIBJPEG_12_PATH@"
@@ -133,7 +139,7 @@
# endif
#else
# ifndef WORDS_BIGENDIAN
# undef WORDS_BIGENDIAN
# cmakedefine WORDS_BIGENDIAN 1
# endif
#endif
+6
View File
@@ -85,9 +85,15 @@
/* 8/12 bit libjpeg dual mode enabled */
#undef JPEG_DUAL_MODE_8_12
/* 8/12 bit dual mode JPEG built into libjpeg-turbo 3.0+ */
#undef HAVE_JPEGTURBO_DUAL_MODE_8_12
/* Support LERC compression */
#undef LERC_SUPPORT
/* Define to 1 when building a static libtiff with LERC enabled. */
#undef LERC_STATIC
/* 12bit libjpeg primary include file with path */
#undef LIBJPEG_12_PATH
+21 -19
View File
@@ -723,10 +723,9 @@ static int _TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap)
{
TIFFTagValue *new_customValues;
td->td_customValueCount++;
new_customValues = (TIFFTagValue *)_TIFFreallocExt(
tif, td->td_customValues,
sizeof(TIFFTagValue) * td->td_customValueCount);
sizeof(TIFFTagValue) * (td->td_customValueCount + 1));
if (!new_customValues)
{
TIFFErrorExtR(tif, module,
@@ -737,6 +736,7 @@ static int _TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap)
goto end;
}
td->td_customValueCount++;
td->td_customValues = new_customValues;
tv = td->td_customValues + (td->td_customValueCount - 1);
@@ -748,8 +748,8 @@ static int _TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap)
/*
* Set custom value ... save a copy of the custom tag value.
*/
/*--: Rational2Double: For Rationals evaluate "set_field_type" to
* determine internal storage size. */
/*--: Rational2Double: For Rationals evaluate "set_get_field_type"
* to determine internal storage size. */
tv_size = TIFFFieldSetGetSize(fip);
if (tv_size == 0)
{
@@ -842,7 +842,7 @@ static int _TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap)
fip->field_writecount == TIFF_SPP || tv->count > 1)
{
/*--: Rational2Double: For Rationals tv_size is set above to
* 4 or 8 according to fip->set_field_type! */
* 4 or 8 according to fip->set_get_field_type! */
_TIFFmemcpy(tv->value, va_arg(ap, void *),
tv->count * tv_size);
/* Test here for too big values for LONG8, SLONG8 in
@@ -977,7 +977,8 @@ static int _TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap)
case TIFF_RATIONAL:
case TIFF_SRATIONAL:
/*-- Rational2Double: For Rationals tv_size is set
* above to 4 or 8 according to fip->set_field_type!
* above to 4 or 8 according to
* fip->set_get_field_type!
*/
{
if (tv_size == 8)
@@ -995,11 +996,11 @@ static int _TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap)
* default. */
if (tv_size != 4)
{
TIFFErrorExtR(
tif, module,
"Rational2Double: .set_field_type "
"in not 4 but %d",
tv_size);
TIFFErrorExtR(tif, module,
"Rational2Double: "
".set_get_field_type "
"in not 4 but %d",
tv_size);
}
}
}
@@ -1526,7 +1527,7 @@ static int _TIFFVGetField(TIFF *tif, uint32_t tag, va_list ap)
case TIFF_SRATIONAL:
{
/*-- Rational2Double: For Rationals evaluate
* "set_field_type" to determine internal
* "set_get_field_type" to determine internal
* storage size and return value size. */
int tv_size = TIFFFieldSetGetSize(fip);
if (tv_size == 8)
@@ -1544,11 +1545,11 @@ static int _TIFFVGetField(TIFF *tif, uint32_t tag, va_list ap)
* default. */
if (tv_size != 4)
{
TIFFErrorExtR(
tif, "_TIFFVGetField",
"Rational2Double: .set_field_type "
"in not 4 but %d",
tv_size);
TIFFErrorExtR(tif, "_TIFFVGetField",
"Rational2Double: "
".set_get_field_type "
"in not 4 but %d",
tv_size);
}
}
}
@@ -1620,6 +1621,7 @@ void TIFFFreeDirectory(TIFF *tif)
TIFFDirectory *td = &tif->tif_dir;
int i;
(*tif->tif_cleanup)(tif);
_TIFFmemset(td->td_fieldsset, 0, sizeof(td->td_fieldsset));
CleanupField(td_sminsamplevalue);
CleanupField(td_smaxsamplevalue);
@@ -2206,7 +2208,7 @@ int TIFFSetSubDirectory(TIFF *tif, uint64_t diroff)
_TIFFCleanupIFDOffsetAndNumberMaps(tif);
tif->tif_curdir = 0; /* first directory of new chain */
/* add this offset to new IFD list */
_TIFFCheckDirNumberAndOffset(tif, tif->tif_curdir, diroff);
retval = _TIFFCheckDirNumberAndOffset(tif, tif->tif_curdir, diroff);
}
/* To be able to return from SubIFD or custom-IFD to main-IFD */
tif->tif_setdirectory_force_absolute = TRUE;
@@ -2335,12 +2337,12 @@ int TIFFUnlinkDirectory(TIFF *tif, tdir_t dirn)
* means that the caller can only append to the directory
* chain.
*/
(*tif->tif_cleanup)(tif);
if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata)
{
_TIFFfreeExt(tif, tif->tif_rawdata);
tif->tif_rawdata = NULL;
tif->tif_rawcc = 0;
tif->tif_rawcp = NULL;
tif->tif_rawdataoff = 0;
tif->tif_rawdataloaded = 0;
}
+9 -10
View File
@@ -329,16 +329,15 @@ extern "C"
struct _TIFFField
{
uint32_t field_tag; /* field's tag */
short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */
short field_writecount; /* write count/TIFF_VARIABLE */
TIFFDataType field_type; /* type of associated data */
uint32_t
field_anonymous; /* if true, this is a unknown / anonymous tag */
TIFFSetGetFieldType set_field_type; /* type to be passed to TIFFSetField
and TIFFGetField*/
TIFFSetGetFieldType get_field_type; /* not used */
unsigned short field_bit; /* bit in fieldsset bit vector */
uint32_t field_tag; /* field's tag */
short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */
short field_writecount; /* write count/TIFF_VARIABLE */
TIFFDataType field_type; /* type of associated data */
uint32_t field_anonymous; /* if true, this is a unknown /
anonymous tag */
TIFFSetGetFieldType set_get_field_type; /* type to be passed to
TIFFSetField, TIFFGetField */
unsigned short field_bit; /* bit in fieldsset bit vector */
unsigned char field_oktochange; /* if true, can change while writing */
unsigned char field_passcount; /* if true, pass dir count on set */
char *field_name; /* ASCII name */
+412 -411
View File
@@ -54,10 +54,10 @@ static const TIFFFieldArray gpsFieldArray;
/*--: Rational2Double: --
* The Rational2Double upgraded libtiff functionality allows the definition and
* achievement of true double-precision accuracy for TIFF tags of RATIONAL type
* and field_bit=FIELD_CUSTOM using the set_field_type = TIFF_SETGET_DOUBLE.
* and field_bit=FIELD_CUSTOM using the set_get_field_type = TIFF_SETGET_DOUBLE.
* Unfortunately, that changes the old implemented interface for TIFFGetField().
* In order to keep the old TIFFGetField() interface behavior those tags have to
* be redefined with set_field_type = TIFF_SETGET_FLOAT!
* be redefined with set_get_field_type = TIFF_SETGET_FLOAT!
*
* Rational custom arrays are already defined as _Cxx_FLOAT, thus can stay.
*
@@ -65,281 +65,281 @@ static const TIFFFieldArray gpsFieldArray;
/* clang-format off */ /* for better readability of tag comments */
static const TIFFField tiffFields[] = {
{TIFFTAG_SUBFILETYPE, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_SUBFILETYPE, 1, 0, "SubfileType", NULL},
{TIFFTAG_OSUBFILETYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "OldSubfileType", NULL},
{TIFFTAG_IMAGEWIDTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_IMAGEDIMENSIONS, 0, 0, "ImageWidth", NULL},
{TIFFTAG_IMAGELENGTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_IMAGEDIMENSIONS, 1, 0, "ImageLength", NULL},
{TIFFTAG_BITSPERSAMPLE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_BITSPERSAMPLE, 0, 0, "BitsPerSample", NULL},
{TIFFTAG_COMPRESSION, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_COMPRESSION, 0, 0, "Compression", NULL},
{TIFFTAG_PHOTOMETRIC, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_PHOTOMETRIC, 0, 0, "PhotometricInterpretation", NULL},
{TIFFTAG_THRESHHOLDING, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_THRESHHOLDING, 1, 0, "Threshholding", NULL},
{TIFFTAG_CELLWIDTH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CellWidth", NULL},
{TIFFTAG_CELLLENGTH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CellLength", NULL},
{TIFFTAG_FILLORDER, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_FILLORDER, 0, 0, "FillOrder", NULL},
{TIFFTAG_DOCUMENTNAME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DocumentName", NULL},
{TIFFTAG_IMAGEDESCRIPTION, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImageDescription", NULL},
{TIFFTAG_MAKE, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Make", NULL},
{TIFFTAG_MODEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Model", NULL},
{TIFFTAG_STRIPOFFSETS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_STRIPOFFSETS, 0, 0, "StripOffsets", NULL},
{TIFFTAG_ORIENTATION, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_ORIENTATION, 0, 0, "Orientation", NULL},
{TIFFTAG_SAMPLESPERPIXEL, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_SAMPLESPERPIXEL, 0, 0, "SamplesPerPixel", NULL},
{TIFFTAG_ROWSPERSTRIP, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_ROWSPERSTRIP, 0, 0, "RowsPerStrip", NULL},
{TIFFTAG_STRIPBYTECOUNTS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_STRIPBYTECOUNTS, 0, 0, "StripByteCounts", NULL},
{TIFFTAG_MINSAMPLEVALUE, -2, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_MINSAMPLEVALUE, 1, 0, "MinSampleValue", NULL},
{TIFFTAG_MAXSAMPLEVALUE, -2, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_MAXSAMPLEVALUE, 1, 0, "MaxSampleValue", NULL},
{TIFFTAG_XRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_RESOLUTION, 1, 0, "XResolution", NULL},
{TIFFTAG_YRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_RESOLUTION, 1, 0, "YResolution", NULL},
{TIFFTAG_PLANARCONFIG, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_PLANARCONFIG, 0, 0, "PlanarConfiguration", NULL},
{TIFFTAG_PAGENAME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "PageName", NULL},
{TIFFTAG_XPOSITION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_POSITION, 1, 0, "XPosition", NULL},
{TIFFTAG_YPOSITION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_POSITION, 1, 0, "YPosition", NULL},
{TIFFTAG_FREEOFFSETS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 0, 0, "FreeOffsets", NULL},
{TIFFTAG_FREEBYTECOUNTS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 0, 0, "FreeByteCounts", NULL},
{TIFFTAG_GRAYRESPONSEUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "GrayResponseUnit", NULL},
{TIFFTAG_GRAYRESPONSECURVE, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "GrayResponseCurve", NULL},
{TIFFTAG_RESOLUTIONUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_RESOLUTIONUNIT, 1, 0, "ResolutionUnit", NULL},
{TIFFTAG_PAGENUMBER, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, TIFF_SETGET_UNDEFINED, FIELD_PAGENUMBER, 1, 0, "PageNumber", NULL},
{TIFFTAG_COLORRESPONSEUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "ColorResponseUnit", NULL},
{TIFFTAG_TRANSFERFUNCTION, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_OTHER, TIFF_SETGET_UNDEFINED, FIELD_TRANSFERFUNCTION, 1, 0, "TransferFunction", NULL},
{TIFFTAG_SOFTWARE, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Software", NULL},
{TIFFTAG_DATETIME, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DateTime", NULL},
{TIFFTAG_ARTIST, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Artist", NULL},
{TIFFTAG_HOSTCOMPUTER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "HostComputer", NULL},
{TIFFTAG_WHITEPOINT, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "WhitePoint", NULL},
{TIFFTAG_PRIMARYCHROMATICITIES, 6, 6, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "PrimaryChromaticities", NULL},
{TIFFTAG_COLORMAP, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_OTHER, TIFF_SETGET_UNDEFINED, FIELD_COLORMAP, 1, 0, "ColorMap", NULL},
{TIFFTAG_HALFTONEHINTS, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, TIFF_SETGET_UNDEFINED, FIELD_HALFTONEHINTS, 1, 0, "HalftoneHints", NULL},
{TIFFTAG_TILEWIDTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_TILEDIMENSIONS, 0, 0, "TileWidth", NULL},
{TIFFTAG_TILELENGTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_TILEDIMENSIONS, 0, 0, "TileLength", NULL},
{TIFFTAG_TILEOFFSETS, -1, 1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_STRIPOFFSETS, 0, 0, "TileOffsets", NULL},
{TIFFTAG_TILEBYTECOUNTS, -1, 1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_STRIPBYTECOUNTS, 0, 0, "TileByteCounts", NULL},
{TIFFTAG_SUBIFD, -1, -1, TIFF_IFD8, 0, TIFF_SETGET_C16_IFD8, TIFF_SETGET_UNDEFINED, FIELD_SUBIFD, 1, 1, "SubIFD", (TIFFFieldArray *)&tiffFieldArray},
{TIFFTAG_INKSET, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "InkSet", NULL},
{TIFFTAG_INKNAMES, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_C16_ASCII, TIFF_SETGET_UNDEFINED, FIELD_INKNAMES, 1, 1, "InkNames", NULL},
{TIFFTAG_NUMBEROFINKS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_NUMBEROFINKS, 1, 0, "NumberOfInks", NULL},
{TIFFTAG_DOTRANGE, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "DotRange", NULL},
{TIFFTAG_TARGETPRINTER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "TargetPrinter", NULL},
{TIFFTAG_EXTRASAMPLES, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_EXTRASAMPLES, 0, 1, "ExtraSamples", NULL},
{TIFFTAG_SAMPLEFORMAT, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_SAMPLEFORMAT, 0, 0, "SampleFormat", NULL},
{TIFFTAG_SMINSAMPLEVALUE, -2, -1, TIFF_ANY, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_SMINSAMPLEVALUE, 1, 0, "SMinSampleValue", NULL},
{TIFFTAG_SMAXSAMPLEVALUE, -2, -1, TIFF_ANY, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_SMAXSAMPLEVALUE, 1, 0, "SMaxSampleValue", NULL},
{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},
{TIFFTAG_YCBCRCOEFFICIENTS, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "YCbCrCoefficients", NULL},
{TIFFTAG_YCBCRSUBSAMPLING, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, TIFF_SETGET_UNDEFINED, FIELD_YCBCRSUBSAMPLING, 0, 0, "YCbCrSubsampling", NULL},
{TIFFTAG_YCBCRPOSITIONING, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_YCBCRPOSITIONING, 0, 0, "YCbCrPositioning", NULL},
{TIFFTAG_REFERENCEBLACKWHITE, 6, 6, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_REFBLACKWHITE, 1, 0, "ReferenceBlackWhite", NULL},
{TIFFTAG_XMLPACKET, -3, -3, TIFF_BYTE, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "XMLPacket", NULL},
{TIFFTAG_SUBFILETYPE, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_SUBFILETYPE, 1, 0, "SubfileType", NULL},
{TIFFTAG_OSUBFILETYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "OldSubfileType", NULL},
{TIFFTAG_IMAGEWIDTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_IMAGEDIMENSIONS, 0, 0, "ImageWidth", NULL},
{TIFFTAG_IMAGELENGTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_IMAGEDIMENSIONS, 1, 0, "ImageLength", NULL},
{TIFFTAG_BITSPERSAMPLE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_BITSPERSAMPLE, 0, 0, "BitsPerSample", NULL},
{TIFFTAG_COMPRESSION, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_COMPRESSION, 0, 0, "Compression", NULL},
{TIFFTAG_PHOTOMETRIC, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_PHOTOMETRIC, 0, 0, "PhotometricInterpretation", NULL},
{TIFFTAG_THRESHHOLDING, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_THRESHHOLDING, 1, 0, "Threshholding", NULL},
{TIFFTAG_CELLWIDTH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CellWidth", NULL},
{TIFFTAG_CELLLENGTH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CellLength", NULL},
{TIFFTAG_FILLORDER, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_FILLORDER, 0, 0, "FillOrder", NULL},
{TIFFTAG_DOCUMENTNAME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DocumentName", NULL},
{TIFFTAG_IMAGEDESCRIPTION, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "ImageDescription", NULL},
{TIFFTAG_MAKE, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "Make", NULL},
{TIFFTAG_MODEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "Model", NULL},
{TIFFTAG_STRIPOFFSETS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, FIELD_STRIPOFFSETS, 0, 0, "StripOffsets", NULL},
{TIFFTAG_ORIENTATION, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_ORIENTATION, 0, 0, "Orientation", NULL},
{TIFFTAG_SAMPLESPERPIXEL, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_SAMPLESPERPIXEL, 0, 0, "SamplesPerPixel", NULL},
{TIFFTAG_ROWSPERSTRIP, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_ROWSPERSTRIP, 0, 0, "RowsPerStrip", NULL},
{TIFFTAG_STRIPBYTECOUNTS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, FIELD_STRIPBYTECOUNTS, 0, 0, "StripByteCounts", NULL},
{TIFFTAG_MINSAMPLEVALUE, -2, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_MINSAMPLEVALUE, 1, 0, "MinSampleValue", NULL},
{TIFFTAG_MAXSAMPLEVALUE, -2, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_MAXSAMPLEVALUE, 1, 0, "MaxSampleValue", NULL},
{TIFFTAG_XRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_RESOLUTION, 1, 0, "XResolution", NULL},
{TIFFTAG_YRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_RESOLUTION, 1, 0, "YResolution", NULL},
{TIFFTAG_PLANARCONFIG, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_PLANARCONFIG, 0, 0, "PlanarConfiguration", NULL},
{TIFFTAG_PAGENAME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "PageName", NULL},
{TIFFTAG_XPOSITION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_POSITION, 1, 0, "XPosition", NULL},
{TIFFTAG_YPOSITION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_POSITION, 1, 0, "YPosition", NULL},
{TIFFTAG_FREEOFFSETS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 0, 0, "FreeOffsets", NULL},
{TIFFTAG_FREEBYTECOUNTS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 0, 0, "FreeByteCounts", NULL},
{TIFFTAG_GRAYRESPONSEUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "GrayResponseUnit", NULL},
{TIFFTAG_GRAYRESPONSECURVE, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "GrayResponseCurve", NULL},
{TIFFTAG_RESOLUTIONUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_RESOLUTIONUNIT, 1, 0, "ResolutionUnit", NULL},
{TIFFTAG_PAGENUMBER, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, FIELD_PAGENUMBER, 1, 0, "PageNumber", NULL},
{TIFFTAG_COLORRESPONSEUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "ColorResponseUnit", NULL},
{TIFFTAG_TRANSFERFUNCTION, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_OTHER, FIELD_TRANSFERFUNCTION, 1, 0, "TransferFunction", NULL},
{TIFFTAG_SOFTWARE, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "Software", NULL},
{TIFFTAG_DATETIME, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DateTime", NULL},
{TIFFTAG_ARTIST, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "Artist", NULL},
{TIFFTAG_HOSTCOMPUTER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "HostComputer", NULL},
{TIFFTAG_WHITEPOINT, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "WhitePoint", NULL},
{TIFFTAG_PRIMARYCHROMATICITIES, 6, 6, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "PrimaryChromaticities", NULL},
{TIFFTAG_COLORMAP, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_OTHER, FIELD_COLORMAP, 1, 0, "ColorMap", NULL},
{TIFFTAG_HALFTONEHINTS, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, FIELD_HALFTONEHINTS, 1, 0, "HalftoneHints", NULL},
{TIFFTAG_TILEWIDTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_TILEDIMENSIONS, 0, 0, "TileWidth", NULL},
{TIFFTAG_TILELENGTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_TILEDIMENSIONS, 0, 0, "TileLength", NULL},
{TIFFTAG_TILEOFFSETS, -1, 1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, FIELD_STRIPOFFSETS, 0, 0, "TileOffsets", NULL},
{TIFFTAG_TILEBYTECOUNTS, -1, 1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, FIELD_STRIPBYTECOUNTS, 0, 0, "TileByteCounts", NULL},
{TIFFTAG_SUBIFD, -1, -1, TIFF_IFD8, 0, TIFF_SETGET_C16_IFD8, FIELD_SUBIFD, 1, 1, "SubIFD", (TIFFFieldArray *)&tiffFieldArray},
{TIFFTAG_INKSET, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 0, 0, "InkSet", NULL},
{TIFFTAG_INKNAMES, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_C16_ASCII, FIELD_INKNAMES, 1, 1, "InkNames", NULL},
{TIFFTAG_NUMBEROFINKS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_NUMBEROFINKS, 1, 0, "NumberOfInks", NULL},
{TIFFTAG_DOTRANGE, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, FIELD_CUSTOM, 0, 0, "DotRange", NULL},
{TIFFTAG_TARGETPRINTER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "TargetPrinter", NULL},
{TIFFTAG_EXTRASAMPLES, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, FIELD_EXTRASAMPLES, 0, 1, "ExtraSamples", NULL},
{TIFFTAG_SAMPLEFORMAT, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_SAMPLEFORMAT, 0, 0, "SampleFormat", NULL},
{TIFFTAG_SMINSAMPLEVALUE, -2, -1, TIFF_ANY, 0, TIFF_SETGET_DOUBLE, FIELD_SMINSAMPLEVALUE, 1, 0, "SMinSampleValue", NULL},
{TIFFTAG_SMAXSAMPLEVALUE, -2, -1, TIFF_ANY, 0, TIFF_SETGET_DOUBLE, FIELD_SMAXSAMPLEVALUE, 1, 0, "SMaxSampleValue", NULL},
{TIFFTAG_CLIPPATH, -3, -3, TIFF_BYTE, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 0, 1, "ClipPath", NULL},
{TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 0, 0, "XClipPathUnits", NULL},
{TIFFTAG_YCLIPPATHUNITS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 0, 0, "YClipPathUnits", NULL},
{TIFFTAG_YCBCRCOEFFICIENTS, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 0, 0, "YCbCrCoefficients", NULL},
{TIFFTAG_YCBCRSUBSAMPLING, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, FIELD_YCBCRSUBSAMPLING, 0, 0, "YCbCrSubsampling", NULL},
{TIFFTAG_YCBCRPOSITIONING, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_YCBCRPOSITIONING, 0, 0, "YCbCrPositioning", NULL},
{TIFFTAG_REFERENCEBLACKWHITE, 6, 6, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_REFBLACKWHITE, 1, 0, "ReferenceBlackWhite", NULL},
{TIFFTAG_XMLPACKET, -3, -3, TIFF_BYTE, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "XMLPacket", NULL},
/* begin SGI tags */
{TIFFTAG_MATTEING, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_EXTRASAMPLES, 0, 0, "Matteing", NULL},
{TIFFTAG_DATATYPE, -2, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_SAMPLEFORMAT, 0, 0, "DataType", NULL},
{TIFFTAG_IMAGEDEPTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_IMAGEDEPTH, 0, 0, "ImageDepth", NULL},
{TIFFTAG_TILEDEPTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_TILEDEPTH, 0, 0, "TileDepth", NULL},
{TIFFTAG_MATTEING, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_EXTRASAMPLES, 0, 0, "Matteing", NULL},
{TIFFTAG_DATATYPE, -2, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_SAMPLEFORMAT, 0, 0, "DataType", NULL},
{TIFFTAG_IMAGEDEPTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_IMAGEDEPTH, 0, 0, "ImageDepth", NULL},
{TIFFTAG_TILEDEPTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_TILEDEPTH, 0, 0, "TileDepth", NULL},
/* end SGI tags */
/* begin Pixar tags */
{TIFFTAG_PIXAR_IMAGEFULLWIDTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImageFullWidth", NULL},
{TIFFTAG_PIXAR_IMAGEFULLLENGTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImageFullLength", NULL},
{TIFFTAG_PIXAR_TEXTUREFORMAT, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "TextureFormat", NULL},
{TIFFTAG_PIXAR_WRAPMODES, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "TextureWrapModes", NULL},
{TIFFTAG_PIXAR_FOVCOT, 1, 1, TIFF_FLOAT, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FieldOfViewCotangent", NULL},
{TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN, 16, 16, TIFF_FLOAT, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "MatrixWorldToScreen", NULL},
{TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA, 16, 16, TIFF_FLOAT, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "MatrixWorldToCamera", NULL},
{TIFFTAG_COPYRIGHT, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Copyright", NULL},
{TIFFTAG_PIXAR_IMAGEFULLWIDTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ImageFullWidth", NULL},
{TIFFTAG_PIXAR_IMAGEFULLLENGTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ImageFullLength", NULL},
{TIFFTAG_PIXAR_TEXTUREFORMAT, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "TextureFormat", NULL},
{TIFFTAG_PIXAR_WRAPMODES, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "TextureWrapModes", NULL},
{TIFFTAG_PIXAR_FOVCOT, 1, 1, TIFF_FLOAT, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "FieldOfViewCotangent", NULL},
{TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN, 16, 16, TIFF_FLOAT, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "MatrixWorldToScreen", NULL},
{TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA, 16, 16, TIFF_FLOAT, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "MatrixWorldToCamera", NULL},
{TIFFTAG_COPYRIGHT, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "Copyright", NULL},
/* end Pixar tags */
{TIFFTAG_RICHTIFFIPTC, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "RichTIFFIPTC", NULL},
{TIFFTAG_PHOTOSHOP, -3, -3, TIFF_BYTE, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "Photoshop", NULL},
{TIFFTAG_RICHTIFFIPTC, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "RichTIFFIPTC", NULL},
{TIFFTAG_PHOTOSHOP, -3, -3, TIFF_BYTE, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "Photoshop", NULL},
/*--: EXIFIFD and GPSIFD specified as TIFF_LONG by Aware-Systems and not TIFF_IFD8 as in original LibTiff. However, for IFD-like tags,
* libtiff uses the data type TIFF_IFD8 in tiffFields[]-tag definition combined with a special handling procedure in order to write either
* a 32-bit value and the TIFF_IFD type-id into ClassicTIFF files or a 64-bit value and the TIFF_IFD8 type-id into BigTIFF files. */
{TIFFTAG_EXIFIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EXIFIFDOffset", (TIFFFieldArray *)&exifFieldArray},
{TIFFTAG_ICCPROFILE, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ICC Profile", NULL},
{TIFFTAG_GPSIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "GPSIFDOffset", (TIFFFieldArray *)&gpsFieldArray},
{TIFFTAG_FAXRECVPARAMS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UINT32, FIELD_CUSTOM, TRUE, FALSE, "FaxRecvParams", NULL},
{TIFFTAG_FAXSUBADDRESS, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_ASCII, FIELD_CUSTOM, TRUE, FALSE, "FaxSubAddress", NULL},
{TIFFTAG_FAXRECVTIME, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UINT32, FIELD_CUSTOM, TRUE, FALSE, "FaxRecvTime", NULL},
{TIFFTAG_FAXDCS, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_ASCII, FIELD_CUSTOM, TRUE, FALSE, "FaxDcs", NULL},
{TIFFTAG_STONITS, 1, 1, TIFF_DOUBLE, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "StoNits", NULL},
{TIFFTAG_IMAGESOURCEDATA, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "Adobe Photoshop Document Data Block", NULL},
{TIFFTAG_INTEROPERABILITYIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "InteroperabilityIFDOffset", NULL},
{TIFFTAG_EXIFIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, FIELD_CUSTOM, 1, 0, "EXIFIFDOffset", (TIFFFieldArray *)&exifFieldArray},
{TIFFTAG_ICCPROFILE, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "ICC Profile", NULL},
{TIFFTAG_GPSIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, FIELD_CUSTOM, 1, 0, "GPSIFDOffset", (TIFFFieldArray *)&gpsFieldArray},
{TIFFTAG_FAXRECVPARAMS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, TRUE, FALSE, "FaxRecvParams", NULL},
{TIFFTAG_FAXSUBADDRESS, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, TRUE, FALSE, "FaxSubAddress", NULL},
{TIFFTAG_FAXRECVTIME, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, TRUE, FALSE, "FaxRecvTime", NULL},
{TIFFTAG_FAXDCS, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, TRUE, FALSE, "FaxDcs", NULL},
{TIFFTAG_STONITS, 1, 1, TIFF_DOUBLE, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 0, 0, "StoNits", NULL},
{TIFFTAG_IMAGESOURCEDATA, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "Adobe Photoshop Document Data Block", NULL},
{TIFFTAG_INTEROPERABILITYIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, FIELD_CUSTOM, 0, 0, "InteroperabilityIFDOffset", NULL},
/* begin DNG tags */
{TIFFTAG_DNGVERSION, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DNGVersion", NULL},
{TIFFTAG_DNGBACKWARDVERSION, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DNGBackwardVersion", NULL},
{TIFFTAG_UNIQUECAMERAMODEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "UniqueCameraModel", NULL},
{TIFFTAG_LOCALIZEDCAMERAMODEL, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "LocalizedCameraModel", NULL},
{TIFFTAG_CFAPLANECOLOR, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "CFAPlaneColor", NULL},
{TIFFTAG_CFALAYOUT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CFALayout", NULL},
{TIFFTAG_LINEARIZATIONTABLE, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "LinearizationTable", NULL},
{TIFFTAG_BLACKLEVELREPEATDIM, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "BlackLevelRepeatDim", NULL},
{TIFFTAG_BLACKLEVEL, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "BlackLevel", NULL},
{TIFFTAG_BLACKLEVELDELTAH, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "BlackLevelDeltaH", NULL},
{TIFFTAG_BLACKLEVELDELTAV, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "BlackLevelDeltaV", NULL},
{TIFFTAG_WHITELEVEL, -1, -1, TIFF_LONG, 0, TIFF_SETGET_C16_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "WhiteLevel", NULL},
{TIFFTAG_DEFAULTSCALE, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DefaultScale", NULL},
{TIFFTAG_BESTQUALITYSCALE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "BestQualityScale", NULL},
{TIFFTAG_DEFAULTCROPORIGIN, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DefaultCropOrigin", NULL},
{TIFFTAG_DEFAULTCROPSIZE, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DefaultCropSize", NULL},
{TIFFTAG_COLORMATRIX1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ColorMatrix1", NULL},
{TIFFTAG_COLORMATRIX2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ColorMatrix2", NULL},
{TIFFTAG_CAMERACALIBRATION1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "CameraCalibration1", NULL},
{TIFFTAG_CAMERACALIBRATION2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "CameraCalibration2", NULL},
{TIFFTAG_REDUCTIONMATRIX1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ReductionMatrix1", NULL},
{TIFFTAG_REDUCTIONMATRIX2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ReductionMatrix2", NULL},
{TIFFTAG_ANALOGBALANCE, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "AnalogBalance", NULL},
{TIFFTAG_ASSHOTNEUTRAL, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "AsShotNeutral", NULL},
{TIFFTAG_ASSHOTWHITEXY, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "AsShotWhiteXY", NULL},
{TIFFTAG_BASELINEEXPOSURE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "BaselineExposure", NULL},
{TIFFTAG_BASELINENOISE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "BaselineNoise", NULL},
{TIFFTAG_BASELINESHARPNESS, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "BaselineSharpness", NULL},
{TIFFTAG_BAYERGREENSPLIT, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "BayerGreenSplit", NULL},
{TIFFTAG_LINEARRESPONSELIMIT, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "LinearResponseLimit", NULL},
{TIFFTAG_CAMERASERIALNUMBER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CameraSerialNumber", NULL},
{TIFFTAG_LENSINFO, 4, 4, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "LensInfo", NULL},
{TIFFTAG_CHROMABLURRADIUS, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ChromaBlurRadius", NULL},
{TIFFTAG_ANTIALIASSTRENGTH, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "AntiAliasStrength", NULL},
{TIFFTAG_SHADOWSCALE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ShadowScale", NULL},
{TIFFTAG_DNGPRIVATEDATA, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "DNGPrivateData", NULL},
{TIFFTAG_MAKERNOTESAFETY, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "MakerNoteSafety", NULL},
{TIFFTAG_CALIBRATIONILLUMINANT1, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CalibrationIlluminant1", NULL},
{TIFFTAG_CALIBRATIONILLUMINANT2, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CalibrationIlluminant2", NULL},
{TIFFTAG_RAWDATAUNIQUEID, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "RawDataUniqueID", NULL},
{TIFFTAG_ORIGINALRAWFILENAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "OriginalRawFileName", NULL},
{TIFFTAG_ORIGINALRAWFILEDATA, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "OriginalRawFileData", NULL},
{TIFFTAG_ACTIVEAREA, 4, 4, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ActiveArea", NULL},
{TIFFTAG_MASKEDAREAS, -1, -1, TIFF_LONG, 0, TIFF_SETGET_C16_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "MaskedAreas", NULL},
{TIFFTAG_ASSHOTICCPROFILE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "AsShotICCProfile", NULL},
{TIFFTAG_ASSHOTPREPROFILEMATRIX, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "AsShotPreProfileMatrix", NULL},
{TIFFTAG_CURRENTICCPROFILE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "CurrentICCProfile", NULL},
{TIFFTAG_CURRENTPREPROFILEMATRIX, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "CurrentPreProfileMatrix", NULL},
{TIFFTAG_PERSAMPLE, 0, 0, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, TRUE, FALSE, "PerSample", NULL},
{TIFFTAG_DNGVERSION, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "DNGVersion", NULL},
{TIFFTAG_DNGBACKWARDVERSION, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "DNGBackwardVersion", NULL},
{TIFFTAG_UNIQUECAMERAMODEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "UniqueCameraModel", NULL},
{TIFFTAG_LOCALIZEDCAMERAMODEL, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "LocalizedCameraModel", NULL},
{TIFFTAG_CFAPLANECOLOR, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "CFAPlaneColor", NULL},
{TIFFTAG_CFALAYOUT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CFALayout", NULL},
{TIFFTAG_LINEARIZATIONTABLE, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, FIELD_CUSTOM, 1, 1, "LinearizationTable", NULL},
{TIFFTAG_BLACKLEVELREPEATDIM, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, FIELD_CUSTOM, 1, 0, "BlackLevelRepeatDim", NULL},
{TIFFTAG_BLACKLEVEL, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "BlackLevel", NULL},
{TIFFTAG_BLACKLEVELDELTAH, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "BlackLevelDeltaH", NULL},
{TIFFTAG_BLACKLEVELDELTAV, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "BlackLevelDeltaV", NULL},
{TIFFTAG_WHITELEVEL, -1, -1, TIFF_LONG, 0, TIFF_SETGET_C16_UINT32, FIELD_CUSTOM, 1, 1, "WhiteLevel", NULL},
{TIFFTAG_DEFAULTSCALE, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "DefaultScale", NULL},
{TIFFTAG_BESTQUALITYSCALE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "BestQualityScale", NULL},
{TIFFTAG_DEFAULTCROPORIGIN, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "DefaultCropOrigin", NULL},
{TIFFTAG_DEFAULTCROPSIZE, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "DefaultCropSize", NULL},
{TIFFTAG_COLORMATRIX1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ColorMatrix1", NULL},
{TIFFTAG_COLORMATRIX2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ColorMatrix2", NULL},
{TIFFTAG_CAMERACALIBRATION1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "CameraCalibration1", NULL},
{TIFFTAG_CAMERACALIBRATION2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "CameraCalibration2", NULL},
{TIFFTAG_REDUCTIONMATRIX1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ReductionMatrix1", NULL},
{TIFFTAG_REDUCTIONMATRIX2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ReductionMatrix2", NULL},
{TIFFTAG_ANALOGBALANCE, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "AnalogBalance", NULL},
{TIFFTAG_ASSHOTNEUTRAL, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "AsShotNeutral", NULL},
{TIFFTAG_ASSHOTWHITEXY, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "AsShotWhiteXY", NULL},
{TIFFTAG_BASELINEEXPOSURE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "BaselineExposure", NULL},
{TIFFTAG_BASELINENOISE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "BaselineNoise", NULL},
{TIFFTAG_BASELINESHARPNESS, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "BaselineSharpness", NULL},
{TIFFTAG_BAYERGREENSPLIT, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "BayerGreenSplit", NULL},
{TIFFTAG_LINEARRESPONSELIMIT, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "LinearResponseLimit", NULL},
{TIFFTAG_CAMERASERIALNUMBER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "CameraSerialNumber", NULL},
{TIFFTAG_LENSINFO, 4, 4, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "LensInfo", NULL},
{TIFFTAG_CHROMABLURRADIUS, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "ChromaBlurRadius", NULL},
{TIFFTAG_ANTIALIASSTRENGTH, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "AntiAliasStrength", NULL},
{TIFFTAG_SHADOWSCALE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "ShadowScale", NULL},
{TIFFTAG_DNGPRIVATEDATA, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "DNGPrivateData", NULL},
{TIFFTAG_MAKERNOTESAFETY, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "MakerNoteSafety", NULL},
{TIFFTAG_CALIBRATIONILLUMINANT1, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CalibrationIlluminant1", NULL},
{TIFFTAG_CALIBRATIONILLUMINANT2, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CalibrationIlluminant2", NULL},
{TIFFTAG_RAWDATAUNIQUEID, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "RawDataUniqueID", NULL},
{TIFFTAG_ORIGINALRAWFILENAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "OriginalRawFileName", NULL},
{TIFFTAG_ORIGINALRAWFILEDATA, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "OriginalRawFileData", NULL},
{TIFFTAG_ACTIVEAREA, 4, 4, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "ActiveArea", NULL},
{TIFFTAG_MASKEDAREAS, -1, -1, TIFF_LONG, 0, TIFF_SETGET_C16_UINT32, FIELD_CUSTOM, 1, 1, "MaskedAreas", NULL},
{TIFFTAG_ASSHOTICCPROFILE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "AsShotICCProfile", NULL},
{TIFFTAG_ASSHOTPREPROFILEMATRIX, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "AsShotPreProfileMatrix", NULL},
{TIFFTAG_CURRENTICCPROFILE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "CurrentICCProfile", NULL},
{TIFFTAG_CURRENTPREPROFILEMATRIX, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "CurrentPreProfileMatrix", NULL},
{TIFFTAG_PERSAMPLE, 0, 0, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, TRUE, FALSE, "PerSample", NULL},
#if 0
/* begin DNG 1.2.0.0 tags */
{TIFFTAG_COLORIMETRICREFERENCE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ColorimetricReference", NULL},
{TIFFTAG_CAMERACALIBRATIONSIGNATURE, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "CameraCalibrationSignature", NULL},
{TIFFTAG_PROFILECALIBRATIONSIGNATURE, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ProfileCalibrationSignature", NULL},
{TIFFTAG_EXTRACAMERAPROFILES, -1, -1, TIFF_IFD8, 0, TIFF_SETGET_C16_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ExtraCameraProfiles", NULL},
{TIFFTAG_ASSHOTPROFILENAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "AsShotProfileName", NULL},
{TIFFTAG_NOISEREDUCTIONAPPLIED, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "NoiseReductionApplied", NULL},
{TIFFTAG_PROFILENAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ProfileName", NULL},
{TIFFTAG_PROFILEHUESATMAPDIMS, 3, 3, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ProfileHueSatMapDims", NULL},
{TIFFTAG_PROFILEHUESATMAPDATA1, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ProfileHueSatMapData1", NULL},
{TIFFTAG_PROFILEHUESATMAPDATA2, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ProfileHueSatMapData2", NULL},
{TIFFTAG_PROFILETONECURVE, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ProfileToneCurve", NULL},
{TIFFTAG_PROFILEEMBEDPOLICY, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ProfileEmbedPolicy", NULL},
{TIFFTAG_PROFILECOPYRIGHT, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ProfileCopyright", NULL},
{TIFFTAG_FORWARDMATRIX1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ForwardMatrix1", NULL},
{TIFFTAG_FORWARDMATRIX2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ForwardMatrix2", NULL},
{TIFFTAG_PREVIEWAPPLICATIONNAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "PreviewApplicationName", NULL},
{TIFFTAG_PREVIEWAPPLICATIONVERSION, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "PreviewApplicationVersion", NULL},
{TIFFTAG_PREVIEWSETTINGSNAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "PreviewSettingsName", NULL},
{TIFFTAG_PREVIEWSETTINGSDIGEST, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "PreviewSettingsDigest", NULL},
{TIFFTAG_PREVIEWCOLORSPACE, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "PreviewColorSpace", NULL},
{TIFFTAG_PREVIEWDATETIME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "PreviewDateTime", NULL},
{TIFFTAG_RAWIMAGEDIGEST, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "RawImageDigest", NULL},
{TIFFTAG_ORIGINALRAWFILEDIGEST, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "OriginalRawFileDigest", NULL},
{TIFFTAG_SUBTILEBLOCKSIZE, 2, 2, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubTileBlockSize", NULL},
{TIFFTAG_ROWINTERLEAVEFACTOR, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "RowInterleaveFactor", NULL},
{TIFFTAG_PROFILELOOKTABLEDIMS, 3, 3, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ProfileLookTableDims", NULL},
{TIFFTAG_PROFILELOOKTABLEDATA, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ProfileLookTableData", NULL},
{TIFFTAG_COLORIMETRICREFERENCE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "ColorimetricReference", NULL},
{TIFFTAG_CAMERACALIBRATIONSIGNATURE, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "CameraCalibrationSignature", NULL},
{TIFFTAG_PROFILECALIBRATIONSIGNATURE, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "ProfileCalibrationSignature", NULL},
{TIFFTAG_EXTRACAMERAPROFILES, -1, -1, TIFF_IFD8, 0, TIFF_SETGET_C16_IFD8, FIELD_CUSTOM, 1, 1, "ExtraCameraProfiles", NULL},
{TIFFTAG_ASSHOTPROFILENAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "AsShotProfileName", NULL},
{TIFFTAG_NOISEREDUCTIONAPPLIED, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "NoiseReductionApplied", NULL},
{TIFFTAG_PROFILENAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "ProfileName", NULL},
{TIFFTAG_PROFILEHUESATMAPDIMS, 3, 3, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "ProfileHueSatMapDims", NULL},
{TIFFTAG_PROFILEHUESATMAPDATA1, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ProfileHueSatMapData1", NULL},
{TIFFTAG_PROFILEHUESATMAPDATA2, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ProfileHueSatMapData2", NULL},
{TIFFTAG_PROFILETONECURVE, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ProfileToneCurve", NULL},
{TIFFTAG_PROFILEEMBEDPOLICY, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ProfileEmbedPolicy", NULL},
{TIFFTAG_PROFILECOPYRIGHT, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "ProfileCopyright", NULL},
{TIFFTAG_FORWARDMATRIX1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ForwardMatrix1", NULL},
{TIFFTAG_FORWARDMATRIX2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ForwardMatrix2", NULL},
{TIFFTAG_PREVIEWAPPLICATIONNAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "PreviewApplicationName", NULL},
{TIFFTAG_PREVIEWAPPLICATIONVERSION, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "PreviewApplicationVersion", NULL},
{TIFFTAG_PREVIEWSETTINGSNAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "PreviewSettingsName", NULL},
{TIFFTAG_PREVIEWSETTINGSDIGEST, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "PreviewSettingsDigest", NULL},
{TIFFTAG_PREVIEWCOLORSPACE, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "PreviewColorSpace", NULL},
{TIFFTAG_PREVIEWDATETIME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "PreviewDateTime", NULL},
{TIFFTAG_RAWIMAGEDIGEST, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "RawImageDigest", NULL},
{TIFFTAG_ORIGINALRAWFILEDIGEST, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "OriginalRawFileDigest", NULL},
{TIFFTAG_SUBTILEBLOCKSIZE, 2, 2, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "SubTileBlockSize", NULL},
{TIFFTAG_ROWINTERLEAVEFACTOR, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "RowInterleaveFactor", NULL},
{TIFFTAG_PROFILELOOKTABLEDIMS, 3, 3, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "ProfileLookTableDims", NULL},
{TIFFTAG_PROFILELOOKTABLEDATA, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ProfileLookTableData", NULL},
/* begin DNG 1.3.0.0 tags */
{TIFFTAG_OPCODELIST1, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "OpcodeList1", NULL},
{TIFFTAG_OPCODELIST2, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "OpcodeList2", NULL},
{TIFFTAG_OPCODELIST3, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "OpcodeList3", NULL},
{TIFFTAG_NOISEPROFILE, -1, -1, TIFF_DOUBLE, 0, TIFF_SETGET_C16_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "NoiseProfile", NULL},
{TIFFTAG_OPCODELIST1, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "OpcodeList1", NULL},
{TIFFTAG_OPCODELIST2, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "OpcodeList2", NULL},
{TIFFTAG_OPCODELIST3, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "OpcodeList3", NULL},
{TIFFTAG_NOISEPROFILE, -1, -1, TIFF_DOUBLE, 0, TIFF_SETGET_C16_DOUBLE, FIELD_CUSTOM, 1, 1, "NoiseProfile", NULL},
/* begin DNG 1.4.0.0 tags */
{TIFFTAG_DEFAULTUSERCROP, 4, 4, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DefaultUserCrop", NULL},
{TIFFTAG_DEFAULTBLACKRENDER, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DefaultBlackRender", NULL},
{TIFFTAG_BASELINEEXPOSUREOFFSET, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "BaselineExposureOffset", NULL},
{TIFFTAG_PROFILELOOKTABLEENCODING, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ProfileLookTableEncoding", NULL},
{TIFFTAG_PROFILEHUESATMAPENCODING, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ProfileHueSatMapEncoding", NULL},
{TIFFTAG_ORIGINALDEFAULTFINALSIZE, 2, 2, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "OriginalDefaultFinalSize", NULL},
{TIFFTAG_ORIGINALBESTQUALITYFINALSIZE, 2, 2, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "OriginalBestQualityFinalSize", NULL},
{TIFFTAG_ORIGINALDEFAULTCROPSIZE, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "OriginalDefaultCropSize", NULL}, /* could also be rational */
{TIFFTAG_NEWRAWIMAGEDIGEST, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "NewRawImageDigest", NULL},
{TIFFTAG_RAWTOPREVIEWGAIN, 1, 1, TIFF_DOUBLE, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "RawToPreviewGain", NULL},
{TIFFTAG_DEFAULTUSERCROP, 4, 4, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "DefaultUserCrop", NULL},
{TIFFTAG_DEFAULTBLACKRENDER, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "DefaultBlackRender", NULL},
{TIFFTAG_BASELINEEXPOSUREOFFSET, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "BaselineExposureOffset", NULL},
{TIFFTAG_PROFILELOOKTABLEENCODING, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ProfileLookTableEncoding", NULL},
{TIFFTAG_PROFILEHUESATMAPENCODING, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ProfileHueSatMapEncoding", NULL},
{TIFFTAG_ORIGINALDEFAULTFINALSIZE, 2, 2, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "OriginalDefaultFinalSize", NULL},
{TIFFTAG_ORIGINALBESTQUALITYFINALSIZE, 2, 2, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "OriginalBestQualityFinalSize", NULL},
{TIFFTAG_ORIGINALDEFAULTCROPSIZE, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "OriginalDefaultCropSize", NULL}, /* could also be rational */
{TIFFTAG_NEWRAWIMAGEDIGEST, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "NewRawImageDigest", NULL},
{TIFFTAG_RAWTOPREVIEWGAIN, 1, 1, TIFF_DOUBLE, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "RawToPreviewGain", NULL},
/* begin DNG 1.5.0.0 tags */
{TIFFTAG_DEPTHFORMAT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DepthFormat", NULL},
{TIFFTAG_DEPTHNEAR, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DepthNear", NULL},
{TIFFTAG_DEPTHFAR, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DepthFar", NULL},
{TIFFTAG_DEPTHUNITS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DepthUnits", NULL},
{TIFFTAG_DEPTHMEASURETYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DepthMeasureType", NULL},
{TIFFTAG_ENHANCEPARAMS, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EnhanceParams", NULL},
{TIFFTAG_DEPTHFORMAT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "DepthFormat", NULL},
{TIFFTAG_DEPTHNEAR, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "DepthNear", NULL},
{TIFFTAG_DEPTHFAR, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "DepthFar", NULL},
{TIFFTAG_DEPTHUNITS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "DepthUnits", NULL},
{TIFFTAG_DEPTHMEASURETYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "DepthMeasureType", NULL},
{TIFFTAG_ENHANCEPARAMS, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "EnhanceParams", NULL},
/* begin DNG 1.6.0.0 tags */
{TIFFTAG_PROFILEGAINTABLEMAP, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ProfileGainTableMap", NULL},
{TIFFTAG_SEMANTICNAME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SemanticName", NULL},
{TIFFTAG_SEMANTICINSTANCEID, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SemanticInstanceID", NULL},
{TIFFTAG_MASKSUBAREA, 4, 4, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "MaskSubArea", NULL},
{TIFFTAG_RGBTABLES, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "RGBTables", NULL},
{TIFFTAG_CALIBRATIONILLUMINANT3, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CalibrationIlluminant3", NULL},
{TIFFTAG_COLORMATRIX3, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ColorMatrix3", NULL},
{TIFFTAG_CAMERACALIBRATION3, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "CameraCalibration3", NULL},
{TIFFTAG_REDUCTIONMATRIX3, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ReductionMatrix3", NULL},
{TIFFTAG_PROFILEHUESATMAPDATA3, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ProfileHueSatMapData3", NULL},
{TIFFTAG_FORWARDMATRIX3, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ForwardMatrix3", NULL},
{TIFFTAG_ILLUMINANTDATA1, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "IlluminantData1", NULL},
{TIFFTAG_ILLUMINANTDATA2, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "IlluminantData2", NULL},
{TIFFTAG_ILLUMINANTDATA3, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "IlluminantData3", NULL},
{TIFFTAG_PROFILEGAINTABLEMAP, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "ProfileGainTableMap", NULL},
{TIFFTAG_SEMANTICNAME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "SemanticName", NULL},
{TIFFTAG_SEMANTICINSTANCEID, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "SemanticInstanceID", NULL},
{TIFFTAG_MASKSUBAREA, 4, 4, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "MaskSubArea", NULL},
{TIFFTAG_RGBTABLES, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "RGBTables", NULL},
{TIFFTAG_CALIBRATIONILLUMINANT3, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CalibrationIlluminant3", NULL},
{TIFFTAG_COLORMATRIX3, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ColorMatrix3", NULL},
{TIFFTAG_CAMERACALIBRATION3, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "CameraCalibration3", NULL},
{TIFFTAG_REDUCTIONMATRIX3, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ReductionMatrix3", NULL},
{TIFFTAG_PROFILEHUESATMAPDATA3, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ProfileHueSatMapData3", NULL},
{TIFFTAG_FORWARDMATRIX3, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ForwardMatrix3", NULL},
{TIFFTAG_ILLUMINANTDATA1, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "IlluminantData1", NULL},
{TIFFTAG_ILLUMINANTDATA2, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "IlluminantData2", NULL},
{TIFFTAG_ILLUMINANTDATA3, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "IlluminantData3", NULL},
/* end DNG tags */
#endif
/* begin TIFF/EP tags */
{TIFFTAG_EP_CFAREPEATPATTERNDIM, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP CFARepeatPatternDim", NULL},
{TIFFTAG_EP_CFAPATTERN, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "EP CFAPattern", NULL},
{TIFFTAG_EP_CFAREPEATPATTERNDIM, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, FIELD_CUSTOM, 1, 0, "EP CFARepeatPatternDim", NULL},
{TIFFTAG_EP_CFAPATTERN, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "EP CFAPattern", NULL},
#if 0
/* TIFFTAG_EP_BATTERYLEVEL can be RATIONAL or ASCII.
* LibTiff defines it as ASCII and converts RATIONAL to an ASCII string. */
{TIFFTAG_EP_BATTERYLEVEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP BatteryLevel", NULL},
{TIFFTAG_EP_INTERLACE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP Interlace", NULL},
{TIFFTAG_EP_BATTERYLEVEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "EP BatteryLevel", NULL},
{TIFFTAG_EP_INTERLACE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP Interlace", NULL},
/* TIFFTAG_EP_IPTC_NAA and TIFFTAG_RICHTIFFIPTC share the same tag number (33723)
* LibTIFF type is UNDEFINED or BYTE, but often times incorrectly specified as LONG, because TIFF/EP (ISO/DIS 12234-2) specifies type LONG or ASCII. */
{TIFFTAG_EP_TIMEZONEOFFSET, -1, -1, TIFF_SSHORT, 0, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "EP TimeZoneOffset", NULL},
{TIFFTAG_EP_SELFTIMERMODE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP SelfTimerMode", NULL},
{TIFFTAG_EP_FLASHENERGY, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "EP FlashEnergy", NULL},
{TIFFTAG_EP_SPATIALFREQUENCYRESPONSE, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "EP SpatialFrequencyResponse", NULL},
{TIFFTAG_EP_NOISE, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "EP Noise", NULL},
{TIFFTAG_EP_FOCALPLANEXRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP FocalPlaneXResolution", NULL},
{TIFFTAG_EP_FOCALPLANEYRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP FocalPlaneYResolution", NULL},
{TIFFTAG_EP_FOCALPLANERESOLUTIONUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP FocalPlaneResolutionUnit", NULL},
{TIFFTAG_EP_IMAGENUMBER, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP ImageNumber", NULL}, /* or SHORT */
{TIFFTAG_EP_SECURITYCLASSIFICATION, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP SecurityClassification", NULL},
{TIFFTAG_EP_IMAGEHISTORY, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP ImageHistory", NULL},
{TIFFTAG_EP_EXPOSUREINDEX, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "EP ExposureIndex", NULL},
{TIFFTAG_EP_STANDARDID, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP StandardId", NULL},
{TIFFTAG_EP_SENSINGMETHOD, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP SensingMethod", NULL},
{TIFFTAG_EP_TIMEZONEOFFSET, -1, -1, TIFF_SSHORT, 0, TIFF_SETGET_C16_UINT16, FIELD_CUSTOM, 1, 1, "EP TimeZoneOffset", NULL},
{TIFFTAG_EP_SELFTIMERMODE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP SelfTimerMode", NULL},
{TIFFTAG_EP_FLASHENERGY, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP FlashEnergy", NULL},
{TIFFTAG_EP_SPATIALFREQUENCYRESPONSE, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "EP SpatialFrequencyResponse", NULL},
{TIFFTAG_EP_NOISE, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "EP Noise", NULL},
{TIFFTAG_EP_FOCALPLANEXRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "EP FocalPlaneXResolution", NULL},
{TIFFTAG_EP_FOCALPLANEYRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "EP FocalPlaneYResolution", NULL},
{TIFFTAG_EP_FOCALPLANERESOLUTIONUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP FocalPlaneResolutionUnit", NULL},
{TIFFTAG_EP_IMAGENUMBER, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "EP ImageNumber", NULL}, /* or SHORT */
{TIFFTAG_EP_SECURITYCLASSIFICATION, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "EP SecurityClassification", NULL},
{TIFFTAG_EP_IMAGEHISTORY, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "EP ImageHistory", NULL},
{TIFFTAG_EP_EXPOSUREINDEX, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP ExposureIndex", NULL},
{TIFFTAG_EP_STANDARDID, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "EP StandardId", NULL},
{TIFFTAG_EP_SENSINGMETHOD, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP SensingMethod", NULL},
/* TIFF/EP tags equivalent to EXIF tags, sometimes defined differently. */
{TIFFTAG_EP_EXPOSURETIME, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "EP ExposureTime", NULL}, /*N=1 or 2 */
{TIFFTAG_EP_FNUMBER, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "EP FNumber", NULL},
{TIFFTAG_EP_EXPOSUREPROGRAM, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP ExposureProgram", NULL},
{TIFFTAG_EP_SPECTRALSENSITIVITY, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP SpectralSensitivity", NULL},
{TIFFTAG_EP_ISOSPEEDRATINGS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP ISOSpeedRatings", NULL},
{TIFFTAG_EP_OECF, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "EP OptoelectricConversionFactor", NULL},
{TIFFTAG_EP_DATETIMEORIGINAL, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP DateTimeOriginal", NULL},
{TIFFTAG_EP_COMPRESSEDBITSPERPIXEL, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP CompressedBitsPerPixel", NULL},
{TIFFTAG_EP_SHUTTERSPEEDVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP ShutterSpeedValue", NULL},
{TIFFTAG_EP_APERTUREVALUE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP ApertureValue", NULL},
{TIFFTAG_EP_BRIGHTNESSVALUE, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "EP BrightnessValue", NULL},
{TIFFTAG_EP_EXPOSUREBIASVALUE, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "EP ExposureBiasValue", NULL}, /*N=1 or 2 */
{TIFFTAG_EP_MAXAPERTUREVALUE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP MaxApertureValue", NULL},
{TIFFTAG_EP_SUBJECTDISTANCE, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "EP SubjectDistance", NULL},
{TIFFTAG_EP_METERINGMODE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP MeteringMode", NULL},
{TIFFTAG_EP_LIGHTSOURCE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP LightSource", NULL},
{TIFFTAG_EP_FLASH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "EP Flash", NULL},
{TIFFTAG_EP_FOCALLENGTH, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "EP FocalLength", NULL},
{TIFFTAG_EP_SUBJECTLOCATION, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "EP SubjectLocation", NULL},
{TIFFTAG_EP_EXPOSURETIME, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP ExposureTime", NULL}, /*N=1 or 2 */
{TIFFTAG_EP_FNUMBER, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP FNumber", NULL},
{TIFFTAG_EP_EXPOSUREPROGRAM, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP ExposureProgram", NULL},
{TIFFTAG_EP_SPECTRALSENSITIVITY, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "EP SpectralSensitivity", NULL},
{TIFFTAG_EP_ISOSPEEDRATINGS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP ISOSpeedRatings", NULL},
{TIFFTAG_EP_OECF, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "EP OptoelectricConversionFactor", NULL},
{TIFFTAG_EP_DATETIMEORIGINAL, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "EP DateTimeOriginal", NULL},
{TIFFTAG_EP_COMPRESSEDBITSPERPIXEL, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "EP CompressedBitsPerPixel", NULL},
{TIFFTAG_EP_SHUTTERSPEEDVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "EP ShutterSpeedValue", NULL},
{TIFFTAG_EP_APERTUREVALUE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "EP ApertureValue", NULL},
{TIFFTAG_EP_BRIGHTNESSVALUE, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP BrightnessValue", NULL},
{TIFFTAG_EP_EXPOSUREBIASVALUE, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP ExposureBiasValue", NULL}, /*N=1 or 2 */
{TIFFTAG_EP_MAXAPERTUREVALUE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "EP MaxApertureValue", NULL},
{TIFFTAG_EP_SUBJECTDISTANCE, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP SubjectDistance", NULL},
{TIFFTAG_EP_METERINGMODE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP MeteringMode", NULL},
{TIFFTAG_EP_LIGHTSOURCE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP LightSource", NULL},
{TIFFTAG_EP_FLASH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP Flash", NULL},
{TIFFTAG_EP_FOCALLENGTH, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP FocalLength", NULL},
{TIFFTAG_EP_SUBJECTLOCATION, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, FIELD_CUSTOM, 1, 1, "EP SubjectLocation", NULL},
/* end TIFF/EP tags */
#endif
/* begin TIFF/FX tags */
{TIFFTAG_INDEXED, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Indexed", NULL},
{TIFFTAG_GLOBALPARAMETERSIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "GlobalParametersIFD", NULL},
{TIFFTAG_PROFILETYPE, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ProfileType", NULL},
{TIFFTAG_FAXPROFILE, 1, 1, TIFF_BYTE, 0, TIFF_SETGET_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FaxProfile", NULL},
{TIFFTAG_CODINGMETHODS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CodingMethods", NULL},
{TIFFTAG_VERSIONYEAR, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "VersionYear", NULL},
{TIFFTAG_MODENUMBER, 1, 1, TIFF_BYTE, 0, TIFF_SETGET_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ModeNumber", NULL},
{TIFFTAG_DECODE, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "Decode", NULL},
{TIFFTAG_IMAGEBASECOLOR, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ImageBaseColor", NULL},
{TIFFTAG_T82OPTIONS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "T82Options", NULL},
{TIFFTAG_STRIPROWCOUNTS, -1, -1, TIFF_LONG, 0, TIFF_SETGET_C16_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "StripRowCounts", NULL},
{TIFFTAG_IMAGELAYER, 2, 2, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImageLayer", NULL},
{TIFFTAG_INDEXED, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "Indexed", NULL},
{TIFFTAG_GLOBALPARAMETERSIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, FIELD_CUSTOM, 1, 0, "GlobalParametersIFD", NULL},
{TIFFTAG_PROFILETYPE, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ProfileType", NULL},
{TIFFTAG_FAXPROFILE, 1, 1, TIFF_BYTE, 0, TIFF_SETGET_UINT8, FIELD_CUSTOM, 1, 0, "FaxProfile", NULL},
{TIFFTAG_CODINGMETHODS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "CodingMethods", NULL},
{TIFFTAG_VERSIONYEAR, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "VersionYear", NULL},
{TIFFTAG_MODENUMBER, 1, 1, TIFF_BYTE, 0, TIFF_SETGET_UINT8, FIELD_CUSTOM, 1, 0, "ModeNumber", NULL},
{TIFFTAG_DECODE, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "Decode", NULL},
{TIFFTAG_IMAGEBASECOLOR, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, FIELD_CUSTOM, 1, 1, "ImageBaseColor", NULL},
{TIFFTAG_T82OPTIONS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "T82Options", NULL},
{TIFFTAG_STRIPROWCOUNTS, -1, -1, TIFF_LONG, 0, TIFF_SETGET_C16_UINT32, FIELD_CUSTOM, 1, 1, "StripRowCounts", NULL},
{TIFFTAG_IMAGELAYER, 2, 2, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "ImageLayer", NULL},
/* end TIFF/FX tags */
/* begin pseudo tags */
};
@@ -348,91 +348,91 @@ static const TIFFField tiffFields[] = {
* EXIF tags (Version 2.31, July 2016 plus version 2.32 May 2019)
*/
static const TIFFField exifFields[] = {
{EXIFTAG_EXPOSURETIME, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ExposureTime", NULL},
{EXIFTAG_FNUMBER, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FNumber", NULL},
{EXIFTAG_EXPOSUREPROGRAM, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ExposureProgram", NULL},
{EXIFTAG_SPECTRALSENSITIVITY, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SpectralSensitivity", NULL},
{EXIFTAG_EXPOSURETIME, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "ExposureTime", NULL},
{EXIFTAG_FNUMBER, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "FNumber", NULL},
{EXIFTAG_EXPOSUREPROGRAM, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "ExposureProgram", NULL},
{EXIFTAG_SPECTRALSENSITIVITY, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "SpectralSensitivity", NULL},
/* After EXIF 2.2.1 ISOSpeedRatings is named PhotographicSensitivity. In addition, while "Count=Any", only 1 count should be used. */
{EXIFTAG_ISOSPEEDRATINGS, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ISOSpeedRatings", NULL},
{EXIFTAG_OECF, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "OptoelectricConversionFactor", NULL},
{EXIFTAG_SENSITIVITYTYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SensitivityType", NULL},
{EXIFTAG_STANDARDOUTPUTSENSITIVITY, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "StandardOutputSensitivity", NULL},
{EXIFTAG_RECOMMENDEDEXPOSUREINDEX, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "RecommendedExposureIndex", NULL},
{EXIFTAG_ISOSPEED, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ISOSpeed", NULL},
{EXIFTAG_ISOSPEEDLATITUDEYYY, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ISOSpeedLatitudeyyy", NULL},
{EXIFTAG_ISOSPEEDLATITUDEZZZ, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ISOSpeedLatitudezzz", NULL},
{EXIFTAG_EXIFVERSION, 4, 4, TIFF_UNDEFINED, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ExifVersion", NULL},
{EXIFTAG_DATETIMEORIGINAL, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DateTimeOriginal", NULL},
{EXIFTAG_DATETIMEDIGITIZED, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DateTimeDigitized", NULL},
{EXIFTAG_OFFSETTIME, 7, 7, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "OffsetTime", NULL},
{EXIFTAG_OFFSETTIMEORIGINAL, 7, 7, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "OffsetTimeOriginal", NULL},
{EXIFTAG_OFFSETTIMEDIGITIZED, 7, 7, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "OffsetTimeDigitized", NULL},
{EXIFTAG_COMPONENTSCONFIGURATION, 4, 4, TIFF_UNDEFINED, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ComponentsConfiguration", NULL},
{EXIFTAG_COMPRESSEDBITSPERPIXEL, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CompressedBitsPerPixel", NULL},
{EXIFTAG_SHUTTERSPEEDVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ShutterSpeedValue", NULL},
{EXIFTAG_APERTUREVALUE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ApertureValue", NULL},
{EXIFTAG_BRIGHTNESSVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "BrightnessValue", NULL},
{EXIFTAG_EXPOSUREBIASVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ExposureBiasValue", NULL},
{EXIFTAG_MAXAPERTUREVALUE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "MaxApertureValue", NULL},
{EXIFTAG_ISOSPEEDRATINGS, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, FIELD_CUSTOM, 1, 1, "ISOSpeedRatings", NULL},
{EXIFTAG_OECF, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "OptoelectricConversionFactor", NULL},
{EXIFTAG_SENSITIVITYTYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "SensitivityType", NULL},
{EXIFTAG_STANDARDOUTPUTSENSITIVITY, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "StandardOutputSensitivity", NULL},
{EXIFTAG_RECOMMENDEDEXPOSUREINDEX, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "RecommendedExposureIndex", NULL},
{EXIFTAG_ISOSPEED, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ISOSpeed", NULL},
{EXIFTAG_ISOSPEEDLATITUDEYYY, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ISOSpeedLatitudeyyy", NULL},
{EXIFTAG_ISOSPEEDLATITUDEZZZ, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ISOSpeedLatitudezzz", NULL},
{EXIFTAG_EXIFVERSION, 4, 4, TIFF_UNDEFINED, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "ExifVersion", NULL},
{EXIFTAG_DATETIMEORIGINAL, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DateTimeOriginal", NULL},
{EXIFTAG_DATETIMEDIGITIZED, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DateTimeDigitized", NULL},
{EXIFTAG_OFFSETTIME, 7, 7, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "OffsetTime", NULL},
{EXIFTAG_OFFSETTIMEORIGINAL, 7, 7, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "OffsetTimeOriginal", NULL},
{EXIFTAG_OFFSETTIMEDIGITIZED, 7, 7, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "OffsetTimeDigitized", NULL},
{EXIFTAG_COMPONENTSCONFIGURATION, 4, 4, TIFF_UNDEFINED, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "ComponentsConfiguration", NULL},
{EXIFTAG_COMPRESSEDBITSPERPIXEL, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "CompressedBitsPerPixel", NULL},
{EXIFTAG_SHUTTERSPEEDVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "ShutterSpeedValue", NULL},
{EXIFTAG_APERTUREVALUE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "ApertureValue", NULL},
{EXIFTAG_BRIGHTNESSVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "BrightnessValue", NULL},
{EXIFTAG_EXPOSUREBIASVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "ExposureBiasValue", NULL},
{EXIFTAG_MAXAPERTUREVALUE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "MaxApertureValue", NULL},
/*--: EXIFTAG_SUBJECTDISTANCE: LibTiff returns value of "-1" if numerator equals 4294967295 (0xFFFFFFFF) to indicate infinite distance!
* However, there are two other EXIF tags where numerator indicates a special value and six other cases where the denominator indicates special values,
* which are not treated within LibTiff!! */
{EXIFTAG_SUBJECTDISTANCE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubjectDistance", NULL},
{EXIFTAG_METERINGMODE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "MeteringMode", NULL},
{EXIFTAG_LIGHTSOURCE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "LightSource", NULL},
{EXIFTAG_FLASH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Flash", NULL},
{EXIFTAG_FOCALLENGTH, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FocalLength", NULL},
{EXIFTAG_SUBJECTAREA, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "SubjectArea", NULL},
{EXIFTAG_MAKERNOTE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "MakerNote", NULL},
{EXIFTAG_USERCOMMENT, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "UserComment", NULL},
{EXIFTAG_SUBSECTIME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubSecTime", NULL},
{EXIFTAG_SUBSECTIMEORIGINAL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubSecTimeOriginal", NULL},
{EXIFTAG_SUBSECTIMEDIGITIZED, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubSecTimeDigitized", NULL},
{EXIFTAG_TEMPERATURE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Temperature", NULL},
{EXIFTAG_HUMIDITY, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Humidity", NULL},
{EXIFTAG_PRESSURE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Pressure", NULL},
{EXIFTAG_WATERDEPTH, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "WaterDepth", NULL},
{EXIFTAG_ACCELERATION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Acceleration", NULL},
{EXIFTAG_CAMERAELEVATIONANGLE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CameraElevationAngle", NULL},
{EXIFTAG_FLASHPIXVERSION, 4, 4, TIFF_UNDEFINED, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FlashpixVersion", NULL},
{EXIFTAG_COLORSPACE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ColorSpace", NULL},
{EXIFTAG_PIXELXDIMENSION, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "PixelXDimension", NULL},
{EXIFTAG_PIXELYDIMENSION, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "PixelYDimension", NULL},
{EXIFTAG_RELATEDSOUNDFILE, 13, 13, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "RelatedSoundFile", NULL},
{EXIFTAG_FLASHENERGY, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FlashEnergy", NULL},
{EXIFTAG_SPATIALFREQUENCYRESPONSE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "SpatialFrequencyResponse", NULL},
{EXIFTAG_FOCALPLANEXRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FocalPlaneXResolution", NULL},
{EXIFTAG_FOCALPLANEYRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FocalPlaneYResolution", NULL},
{EXIFTAG_FOCALPLANERESOLUTIONUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FocalPlaneResolutionUnit", NULL},
{EXIFTAG_SUBJECTLOCATION, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubjectLocation", NULL},
{EXIFTAG_EXPOSUREINDEX, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ExposureIndex", NULL},
{EXIFTAG_SENSINGMETHOD, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SensingMethod", NULL},
{EXIFTAG_FILESOURCE, 1, 1, TIFF_UNDEFINED, 0, TIFF_SETGET_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FileSource", NULL},
{EXIFTAG_SCENETYPE, 1, 1, TIFF_UNDEFINED, 0, TIFF_SETGET_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SceneType", NULL},
{EXIFTAG_CFAPATTERN, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "CFAPattern", NULL},
{EXIFTAG_CUSTOMRENDERED, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CustomRendered", NULL},
{EXIFTAG_EXPOSUREMODE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ExposureMode", NULL},
{EXIFTAG_WHITEBALANCE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "WhiteBalance", NULL},
{EXIFTAG_DIGITALZOOMRATIO, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DigitalZoomRatio", NULL},
{EXIFTAG_FOCALLENGTHIN35MMFILM, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FocalLengthIn35mmFilm", NULL},
{EXIFTAG_SCENECAPTURETYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SceneCaptureType", NULL},
{EXIFTAG_GAINCONTROL, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "GainControl", NULL},
{EXIFTAG_CONTRAST, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Contrast", NULL},
{EXIFTAG_SATURATION, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Saturation", NULL},
{EXIFTAG_SHARPNESS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Sharpness", NULL},
{EXIFTAG_DEVICESETTINGDESCRIPTION, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "DeviceSettingDescription", NULL},
{EXIFTAG_SUBJECTDISTANCERANGE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubjectDistanceRange", NULL},
{EXIFTAG_IMAGEUNIQUEID, 33, 33, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImageUniqueID", NULL},
{EXIFTAG_CAMERAOWNERNAME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CameraOwnerName", NULL},
{EXIFTAG_BODYSERIALNUMBER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "BodySerialNumber", NULL},
{EXIFTAG_LENSSPECIFICATION, 4, 4, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "LensSpecification", NULL},
{EXIFTAG_LENSMAKE, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "LensMake", NULL},
{EXIFTAG_LENSMODEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "LensModel", NULL},
{EXIFTAG_LENSSERIALNUMBER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "LensSerialNumber", NULL},
{EXIFTAG_GAMMA, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Gamma", NULL},
{EXIFTAG_COMPOSITEIMAGE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CompositeImage", NULL},
{EXIFTAG_SOURCEIMAGENUMBEROFCOMPOSITEIMAGE, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SourceImageNumberOfCompositeImage", NULL},
{EXIFTAG_SOURCEEXPOSURETIMESOFCOMPOSITEIMAGE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1,
{EXIFTAG_SUBJECTDISTANCE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "SubjectDistance", NULL},
{EXIFTAG_METERINGMODE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "MeteringMode", NULL},
{EXIFTAG_LIGHTSOURCE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "LightSource", NULL},
{EXIFTAG_FLASH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "Flash", NULL},
{EXIFTAG_FOCALLENGTH, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "FocalLength", NULL},
{EXIFTAG_SUBJECTAREA, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, FIELD_CUSTOM, 1, 1, "SubjectArea", NULL},
{EXIFTAG_MAKERNOTE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "MakerNote", NULL},
{EXIFTAG_USERCOMMENT, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "UserComment", NULL},
{EXIFTAG_SUBSECTIME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "SubSecTime", NULL},
{EXIFTAG_SUBSECTIMEORIGINAL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "SubSecTimeOriginal", NULL},
{EXIFTAG_SUBSECTIMEDIGITIZED, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "SubSecTimeDigitized", NULL},
{EXIFTAG_TEMPERATURE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "Temperature", NULL},
{EXIFTAG_HUMIDITY, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "Humidity", NULL},
{EXIFTAG_PRESSURE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "Pressure", NULL},
{EXIFTAG_WATERDEPTH, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "WaterDepth", NULL},
{EXIFTAG_ACCELERATION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "Acceleration", NULL},
{EXIFTAG_CAMERAELEVATIONANGLE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "CameraElevationAngle", NULL},
{EXIFTAG_FLASHPIXVERSION, 4, 4, TIFF_UNDEFINED, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "FlashpixVersion", NULL},
{EXIFTAG_COLORSPACE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "ColorSpace", NULL},
{EXIFTAG_PIXELXDIMENSION, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "PixelXDimension", NULL},
{EXIFTAG_PIXELYDIMENSION, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "PixelYDimension", NULL},
{EXIFTAG_RELATEDSOUNDFILE, 13, 13, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "RelatedSoundFile", NULL},
{EXIFTAG_FLASHENERGY, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "FlashEnergy", NULL},
{EXIFTAG_SPATIALFREQUENCYRESPONSE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "SpatialFrequencyResponse", NULL},
{EXIFTAG_FOCALPLANEXRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "FocalPlaneXResolution", NULL},
{EXIFTAG_FOCALPLANEYRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "FocalPlaneYResolution", NULL},
{EXIFTAG_FOCALPLANERESOLUTIONUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "FocalPlaneResolutionUnit", NULL},
{EXIFTAG_SUBJECTLOCATION, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, FIELD_CUSTOM, 1, 0, "SubjectLocation", NULL},
{EXIFTAG_EXPOSUREINDEX, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "ExposureIndex", NULL},
{EXIFTAG_SENSINGMETHOD, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "SensingMethod", NULL},
{EXIFTAG_FILESOURCE, 1, 1, TIFF_UNDEFINED, 0, TIFF_SETGET_UINT8, FIELD_CUSTOM, 1, 0, "FileSource", NULL},
{EXIFTAG_SCENETYPE, 1, 1, TIFF_UNDEFINED, 0, TIFF_SETGET_UINT8, FIELD_CUSTOM, 1, 0, "SceneType", NULL},
{EXIFTAG_CFAPATTERN, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "CFAPattern", NULL},
{EXIFTAG_CUSTOMRENDERED, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CustomRendered", NULL},
{EXIFTAG_EXPOSUREMODE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "ExposureMode", NULL},
{EXIFTAG_WHITEBALANCE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "WhiteBalance", NULL},
{EXIFTAG_DIGITALZOOMRATIO, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "DigitalZoomRatio", NULL},
{EXIFTAG_FOCALLENGTHIN35MMFILM, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "FocalLengthIn35mmFilm", NULL},
{EXIFTAG_SCENECAPTURETYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "SceneCaptureType", NULL},
{EXIFTAG_GAINCONTROL, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "GainControl", NULL},
{EXIFTAG_CONTRAST, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "Contrast", NULL},
{EXIFTAG_SATURATION, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "Saturation", NULL},
{EXIFTAG_SHARPNESS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "Sharpness", NULL},
{EXIFTAG_DEVICESETTINGDESCRIPTION, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "DeviceSettingDescription", NULL},
{EXIFTAG_SUBJECTDISTANCERANGE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "SubjectDistanceRange", NULL},
{EXIFTAG_IMAGEUNIQUEID, 33, 33, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "ImageUniqueID", NULL},
{EXIFTAG_CAMERAOWNERNAME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "CameraOwnerName", NULL},
{EXIFTAG_BODYSERIALNUMBER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "BodySerialNumber", NULL},
{EXIFTAG_LENSSPECIFICATION, 4, 4, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "LensSpecification", NULL},
{EXIFTAG_LENSMAKE, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "LensMake", NULL},
{EXIFTAG_LENSMODEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "LensModel", NULL},
{EXIFTAG_LENSSERIALNUMBER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "LensSerialNumber", NULL},
{EXIFTAG_GAMMA, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "Gamma", NULL},
{EXIFTAG_COMPOSITEIMAGE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CompositeImage", NULL},
{EXIFTAG_SOURCEIMAGENUMBEROFCOMPOSITEIMAGE, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, FIELD_CUSTOM, 1, 0, "SourceImageNumberOfCompositeImage", NULL},
{EXIFTAG_SOURCEEXPOSURETIMESOFCOMPOSITEIMAGE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1,
"SourceExposureTimesOfCompositeImage", NULL}};
/*
* EXIF-GPS tags (Version 2.31, July 2016; nothing changed for version 2.32 May
@@ -445,38 +445,38 @@ static const TIFFField gpsFields[] = {
* In order to achieve double precision for GPS tags: Standard definitions for GPSTAG is kept to TIFF_SETGET_DOUBLE
* and TIFF_SETGET_C0_FLOAT is changed to TIFF_SETGET_C0_DOUBLE.
*/
{GPSTAG_VERSIONID, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UINT8, FIELD_CUSTOM, 1, 0, "VersionID", NULL},
{GPSTAG_LATITUDEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "LatitudeRef", NULL},
{GPSTAG_LATITUDE, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Latitude", NULL},
{GPSTAG_LONGITUDEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "LongitudeRef", NULL},
{GPSTAG_LONGITUDE, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Longitude", NULL},
{GPSTAG_ALTITUDEREF, 1, 1, TIFF_BYTE, 0, TIFF_SETGET_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "AltitudeRef", NULL},
{GPSTAG_ALTITUDE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Altitude", NULL},
{GPSTAG_TIMESTAMP, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "TimeStamp", NULL},
{GPSTAG_SATELLITES, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Satellites", NULL},
{GPSTAG_STATUS, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Status", NULL},
{GPSTAG_MEASUREMODE, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "MeasureMode", NULL},
{GPSTAG_DOP, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DOP", NULL},
{GPSTAG_SPEEDREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SpeedRef", NULL},
{GPSTAG_SPEED, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Speed", NULL},
{GPSTAG_TRACKREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "TrackRef", NULL},
{GPSTAG_TRACK, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Track", NULL},
{GPSTAG_IMGDIRECTIONREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImgDirectionRef", NULL},
{GPSTAG_IMGDIRECTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImgDirection", NULL},
{GPSTAG_MAPDATUM, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "MapDatum", NULL},
{GPSTAG_DESTLATITUDEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DestLatitudeRef", NULL},
{GPSTAG_DESTLATITUDE, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DestLatitude", NULL},
{GPSTAG_DESTLONGITUDEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DestLongitudeRef", NULL},
{GPSTAG_DESTLONGITUDE, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DestLongitude", NULL},
{GPSTAG_DESTBEARINGREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DestBearingRef", NULL},
{GPSTAG_DESTBEARING, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DestBearing", NULL},
{GPSTAG_DESTDISTANCEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DestDistanceRef", NULL},
{GPSTAG_DESTDISTANCE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DestDistance", NULL},
{GPSTAG_PROCESSINGMETHOD, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ProcessingMethod", NULL},
{GPSTAG_AREAINFORMATION, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "AreaInformation", NULL},
{GPSTAG_DATESTAMP, 11, 11, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DateStamp", NULL},
{GPSTAG_DIFFERENTIAL, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Differential", NULL},
{GPSTAG_GPSHPOSITIONINGERROR, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "HorizontalPositioningError", NULL}};
{GPSTAG_VERSIONID, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "VersionID", NULL},
{GPSTAG_LATITUDEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "LatitudeRef", NULL},
{GPSTAG_LATITUDE, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, FIELD_CUSTOM, 1, 0, "Latitude", NULL},
{GPSTAG_LONGITUDEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "LongitudeRef", NULL},
{GPSTAG_LONGITUDE, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, FIELD_CUSTOM, 1, 0, "Longitude", NULL},
{GPSTAG_ALTITUDEREF, 1, 1, TIFF_BYTE, 0, TIFF_SETGET_UINT8, FIELD_CUSTOM, 1, 0, "AltitudeRef", NULL},
{GPSTAG_ALTITUDE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "Altitude", NULL},
{GPSTAG_TIMESTAMP, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, FIELD_CUSTOM, 1, 0, "TimeStamp", NULL},
{GPSTAG_SATELLITES, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "Satellites", NULL},
{GPSTAG_STATUS, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "Status", NULL},
{GPSTAG_MEASUREMODE, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "MeasureMode", NULL},
{GPSTAG_DOP, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "DOP", NULL},
{GPSTAG_SPEEDREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "SpeedRef", NULL},
{GPSTAG_SPEED, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "Speed", NULL},
{GPSTAG_TRACKREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "TrackRef", NULL},
{GPSTAG_TRACK, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "Track", NULL},
{GPSTAG_IMGDIRECTIONREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "ImgDirectionRef", NULL},
{GPSTAG_IMGDIRECTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "ImgDirection", NULL},
{GPSTAG_MAPDATUM, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "MapDatum", NULL},
{GPSTAG_DESTLATITUDEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DestLatitudeRef", NULL},
{GPSTAG_DESTLATITUDE, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, FIELD_CUSTOM, 1, 0, "DestLatitude", NULL},
{GPSTAG_DESTLONGITUDEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DestLongitudeRef", NULL},
{GPSTAG_DESTLONGITUDE, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, FIELD_CUSTOM, 1, 0, "DestLongitude", NULL},
{GPSTAG_DESTBEARINGREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DestBearingRef", NULL},
{GPSTAG_DESTBEARING, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "DestBearing", NULL},
{GPSTAG_DESTDISTANCEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DestDistanceRef", NULL},
{GPSTAG_DESTDISTANCE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "DestDistance", NULL},
{GPSTAG_PROCESSINGMETHOD, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "ProcessingMethod", NULL},
{GPSTAG_AREAINFORMATION, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "AreaInformation", NULL},
{GPSTAG_DATESTAMP, 11, 11, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DateStamp", NULL},
{GPSTAG_DIFFERENTIAL, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "Differential", NULL},
{GPSTAG_GPSHPOSITIONINGERROR, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "HorizontalPositioningError", NULL}};
/* clang-format on */ /* was off for better readability of tag comments */
static const TIFFFieldArray tiffFieldArray = {
@@ -674,18 +674,19 @@ int TIFFFieldSetGetSize(const TIFFField *fip)
{
/*
* TIFFSetField() and TIFFGetField() must provide the parameter accordingly
* to the definition of "set_field_type" of the tag definition in
* to the definition of "set_get_field_type" of the tag definition in
* dir_info.c. This function returns the data size for that purpose.
*
* Furthermore, this data size is also used for the internal storage,
* even for TIFF_RATIONAL values for FIELD_CUSTOM, which are stored
* internally as 4-byte float, but some of them should be stored internally
* as 8-byte double, depending on the "set_field_type" _FLOAT_ or _DOUBLE_.
* as 8-byte double, depending on the "set_get_field_type" _FLOAT_ or
* _DOUBLE_.
*/
if (fip == NULL)
return 0;
switch (fip->set_field_type)
switch (fip->set_get_field_type)
{
case TIFF_SETGET_UNDEFINED:
case TIFF_SETGET_ASCII:
@@ -758,7 +759,7 @@ int TIFFFieldSetGetCountSize(const TIFFField *fip)
if (fip == NULL)
return 0;
switch (fip->set_field_type)
switch (fip->set_get_field_type)
{
case TIFF_SETGET_C16_ASCII:
case TIFF_SETGET_C16_UINT8:
@@ -793,7 +794,7 @@ int TIFFFieldSetGetCountSize(const TIFFField *fip)
const TIFFField *TIFFFindField(TIFF *tif, uint32_t tag, TIFFDataType dt)
{
TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, 0, NULL, NULL};
TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, NULL, NULL};
TIFFField *pkey = &key;
const TIFFField **ret;
if (tif->tif_foundfield && tif->tif_foundfield->field_tag == tag &&
@@ -817,7 +818,7 @@ const TIFFField *TIFFFindField(TIFF *tif, uint32_t tag, TIFFDataType dt)
static const TIFFField *_TIFFFindFieldByName(TIFF *tif, const char *field_name,
TIFFDataType dt)
{
TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, 0, NULL, NULL};
TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, NULL, NULL};
TIFFField *pkey = &key;
const TIFFField **ret;
if (tif->tif_foundfield &&
@@ -915,59 +916,46 @@ TIFFField *_TIFFCreateAnonField(TIFF *tif, uint32_t tag,
{
case TIFF_BYTE:
case TIFF_UNDEFINED:
fld->set_field_type = TIFF_SETGET_C32_UINT8;
fld->get_field_type = TIFF_SETGET_C32_UINT8;
fld->set_get_field_type = TIFF_SETGET_C32_UINT8;
break;
case TIFF_ASCII:
fld->set_field_type = TIFF_SETGET_C32_ASCII;
fld->get_field_type = TIFF_SETGET_C32_ASCII;
fld->set_get_field_type = TIFF_SETGET_C32_ASCII;
break;
case TIFF_SHORT:
fld->set_field_type = TIFF_SETGET_C32_UINT16;
fld->get_field_type = TIFF_SETGET_C32_UINT16;
fld->set_get_field_type = TIFF_SETGET_C32_UINT16;
break;
case TIFF_LONG:
fld->set_field_type = TIFF_SETGET_C32_UINT32;
fld->get_field_type = TIFF_SETGET_C32_UINT32;
fld->set_get_field_type = TIFF_SETGET_C32_UINT32;
break;
case TIFF_RATIONAL:
case TIFF_SRATIONAL:
case TIFF_FLOAT:
fld->set_field_type = TIFF_SETGET_C32_FLOAT;
fld->get_field_type = TIFF_SETGET_C32_FLOAT;
fld->set_get_field_type = TIFF_SETGET_C32_FLOAT;
break;
case TIFF_SBYTE:
fld->set_field_type = TIFF_SETGET_C32_SINT8;
fld->get_field_type = TIFF_SETGET_C32_SINT8;
fld->set_get_field_type = TIFF_SETGET_C32_SINT8;
break;
case TIFF_SSHORT:
fld->set_field_type = TIFF_SETGET_C32_SINT16;
fld->get_field_type = TIFF_SETGET_C32_SINT16;
fld->set_get_field_type = TIFF_SETGET_C32_SINT16;
break;
case TIFF_SLONG:
fld->set_field_type = TIFF_SETGET_C32_SINT32;
fld->get_field_type = TIFF_SETGET_C32_SINT32;
fld->set_get_field_type = TIFF_SETGET_C32_SINT32;
break;
case TIFF_DOUBLE:
fld->set_field_type = TIFF_SETGET_C32_DOUBLE;
fld->get_field_type = TIFF_SETGET_C32_DOUBLE;
fld->set_get_field_type = TIFF_SETGET_C32_DOUBLE;
break;
case TIFF_IFD:
case TIFF_IFD8:
fld->set_field_type = TIFF_SETGET_C32_IFD8;
fld->get_field_type = TIFF_SETGET_C32_IFD8;
fld->set_get_field_type = TIFF_SETGET_C32_IFD8;
break;
case TIFF_LONG8:
fld->set_field_type = TIFF_SETGET_C32_UINT64;
fld->get_field_type = TIFF_SETGET_C32_UINT64;
fld->set_get_field_type = TIFF_SETGET_C32_UINT64;
break;
case TIFF_SLONG8:
fld->set_field_type = TIFF_SETGET_C32_SINT64;
fld->get_field_type = TIFF_SETGET_C32_SINT64;
fld->set_get_field_type = TIFF_SETGET_C32_SINT64;
break;
default:
fld->set_field_type = TIFF_SETGET_UNDEFINED;
fld->get_field_type = TIFF_SETGET_UNDEFINED;
fld->set_get_field_type = TIFF_SETGET_UNDEFINED;
break;
}
fld->field_bit = FIELD_CUSTOM;
@@ -1198,38 +1186,51 @@ int TIFFMergeFieldInfo(TIFF *tif, const TIFFFieldInfo info[], uint32_t n)
{
tp->field_tag = info[i].field_tag;
if (info[i].field_readcount < TIFF_VARIABLE2 ||
info[i].field_readcount == 0 ||
info[i].field_writecount < TIFF_VARIABLE2 ||
info[i].field_writecount == 0)
info[i].field_writecount < TIFF_VARIABLE2)
{
/* The fields (field_readcount) and (field_writecount) may use the
* values TIFF_VARIABLE (-1), TIFF_SPP (-2), TIFF_VARIABLE2 (-3). */
TIFFErrorExtR(tif, module,
"The value of field_readcount and field_writecount "
"must be greater than or equal to -3 and not zero.");
TIFFErrorExtR(
tif, module,
"The value of field_readcount %d and field_writecount %d "
"must be greater than or equal to -3.",
info[i].field_readcount, info[i].field_writecount);
return -1;
}
if ((info[i].field_readcount == 0 || info[i].field_writecount == 0) &&
info[i].field_bit != FIELD_IGNORE)
{
/* The fields (field_readcount) and (field_writecount) may only
be zero for pseudo_tags or ignored tags. */
TIFFErrorExtR(
tif, module,
"The value of field_readcount %d and field_writecount %d "
"may only be zero for field_bit = 0 (i.e. ignored tags).",
info[i].field_readcount, info[i].field_writecount);
return -1;
}
tp->field_readcount = info[i].field_readcount;
tp->field_writecount = info[i].field_writecount;
tp->field_type = info[i].field_type;
tp->field_anonymous = 0;
tp->set_field_type =
tp->set_get_field_type =
_TIFFSetGetType(info[i].field_type, info[i].field_writecount,
info[i].field_passcount);
tp->get_field_type =
_TIFFSetGetType(info[i].field_type, info[i].field_readcount,
info[i].field_passcount);
tp->field_bit = info[i].field_bit;
tp->field_oktochange = info[i].field_oktochange;
tp->field_passcount = info[i].field_passcount;
/* Define an empty static string to be passed as field_name where a NULL
* pointer is passed in. Otherwise, this will lead to buffer overflow
* furtheron. */
if (info[i].field_name == NULL)
{
TIFFErrorExtR(tif, module,
"Field_name of %d.th allocation tag %d is NULL", i,
info[i].field_tag);
return -1;
static const char *string_static_empty = "";
tp->field_name = (char *)string_static_empty;
}
else
{
tp->field_name = info[i].field_name;
}
tp->field_name = info[i].field_name;
tp->field_subfields = NULL;
tp++;
}
+31 -19
View File
@@ -47,6 +47,9 @@
#define TIFFCvtIEEEFloatToNative(tif, n, fp)
#define TIFFCvtIEEEDoubleToNative(tif, n, dp)
#else
/* If your machine does not support IEEE floating point then you will need to
* add support to tif_machdep.c to convert between the native format and
* IEEE format. */
extern void TIFFCvtIEEEFloatToNative(TIFF *, uint32_t, float *);
extern void TIFFCvtIEEEDoubleToNative(TIFF *, uint32_t, double *);
#endif
@@ -2781,7 +2784,7 @@ TIFFReadDirEntryFloatArray(TIFF *tif, TIFFDirEntry *direntry, float **value)
case TIFF_FLOAT:
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabArrayOfLong((uint32_t *)origdata, count);
TIFFCvtIEEEDoubleToNative(tif, count, (float *)origdata);
TIFFCvtIEEEFloatToNative(tif, count, (float *)origdata);
*value = (float *)origdata;
return (TIFFReadDirEntryErrOk);
}
@@ -4310,7 +4313,6 @@ int TIFFReadDirectory(TIFF *tif)
tif->tif_flags &= ~TIFF_CHOPPEDUPARRAYS;
/* free any old stuff and reinit */
(*tif->tif_cleanup)(tif); /* cleanup any previous compression state */
TIFFFreeDirectory(tif);
TIFFDefaultDirectory(tif);
@@ -4403,10 +4405,13 @@ int TIFFReadDirectory(TIFF *tif)
TIFFReadDirectoryFindFieldInfo(tif, dp->tdir_tag, &fii);
if (fii == FAILED_FII)
{
TIFFWarningExtR(tif, module,
"Unknown field with tag %" PRIu16 " (0x%" PRIx16
") encountered",
dp->tdir_tag, dp->tdir_tag);
if (tif->tif_warn_about_unknown_tags)
{
TIFFWarningExtR(tif, module,
"Unknown field with tag %" PRIu16
" (0x%" PRIx16 ") encountered",
dp->tdir_tag, dp->tdir_tag);
}
/* the following knowingly leaks the
anonymous field structure */
const TIFFField *fld = _TIFFCreateAnonField(
@@ -5281,6 +5286,7 @@ int TIFFReadCustomDirectory(TIFF *tif, toff_t diroff,
const TIFFField *fip;
uint32_t fii;
assert(infoarray != NULL);
dircount = TIFFFetchDirectory(tif, diroff, &dir, NULL);
if (!dircount)
{
@@ -5313,7 +5319,6 @@ int TIFFReadCustomDirectory(TIFF *tif, toff_t diroff,
}
/* Free any old stuff and reinit. */
(*tif->tif_cleanup)(tif); /* cleanup any previous compression state */
TIFFFreeDirectory(tif);
/* Even if custom directories do not need the default settings of a standard
* IFD, the pointer to the TIFFSetField() and TIFFGetField() (i.e.
@@ -5344,18 +5349,25 @@ int TIFFReadCustomDirectory(TIFF *tif, toff_t diroff,
TIFFReadDirectoryFindFieldInfo(tif, dp->tdir_tag, &fii);
if (fii == FAILED_FII)
{
TIFFWarningExtR(tif, module,
"Unknown field with tag %" PRIu16 " (0x%" PRIx16
") encountered",
dp->tdir_tag, dp->tdir_tag);
if (tif->tif_warn_about_unknown_tags)
{
TIFFWarningExtR(tif, module,
"Unknown field with tag %" PRIu16 " (0x%" PRIx16
") encountered",
dp->tdir_tag, dp->tdir_tag);
}
const TIFFField *fld = _TIFFCreateAnonField(
tif, dp->tdir_tag, (TIFFDataType)dp->tdir_type);
if (fld == NULL || !_TIFFMergeFields(tif, fld, 1))
{
TIFFWarningExtR(tif, module,
"Registering anonymous field with tag %" PRIu16
" (0x%" PRIx16 ") failed",
dp->tdir_tag, dp->tdir_tag);
if (tif->tif_warn_about_unknown_tags)
{
TIFFWarningExtR(
tif, module,
"Registering anonymous field with tag %" PRIu16
" (0x%" PRIx16 ") failed",
dp->tdir_tag, dp->tdir_tag);
}
dp->tdir_ignore = TRUE;
}
else
@@ -6273,19 +6285,19 @@ static int TIFFFetchNormalTag(TIFF *tif, TIFFDirEntry *dp, int recover)
}
fip = tif->tif_fields[fii];
assert(fip != NULL); /* should not happen */
assert(fip->set_field_type !=
assert(fip->set_get_field_type !=
TIFF_SETGET_OTHER); /* if so, we shouldn't arrive here but deal with
this in specialized code */
assert(fip->set_field_type !=
assert(fip->set_get_field_type !=
TIFF_SETGET_INT); /* if so, we shouldn't arrive here as this is only
the case for pseudo-tags */
err = TIFFReadDirEntryErrOk;
switch (fip->set_field_type)
switch (fip->set_get_field_type)
{
case TIFF_SETGET_UNDEFINED:
TIFFErrorExtR(
tif, "TIFFFetchNormalTag",
"Defined set_field_type of custom tag %u (%s) is "
"Defined set_get_field_type of custom tag %u (%s) is "
"TIFF_SETGET_UNDEFINED and thus tag is not read from file",
fip->field_tag, fip->field_name);
break;
+22 -17
View File
@@ -35,6 +35,9 @@
#define TIFFCvtNativeToIEEEFloat(tif, n, fp)
#define TIFFCvtNativeToIEEEDouble(tif, n, dp)
#else
/* If your machine does not support IEEE floating point then you will need to
* add support to tif_machdep.c to convert between the native format and
* IEEE format. */
extern void TIFFCvtNativeToIEEEFloat(TIFF *tif, uint32_t n, float *fp);
extern void TIFFCvtNativeToIEEEDouble(TIFF *tif, uint32_t n, double *dp);
#endif
@@ -534,6 +537,7 @@ static int TIFFWriteDirectorySec(TIFF *tif, int isimage, int imagedone,
{
_TIFFfreeExt(tif, tif->tif_rawdata);
tif->tif_rawdata = NULL;
tif->tif_rawcp = NULL;
tif->tif_rawcc = 0;
tif->tif_rawdatasize = 0;
tif->tif_rawdataoff = 0;
@@ -563,7 +567,7 @@ static int TIFFWriteDirectorySec(TIFF *tif, int isimage, int imagedone,
if (isimage)
{
/*-- Step 1: Process named tags for an image with FIELD bits
* assocciated. --*/
* associated. --*/
if (TIFFFieldSet(tif, FIELD_IMAGEDIMENSIONS))
{
if (!TIFFWriteDirectoryTagShortLong(tif, &ndir, dir,
@@ -875,7 +879,7 @@ static int TIFFWriteDirectorySec(TIFF *tif, int isimage, int imagedone,
if ((o->field_bit >= FIELD_CODEC) &&
(TIFFFieldSet(tif, o->field_bit)))
{
switch (o->set_field_type)
switch (o->set_get_field_type)
{
case TIFF_SETGET_ASCII:
{
@@ -1016,7 +1020,8 @@ static int TIFFWriteDirectorySec(TIFF *tif, int isimage, int imagedone,
case TIFF_RATIONAL:
{
/*-- Rational2Double: For Rationals evaluate
* "set_field_type" to determine internal storage size. */
* "set_get_field_type" to determine internal storage size.
*/
int tv_size;
tv_size = TIFFFieldSetGetSize(
tif->tif_dir.td_customValues[m].info);
@@ -1038,11 +1043,11 @@ static int TIFFWriteDirectorySec(TIFF *tif, int isimage, int imagedone,
* tv_size==4 should be set as default. */
if (tv_size != 4)
{
TIFFErrorExtR(tif,
"TIFFLib: _TIFFWriteDirectorySec()",
"Rational2Double: .set_field_type is "
"not 4 but %d",
tv_size);
TIFFErrorExtR(
tif, "TIFFLib: _TIFFWriteDirectorySec()",
"Rational2Double: .set_get_field_type is "
"not 4 but %d",
tv_size);
}
}
}
@@ -1050,7 +1055,8 @@ static int TIFFWriteDirectorySec(TIFF *tif, int isimage, int imagedone,
case TIFF_SRATIONAL:
{
/*-- Rational2Double: For Rationals evaluate
* "set_field_type" to determine internal storage size. */
* "set_get_field_type" to determine internal storage size.
*/
int tv_size;
tv_size = TIFFFieldSetGetSize(
tif->tif_dir.td_customValues[m].info);
@@ -1072,11 +1078,11 @@ static int TIFFWriteDirectorySec(TIFF *tif, int isimage, int imagedone,
* tv_size==4 should be set as default. */
if (tv_size != 4)
{
TIFFErrorExtR(tif,
"TIFFLib: _TIFFWriteDirectorySec()",
"Rational2Double: .set_field_type is "
"not 4 but %d",
tv_size);
TIFFErrorExtR(
tif, "TIFFLib: _TIFFWriteDirectorySec()",
"Rational2Double: .set_get_field_type is "
"not 4 but %d",
tv_size);
}
}
}
@@ -1377,7 +1383,6 @@ static int TIFFWriteDirectorySec(TIFF *tif, int isimage, int imagedone,
TIFFFreeDirectory(tif);
tif->tif_flags &= ~TIFF_DIRTYDIRECT;
tif->tif_flags &= ~TIFF_DIRTYSTRIP;
(*tif->tif_cleanup)(tif);
/* Reset directory-related state for subsequent directories. */
TIFFCreateDirectory(tif);
}
@@ -2966,7 +2971,7 @@ static int TIFFWriteDirectoryTagCheckedFloatArray(TIFF *tif, uint32_t *ndir,
EvaluateIFDdatasizeWrite(tif, count, 4, ndir);
return 1;
}
TIFFCvtNativeToIEEEFloat(tif, count, &value);
TIFFCvtNativeToIEEEFloat(tif, count, value);
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabArrayOfFloat(value, count);
return (TIFFWriteDirectoryTagData(tif, ndir, dir, tag, TIFF_FLOAT, count,
@@ -2985,7 +2990,7 @@ static int TIFFWriteDirectoryTagCheckedDoubleArray(TIFF *tif, uint32_t *ndir,
EvaluateIFDdatasizeWrite(tif, count, 8, ndir);
return 1;
}
TIFFCvtNativeToIEEEDouble(tif, count, &value);
TIFFCvtNativeToIEEEDouble(tif, count, value);
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabArrayOfDouble(value, count);
return (TIFFWriteDirectoryTagData(tif, ndir, dir, tag, TIFF_DOUBLE, count,

Some files were not shown because too many files have changed in this diff Show More