LibTIFF 4.7.2
TIFF library public API and implementation reference
Loading...
Searching...
No Matches
tif_dirinfo.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 1988-1997 Sam Leffler
3 * Copyright (c) 1991-1997 Silicon Graphics, Inc.
4 *
5 * Permission to use, copy, modify, distribute, and sell this software and
6 * its documentation for any purpose is hereby granted without fee, provided
7 * that (i) the above copyright notices and this permission notice appear in
8 * all copies of the software and related documentation, and (ii) the names of
9 * Sam Leffler and Silicon Graphics may not be used in any advertising or
10 * publicity relating to the software without the specific, prior written
11 * permission of Sam Leffler and Silicon Graphics.
12 *
13 * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
14 * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
15 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
16 *
17 * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
18 * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
19 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20 * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
21 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
22 * OF THIS SOFTWARE.
23 */
24
25/*
26 * TIFF Library.
27 *
28 * Core Directory Tag Support.
29 */
35#include "tiffiop.h"
36#include <stdlib.h>
37
38/*
39 * NOTE: THIS ARRAY IS ASSUMED TO BE SORTED BY TAG.
40 *
41 * NOTE: The second field (field_readcount) and third field (field_writecount)
42 * sometimes use the values TIFF_VARIABLE (-1), TIFF_VARIABLE2 (-3)
43 * and TIFF_SPP (-2). The macros should be used but would throw off
44 * the formatting of the code, so please interpret the -1, -2 and -3
45 * values accordingly.
46 */
47
48/* Forward declarations - definition follows after field arrays.
49 * Note: In C, we can forward declare static const objects and define them
50 * later. In C++, we need extern for the declaration, then define without
51 * extern. Since these are only used within this file via pointers, we use a
52 * workaround that works in both C and C++: declare as extern here, define as
53 * static later, but actually we need a different approach for C++
54 * compatibility.
55 *
56 * For C/C++ compatibility, we define a simple struct that holds the pointer
57 * and initialize it after the arrays are defined.
58 */
59#ifdef __cplusplus
60/* C++ doesn't allow forward declaration of const objects, so we use extern */
63extern const TIFFFieldArray gpsFieldArray;
64#else
65/* C allows forward declaration of const objects, but C++ doesn't.
66 * We disable the C++-compat warning for this section since these circular
67 * dependencies are unavoidable with static initialization. */
68#if defined(__GNUC__) && !defined(__clang__)
69#pragma GCC diagnostic push
70#pragma GCC diagnostic ignored "-Wc++-compat"
71#elif defined(__clang__)
72#pragma clang diagnostic push
73#pragma clang diagnostic ignored "-Wc++-compat"
74#elif defined(_MSC_VER)
75#pragma warning(push)
76#pragma warning(disable : 4132)
77#endif
81#if defined(__GNUC__) && !defined(__clang__)
82#pragma GCC diagnostic pop
83#elif defined(__clang__)
84#pragma clang diagnostic pop
85#elif defined(_MSC_VER)
86#pragma warning(pop)
87#endif
88#endif
89/*--: Rational2Double: --
90 * The Rational2Double upgraded libtiff functionality allows the definition and
91 * achievement of true double-precision accuracy for TIFF tags of RATIONAL type
92 * and field_bit=FIELD_CUSTOM using the set_get_field_type = TIFF_SETGET_DOUBLE.
93 * Unfortunately, that changes the old implemented interface for TIFFGetField().
94 * In order to keep the old TIFFGetField() interface behavior those tags have to
95 * be redefined with set_get_field_type = TIFF_SETGET_FLOAT!
96 *
97 * Rational custom arrays are already defined as _Cxx_FLOAT, thus can stay.
98 *
99 */
100
101/* clang-format off */ /* for better readability of tag comments */
111static const TIFFField tiffFields[] = {
112 {TIFFTAG_SUBFILETYPE, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_SUBFILETYPE, 1, 0, "SubfileType", NULL},
113 {TIFFTAG_OSUBFILETYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "OldSubfileType", NULL},
114 {TIFFTAG_IMAGEWIDTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_IMAGEDIMENSIONS, 0, 0, "ImageWidth", NULL},
115 {TIFFTAG_IMAGELENGTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_IMAGEDIMENSIONS, 1, 0, "ImageLength", NULL},
116 {TIFFTAG_BITSPERSAMPLE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_BITSPERSAMPLE, 0, 0, "BitsPerSample", NULL},
117 {TIFFTAG_COMPRESSION, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_COMPRESSION, 0, 0, "Compression", NULL},
118 {TIFFTAG_PHOTOMETRIC, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_PHOTOMETRIC, 0, 0, "PhotometricInterpretation", NULL},
119 {TIFFTAG_THRESHHOLDING, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_THRESHHOLDING, 1, 0, "Threshholding", NULL},
120 {TIFFTAG_CELLWIDTH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CellWidth", NULL},
121 {TIFFTAG_CELLLENGTH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CellLength", NULL},
122 {TIFFTAG_FILLORDER, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_FILLORDER, 0, 0, "FillOrder", NULL},
123 {TIFFTAG_DOCUMENTNAME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DocumentName", NULL},
124 {TIFFTAG_IMAGEDESCRIPTION, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "ImageDescription", NULL},
125 {TIFFTAG_MAKE, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "Make", NULL},
126 {TIFFTAG_MODEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "Model", NULL},
127 {TIFFTAG_STRIPOFFSETS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, FIELD_STRIPOFFSETS, 0, 0, "StripOffsets", NULL},
128 {TIFFTAG_ORIENTATION, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_ORIENTATION, 0, 0, "Orientation", NULL},
129 {TIFFTAG_SAMPLESPERPIXEL, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_SAMPLESPERPIXEL, 0, 0, "SamplesPerPixel", NULL},
130 {TIFFTAG_ROWSPERSTRIP, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_ROWSPERSTRIP, 0, 0, "RowsPerStrip", NULL},
131 {TIFFTAG_STRIPBYTECOUNTS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, FIELD_STRIPBYTECOUNTS, 0, 0, "StripByteCounts", NULL},
132 {TIFFTAG_MINSAMPLEVALUE, -2, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_MINSAMPLEVALUE, 1, 0, "MinSampleValue", NULL},
133 {TIFFTAG_MAXSAMPLEVALUE, -2, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_MAXSAMPLEVALUE, 1, 0, "MaxSampleValue", NULL},
134 {TIFFTAG_XRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_RESOLUTION, 1, 0, "XResolution", NULL},
135 {TIFFTAG_YRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_RESOLUTION, 1, 0, "YResolution", NULL},
136 {TIFFTAG_PLANARCONFIG, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_PLANARCONFIG, 0, 0, "PlanarConfiguration", NULL},
137 {TIFFTAG_PAGENAME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "PageName", NULL},
138 {TIFFTAG_XPOSITION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_POSITION, 1, 0, "XPosition", NULL},
139 {TIFFTAG_YPOSITION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_POSITION, 1, 0, "YPosition", NULL},
140 {TIFFTAG_FREEOFFSETS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 0, 0, "FreeOffsets", NULL},
141 {TIFFTAG_FREEBYTECOUNTS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 0, 0, "FreeByteCounts", NULL},
142 {TIFFTAG_GRAYRESPONSEUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "GrayResponseUnit", NULL},
143 {TIFFTAG_GRAYRESPONSECURVE, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "GrayResponseCurve", NULL},
144 {TIFFTAG_RESOLUTIONUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_RESOLUTIONUNIT, 1, 0, "ResolutionUnit", NULL},
145 {TIFFTAG_PAGENUMBER, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, FIELD_PAGENUMBER, 1, 0, "PageNumber", NULL},
146 {TIFFTAG_COLORRESPONSEUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "ColorResponseUnit", NULL},
147 {TIFFTAG_TRANSFERFUNCTION, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_OTHER, FIELD_TRANSFERFUNCTION, 1, 0, "TransferFunction", NULL},
148 {TIFFTAG_SOFTWARE, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "Software", NULL},
149 {TIFFTAG_DATETIME, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DateTime", NULL},
150 {TIFFTAG_ARTIST, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "Artist", NULL},
151 {TIFFTAG_HOSTCOMPUTER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "HostComputer", NULL},
152 {TIFFTAG_WHITEPOINT, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "WhitePoint", NULL},
153 {TIFFTAG_PRIMARYCHROMATICITIES, 6, 6, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "PrimaryChromaticities", NULL},
154 {TIFFTAG_COLORMAP, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_OTHER, FIELD_COLORMAP, 1, 0, "ColorMap", NULL},
155 {TIFFTAG_HALFTONEHINTS, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, FIELD_HALFTONEHINTS, 1, 0, "HalftoneHints", NULL},
156 {TIFFTAG_TILEWIDTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_TILEDIMENSIONS, 0, 0, "TileWidth", NULL},
157 {TIFFTAG_TILELENGTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_TILEDIMENSIONS, 0, 0, "TileLength", NULL},
158 {TIFFTAG_TILEOFFSETS, -1, 1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, FIELD_STRIPOFFSETS, 0, 0, "TileOffsets", NULL},
159 {TIFFTAG_TILEBYTECOUNTS, -1, 1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, FIELD_STRIPBYTECOUNTS, 0, 0, "TileByteCounts", NULL},
161 {TIFFTAG_INKSET, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 0, 0, "InkSet", NULL},
162 {TIFFTAG_INKNAMES, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_C16_ASCII, FIELD_INKNAMES, 1, 1, "InkNames", NULL},
163 {TIFFTAG_NUMBEROFINKS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_NUMBEROFINKS, 1, 0, "NumberOfInks", NULL},
164 {TIFFTAG_DOTRANGE, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, FIELD_CUSTOM, 0, 0, "DotRange", NULL},
165 {TIFFTAG_TARGETPRINTER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "TargetPrinter", NULL},
166 {TIFFTAG_EXTRASAMPLES, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, FIELD_EXTRASAMPLES, 0, 1, "ExtraSamples", NULL},
167 {TIFFTAG_SAMPLEFORMAT, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_SAMPLEFORMAT, 0, 0, "SampleFormat", NULL},
168 {TIFFTAG_SMINSAMPLEVALUE, -2, -1, TIFF_ANY, 0, TIFF_SETGET_DOUBLE, FIELD_SMINSAMPLEVALUE, 1, 0, "SMinSampleValue", NULL},
169 {TIFFTAG_SMAXSAMPLEVALUE, -2, -1, TIFF_ANY, 0, TIFF_SETGET_DOUBLE, FIELD_SMAXSAMPLEVALUE, 1, 0, "SMaxSampleValue", NULL},
170 {TIFFTAG_CLIPPATH, -3, -3, TIFF_BYTE, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 0, 1, "ClipPath", NULL},
171 {TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 0, 0, "XClipPathUnits", NULL},
172 {TIFFTAG_YCLIPPATHUNITS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 0, 0, "YClipPathUnits", NULL},
173 {TIFFTAG_YCBCRCOEFFICIENTS, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 0, 0, "YCbCrCoefficients", NULL},
174 {TIFFTAG_YCBCRSUBSAMPLING, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, FIELD_YCBCRSUBSAMPLING, 0, 0, "YCbCrSubsampling", NULL},
175 {TIFFTAG_YCBCRPOSITIONING, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_YCBCRPOSITIONING, 0, 0, "YCbCrPositioning", NULL},
176 {TIFFTAG_REFERENCEBLACKWHITE, 6, 6, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_REFBLACKWHITE, 1, 0, "ReferenceBlackWhite", NULL},
177 {TIFFTAG_XMLPACKET, -3, -3, TIFF_BYTE, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "XMLPacket", NULL},
178 /* begin SGI tags */
179 {TIFFTAG_MATTEING, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_EXTRASAMPLES, 0, 0, "Matteing", NULL},
180 {TIFFTAG_DATATYPE, -2, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_SAMPLEFORMAT, 0, 0, "DataType", NULL},
181 {TIFFTAG_IMAGEDEPTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_IMAGEDEPTH, 0, 0, "ImageDepth", NULL},
182 {TIFFTAG_TILEDEPTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_TILEDEPTH, 0, 0, "TileDepth", NULL},
183 /* end SGI tags */
184 /* begin Pixar tags */
185 {TIFFTAG_PIXAR_IMAGEFULLWIDTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ImageFullWidth", NULL},
186 {TIFFTAG_PIXAR_IMAGEFULLLENGTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ImageFullLength", NULL},
187 {TIFFTAG_PIXAR_TEXTUREFORMAT, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "TextureFormat", NULL},
188 {TIFFTAG_PIXAR_WRAPMODES, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "TextureWrapModes", NULL},
189 {TIFFTAG_PIXAR_FOVCOT, 1, 1, TIFF_FLOAT, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "FieldOfViewCotangent", NULL},
190 {TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN, 16, 16, TIFF_FLOAT, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "MatrixWorldToScreen", NULL},
191 {TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA, 16, 16, TIFF_FLOAT, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "MatrixWorldToCamera", NULL},
192 {TIFFTAG_COPYRIGHT, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "Copyright", NULL},
193 /* end Pixar tags */
194 {TIFFTAG_RICHTIFFIPTC, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "RichTIFFIPTC", NULL},
195 {TIFFTAG_PHOTOSHOP, -3, -3, TIFF_BYTE, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "Photoshop", NULL},
196 /*--: EXIFIFD and GPSIFD specified as TIFF_LONG by Aware-Systems and not TIFF_IFD8 as in original LibTiff. However, for IFD-like tags,
197 * libtiff uses the data type TIFF_IFD8 in tiffFields[]-tag definition combined with a special handling procedure in order to write either
198 * 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. */
200 {TIFFTAG_ICCPROFILE, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "ICC Profile", NULL},
202 {TIFFTAG_FAXRECVPARAMS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, TRUE, FALSE, "FaxRecvParams", NULL},
203 {TIFFTAG_FAXSUBADDRESS, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, TRUE, FALSE, "FaxSubAddress", NULL},
204 {TIFFTAG_FAXRECVTIME, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, TRUE, FALSE, "FaxRecvTime", NULL},
205 {TIFFTAG_FAXDCS, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, TRUE, FALSE, "FaxDcs", NULL},
206 {TIFFTAG_STONITS, 1, 1, TIFF_DOUBLE, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 0, 0, "StoNits", NULL},
207 {TIFFTAG_IMAGESOURCEDATA, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "Adobe Photoshop Document Data Block", NULL},
208 {TIFFTAG_INTEROPERABILITYIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, FIELD_CUSTOM, 0, 0, "InteroperabilityIFDOffset", NULL},
209 /* begin DNG tags */
210 {TIFFTAG_DNGVERSION, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "DNGVersion", NULL},
211 {TIFFTAG_DNGBACKWARDVERSION, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "DNGBackwardVersion", NULL},
212 {TIFFTAG_UNIQUECAMERAMODEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "UniqueCameraModel", NULL},
213 {TIFFTAG_LOCALIZEDCAMERAMODEL, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "LocalizedCameraModel", NULL},
214 {TIFFTAG_CFAPLANECOLOR, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "CFAPlaneColor", NULL},
215 {TIFFTAG_CFALAYOUT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CFALayout", NULL},
216 {TIFFTAG_LINEARIZATIONTABLE, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, FIELD_CUSTOM, 1, 1, "LinearizationTable", NULL},
217 {TIFFTAG_BLACKLEVELREPEATDIM, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, FIELD_CUSTOM, 1, 0, "BlackLevelRepeatDim", NULL},
218 {TIFFTAG_BLACKLEVEL, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "BlackLevel", NULL},
219 {TIFFTAG_BLACKLEVELDELTAH, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "BlackLevelDeltaH", NULL},
220 {TIFFTAG_BLACKLEVELDELTAV, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "BlackLevelDeltaV", NULL},
221 {TIFFTAG_WHITELEVEL, -1, -1, TIFF_LONG, 0, TIFF_SETGET_C16_UINT32, FIELD_CUSTOM, 1, 1, "WhiteLevel", NULL},
222 {TIFFTAG_DEFAULTSCALE, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "DefaultScale", NULL},
223 {TIFFTAG_BESTQUALITYSCALE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "BestQualityScale", NULL},
224 {TIFFTAG_DEFAULTCROPORIGIN, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "DefaultCropOrigin", NULL},
225 {TIFFTAG_DEFAULTCROPSIZE, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "DefaultCropSize", NULL},
226 {TIFFTAG_COLORMATRIX1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ColorMatrix1", NULL},
227 {TIFFTAG_COLORMATRIX2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ColorMatrix2", NULL},
228 {TIFFTAG_CAMERACALIBRATION1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "CameraCalibration1", NULL},
229 {TIFFTAG_CAMERACALIBRATION2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "CameraCalibration2", NULL},
230 {TIFFTAG_REDUCTIONMATRIX1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ReductionMatrix1", NULL},
231 {TIFFTAG_REDUCTIONMATRIX2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ReductionMatrix2", NULL},
232 {TIFFTAG_ANALOGBALANCE, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "AnalogBalance", NULL},
233 {TIFFTAG_ASSHOTNEUTRAL, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "AsShotNeutral", NULL},
234 {TIFFTAG_ASSHOTWHITEXY, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "AsShotWhiteXY", NULL},
235 {TIFFTAG_BASELINEEXPOSURE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "BaselineExposure", NULL},
236 {TIFFTAG_BASELINENOISE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "BaselineNoise", NULL},
237 {TIFFTAG_BASELINESHARPNESS, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "BaselineSharpness", NULL},
238 {TIFFTAG_BAYERGREENSPLIT, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "BayerGreenSplit", NULL},
239 {TIFFTAG_LINEARRESPONSELIMIT, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "LinearResponseLimit", NULL},
240 {TIFFTAG_CAMERASERIALNUMBER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "CameraSerialNumber", NULL},
241 {TIFFTAG_LENSINFO, 4, 4, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "LensInfo", NULL},
242 {TIFFTAG_CHROMABLURRADIUS, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "ChromaBlurRadius", NULL},
243 {TIFFTAG_ANTIALIASSTRENGTH, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "AntiAliasStrength", NULL},
244 {TIFFTAG_SHADOWSCALE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "ShadowScale", NULL},
245 {TIFFTAG_DNGPRIVATEDATA, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "DNGPrivateData", NULL},
246 {TIFFTAG_MAKERNOTESAFETY, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "MakerNoteSafety", NULL},
247 {TIFFTAG_CALIBRATIONILLUMINANT1, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CalibrationIlluminant1", NULL},
248 {TIFFTAG_CALIBRATIONILLUMINANT2, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CalibrationIlluminant2", NULL},
249 {TIFFTAG_RAWDATAUNIQUEID, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "RawDataUniqueID", NULL},
250 {TIFFTAG_ORIGINALRAWFILENAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "OriginalRawFileName", NULL},
251 {TIFFTAG_ORIGINALRAWFILEDATA, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "OriginalRawFileData", NULL},
252 {TIFFTAG_ACTIVEAREA, 4, 4, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "ActiveArea", NULL},
253 {TIFFTAG_MASKEDAREAS, -1, -1, TIFF_LONG, 0, TIFF_SETGET_C16_UINT32, FIELD_CUSTOM, 1, 1, "MaskedAreas", NULL},
254 {TIFFTAG_ASSHOTICCPROFILE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "AsShotICCProfile", NULL},
255 {TIFFTAG_ASSHOTPREPROFILEMATRIX, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "AsShotPreProfileMatrix", NULL},
256 {TIFFTAG_CURRENTICCPROFILE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "CurrentICCProfile", NULL},
257 {TIFFTAG_CURRENTPREPROFILEMATRIX, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "CurrentPreProfileMatrix", NULL},
258 {TIFFTAG_PERSAMPLE, 0, 0, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, TRUE, FALSE, "PerSample", NULL},
259#if 0
260 /* begin DNG 1.2.0.0 tags */
261 {TIFFTAG_COLORIMETRICREFERENCE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "ColorimetricReference", NULL},
262 {TIFFTAG_CAMERACALIBRATIONSIGNATURE, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "CameraCalibrationSignature", NULL},
263 {TIFFTAG_PROFILECALIBRATIONSIGNATURE, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "ProfileCalibrationSignature", NULL},
264 {TIFFTAG_EXTRACAMERAPROFILES, -1, -1, TIFF_IFD8, 0, TIFF_SETGET_C16_IFD8, FIELD_CUSTOM, 1, 1, "ExtraCameraProfiles", NULL},
265 {TIFFTAG_ASSHOTPROFILENAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "AsShotProfileName", NULL},
266 {TIFFTAG_NOISEREDUCTIONAPPLIED, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "NoiseReductionApplied", NULL},
267 {TIFFTAG_PROFILENAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "ProfileName", NULL},
268 {TIFFTAG_PROFILEHUESATMAPDIMS, 3, 3, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "ProfileHueSatMapDims", NULL},
269 {TIFFTAG_PROFILEHUESATMAPDATA1, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ProfileHueSatMapData1", NULL},
270 {TIFFTAG_PROFILEHUESATMAPDATA2, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ProfileHueSatMapData2", NULL},
271 {TIFFTAG_PROFILETONECURVE, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ProfileToneCurve", NULL},
272 {TIFFTAG_PROFILEEMBEDPOLICY, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ProfileEmbedPolicy", NULL},
273 {TIFFTAG_PROFILECOPYRIGHT, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "ProfileCopyright", NULL},
274 {TIFFTAG_FORWARDMATRIX1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ForwardMatrix1", NULL},
275 {TIFFTAG_FORWARDMATRIX2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ForwardMatrix2", NULL},
276 {TIFFTAG_PREVIEWAPPLICATIONNAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "PreviewApplicationName", NULL},
277 {TIFFTAG_PREVIEWAPPLICATIONVERSION, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "PreviewApplicationVersion", NULL},
278 {TIFFTAG_PREVIEWSETTINGSNAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "PreviewSettingsName", NULL},
279 {TIFFTAG_PREVIEWSETTINGSDIGEST, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "PreviewSettingsDigest", NULL},
280 {TIFFTAG_PREVIEWCOLORSPACE, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "PreviewColorSpace", NULL},
281 {TIFFTAG_PREVIEWDATETIME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "PreviewDateTime", NULL},
282 {TIFFTAG_RAWIMAGEDIGEST, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "RawImageDigest", NULL},
283 {TIFFTAG_ORIGINALRAWFILEDIGEST, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "OriginalRawFileDigest", NULL},
284 {TIFFTAG_SUBTILEBLOCKSIZE, 2, 2, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "SubTileBlockSize", NULL},
285 {TIFFTAG_ROWINTERLEAVEFACTOR, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "RowInterleaveFactor", NULL},
286 {TIFFTAG_PROFILELOOKTABLEDIMS, 3, 3, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "ProfileLookTableDims", NULL},
287 {TIFFTAG_PROFILELOOKTABLEDATA, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ProfileLookTableData", NULL},
288 /* begin DNG 1.3.0.0 tags */
289 {TIFFTAG_OPCODELIST1, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "OpcodeList1", NULL},
290 {TIFFTAG_OPCODELIST2, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "OpcodeList2", NULL},
291 {TIFFTAG_OPCODELIST3, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "OpcodeList3", NULL},
292 {TIFFTAG_NOISEPROFILE, -1, -1, TIFF_DOUBLE, 0, TIFF_SETGET_C16_DOUBLE, FIELD_CUSTOM, 1, 1, "NoiseProfile", NULL},
293 /* begin DNG 1.4.0.0 tags */
294 {TIFFTAG_DEFAULTUSERCROP, 4, 4, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "DefaultUserCrop", NULL},
295 {TIFFTAG_DEFAULTBLACKRENDER, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "DefaultBlackRender", NULL},
296 {TIFFTAG_BASELINEEXPOSUREOFFSET, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "BaselineExposureOffset", NULL},
297 {TIFFTAG_PROFILELOOKTABLEENCODING, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ProfileLookTableEncoding", NULL},
298 {TIFFTAG_PROFILEHUESATMAPENCODING, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ProfileHueSatMapEncoding", NULL},
299 {TIFFTAG_ORIGINALDEFAULTFINALSIZE, 2, 2, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "OriginalDefaultFinalSize", NULL},
300 {TIFFTAG_ORIGINALBESTQUALITYFINALSIZE, 2, 2, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "OriginalBestQualityFinalSize", NULL},
301 {TIFFTAG_ORIGINALDEFAULTCROPSIZE, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "OriginalDefaultCropSize", NULL}, /* could also be rational */
302 {TIFFTAG_NEWRAWIMAGEDIGEST, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "NewRawImageDigest", NULL},
303 {TIFFTAG_RAWTOPREVIEWGAIN, 1, 1, TIFF_DOUBLE, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "RawToPreviewGain", NULL},
304 /* begin DNG 1.5.0.0 tags */
305 {TIFFTAG_DEPTHFORMAT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "DepthFormat", NULL},
306 {TIFFTAG_DEPTHNEAR, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "DepthNear", NULL},
307 {TIFFTAG_DEPTHFAR, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "DepthFar", NULL},
308 {TIFFTAG_DEPTHUNITS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "DepthUnits", NULL},
309 {TIFFTAG_DEPTHMEASURETYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "DepthMeasureType", NULL},
310 {TIFFTAG_ENHANCEPARAMS, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "EnhanceParams", NULL},
311 /* begin DNG 1.6.0.0 tags */
312 {TIFFTAG_PROFILEGAINTABLEMAP, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "ProfileGainTableMap", NULL},
313 {TIFFTAG_SEMANTICNAME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "SemanticName", NULL},
314 {TIFFTAG_SEMANTICINSTANCEID, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "SemanticInstanceID", NULL},
315 {TIFFTAG_MASKSUBAREA, 4, 4, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "MaskSubArea", NULL},
316 {TIFFTAG_RGBTABLES, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "RGBTables", NULL},
317 {TIFFTAG_CALIBRATIONILLUMINANT3, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CalibrationIlluminant3", NULL},
318 {TIFFTAG_COLORMATRIX3, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ColorMatrix3", NULL},
319 {TIFFTAG_CAMERACALIBRATION3, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "CameraCalibration3", NULL},
320 {TIFFTAG_REDUCTIONMATRIX3, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ReductionMatrix3", NULL},
321 {TIFFTAG_PROFILEHUESATMAPDATA3, -1, -1, TIFF_FLOAT, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ProfileHueSatMapData3", NULL},
322 {TIFFTAG_FORWARDMATRIX3, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "ForwardMatrix3", NULL},
323 {TIFFTAG_ILLUMINANTDATA1, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "IlluminantData1", NULL},
324 {TIFFTAG_ILLUMINANTDATA2, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "IlluminantData2", NULL},
325 {TIFFTAG_ILLUMINANTDATA3, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "IlluminantData3", NULL},
326 /* end DNG tags */
327#endif
328 /* begin TIFF/EP tags */
329 {TIFFTAG_EP_CFAREPEATPATTERNDIM, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, FIELD_CUSTOM, 1, 0, "EP CFARepeatPatternDim", NULL},
330 {TIFFTAG_EP_CFAPATTERN, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "EP CFAPattern", NULL},
331#if 0
332 /* TIFFTAG_EP_BATTERYLEVEL can be RATIONAL or ASCII.
333 * LibTiff defines it as ASCII and converts RATIONAL to an ASCII string. */
334 {TIFFTAG_EP_BATTERYLEVEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "EP BatteryLevel", NULL},
335 {TIFFTAG_EP_INTERLACE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP Interlace", NULL},
336 /* TIFFTAG_EP_IPTC_NAA and TIFFTAG_RICHTIFFIPTC share the same tag number (33723)
337 * 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. */
338 {TIFFTAG_EP_TIMEZONEOFFSET, -1, -1, TIFF_SSHORT, 0, TIFF_SETGET_C16_UINT16, FIELD_CUSTOM, 1, 1, "EP TimeZoneOffset", NULL},
339 {TIFFTAG_EP_SELFTIMERMODE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP SelfTimerMode", NULL},
340 {TIFFTAG_EP_FLASHENERGY, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP FlashEnergy", NULL},
341 {TIFFTAG_EP_SPATIALFREQUENCYRESPONSE, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "EP SpatialFrequencyResponse", NULL},
342 {TIFFTAG_EP_NOISE, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "EP Noise", NULL},
343 {TIFFTAG_EP_FOCALPLANEXRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "EP FocalPlaneXResolution", NULL},
344 {TIFFTAG_EP_FOCALPLANEYRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "EP FocalPlaneYResolution", NULL},
345 {TIFFTAG_EP_FOCALPLANERESOLUTIONUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP FocalPlaneResolutionUnit", NULL},
346 {TIFFTAG_EP_IMAGENUMBER, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "EP ImageNumber", NULL}, /* or SHORT */
347 {TIFFTAG_EP_SECURITYCLASSIFICATION, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "EP SecurityClassification", NULL},
348 {TIFFTAG_EP_IMAGEHISTORY, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "EP ImageHistory", NULL},
349 {TIFFTAG_EP_EXPOSUREINDEX, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP ExposureIndex", NULL},
350 {TIFFTAG_EP_STANDARDID, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "EP StandardId", NULL},
351 {TIFFTAG_EP_SENSINGMETHOD, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP SensingMethod", NULL},
352 /* TIFF/EP tags equivalent to EXIF tags, sometimes defined differently. */
353 {TIFFTAG_EP_EXPOSURETIME, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP ExposureTime", NULL}, /*N=1 or 2 */
354 {TIFFTAG_EP_FNUMBER, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP FNumber", NULL},
355 {TIFFTAG_EP_EXPOSUREPROGRAM, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP ExposureProgram", NULL},
356 {TIFFTAG_EP_SPECTRALSENSITIVITY, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "EP SpectralSensitivity", NULL},
357 {TIFFTAG_EP_ISOSPEEDRATINGS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP ISOSpeedRatings", NULL},
358 {TIFFTAG_EP_OECF, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, FIELD_CUSTOM, 1, 1, "EP OptoelectricConversionFactor", NULL},
359 {TIFFTAG_EP_DATETIMEORIGINAL, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "EP DateTimeOriginal", NULL},
360 {TIFFTAG_EP_COMPRESSEDBITSPERPIXEL, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "EP CompressedBitsPerPixel", NULL},
361 {TIFFTAG_EP_SHUTTERSPEEDVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "EP ShutterSpeedValue", NULL},
362 {TIFFTAG_EP_APERTUREVALUE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "EP ApertureValue", NULL},
363 {TIFFTAG_EP_BRIGHTNESSVALUE, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP BrightnessValue", NULL},
364 {TIFFTAG_EP_EXPOSUREBIASVALUE, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP ExposureBiasValue", NULL}, /*N=1 or 2 */
365 {TIFFTAG_EP_MAXAPERTUREVALUE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "EP MaxApertureValue", NULL},
366 {TIFFTAG_EP_SUBJECTDISTANCE, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP SubjectDistance", NULL},
367 {TIFFTAG_EP_METERINGMODE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP MeteringMode", NULL},
368 {TIFFTAG_EP_LIGHTSOURCE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP LightSource", NULL},
369 {TIFFTAG_EP_FLASH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "EP Flash", NULL},
370 {TIFFTAG_EP_FOCALLENGTH, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "EP FocalLength", NULL},
371 {TIFFTAG_EP_SUBJECTLOCATION, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, FIELD_CUSTOM, 1, 1, "EP SubjectLocation", NULL},
372 /* end TIFF/EP tags */
373#endif
374 /* begin TIFF/FX tags */
375 {TIFFTAG_INDEXED, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "Indexed", NULL},
376 {TIFFTAG_GLOBALPARAMETERSIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, FIELD_CUSTOM, 1, 0, "GlobalParametersIFD", NULL},
377 {TIFFTAG_PROFILETYPE, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ProfileType", NULL},
378 {TIFFTAG_FAXPROFILE, 1, 1, TIFF_BYTE, 0, TIFF_SETGET_UINT8, FIELD_CUSTOM, 1, 0, "FaxProfile", NULL},
379 {TIFFTAG_CODINGMETHODS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "CodingMethods", NULL},
380 {TIFFTAG_VERSIONYEAR, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "VersionYear", NULL},
381 {TIFFTAG_MODENUMBER, 1, 1, TIFF_BYTE, 0, TIFF_SETGET_UINT8, FIELD_CUSTOM, 1, 0, "ModeNumber", NULL},
382 {TIFFTAG_DECODE, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, FIELD_CUSTOM, 1, 1, "Decode", NULL},
383 {TIFFTAG_IMAGEBASECOLOR, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, FIELD_CUSTOM, 1, 1, "ImageBaseColor", NULL},
384 {TIFFTAG_T82OPTIONS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "T82Options", NULL},
385 {TIFFTAG_STRIPROWCOUNTS, -1, -1, TIFF_LONG, 0, TIFF_SETGET_C16_UINT32, FIELD_CUSTOM, 1, 1, "StripRowCounts", NULL},
386 {TIFFTAG_IMAGELAYER, 2, 2, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, FIELD_CUSTOM, 1, 0, "ImageLayer", NULL},
387 /* end TIFF/FX tags */
388 /* begin pseudo tags */
389};
390
391/*
392 * EXIF tags (Version 2.31, July 2016 plus version 2.32 May 2019)
393 */
403static const TIFFField exifFields[] = {
404 {EXIFTAG_EXPOSURETIME, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "ExposureTime", NULL},
405 {EXIFTAG_FNUMBER, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "FNumber", NULL},
406 {EXIFTAG_EXPOSUREPROGRAM, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "ExposureProgram", NULL},
407 {EXIFTAG_SPECTRALSENSITIVITY, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "SpectralSensitivity", NULL},
408 /* After EXIF 2.2.1 ISOSpeedRatings is named PhotographicSensitivity. In addition, while "Count=Any", only 1 count should be used. */
409 {EXIFTAG_ISOSPEEDRATINGS, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, FIELD_CUSTOM, 1, 1, "ISOSpeedRatings", NULL},
410 {EXIFTAG_OECF, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "OptoelectricConversionFactor", NULL},
411 {EXIFTAG_SENSITIVITYTYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "SensitivityType", NULL},
412 {EXIFTAG_STANDARDOUTPUTSENSITIVITY, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "StandardOutputSensitivity", NULL},
413 {EXIFTAG_RECOMMENDEDEXPOSUREINDEX, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "RecommendedExposureIndex", NULL},
414 {EXIFTAG_ISOSPEED, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ISOSpeed", NULL},
415 {EXIFTAG_ISOSPEEDLATITUDEYYY, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ISOSpeedLatitudeyyy", NULL},
416 {EXIFTAG_ISOSPEEDLATITUDEZZZ, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "ISOSpeedLatitudezzz", NULL},
417 {EXIFTAG_EXIFVERSION, 4, 4, TIFF_UNDEFINED, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "ExifVersion", NULL},
418 {EXIFTAG_DATETIMEORIGINAL, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DateTimeOriginal", NULL},
419 {EXIFTAG_DATETIMEDIGITIZED, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DateTimeDigitized", NULL},
420 {EXIFTAG_OFFSETTIME, 7, 7, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "OffsetTime", NULL},
421 {EXIFTAG_OFFSETTIMEORIGINAL, 7, 7, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "OffsetTimeOriginal", NULL},
422 {EXIFTAG_OFFSETTIMEDIGITIZED, 7, 7, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "OffsetTimeDigitized", NULL},
423 {EXIFTAG_COMPONENTSCONFIGURATION, 4, 4, TIFF_UNDEFINED, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "ComponentsConfiguration", NULL},
424 {EXIFTAG_COMPRESSEDBITSPERPIXEL, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "CompressedBitsPerPixel", NULL},
425 {EXIFTAG_SHUTTERSPEEDVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "ShutterSpeedValue", NULL},
426 {EXIFTAG_APERTUREVALUE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "ApertureValue", NULL},
427 {EXIFTAG_BRIGHTNESSVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "BrightnessValue", NULL},
428 {EXIFTAG_EXPOSUREBIASVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "ExposureBiasValue", NULL},
429 {EXIFTAG_MAXAPERTUREVALUE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "MaxApertureValue", NULL},
430 /*--: EXIFTAG_SUBJECTDISTANCE: LibTiff returns value of "-1" if numerator equals 4294967295 (0xFFFFFFFF) to indicate infinite distance!
431 * However, there are two other EXIF tags where numerator indicates a special value and six other cases where the denominator indicates special values,
432 * which are not treated within LibTiff!! */
433 {EXIFTAG_SUBJECTDISTANCE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "SubjectDistance", NULL},
434 {EXIFTAG_METERINGMODE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "MeteringMode", NULL},
435 {EXIFTAG_LIGHTSOURCE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "LightSource", NULL},
436 {EXIFTAG_FLASH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "Flash", NULL},
437 {EXIFTAG_FOCALLENGTH, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "FocalLength", NULL},
438 {EXIFTAG_SUBJECTAREA, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, FIELD_CUSTOM, 1, 1, "SubjectArea", NULL},
439 {EXIFTAG_MAKERNOTE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "MakerNote", NULL},
440 {EXIFTAG_USERCOMMENT, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "UserComment", NULL},
441 {EXIFTAG_SUBSECTIME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "SubSecTime", NULL},
442 {EXIFTAG_SUBSECTIMEORIGINAL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "SubSecTimeOriginal", NULL},
443 {EXIFTAG_SUBSECTIMEDIGITIZED, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "SubSecTimeDigitized", NULL},
444 {EXIFTAG_TEMPERATURE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "Temperature", NULL},
445 {EXIFTAG_HUMIDITY, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "Humidity", NULL},
446 {EXIFTAG_PRESSURE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "Pressure", NULL},
447 {EXIFTAG_WATERDEPTH, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "WaterDepth", NULL},
448 {EXIFTAG_ACCELERATION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "Acceleration", NULL},
449 {EXIFTAG_CAMERAELEVATIONANGLE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "CameraElevationAngle", NULL},
450 {EXIFTAG_FLASHPIXVERSION, 4, 4, TIFF_UNDEFINED, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "FlashpixVersion", NULL},
451 {EXIFTAG_COLORSPACE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "ColorSpace", NULL},
452 {EXIFTAG_PIXELXDIMENSION, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "PixelXDimension", NULL},
453 {EXIFTAG_PIXELYDIMENSION, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, FIELD_CUSTOM, 1, 0, "PixelYDimension", NULL},
454 {EXIFTAG_RELATEDSOUNDFILE, 13, 13, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "RelatedSoundFile", NULL},
455 {EXIFTAG_FLASHENERGY, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "FlashEnergy", NULL},
456 {EXIFTAG_SPATIALFREQUENCYRESPONSE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "SpatialFrequencyResponse", NULL},
457 {EXIFTAG_FOCALPLANEXRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "FocalPlaneXResolution", NULL},
458 {EXIFTAG_FOCALPLANEYRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "FocalPlaneYResolution", NULL},
459 {EXIFTAG_FOCALPLANERESOLUTIONUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "FocalPlaneResolutionUnit", NULL},
460 {EXIFTAG_SUBJECTLOCATION, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, FIELD_CUSTOM, 1, 0, "SubjectLocation", NULL},
461 {EXIFTAG_EXPOSUREINDEX, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "ExposureIndex", NULL},
462 {EXIFTAG_SENSINGMETHOD, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "SensingMethod", NULL},
463 {EXIFTAG_FILESOURCE, 1, 1, TIFF_UNDEFINED, 0, TIFF_SETGET_UINT8, FIELD_CUSTOM, 1, 0, "FileSource", NULL},
464 {EXIFTAG_SCENETYPE, 1, 1, TIFF_UNDEFINED, 0, TIFF_SETGET_UINT8, FIELD_CUSTOM, 1, 0, "SceneType", NULL},
465 {EXIFTAG_CFAPATTERN, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "CFAPattern", NULL},
466 {EXIFTAG_CUSTOMRENDERED, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CustomRendered", NULL},
467 {EXIFTAG_EXPOSUREMODE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "ExposureMode", NULL},
468 {EXIFTAG_WHITEBALANCE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "WhiteBalance", NULL},
469 {EXIFTAG_DIGITALZOOMRATIO, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "DigitalZoomRatio", NULL},
470 {EXIFTAG_FOCALLENGTHIN35MMFILM, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "FocalLengthIn35mmFilm", NULL},
471 {EXIFTAG_SCENECAPTURETYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "SceneCaptureType", NULL},
472 {EXIFTAG_GAINCONTROL, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "GainControl", NULL},
473 {EXIFTAG_CONTRAST, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "Contrast", NULL},
474 {EXIFTAG_SATURATION, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "Saturation", NULL},
475 {EXIFTAG_SHARPNESS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "Sharpness", NULL},
476 {EXIFTAG_DEVICESETTINGDESCRIPTION, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "DeviceSettingDescription", NULL},
477 {EXIFTAG_SUBJECTDISTANCERANGE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "SubjectDistanceRange", NULL},
478 {EXIFTAG_IMAGEUNIQUEID, 33, 33, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "ImageUniqueID", NULL},
479 {EXIFTAG_CAMERAOWNERNAME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "CameraOwnerName", NULL},
480 {EXIFTAG_BODYSERIALNUMBER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "BodySerialNumber", NULL},
481 {EXIFTAG_LENSSPECIFICATION, 4, 4, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, FIELD_CUSTOM, 1, 0, "LensSpecification", NULL},
482 {EXIFTAG_LENSMAKE, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "LensMake", NULL},
483 {EXIFTAG_LENSMODEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "LensModel", NULL},
484 {EXIFTAG_LENSSERIALNUMBER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "LensSerialNumber", NULL},
485 {EXIFTAG_GAMMA, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_FLOAT, FIELD_CUSTOM, 1, 0, "Gamma", NULL},
486 {EXIFTAG_COMPOSITEIMAGE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "CompositeImage", NULL},
487 {EXIFTAG_SOURCEIMAGENUMBEROFCOMPOSITEIMAGE, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, FIELD_CUSTOM, 1, 0, "SourceImageNumberOfCompositeImage", NULL},
489 "SourceExposureTimesOfCompositeImage", NULL}};
490/*
491 * EXIF-GPS tags (Version 2.31, July 2016; nothing changed for version 2.32 May
492 * 2019)
493 */
494
504static const TIFFField gpsFields[] = {
505 /* For the GPS tag definitions in gpsFields[] the standard definition for Rationals is TIFF_SETGET_DOUBLE and TIFF_SETGET_C0_FLOAT.
506 *-- ATTENTION: After the upgrade with Rational2Double, the GPSTAG values can now be written and also read in double precision!
507 * In order to achieve double precision for GPS tags: Standard definitions for GPSTAG is kept to TIFF_SETGET_DOUBLE
508 * and TIFF_SETGET_C0_FLOAT is changed to TIFF_SETGET_C0_DOUBLE.
509 */
510 {GPSTAG_VERSIONID, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, FIELD_CUSTOM, 1, 0, "VersionID", NULL},
511 {GPSTAG_LATITUDEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "LatitudeRef", NULL},
512 {GPSTAG_LATITUDE, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, FIELD_CUSTOM, 1, 0, "Latitude", NULL},
513 {GPSTAG_LONGITUDEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "LongitudeRef", NULL},
514 {GPSTAG_LONGITUDE, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, FIELD_CUSTOM, 1, 0, "Longitude", NULL},
515 {GPSTAG_ALTITUDEREF, 1, 1, TIFF_BYTE, 0, TIFF_SETGET_UINT8, FIELD_CUSTOM, 1, 0, "AltitudeRef", NULL},
516 {GPSTAG_ALTITUDE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "Altitude", NULL},
517 {GPSTAG_TIMESTAMP, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, FIELD_CUSTOM, 1, 0, "TimeStamp", NULL},
518 {GPSTAG_SATELLITES, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "Satellites", NULL},
519 {GPSTAG_STATUS, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "Status", NULL},
520 {GPSTAG_MEASUREMODE, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "MeasureMode", NULL},
521 {GPSTAG_DOP, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "DOP", NULL},
522 {GPSTAG_SPEEDREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "SpeedRef", NULL},
523 {GPSTAG_SPEED, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "Speed", NULL},
524 {GPSTAG_TRACKREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "TrackRef", NULL},
525 {GPSTAG_TRACK, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "Track", NULL},
526 {GPSTAG_IMGDIRECTIONREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "ImgDirectionRef", NULL},
527 {GPSTAG_IMGDIRECTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "ImgDirection", NULL},
528 {GPSTAG_MAPDATUM, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "MapDatum", NULL},
529 {GPSTAG_DESTLATITUDEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DestLatitudeRef", NULL},
530 {GPSTAG_DESTLATITUDE, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, FIELD_CUSTOM, 1, 0, "DestLatitude", NULL},
531 {GPSTAG_DESTLONGITUDEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DestLongitudeRef", NULL},
532 {GPSTAG_DESTLONGITUDE, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_DOUBLE, FIELD_CUSTOM, 1, 0, "DestLongitude", NULL},
533 {GPSTAG_DESTBEARINGREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DestBearingRef", NULL},
534 {GPSTAG_DESTBEARING, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "DestBearing", NULL},
535 {GPSTAG_DESTDISTANCEREF, 2, 2, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DestDistanceRef", NULL},
536 {GPSTAG_DESTDISTANCE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "DestDistance", NULL},
537 {GPSTAG_PROCESSINGMETHOD, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "ProcessingMethod", NULL},
538 {GPSTAG_AREAINFORMATION, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, FIELD_CUSTOM, 1, 1, "AreaInformation", NULL},
539 {GPSTAG_DATESTAMP, 11, 11, TIFF_ASCII, 0, TIFF_SETGET_ASCII, FIELD_CUSTOM, 1, 0, "DateStamp", NULL},
540 {GPSTAG_DIFFERENTIAL, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, FIELD_CUSTOM, 1, 0, "Differential", NULL},
541 {GPSTAG_GPSHPOSITIONINGERROR, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, FIELD_CUSTOM, 1, 0, "HorizontalPositioningError", NULL}};
542/* clang-format on */ /* was off for better readability of tag comments */
543
544#ifdef __cplusplus
545/* In C++, the forward declaration used extern, so definitions must not be
546 * static */
553#else
554/* Suppress C++-compat warning for the definitions as well */
555#if defined(__GNUC__) && !defined(__clang__)
556#pragma GCC diagnostic push
557#pragma GCC diagnostic ignored "-Wc++-compat"
558#elif defined(__clang__)
559#pragma clang diagnostic push
560#pragma clang diagnostic ignored "-Wc++-compat"
561#endif
569static const TIFFFieldArray tiffFieldArray = {
578static const TIFFFieldArray exifFieldArray = {
587static const TIFFFieldArray gpsFieldArray = {
589#if defined(__GNUC__) && !defined(__clang__)
590#pragma GCC diagnostic pop
591#elif defined(__clang__)
592#pragma clang diagnostic pop
593#endif
594#endif
595
596/*
597 * We have our own local lfind() equivalent to avoid subtle differences
598 * in types passed to lfind() on different systems.
599 */
600
619static void *td_lfind(const void *key, const void *base, size_t *nmemb,
620 size_t size, int (*compar)(const void *, const void *))
621{
622 char *element, *end;
623
624 end = (char *)base + *nmemb * size;
625 for (element = (char *)base; element < end; element += size)
626 if (!compar(key, element)) /* key found */
627 return element;
628
629 return NULL;
630}
631
633
635
637
638void _TIFFSetupFields(TIFF *tif, const TIFFFieldArray *fieldarray)
639{
640 if (tif->tif_fields && tif->tif_nfields > 0)
641 {
642 uint32_t i;
643
644 for (i = 0; i < tif->tif_nfields; i++)
645 {
646 TIFFField *fld = tif->tif_fields[i];
647 if (fld->field_name != NULL)
648 {
649 if (fld->field_bit == FIELD_CUSTOM && TIFFFieldIsAnonymous(fld))
650 {
651 _TIFFfreeExt(tif, (void *)fld->field_name);
652 /* caution: tif_fields[i] must not be the beginning of a
653 * fields-array. Otherwise the following tags are also freed
654 * with the first free().
655 */
656 _TIFFfreeExt(tif, fld);
657 }
658 }
659 }
660
661 _TIFFfreeExt(tif, tif->tif_fields);
662 tif->tif_fields = NULL;
663 tif->tif_nfields = 0;
664 }
665 if (!_TIFFMergeFields(tif, fieldarray->fields, fieldarray->count))
666 {
667 TIFFErrorExtR(tif, "_TIFFSetupFields", "Setting up field info failed");
668 }
669}
670
685static int tagCompare(const void *a, const void *b)
686{
687 const TIFFField *ta = *(const TIFFField **)a;
688 const TIFFField *tb = *(const TIFFField **)b;
689 /* NB: be careful of return values for 16-bit platforms */
690 if (ta->field_tag != tb->field_tag)
691 return (int)ta->field_tag - (int)tb->field_tag;
692 else
693 return (ta->field_type == TIFF_ANY)
694 ? 0
695 : ((int)tb->field_type - (int)ta->field_type);
696}
697
712static int tagNameCompare(const void *a, const void *b)
713{
714 const TIFFField *ta = *(const TIFFField **)a;
715 const TIFFField *tb = *(const TIFFField **)b;
716 int ret = strcmp(ta->field_name, tb->field_name);
717
718 if (ret)
719 return ret;
720 else
721 return (ta->field_type == TIFF_ANY)
722 ? 0
723 : ((int)tb->field_type - (int)ta->field_type);
724}
725
726int _TIFFMergeFields(TIFF *tif, const TIFFField info[], uint32_t n)
727{
728 static const char module[] = "_TIFFMergeFields";
729 static const char reason[] = "for fields array";
730 /* TIFFField** tp; */
731 uint32_t i;
732
733 tif->tif_foundfield = NULL;
734
735 TIFFField **tif_newfields = NULL;
736
737 if (tif->tif_fields && tif->tif_nfields > 0)
738 {
739 tif_newfields = (TIFFField **)_TIFFCheckRealloc(
740 tif, tif->tif_fields, (tmsize_t)tif->tif_nfields + n,
741 (tmsize_t)sizeof(TIFFField *), reason);
742 }
743 else
744 {
745 tif_newfields =
746 (TIFFField **)_TIFFCheckMalloc(tif, n, sizeof(TIFFField *), reason);
747 }
748 if (!tif_newfields)
749 {
750 TIFFErrorExtR(tif, module, "Failed to allocate fields array");
751 return 0;
752 }
753 tif->tif_fields = tif_newfields;
754
755 /* tp = tif->tif_fields + tif->tif_nfields; */
756 for (i = 0; i < n; i++)
757 {
758 const TIFFField *fip = TIFFFindField(tif, info[i].field_tag, TIFF_ANY);
759
760 /* only add definitions that aren't already present */
761 if (!fip)
762 {
763 tif->tif_fields[tif->tif_nfields] = (TIFFField *)(info + i);
764 tif->tif_nfields++;
765 }
766 }
767
768 /* Sort the field info by tag number */
769 qsort(tif->tif_fields, tif->tif_nfields, sizeof(TIFFField *), tagCompare);
770
771 return (int)n;
772}
773
774void _TIFFPrintFieldInfo(TIFF *tif, FILE *fd)
775{
776 uint32_t i;
777
778 fprintf(fd, "%s: \n", tif->tif_name);
779 for (i = 0; i < tif->tif_nfields; i++)
780 {
781 const TIFFField *fip = tif->tif_fields[i];
782 fprintf(fd, "field[%2d] %5lu, %2d, %2d, %u, %2d, %5s, %5s, %s\n",
783 (int)i, (unsigned long)fip->field_tag, fip->field_readcount,
784 fip->field_writecount, fip->field_type, fip->field_bit,
785 fip->field_oktochange ? "TRUE" : "FALSE",
786 fip->field_passcount ? "TRUE" : "FALSE", fip->field_name);
787 }
788}
789
790/*
791 * Return size of TIFFDataType within TIFF-file in bytes
792 */
794{
795 switch (type)
796 {
797 case 0: /* nothing */
798 case TIFF_BYTE:
799 case TIFF_ASCII:
800 case TIFF_SBYTE:
801 case TIFF_UNDEFINED:
802 return 1;
803 case TIFF_SHORT:
804 case TIFF_SSHORT:
805 return 2;
806 case TIFF_LONG:
807 case TIFF_SLONG:
808 case TIFF_FLOAT:
809 case TIFF_IFD:
810 return 4;
811 case TIFF_RATIONAL:
812 case TIFF_SRATIONAL:
813 case TIFF_DOUBLE:
814 case TIFF_LONG8:
815 case TIFF_SLONG8:
816 case TIFF_IFD8:
817 return 8;
818 default:
819 return 0; /* will return 0 for unknown types */
820 }
821}
822
823/*
824 * Return internal storage size of TIFFSetGetFieldType in bytes.
825 * TIFFSetField() and TIFFGetField() have to provide the parameter accordingly.
826 * Replaces internal functions _TIFFDataSize() and _TIFFSetGetFieldSize()
827 * with now extern available function TIFFFieldSetGetSize().
828 */
830{
831 /*
832 * TIFFSetField() and TIFFGetField() must provide the parameter accordingly
833 * to the definition of "set_get_field_type" of the tag definition in
834 * dir_info.c. This function returns the data size for that purpose.
835 *
836 * Furthermore, this data size is also used for the internal storage,
837 * even for TIFF_RATIONAL values for FIELD_CUSTOM, which are stored
838 * internally as 4-byte float, but some of them should be stored internally
839 * as 8-byte double, depending on the "set_get_field_type" _FLOAT_ or
840 * _DOUBLE_.
841 */
842 if (fip == NULL)
843 return 0;
844
845 switch (fip->set_get_field_type)
846 {
853 return 1;
862 return 1;
871 return 2;
872 case TIFF_SETGET_INT:
886 return 4;
890 case TIFF_SETGET_IFD8:
903 return 8;
904 default:
905 return 0;
906 }
907} /*-- TIFFFieldSetGetSize() --- */
908
909/*
910 * Return size of count parameter of TIFFSetField() and TIFFGetField()
911 * and also if it is required: 0=none, 2=uint16_t, 4=uint32_t
912 */
914{
915 if (fip == NULL)
916 return 0;
917
918 switch (fip->set_get_field_type)
919 {
932 return 2;
945 return 4;
958 case TIFF_SETGET_IFD8:
959 case TIFF_SETGET_INT:
974 default:
975 return 0;
976 }
977} /*-- TIFFFieldSetGetCountSize() --- */
978
979const TIFFField *TIFFFindField(TIFF *tif, uint32_t tag, TIFFDataType dt)
980{
981 TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, TIFF_SETGET_UNDEFINED,
982 0, 0, 0, NULL, NULL};
983 TIFFField *pkey = &key;
984 const TIFFField **ret;
985 if (tif->tif_foundfield && tif->tif_foundfield->field_tag == tag &&
986 (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type))
987 return tif->tif_foundfield;
988
989 /* If we are invoked with no field information, then just return. */
990 if (!tif->tif_fields)
991 return NULL;
992
993 /* NB: use sorted search (e.g. binary search) */
994
995 key.field_tag = tag;
996 key.field_type = dt;
997
998 ret = (const TIFFField **)bsearch(&pkey, tif->tif_fields, tif->tif_nfields,
999 sizeof(TIFFField *), tagCompare);
1000 return tif->tif_foundfield = (ret ? *ret : NULL);
1001}
1002
1019static const TIFFField *_TIFFFindFieldByName(TIFF *tif, const char *field_name,
1020 TIFFDataType dt)
1021{
1022 TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, TIFF_SETGET_UNDEFINED,
1023 0, 0, 0, NULL, NULL};
1024 TIFFField *pkey = &key;
1025 const TIFFField **ret;
1026 if (tif->tif_foundfield &&
1027 streq(tif->tif_foundfield->field_name, field_name) &&
1028 (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type))
1029 return (tif->tif_foundfield);
1030
1031 /* If we are invoked with no field information, then just return. */
1032 if (!tif->tif_fields)
1033 return NULL;
1034
1035 /* NB: use linear search since list is sorted by key#, not name */
1036
1037 key.field_name = (char *)field_name;
1038 key.field_type = dt;
1039
1040 ret =
1041 (const TIFFField **)td_lfind(&pkey, tif->tif_fields, &tif->tif_nfields,
1042 sizeof(TIFFField *), tagNameCompare);
1043
1044 return tif->tif_foundfield = (ret ? *ret : NULL);
1045}
1046
1047const TIFFField *TIFFFieldWithTag(TIFF *tif, uint32_t tag)
1048{
1049 const TIFFField *fip = TIFFFindField(tif, tag, TIFF_ANY);
1050 if (!fip)
1051 {
1053 {
1054 TIFFWarningExtR(tif, "TIFFFieldWithTag",
1055 "Warning, unknown tag 0x%x", (unsigned int)tag);
1056 }
1057 }
1058 return (fip);
1059}
1060
1061const TIFFField *TIFFFieldWithName(TIFF *tif, const char *field_name)
1062{
1063 const TIFFField *fip = _TIFFFindFieldByName(tif, field_name, TIFF_ANY);
1064 if (!fip)
1065 {
1067 {
1068 TIFFWarningExtR(tif, "TIFFFieldWithName", "Warning, unknown tag %s",
1069 field_name);
1070 }
1071 }
1072 return (fip);
1073}
1074
1075uint32_t TIFFFieldTag(const TIFFField *fip) { return fip->field_tag; }
1076
1077const char *TIFFFieldName(const TIFFField *fip) { return fip->field_name; }
1078
1080
1081int TIFFFieldPassCount(const TIFFField *fip) { return fip->field_passcount; }
1082
1083int TIFFFieldReadCount(const TIFFField *fip) { return fip->field_readcount; }
1084
1085int TIFFFieldWriteCount(const TIFFField *fip) { return fip->field_writecount; }
1086
1088{
1089 return (int)fip->field_anonymous;
1090}
1091
1092const TIFFField *_TIFFFindOrRegisterField(TIFF *tif, uint32_t tag,
1093 TIFFDataType dt)
1094
1095{
1096 const TIFFField *fld;
1097
1098 fld = TIFFFindField(tif, tag, dt);
1099 if (fld == NULL)
1100 {
1101 fld = _TIFFCreateAnonField(tif, tag, dt);
1102 if (fld == NULL || !_TIFFMergeFields(tif, fld, 1))
1103 return NULL;
1104 }
1105
1106 return fld;
1107}
1108
1110 TIFFDataType field_type)
1111{
1112 TIFFField *fld;
1113 (void)tif;
1114
1115 fld = (TIFFField *)_TIFFmallocExt(tif, sizeof(TIFFField));
1116 if (fld == NULL)
1117 return NULL;
1118 _TIFFmemset(fld, 0, sizeof(TIFFField));
1119
1120 fld->field_tag = tag;
1123 fld->field_type = field_type;
1124 fld->field_anonymous =
1125 1; /* indicate that this is an anonymous / unknown tag */
1126 switch (field_type)
1127 {
1128 case TIFF_BYTE:
1129 case TIFF_UNDEFINED:
1131 break;
1132 case TIFF_ASCII:
1134 break;
1135 case TIFF_SHORT:
1137 break;
1138 case TIFF_LONG:
1140 break;
1141 case TIFF_RATIONAL:
1142 case TIFF_SRATIONAL:
1143 case TIFF_FLOAT:
1145 break;
1146 case TIFF_SBYTE:
1148 break;
1149 case TIFF_SSHORT:
1151 break;
1152 case TIFF_SLONG:
1154 break;
1155 case TIFF_DOUBLE:
1157 break;
1158 case TIFF_IFD:
1159 case TIFF_IFD8:
1161 break;
1162 case TIFF_LONG8:
1164 break;
1165 case TIFF_SLONG8:
1167 break;
1168 case TIFF_NOTYPE:
1169 default:
1171 break;
1172 }
1173 fld->field_bit = FIELD_CUSTOM;
1174 fld->field_oktochange = TRUE;
1175 fld->field_passcount = TRUE;
1176 char *field_name_buf = (char *)_TIFFmallocExt(tif, 32);
1177 if (field_name_buf == NULL)
1178 {
1179 _TIFFfreeExt(tif, fld);
1180 return NULL;
1181 }
1182 fld->field_subfields = NULL;
1183
1184 /*
1185 * note that this name is a special sign to TIFFClose() and
1186 * _TIFFSetupFields() to free the field
1187 * Update:
1188 * This special sign is replaced by fld->field_anonymous flag.
1189 */
1190 (void)snprintf(field_name_buf, 32, "Tag %d", (int)tag);
1191 fld->field_name = field_name_buf;
1192
1193 return fld;
1194}
1195
1196/****************************************************************************
1197 * O B S O L E T E D I N T E R F A C E S
1198 *
1199 * Don't use this stuff in your applications, it may be removed in the future
1200 * libtiff versions.
1201 ****************************************************************************/
1202
1220 unsigned char passcount)
1221{
1222 if (type == TIFF_ASCII && count == TIFF_VARIABLE && passcount == 0)
1223 return TIFF_SETGET_ASCII;
1224
1225 else if (count == 1 && passcount == 0)
1226 {
1227 switch (type)
1228 {
1229 case TIFF_BYTE:
1230 case TIFF_UNDEFINED:
1231 return TIFF_SETGET_UINT8;
1232 case TIFF_ASCII:
1233 return TIFF_SETGET_ASCII;
1234 case TIFF_SHORT:
1235 return TIFF_SETGET_UINT16;
1236 case TIFF_LONG:
1237 return TIFF_SETGET_UINT32;
1238 case TIFF_RATIONAL:
1239 case TIFF_SRATIONAL:
1240 case TIFF_FLOAT:
1241 return TIFF_SETGET_FLOAT;
1242 case TIFF_SBYTE:
1243 return TIFF_SETGET_SINT8;
1244 case TIFF_SSHORT:
1245 return TIFF_SETGET_SINT16;
1246 case TIFF_SLONG:
1247 return TIFF_SETGET_SINT32;
1248 case TIFF_DOUBLE:
1249 return TIFF_SETGET_DOUBLE;
1250 case TIFF_IFD:
1251 case TIFF_IFD8:
1252 return TIFF_SETGET_IFD8;
1253 case TIFF_LONG8:
1254 return TIFF_SETGET_UINT64;
1255 case TIFF_SLONG8:
1256 return TIFF_SETGET_SINT64;
1257 case TIFF_NOTYPE:
1258 default:
1259 return TIFF_SETGET_UNDEFINED;
1260 }
1261 }
1262
1263 else if (count >= 1 && passcount == 0)
1264 {
1265 switch (type)
1266 {
1267 case TIFF_BYTE:
1268 case TIFF_UNDEFINED:
1269 return TIFF_SETGET_C0_UINT8;
1270 case TIFF_ASCII:
1271 return TIFF_SETGET_C0_ASCII;
1272 case TIFF_SHORT:
1273 return TIFF_SETGET_C0_UINT16;
1274 case TIFF_LONG:
1275 return TIFF_SETGET_C0_UINT32;
1276 case TIFF_RATIONAL:
1277 case TIFF_SRATIONAL:
1278 case TIFF_FLOAT:
1279 return TIFF_SETGET_C0_FLOAT;
1280 case TIFF_SBYTE:
1281 return TIFF_SETGET_C0_SINT8;
1282 case TIFF_SSHORT:
1283 return TIFF_SETGET_C0_SINT16;
1284 case TIFF_SLONG:
1285 return TIFF_SETGET_C0_SINT32;
1286 case TIFF_DOUBLE:
1287 return TIFF_SETGET_C0_DOUBLE;
1288 case TIFF_IFD:
1289 case TIFF_IFD8:
1290 return TIFF_SETGET_C0_IFD8;
1291 case TIFF_LONG8:
1292 return TIFF_SETGET_C0_UINT64;
1293 case TIFF_SLONG8:
1294 return TIFF_SETGET_C0_SINT64;
1295 case TIFF_NOTYPE:
1296 default:
1297 return TIFF_SETGET_UNDEFINED;
1298 }
1299 }
1300
1301 else if (count == TIFF_VARIABLE && passcount == 1)
1302 {
1303 switch (type)
1304 {
1305 case TIFF_BYTE:
1306 case TIFF_UNDEFINED:
1307 return TIFF_SETGET_C16_UINT8;
1308 case TIFF_ASCII:
1309 return TIFF_SETGET_C16_ASCII;
1310 case TIFF_SHORT:
1312 case TIFF_LONG:
1314 case TIFF_RATIONAL:
1315 case TIFF_SRATIONAL:
1316 case TIFF_FLOAT:
1317 return TIFF_SETGET_C16_FLOAT;
1318 case TIFF_SBYTE:
1319 return TIFF_SETGET_C16_SINT8;
1320 case TIFF_SSHORT:
1322 case TIFF_SLONG:
1324 case TIFF_DOUBLE:
1326 case TIFF_IFD:
1327 case TIFF_IFD8:
1328 return TIFF_SETGET_C16_IFD8;
1329 case TIFF_LONG8:
1331 case TIFF_SLONG8:
1333 case TIFF_NOTYPE:
1334 default:
1335 return TIFF_SETGET_UNDEFINED;
1336 }
1337 }
1338
1339 else if (count == TIFF_VARIABLE2 && passcount == 1)
1340 {
1341 switch (type)
1342 {
1343 case TIFF_BYTE:
1344 case TIFF_UNDEFINED:
1345 return TIFF_SETGET_C32_UINT8;
1346 case TIFF_ASCII:
1347 return TIFF_SETGET_C32_ASCII;
1348 case TIFF_SHORT:
1350 case TIFF_LONG:
1352 case TIFF_RATIONAL:
1353 case TIFF_SRATIONAL:
1354 case TIFF_FLOAT:
1355 return TIFF_SETGET_C32_FLOAT;
1356 case TIFF_SBYTE:
1357 return TIFF_SETGET_C32_SINT8;
1358 case TIFF_SSHORT:
1360 case TIFF_SLONG:
1362 case TIFF_DOUBLE:
1364 case TIFF_IFD:
1365 case TIFF_IFD8:
1366 return TIFF_SETGET_C32_IFD8;
1367 case TIFF_LONG8:
1369 case TIFF_SLONG8:
1371 case TIFF_NOTYPE:
1372 default:
1373 return TIFF_SETGET_UNDEFINED;
1374 }
1375 }
1376
1377 return TIFF_SETGET_UNDEFINED;
1378}
1379
1380int TIFFMergeFieldInfo(TIFF *tif, const TIFFFieldInfo info[], uint32_t n)
1381{
1382 static const char module[] = "TIFFMergeFieldInfo";
1383 static const char reason[] = "for fields array";
1384 TIFFField *tp;
1385 size_t nfields;
1386 uint32_t i;
1387
1388 TIFFFieldArray *tif_newfieldscompat = NULL;
1389
1390 if (tif->tif_nfieldscompat > 0)
1391 {
1392 tif_newfieldscompat = (TIFFFieldArray *)_TIFFCheckRealloc(
1393 tif, tif->tif_fieldscompat, (tmsize_t)tif->tif_nfieldscompat + 1,
1394 (tmsize_t)sizeof(TIFFFieldArray), reason);
1395 }
1396 else
1397 {
1398 tif_newfieldscompat = (TIFFFieldArray *)_TIFFCheckMalloc(
1399 tif, 1, sizeof(TIFFFieldArray), reason);
1400 }
1401 if (!tif_newfieldscompat)
1402 {
1403 TIFFErrorExtR(tif, module, "Failed to allocate fields array");
1404 return -1;
1405 }
1406 tif->tif_fieldscompat = tif_newfieldscompat;
1407 nfields = tif->tif_nfieldscompat++;
1408
1409 tif->tif_fieldscompat[nfields].type = tfiatOther;
1410 tif->tif_fieldscompat[nfields].allocated_size = n;
1411 tif->tif_fieldscompat[nfields].count = n;
1412 tif->tif_fieldscompat[nfields].fields =
1413 (TIFFField *)_TIFFCheckMalloc(tif, n, sizeof(TIFFField), reason);
1414 if (!tif->tif_fieldscompat[nfields].fields)
1415 {
1416 TIFFErrorExtR(tif, module, "Failed to allocate fields array");
1417 return -1;
1418 }
1419
1420 tp = tif->tif_fieldscompat[nfields].fields;
1421 for (i = 0; i < n; i++)
1422 {
1423 tp->field_tag = info[i].field_tag;
1424 if (info[i].field_readcount < TIFF_VARIABLE2 ||
1425 info[i].field_writecount < TIFF_VARIABLE2)
1426 {
1427 /* The fields (field_readcount) and (field_writecount) may use the
1428 * values TIFF_VARIABLE (-1), TIFF_SPP (-2), TIFF_VARIABLE2 (-3). */
1430 tif, module,
1431 "The value of field_readcount %d and field_writecount %d "
1432 "must be greater than or equal to -3.",
1433 info[i].field_readcount, info[i].field_writecount);
1434 return -1;
1435 }
1436 if ((info[i].field_readcount == 0 || info[i].field_writecount == 0) &&
1437 info[i].field_bit != FIELD_IGNORE)
1438 {
1439 /* The fields (field_readcount) and (field_writecount) may only
1440 be zero for pseudo_tags or ignored tags. */
1442 tif, module,
1443 "The value of field_readcount %d and field_writecount %d "
1444 "may only be zero for field_bit = 0 (i.e. ignored tags).",
1445 info[i].field_readcount, info[i].field_writecount);
1446 return -1;
1447 }
1448 tp->field_readcount = info[i].field_readcount;
1449 tp->field_writecount = info[i].field_writecount;
1450 tp->field_type = info[i].field_type;
1451 tp->field_anonymous = 0;
1452 tp->set_get_field_type =
1453 _TIFFSetGetType(info[i].field_type, info[i].field_writecount,
1454 info[i].field_passcount);
1455 tp->field_bit = info[i].field_bit;
1456 tp->field_oktochange = info[i].field_oktochange;
1457 tp->field_passcount = info[i].field_passcount;
1458 /* Define an empty static string to be passed as field_name where a NULL
1459 * pointer is passed in. Otherwise, this will lead to buffer overflow
1460 * furtheron. */
1461 if (info[i].field_name == NULL)
1462 {
1463 static const char *string_static_empty = "";
1464 tp->field_name = (char *)string_static_empty;
1465 }
1466 else
1467 {
1468 tp->field_name = info[i].field_name;
1469 }
1470 tp->field_subfields = NULL;
1471 tp++;
1472 }
1473
1474 if (!_TIFFMergeFields(tif, tif->tif_fieldscompat[nfields].fields, n))
1475 {
1476 TIFFErrorExtR(tif, module, "Setting up field info failed");
1477 return -1;
1478 }
1479
1480 return 0;
1481}
1482
1484{
1485 /* Filter out non-codec specific tags */
1486 switch (tag)
1487 {
1488 /* Shared tags */
1489 case TIFFTAG_PREDICTOR:
1490 /* JPEG tags */
1491 case TIFFTAG_JPEGTABLES:
1492 /* OJPEG tags */
1498 case TIFFTAG_JPEGPROC:
1500 /* CCITT* */
1506 /* LERC */
1508 break;
1509 default:
1510 return 1;
1511 }
1513 {
1514 return 0;
1515 }
1516 /* Check if codec specific tags are allowed for the current
1517 * compression scheme (codec) */
1518 switch (tif->tif_dir.td_compression)
1519 {
1520 case COMPRESSION_LZW:
1521 if (tag == TIFFTAG_PREDICTOR)
1522 return 1;
1523 break;
1525 /* No codec-specific tags */
1526 break;
1528 /* No codec-specific tags */
1529 break;
1530 case COMPRESSION_NEXT:
1531 /* No codec-specific tags */
1532 break;
1533 case COMPRESSION_JPEG:
1534 if (tag == TIFFTAG_JPEGTABLES)
1535 return 1;
1536 break;
1537 case COMPRESSION_OJPEG:
1538 switch (tag)
1539 {
1545 case TIFFTAG_JPEGPROC:
1547 return 1;
1548 default:
1549 break;
1550 }
1551 break;
1556 switch (tag)
1557 {
1561 return 1;
1564 return 1;
1565 break;
1568 return 1;
1569 break;
1570 default:
1571 break;
1572 }
1573 break;
1574 case COMPRESSION_JBIG:
1575 /* No codec-specific tags */
1576 break;
1579 if (tag == TIFFTAG_PREDICTOR)
1580 return 1;
1581 break;
1583 if (tag == TIFFTAG_PREDICTOR)
1584 return 1;
1585 break;
1586 case COMPRESSION_SGILOG:
1588 /* No codec-specific tags */
1589 break;
1590 case COMPRESSION_LZMA:
1591 if (tag == TIFFTAG_PREDICTOR)
1592 return 1;
1593 break;
1594 case COMPRESSION_ZSTD:
1595 if (tag == TIFFTAG_PREDICTOR)
1596 return 1;
1597 break;
1598 case COMPRESSION_LERC:
1599 if (tag == TIFFTAG_LERC_PARAMETERS)
1600 return 1;
1601 break;
1602 default:
1603 break;
1604 }
1605 return 0;
1606}
#define FIELD_RESOLUTION
Index the resolution presence bit; not an on-disk tag number.
Definition tif_dir.h:429
#define FIELD_SUBFILETYPE
Index the subfile type presence bit; not an on-disk tag number.
Definition tif_dir.h:441
#define FIELD_STRIPOFFSETS
Index the strile offsets presence bit; not an on-disk tag number.
Definition tif_dir.h:519
#define FIELD_TRANSFERFUNCTION
Index the transfer function presence bit; not an on-disk tag number.
Definition tif_dir.h:580
#define FIELD_HALFTONEHINTS
Index the halftone hints presence bit; not an on-disk tag number.
Definition tif_dir.h:559
#define FIELD_ORIENTATION
Index the orientation presence bit; not an on-disk tag number.
Definition tif_dir.h:471
#define FIELD_MINSAMPLEVALUE
Index the minimum sample value presence bit; not an on-disk tag number.
Definition tif_dir.h:487
int _TIFFMergeFields(TIFF *tif, const TIFFField info[], uint32_t n)
Merge borrowed field definitions into the lookup table.
#define FIELD_FILLORDER
Index the fill order presence bit; not an on-disk tag number.
Definition tif_dir.h:466
#define FIELD_SMAXSAMPLEVALUE
Index the per-sample maximum presence bit; not an on-disk tag number.
Definition tif_dir.h:544
static int tagCompare(const void *a, const void *b)
Compare field pointers by tag number and reverse type order.
#define FIELD_IMAGEDIMENSIONS
Index the image dimensions presence bit; not an on-disk tag number.
Definition tif_dir.h:419
#define FIELD_YCBCRSUBSAMPLING
Index the YCbCr subsampling presence bit; not an on-disk tag number.
Definition tif_dir.h:564
TIFFField * _TIFFCreateAnonField(TIFF *tif, uint32_t tag, TIFFDataType field_type)
Allocate a counted anonymous field descriptor.
#define FIELD_COLORMAP
Index the colormap presence bit; not an on-disk tag number.
Definition tif_dir.h:524
#define FIELD_SUBIFD
Index the child IFD presence bit; not an on-disk tag number.
Definition tif_dir.h:590
static const TIFFField tiffFields[]
Describe the built-in image fields and their argument representations.
static const TIFFFieldArray exifFieldArray
Wrap the static EXIF field schema.
Definition tif_dirinfo.c:79
#define FIELD_EXTRASAMPLES
Index the extra samples presence bit; not an on-disk tag number.
Definition tif_dir.h:529
#define FIELD_IGNORE
Mark a processed-but-discarded tag; bit zero is reserved.
Definition tif_dir.h:412
#define FIELD_IMAGEDEPTH
Index the image depth presence bit; not an on-disk tag number.
Definition tif_dir.h:549
const TIFFField * _TIFFFindOrRegisterField(TIFF *tif, uint32_t tag, TIFFDataType dt)
Find a typed field or register an anonymous replacement.
static int tagNameCompare(const void *a, const void *b)
Compare field pointers by case-sensitive name and reverse type order.
const TIFFFieldArray * _TIFFGetFields(void)
Return the built-in image field schema.
#define FIELD_SMINSAMPLEVALUE
Index the per-sample minimum presence bit; not an on-disk tag number.
Definition tif_dir.h:539
static const TIFFField gpsFields[]
Describe the built-in GPS fields and their argument representations.
static const TIFFFieldArray tiffFieldArray
Wrap the static image field schema.
Definition tif_dirinfo.c:78
#define FIELD_MAXSAMPLEVALUE
Index the maximum sample value presence bit; not an on-disk tag number.
Definition tif_dir.h:493
#define FIELD_NUMBEROFINKS
Index the number of inks presence bit; not an on-disk tag number.
Definition tif_dir.h:595
#define FIELD_TILEDEPTH
Index the tile depth presence bit; not an on-disk tag number.
Definition tif_dir.h:554
void _TIFFPrintFieldInfo(TIFF *tif, FILE *fd)
Print the registered field metadata to a stream.
#define FIELD_TILEDIMENSIONS
Index the tile dimensions presence bit; not an on-disk tag number.
Definition tif_dir.h:424
#define FIELD_POSITION
Index the position presence bit; not an on-disk tag number.
Definition tif_dir.h:434
#define FIELD_ROWSPERSTRIP
Index the rows per strip presence bit; not an on-disk tag number.
Definition tif_dir.h:481
static const TIFFFieldArray gpsFieldArray
Wrap the static GPS field schema.
Definition tif_dirinfo.c:80
#define FIELD_COMPRESSION
Index the compression presence bit; not an on-disk tag number.
Definition tif_dir.h:451
#define FIELD_STRIPBYTECOUNTS
Index the strile byte counts presence bit; not an on-disk tag number.
Definition tif_dir.h:514
void _TIFFSetupFields(TIFF *tif, const TIFFFieldArray *fieldarray)
Replace the registered field-pointer table with a schema.
#define FIELD_YCBCRPOSITIONING
Index the YCbCr positioning presence bit; not an on-disk tag number.
Definition tif_dir.h:569
#define FIELD_PSEUDO
Share bit zero with FIELD_IGNORE for pseudo-tags.
Definition tif_dir.h:620
const TIFFFieldArray * _TIFFGetGpsFields(void)
Return the built-in GPS field schema.
#define FIELD_REFBLACKWHITE
Index the reference black/white presence bit; not an on-disk tag number.
Definition tif_dir.h:575
static const TIFFField * _TIFFFindFieldByName(TIFF *tif, const char *field_name, TIFFDataType dt)
Find a registered descriptor by name and file type.
#define FIELD_SAMPLEFORMAT
Index the sample format presence bit; not an on-disk tag number.
Definition tif_dir.h:534
static const TIFFField exifFields[]
Describe the built-in EXIF fields and their argument representations.
#define FIELD_PAGENUMBER
Index the page number presence bit; not an on-disk tag number.
Definition tif_dir.h:509
int _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag)
Filter recognised codec-specific tags against current compression.
static TIFFSetGetFieldType _TIFFSetGetType(TIFFDataType type, short count, unsigned char passcount)
Translate legacy type/count metadata into a set/get representation.
#define FIELD_BITSPERSAMPLE
Index the bits per sample presence bit; not an on-disk tag number.
Definition tif_dir.h:446
TIFFSetGetFieldType
Encode the internal value and variadic count representation.
Definition tif_dir.h:734
#define FIELD_INKNAMES
Index the ink names presence bit; not an on-disk tag number.
Definition tif_dir.h:585
#define FIELD_RESOLUTIONUNIT
Index the resolution unit presence bit; not an on-disk tag number.
Definition tif_dir.h:504
#define FIELD_PLANARCONFIG
Index the planar configuration presence bit; not an on-disk tag number.
Definition tif_dir.h:499
#define FIELD_SAMPLESPERPIXEL
Index the samples per pixel presence bit; not an on-disk tag number.
Definition tif_dir.h:476
const TIFFFieldArray * _TIFFGetExifFields(void)
Return the built-in EXIF field schema.
#define FIELD_PHOTOMETRIC
Index the photometric presence bit; not an on-disk tag number.
Definition tif_dir.h:456
#define FIELD_THRESHHOLDING
Index the thresholding presence bit; not an on-disk tag number.
Definition tif_dir.h:461
static void * td_lfind(const void *key, const void *base, size_t *nmemb, size_t size, int(*compar)(const void *, const void *))
Find the first equal fixed-width element by linear search.
@ tfiatGps
EXIF GPS metadata-directory schema.
Definition tif_dir.h:943
@ tfiatOther
Other application/compatibility schema.
Definition tif_dir.h:946
@ tfiatImage
Main image-directory schema.
Definition tif_dir.h:939
@ tfiatExif
EXIF metadata-directory schema.
Definition tif_dir.h:941
@ TIFF_SETGET_C16_UINT8
Unsigned 8-bit array with 16-bit explicit count.
Definition tif_dir.h:792
@ TIFF_SETGET_C0_SINT64
Signed 64-bit array with implicit count.
Definition tif_dir.h:782
@ TIFF_SETGET_DOUBLE
Double scalar storage.
Definition tif_dir.h:758
@ TIFF_SETGET_SINT64
Signed 64-bit scalar storage.
Definition tif_dir.h:754
@ TIFF_SETGET_C32_SINT32
Signed 32-bit array with 32-bit explicit count.
Definition tif_dir.h:826
@ TIFF_SETGET_C16_FLOAT
Float array with 16-bit explicit count.
Definition tif_dir.h:808
@ TIFF_SETGET_UNDEFINED
Unsupported or unspecified argument representation.
Definition tif_dir.h:736
@ TIFF_SETGET_SINT8
Signed 8-bit scalar storage.
Definition tif_dir.h:742
@ TIFF_SETGET_C32_ASCII
Character array with 32-bit explicit count.
Definition tif_dir.h:814
@ TIFF_SETGET_INT
Promoted int scalar representation.
Definition tif_dir.h:762
@ TIFF_SETGET_C32_UINT8
Unsigned 8-bit array with 32-bit explicit count.
Definition tif_dir.h:816
@ TIFF_SETGET_IFD8
64-bit directory-offset scalar storage.
Definition tif_dir.h:760
@ TIFF_SETGET_C32_UINT16
Unsigned 16-bit array with 32-bit explicit count.
Definition tif_dir.h:820
@ TIFF_SETGET_C16_DOUBLE
Double array with 16-bit explicit count.
Definition tif_dir.h:810
@ TIFF_SETGET_UINT64
Unsigned 64-bit scalar storage.
Definition tif_dir.h:752
@ TIFF_SETGET_C0_UINT32
Unsigned 32-bit array with implicit count.
Definition tif_dir.h:776
@ TIFF_SETGET_C16_UINT32
Unsigned 32-bit array with 16-bit explicit count.
Definition tif_dir.h:800
@ TIFF_SETGET_UINT16_PAIR
Two separate promoted uint16_t values / uint16_t output slots.
Definition tif_dir.h:764
@ TIFF_SETGET_C32_SINT16
Signed 16-bit array with 32-bit explicit count.
Definition tif_dir.h:822
@ TIFF_SETGET_C16_UINT16
Unsigned 16-bit array with 16-bit explicit count.
Definition tif_dir.h:796
@ TIFF_SETGET_C16_SINT64
Signed 64-bit array with 16-bit explicit count.
Definition tif_dir.h:806
@ TIFF_SETGET_C0_FLOAT
Float array with implicit count.
Definition tif_dir.h:784
@ TIFF_SETGET_C0_SINT32
Signed 32-bit array with implicit count.
Definition tif_dir.h:778
@ TIFF_SETGET_C16_UINT64
Unsigned 64-bit array with 16-bit explicit count.
Definition tif_dir.h:804
@ TIFF_SETGET_C32_UINT32
Unsigned 32-bit array with 32-bit explicit count.
Definition tif_dir.h:824
@ TIFF_SETGET_C0_ASCII
Character array with implicit count.
Definition tif_dir.h:766
@ TIFF_SETGET_C32_SINT8
Signed 8-bit array with 32-bit explicit count.
Definition tif_dir.h:818
@ TIFF_SETGET_UINT16
Unsigned 16-bit scalar storage.
Definition tif_dir.h:744
@ TIFF_SETGET_C16_SINT16
Signed 16-bit array with 16-bit explicit count.
Definition tif_dir.h:798
@ TIFF_SETGET_C0_UINT8
Unsigned 8-bit array with implicit count.
Definition tif_dir.h:768
@ TIFF_SETGET_ASCII
Null-terminated string representation.
Definition tif_dir.h:738
@ TIFF_SETGET_C0_SINT8
Signed 8-bit array with implicit count.
Definition tif_dir.h:770
@ TIFF_SETGET_C16_SINT8
Signed 8-bit array with 16-bit explicit count.
Definition tif_dir.h:794
@ TIFF_SETGET_OTHER
Tag-specific calling convention outside the regular encodings.
Definition tif_dir.h:838
@ TIFF_SETGET_C0_UINT64
Unsigned 64-bit array with implicit count.
Definition tif_dir.h:780
@ TIFF_SETGET_FLOAT
Float scalar storage.
Definition tif_dir.h:756
@ TIFF_SETGET_C16_SINT32
Signed 32-bit array with 16-bit explicit count.
Definition tif_dir.h:802
@ TIFF_SETGET_SINT16
Signed 16-bit scalar storage.
Definition tif_dir.h:746
@ TIFF_SETGET_C0_SINT16
Signed 16-bit array with implicit count.
Definition tif_dir.h:774
@ TIFF_SETGET_C32_IFD8
64-bit directory-offset array with 32-bit explicit count.
Definition tif_dir.h:836
@ TIFF_SETGET_UINT32
Unsigned 32-bit scalar storage.
Definition tif_dir.h:748
@ TIFF_SETGET_C32_SINT64
Signed 64-bit array with 32-bit explicit count.
Definition tif_dir.h:830
@ TIFF_SETGET_C16_ASCII
Character array with 16-bit explicit count.
Definition tif_dir.h:790
@ TIFF_SETGET_C32_DOUBLE
Double array with 32-bit explicit count.
Definition tif_dir.h:834
@ TIFF_SETGET_UINT8
Unsigned 8-bit scalar storage.
Definition tif_dir.h:740
@ TIFF_SETGET_C0_UINT16
Unsigned 16-bit array with implicit count.
Definition tif_dir.h:772
@ TIFF_SETGET_C32_UINT64
Unsigned 64-bit array with 32-bit explicit count.
Definition tif_dir.h:828
@ TIFF_SETGET_C0_IFD8
64-bit directory-offset array with implicit count.
Definition tif_dir.h:788
@ TIFF_SETGET_C16_IFD8
64-bit directory-offset array with 16-bit explicit count.
Definition tif_dir.h:812
@ TIFF_SETGET_SINT32
Signed 32-bit scalar storage.
Definition tif_dir.h:750
@ TIFF_SETGET_C32_FLOAT
Float array with 32-bit explicit count.
Definition tif_dir.h:832
@ TIFF_SETGET_C0_DOUBLE
Double array with implicit count.
Definition tif_dir.h:786
void _TIFFfreeExt(TIFF *tif, void *p)
Release a handle-aware allocation and its payload charge.
Definition tif_open.c:301
void * _TIFFmallocExt(TIFF *tif, tmsize_t s)
Allocate uninitialised bytes under a handle's allocation policy.
Definition tif_open.c:195
void * _TIFFCheckRealloc(TIFF *tif, void *buffer, tmsize_t nmemb, tmsize_t elem_size, const char *what)
Resize a checked array with an allocation-failure diagnostic.
Definition tif_aux.c:249
void * _TIFFCheckMalloc(TIFF *tif, tmsize_t nmemb, tmsize_t elem_size, const char *what)
Allocate a checked array with an allocation-failure diagnostic.
Definition tif_aux.c:274
#define streq(a, b)
Compare two null-terminated strings for equality.
Definition tiffiop.h:108
#define TRUE
Represent the legacy internal true value.
Definition tiffiop.h:131
#define FALSE
Represent the legacy internal false value.
Definition tiffiop.h:136
#define TIFFArrayCount(a)
Compute the element count of an actual array.
Definition tiffiop.h:1239
int TIFFIsCODECConfigured(uint16_t scheme)
Check whether the selected descriptor has a configured initialiser.
Definition tif_codec.c:171
#define FIELD_CUSTOM
Identify a field stored through the custom-metadata mechanism.
Definition tiffio.h:1316
#define TIFF_VARIABLE
Mark a variable-length field with a 16-bit count convention.
Definition tiffio.h:1297
#define TIFF_ANY
Match any data type when searching for a field descriptor.
Definition tiffio.h:1289
#define TIFF_VARIABLE2
Mark a variable-length field with a 32-bit count convention.
Definition tiffio.h:1310
void TIFFWarningExtR(TIFF *tif, const char *module, const char *fmt,...)
Dispatch a warning diagnostic to the configured handlers.
Definition tif_warning.c:85
void TIFFErrorExtR(TIFF *tif, const char *module, const char *fmt,...)
Dispatch a error diagnostic to the configured handlers.
Definition tif_error.c:112
#define TIFFTAG_CALIBRATIONILLUMINANT2
TIFF tag: Illuminant 2 (introduced by Adobe DNG).
Definition tiff.h:1091
#define TIFFTAG_BASELINENOISE
TIFF tag: Relative noise level (introduced by Adobe DNG).
Definition tiff.h:1056
#define TIFFTAG_ILLUMINANTDATA1
TIFF tag: Data for the first calibration illuminant (introduced by Adobe DNG).
Definition tiff.h:1385
#define TIFFTAG_BESTQUALITYSCALE
TIFF tag: Best quality multiplier (introduced by Adobe DNG).
Definition tiff.h:1093
#define TIFFTAG_REDUCTIONMATRIX3
TIFF tag: Dimensionality reduction matrix for use in color conversion to XYZ under CalibrationIllumin...
Definition tiff.h:1371
#define TIFFTAG_DNGPRIVATEDATA
TIFF tag: Manufacturer's private data (introduced by Adobe DNG).
Definition tiff.h:1082
#define TIFFTAG_BASELINESHARPNESS
TIFF tag: Relative amount of sharpening (introduced by Adobe DNG).
Definition tiff.h:1058
#define TIFFTAG_PROFILECOPYRIGHT
TIFF tag: Profile copyright information (UTF-8) (introduced by Adobe DNG).
Definition tiff.h:1172
#define TIFFTAG_RGBTABLES
TIFF tag: Color transforms to apply to masked image regions (introduced by Adobe DNG).
Definition tiff.h:1350
#define TIFFTAG_PROFILEHUESATMAPENCODING
TIFF tag: 3D HueSatMap indexing conversion (introduced by Adobe DNG).
Definition tiff.h:1266
#define TIFFTAG_ORIGINALRAWFILEDATA
TIFF tag: Contents of the original raw file (introduced by Adobe DNG).
Definition tiff.h:1107
#define TIFFTAG_ASSHOTNEUTRAL
TIFF tag: Selected white balance in linear reference space (introduced by Adobe DNG).
Definition tiff.h:1045
#define TIFFTAG_REDUCTIONMATRIX2
TIFF tag: Dimensionality reduction matrix 2 (introduced by Adobe DNG).
Definition tiff.h:1035
#define TIFFTAG_LINEARRESPONSELIMIT
TIFF tag: Non-linear encoding range (introduced by Adobe DNG).
Definition tiff.h:1067
#define TIFFTAG_PREVIEWAPPLICATIONNAME
TIFF tag: Name of application that created preview (UTF-8) (introduced by Adobe DNG).
Definition tiff.h:1187
#define TIFFTAG_MASKEDAREAS
TIFF tag: List of coordinates of fully masked pixels (introduced by Adobe DNG).
Definition tiff.h:1117
#define TIFFTAG_PROFILELOOKTABLEDATA
TIFF tag: Default "look" table for use as starting point (introduced by Adobe DNG).
Definition tiff.h:1228
#define TIFFTAG_ACTIVEAREA
TIFF tag: Active (non-masked) pixels of the sensor (introduced by Adobe DNG).
Definition tiff.h:1112
#define TIFFTAG_WHITELEVEL
TIFF tag: Fully saturated encoding level (introduced by Adobe DNG).
Definition tiff.h:1005
#define TIFFTAG_MAKERNOTESAFETY
TIFF tag: Whether the EXIF MakerNote tag is safe to preserve along with the rest of the EXIF data (in...
Definition tiff.h:1087
#define TIFFTAG_DEPTHFORMAT
TIFF tag: Encoding of the depth data in the file (introduced by Adobe DNG).
Definition tiff.h:1298
#define TIFFTAG_CURRENTICCPROFILE
TIFF tag: DNG current camera ICC profile (introduced by Adobe DNG).
Definition tiff.h:1129
#define TIFFTAG_CAMERACALIBRATION2
TIFF tag: Calibration matrix 2 (introduced by Adobe DNG).
Definition tiff.h:1027
#define TIFFTAG_DEPTHUNITS
TIFF tag: Measurement units for DepthNear and DepthFar (introduced by Adobe DNG).
Definition tiff.h:1313
#define TIFFTAG_PROFILEHUESATMAPDATA3
TIFF tag: The data for the third HSV table (introduced by Adobe DNG).
Definition tiff.h:1375
#define TIFFTAG_PROFILEHUESATMAPDATA1
TIFF tag: First HSV mapping table (introduced by Adobe DNG).
Definition tiff.h:1161
#define TIFFTAG_PROFILETONECURVE
TIFF tag: Default tone curve (introduced by Adobe DNG).
Definition tiff.h:1165
#define TIFFTAG_NOISEREDUCTIONAPPLIED
TIFF tag: Amount of applied noise reduction (introduced by Adobe DNG).
Definition tiff.h:1155
#define TIFFTAG_BASELINEEXPOSURE
TIFF tag: How much to move the zero point (introduced by Adobe DNG).
Definition tiff.h:1054
#define TIFFTAG_DEPTHNEAR
TIFF tag: Distance from the camera represented by value 0 in the depth map (introduced by Adobe DNG).
Definition tiff.h:1303
#define TIFFTAG_CALIBRATIONILLUMINANT1
TIFF tag: Illuminant 1 (introduced by Adobe DNG).
Definition tiff.h:1089
#define TIFFTAG_PROFILEGAINTABLEMAP
TIFF tag: Spatially varying gain tables that can be applied as starting point (introduced by Adobe DN...
Definition tiff.h:1330
#define TIFFTAG_LENSINFO
TIFF tag: Info about the lens.
Definition tiff.h:1071
#define TIFFTAG_BLACKLEVELREPEATDIM
TIFF tag: Repeat pattern size for the BlackLevel tag (introduced by Adobe DNG).
Definition tiff.h:989
#define TIFFTAG_ANALOGBALANCE
TIFF tag: Gain applied the stored raw values (introduced by Adobe DNG).
Definition tiff.h:1040
#define TIFFTAG_SUBTILEBLOCKSIZE
TIFF tag: Subtile block size (introduced by Adobe DNG).
Definition tiff.h:1216
#define TIFFTAG_PREVIEWDATETIME
TIFF tag: Date/time preview was rendered (introduced by Adobe DNG).
Definition tiff.h:1207
#define TIFFTAG_MASKSUBAREA
TIFF tag: The crop rectangle of this IFD's mask, relative to the main image (introduced by Adobe DNG)...
Definition tiff.h:1345
#define TIFFTAG_FORWARDMATRIX3
TIFF tag: Matrix to map white balanced camera colors to XYZ D50 (introduced by Adobe DNG).
Definition tiff.h:1380
#define TIFFTAG_PREVIEWAPPLICATIONVERSION
TIFF tag: Version of application that created preview (UTF-8) (introduced by Adobe DNG).
Definition tiff.h:1192
#define TIFFTAG_RAWDATAUNIQUEID
TIFF tag: Unique identifier for the raw image data (introduced by Adobe DNG).
Definition tiff.h:1098
#define TIFFTAG_PROFILELOOKTABLEENCODING
TIFF tag: 3D LookTable indexing conversion (introduced by Adobe DNG).
Definition tiff.h:1262
#define TIFFTAG_ORIGINALRAWFILEDIGEST
TIFF tag: Md5 of the data stored in the OriginalRawFileData tag (introduced by Adobe DNG).
Definition tiff.h:1214
#define TIFFTAG_ASSHOTICCPROFILE
TIFF tag: DNG as-shot camera ICC profile (introduced by Adobe DNG).
Definition tiff.h:1121
#define TIFFTAG_OPCODELIST1
TIFF tag: Opcodes that should be applied to raw image after reading (introduced by Adobe DNG).
Definition tiff.h:1235
#define TIFFTAG_ENHANCEPARAMS
TIFF tag: A string that documents how the enhanced image data was processed (introduced by Adobe DNG)...
Definition tiff.h:1323
#define TIFFTAG_CAMERACALIBRATIONSIGNATURE
TIFF tag: Camera calibration signature (UTF-8) (introduced by Adobe DNG).
Definition tiff.h:1143
#define TIFFTAG_CFALAYOUT
TIFF tag: Spatial layout of the CFA (introduced by Adobe DNG).
Definition tiff.h:982
#define TIFFTAG_CURRENTPREPROFILEMATRIX
TIFF tag: DNG camera-to-current-profile input transformation matrix (introduced by Adobe DNG).
Definition tiff.h:1134
#define TIFFTAG_REDUCTIONMATRIX1
TIFF tag: Dimensionality reduction matrix 1 (introduced by Adobe DNG).
Definition tiff.h:1031
#define TIFFTAG_OPCODELIST3
TIFF tag: Opcodes that should be applied after demosaicing (introduced by Adobe DNG).
Definition tiff.h:1245
#define TIFFTAG_NEWRAWIMAGEDIGEST
TIFF tag: Modified MD5 digest of the raw image data (introduced by Adobe DNG).
Definition tiff.h:1286
#define TIFFTAG_ANTIALIASSTRENGTH
TIFF tag: Relative strength of the camera's anti-alias filter (introduced by Adobe DNG).
Definition tiff.h:1078
#define TIFFTAG_SEMANTICINSTANCEID
TIFF tag: A string that identifies a specific instance in a semantic mask (introduced by Adobe DNG).
Definition tiff.h:1340
#define TIFFTAG_ASSHOTPROFILENAME
TIFF tag: As shot profile name (UTF-8) (introduced by Adobe DNG).
Definition tiff.h:1151
#define TIFFTAG_ORIGINALBESTQUALITYFINALSIZE
TIFF tag: Best quality final size of larger original file for this proxy (introduced by Adobe DNG).
Definition tiff.h:1276
#define TIFFTAG_DEFAULTUSERCROP
TIFF tag: Default user crop rectangle in relative coords (introduced by Adobe DNG).
Definition tiff.h:1254
#define TIFFTAG_CFAPLANECOLOR
TIFF tag: CFAPattern->LinearRaw space mapping (introduced by Adobe DNG).
Definition tiff.h:980
#define TIFFTAG_DNGVERSION
TIFF tag: DNG version number (introduced by Adobe DNG).
Definition tiff.h:966
#define TIFFTAG_BASELINEEXPOSUREOFFSET
TIFF tag: Baseline exposure offset (introduced by Adobe DNG).
Definition tiff.h:1258
#define TIFFTAG_COLORMATRIX3
TIFF tag: Matrix to convert XYZ values to reference camera native color space under CalibrationIllumi...
Definition tiff.h:1360
#define TIFFTAG_PROFILEHUESATMAPDIMS
TIFF tag: Dimensions of HSV mapping (introduced by Adobe DNG).
Definition tiff.h:1159
#define TIFFTAG_DEFAULTCROPSIZE
TIFF tag: Size of the final image area (introduced by Adobe DNG).
Definition tiff.h:1013
#define TIFFTAG_CALIBRATIONILLUMINANT3
TIFF tag: The illuminant used for the third set of color calibration tags (introduced by Adobe DNG).
Definition tiff.h:1355
#define TIFFTAG_PREVIEWSETTINGSNAME
TIFF tag: Name of conversion settings (UTF-8) (introduced by Adobe DNG).
Definition tiff.h:1197
#define TIFFTAG_ORIGINALDEFAULTFINALSIZE
TIFF tag: Default final size of larger original file for this proxy (introduced by Adobe DNG).
Definition tiff.h:1271
#define TIFFTAG_DEFAULTBLACKRENDER
TIFF tag: Black rendering hint (introduced by Adobe DNG).
Definition tiff.h:1256
#define TIFFTAG_SEMANTICNAME
TIFF tag: A string that identifies the semantic mask (introduced by Adobe DNG).
Definition tiff.h:1335
#define TIFFTAG_NOISEPROFILE
TIFF tag: Noise profile (introduced by Adobe DNG).
Definition tiff.h:1247
#define TIFFTAG_RAWIMAGEDIGEST
TIFF tag: Md5 of raw image data (introduced by Adobe DNG).
Definition tiff.h:1209
#define TIFFTAG_DEFAULTCROPORIGIN
TIFF tag: Origin of the final image area (introduced by Adobe DNG).
Definition tiff.h:1011
#define TIFFTAG_FORWARDMATRIX1
TIFF tag: Matrix for mapping white balanced camera colors to XYZ D50 (introduced by Adobe DNG).
Definition tiff.h:1177
#define TIFFTAG_PREVIEWSETTINGSDIGEST
TIFF tag: Unique id of conversion settings (introduced by Adobe DNG).
Definition tiff.h:1201
#define TIFFTAG_COLORMATRIX2
TIFF tag: XYZ->reference color space transformation matrix 2 (introduced by Adobe DNG).
Definition tiff.h:1023
#define TIFFTAG_DNGBACKWARDVERSION
TIFF tag: DNG compatibility version (introduced by Adobe DNG).
Definition tiff.h:968
#define TIFFTAG_COLORIMETRICREFERENCE
TIFF tag: Colorimetric reference (introduced by Adobe DNG).
Definition tiff.h:1138
#define TIFFTAG_CAMERASERIALNUMBER
TIFF tag: Camera's serial number (introduced by Adobe DNG).
Definition tiff.h:1069
#define TIFFTAG_ROWINTERLEAVEFACTOR
TIFF tag: Number of interleaved fields (introduced by Adobe DNG).
Definition tiff.h:1218
#define TIFFTAG_LOCALIZEDCAMERAMODEL
TIFF tag: Localized camera model name (UTF-8) (introduced by Adobe DNG).
Definition tiff.h:975
#define TIFFTAG_ILLUMINANTDATA3
TIFF tag: Data for the third calibration illuminant (introduced by Adobe DNG).
Definition tiff.h:1395
#define TIFFTAG_FORWARDMATRIX2
TIFF tag: Matrix for mapping white balanced camera colors to XYZ D50 (introduced by Adobe DNG).
Definition tiff.h:1182
#define TIFFTAG_BLACKLEVELDELTAH
TIFF tag: Zero light encoding level differences (columns) (introduced by Adobe DNG).
Definition tiff.h:996
#define TIFFTAG_ASSHOTPREPROFILEMATRIX
TIFF tag: DNG camera-to-as-shot-profile input transformation matrix.
Definition tiff.h:1125
#define TIFFTAG_SHADOWSCALE
TIFF tag: Used by Adobe Camera Raw (introduced by Adobe DNG).
Definition tiff.h:1080
#define TIFFTAG_BLACKLEVEL
TIFF tag: Zero light encoding level (introduced by Adobe DNG).
Definition tiff.h:991
#define TIFFTAG_PROFILEHUESATMAPDATA2
TIFF tag: Second HSV mapping table (introduced by Adobe DNG).
Definition tiff.h:1163
#define TIFFTAG_CAMERACALIBRATION1
TIFF tag: Calibration matrix 1 (introduced by Adobe DNG).
Definition tiff.h:1025
#define TIFFTAG_PROFILEEMBEDPOLICY
TIFF tag: Profile embedding policy (introduced by Adobe DNG).
Definition tiff.h:1167
#define TIFFTAG_PROFILENAME
TIFF tag: Camera profile name (UTF-8) (introduced by Adobe DNG).
Definition tiff.h:1157
#define TIFFTAG_ILLUMINANTDATA2
TIFF tag: Data for the second calibration illuminant (introduced by Adobe DNG).
Definition tiff.h:1390
#define TIFFTAG_DEFAULTSCALE
TIFF tag: Default scale factors (introduced by Adobe DNG).
Definition tiff.h:1007
#define TIFFTAG_ORIGINALRAWFILENAME
TIFF tag: File name of the original raw file (UTF-8) (introduced by Adobe DNG).
Definition tiff.h:1103
#define TIFFTAG_OPCODELIST2
TIFF tag: Opcodes that should be applied after mapping to linear reference (introduced by Adobe DNG).
Definition tiff.h:1240
#define TIFFTAG_CAMERACALIBRATION3
TIFF tag: Matrix to transform reference camera native space values to individual camera native space ...
Definition tiff.h:1366
#define TIFFTAG_CHROMABLURRADIUS
TIFF tag: Chroma blur radius (introduced by Adobe DNG).
Definition tiff.h:1073
#define TIFFTAG_PREVIEWCOLORSPACE
TIFF tag: Preview color space (introduced by Adobe DNG).
Definition tiff.h:1203
#define TIFFTAG_UNIQUECAMERAMODEL
TIFF tag: Name for the camera model (introduced by Adobe DNG).
Definition tiff.h:970
#define TIFFTAG_RAWTOPREVIEWGAIN
TIFF tag: The gain between the main raw FD and the preview IFD containing this tag (introduced by Ado...
Definition tiff.h:1291
#define TIFFTAG_ORIGINALDEFAULTCROPSIZE
TIFF tag: The default crop size of larger original file for this proxy (introduced by Adobe DNG).
Definition tiff.h:1281
#define TIFFTAG_COLORMATRIX1
TIFF tag: XYZ->reference color space transformation matrix 1 (introduced by Adobe DNG).
Definition tiff.h:1018
#define TIFFTAG_DEPTHFAR
TIFF tag: Distance from the camera represented by the maximum value in the depth map (introduced by A...
Definition tiff.h:1308
#define TIFFTAG_ASSHOTWHITEXY
TIFF tag: Selected white balance in x-y chromaticity coordinates (introduced by Adobe DNG).
Definition tiff.h:1050
#define TIFFTAG_PROFILECALIBRATIONSIGNATURE
TIFF tag: Profile calibration signature (UTF-8) (introduced by Adobe DNG).
Definition tiff.h:1148
#define TIFFTAG_LINEARIZATIONTABLE
TIFF tag: Lookup table description (introduced by Adobe DNG).
Definition tiff.h:984
#define TIFFTAG_DEPTHMEASURETYPE
TIFF tag: Measurement geometry for the depth map (introduced by Adobe DNG).
Definition tiff.h:1318
#define TIFFTAG_PROFILELOOKTABLEDIMS
TIFF tag: Num of input samples in each dim of default "look" table (introduced by Adobe DNG).
Definition tiff.h:1223
#define TIFFTAG_BAYERGREENSPLIT
TIFF tag: DNG difference between green responses in blue/green and red/green rows.
Definition tiff.h:1065
#define TIFFTAG_BLACKLEVELDELTAV
TIFF tag: Zero light encoding level differences (rows) (introduced by Adobe DNG).
Definition tiff.h:1001
#define TIFFTAG_EP_DATETIMEORIGINAL
TIFF tag: Date and time of original data generation.
Definition tiff.h:1464
#define TIFFTAG_EP_OECF
TIFF tag: Optoelectric conversion factor.
Definition tiff.h:1462
#define TIFFTAG_EP_SUBJECTLOCATION
TIFF tag: Subject location (area).
Definition tiff.h:1488
#define TIFFTAG_EP_EXPOSUREPROGRAM
TIFF tag: Exposure program.
Definition tiff.h:1456
#define TIFFTAG_EP_IMAGENUMBER
TIFF tag: Number of image when several of burst shot stored in same TIFF/EP.
Definition tiff.h:1435
#define TIFFTAG_EP_FOCALPLANEYRESOLUTION
TIFF tag: Focal plane Y resolution.
Definition tiff.h:1428
#define TIFFTAG_EP_FOCALPLANEXRESOLUTION
TIFF tag: Focal plane X resolution.
Definition tiff.h:1426
#define TIFFTAG_EP_STANDARDID
TIFF tag: TIFF/EP standard version, n.n.n.n.
Definition tiff.h:1443
#define TIFFTAG_EP_EXPOSURETIME
TIFF tag: Exposure time.
Definition tiff.h:1452
#define TIFFTAG_EP_SELFTIMERMODE
TIFF tag: Number of seconds capture was delayed from button press.
Definition tiff.h:1418
#define TIFFTAG_EP_FOCALLENGTH
TIFF tag: Lens focal length.
Definition tiff.h:1486
#define TIFFTAG_EP_EXPOSUREBIASVALUE
TIFF tag: Exposure bias.
Definition tiff.h:1474
#define TIFFTAG_EP_COMPRESSEDBITSPERPIXEL
TIFF tag: Image compression mode.
Definition tiff.h:1466
#define TIFFTAG_EP_LIGHTSOURCE
TIFF tag: Light source.
Definition tiff.h:1482
#define TIFFTAG_EP_EXPOSUREINDEX
TIFF tag: Exposure index.
Definition tiff.h:1441
#define TIFFTAG_EP_BRIGHTNESSVALUE
TIFF tag: Brightness.
Definition tiff.h:1472
#define TIFFTAG_EP_ISOSPEEDRATINGS
TIFF tag: ISO speed rating.
Definition tiff.h:1460
#define TIFFTAG_EP_SECURITYCLASSIFICATION
TIFF tag: Security classification.
Definition tiff.h:1437
#define TIFFTAG_EP_INTERLACE
TIFF tag: Number of multi-field images.
Definition tiff.h:1409
#define TIFFTAG_EP_FLASHENERGY
TIFF tag: Flash energy, or range if there is uncertainty.
Definition tiff.h:1420
#define TIFFTAG_EP_SENSINGMETHOD
TIFF tag: Type of image sensor.
Definition tiff.h:1445
#define TIFFTAG_EP_NOISE
TIFF tag: Camera noise measurement values.
Definition tiff.h:1424
#define TIFFTAG_EP_METERINGMODE
TIFF tag: Metering mode.
Definition tiff.h:1480
#define TIFFTAG_EP_FLASH
TIFF tag: Flash.
Definition tiff.h:1484
#define TIFFTAG_EP_APERTUREVALUE
TIFF tag: Aperture.
Definition tiff.h:1470
#define TIFFTAG_EP_SPATIALFREQUENCYRESPONSE
TIFF tag: Spatial frequency response.
Definition tiff.h:1422
#define TIFFTAG_EP_FOCALPLANERESOLUTIONUNIT
TIFF tag: Focal plane resolution unit.
Definition tiff.h:1430
#define TIFFTAG_EP_IMAGEHISTORY
TIFF tag: Record of what has been done to the image.
Definition tiff.h:1439
#define TIFFTAG_EP_SHUTTERSPEEDVALUE
TIFF tag: Shutter speed.
Definition tiff.h:1468
#define TIFFTAG_EP_SUBJECTDISTANCE
TIFF tag: Subject distance.
Definition tiff.h:1478
#define TIFFTAG_EP_CFAPATTERN
TIFF tag: Color filter array pattern.
Definition tiff.h:1405
#define TIFFTAG_EP_SPECTRALSENSITIVITY
TIFF tag: Spectral sensitivity.
Definition tiff.h:1458
#define TIFFTAG_EP_FNUMBER
TIFF tag: F number.
Definition tiff.h:1454
#define TIFFTAG_EP_BATTERYLEVEL
TIFF tag: Battery level (rational or ASCII).
Definition tiff.h:1407
#define TIFFTAG_EP_TIMEZONEOFFSET
TIFF tag: Time zone offset relative to UTC.
Definition tiff.h:1416
#define TIFFTAG_EP_CFAREPEATPATTERNDIM
TIFF tag: Dimensions of CFA pattern.
Definition tiff.h:1403
#define TIFFTAG_EP_MAXAPERTUREVALUE
TIFF tag: Maximum lens aperture.
Definition tiff.h:1476
#define EXIFTAG_FOCALLENGTH
EXIF tag: Lens focal length.
Definition tiff.h:1734
#define EXIFTAG_BRIGHTNESSVALUE
EXIF tag: Brightness.
Definition tiff.h:1720
#define EXIFTAG_EXPOSUREPROGRAM
EXIF tag: Exposure program.
Definition tiff.h:1694
#define EXIFTAG_ISOSPEEDLATITUDEYYY
EXIF tag: ISO speed latitude yyy.
Definition tiff.h:1822
#define EXIFTAG_PIXELYDIMENSION
EXIF tag: Valid image height.
Definition tiff.h:1754
#define EXIFTAG_ISOSPEED
EXIF tag: ISO speed value.
Definition tiff.h:1820
#define EXIFTAG_OFFSETTIME
EXIF tag: Offset from UTC of the time of DateTime tag.
Definition tiff.h:1826
#define EXIFTAG_DIGITALZOOMRATIO
EXIF tag: Digital zoom ratio.
Definition tiff.h:1786
#define EXIFTAG_OFFSETTIMEORIGINAL
EXIF tag: Offset from UTC of the time of DateTimeOriginal tag.
Definition tiff.h:1828
#define EXIFTAG_LENSSPECIFICATION
EXIF tag: Minimum/maximum lens focal lengths in millimetres and corresponding minimum F numbers.
Definition tiff.h:1866
#define EXIFTAG_SENSINGMETHOD
EXIF tag: Sensing method.
Definition tiff.h:1772
#define EXIFTAG_USERCOMMENT
EXIF tag: User comments.
Definition tiff.h:1740
#define EXIFTAG_CFAPATTERN
EXIF tag: CFA pattern.
Definition tiff.h:1778
#define EXIFTAG_METERINGMODE
EXIF tag: Metering mode.
Definition tiff.h:1728
#define EXIFTAG_EXPOSUREMODE
EXIF tag: Exposure mode.
Definition tiff.h:1782
#define EXIFTAG_CAMERAOWNERNAME
EXIF tag: Owner of a camera.
Definition tiff.h:1857
#define EXIFTAG_SOURCEIMAGENUMBEROFCOMPOSITEIMAGE
EXIF tag: Source image number of composite image.
Definition tiff.h:1878
#define EXIFTAG_SUBJECTLOCATION
EXIF tag: Subject location.
Definition tiff.h:1768
#define EXIFTAG_OFFSETTIMEDIGITIZED
EXIF tag: Offset from UTC of the time of DateTimeDigitized tag.
Definition tiff.h:1830
#define EXIFTAG_TEMPERATURE
EXIF tag: Ambient temperature at capture, in degrees Celsius.
Definition tiff.h:1832
#define EXIFTAG_COMPOSITEIMAGE
EXIF tag: Composite image.
Definition tiff.h:1876
#define EXIFTAG_MAKERNOTE
EXIF tag: Manufacturer notes.
Definition tiff.h:1738
#define EXIFTAG_ISOSPEEDRATINGS
EXIF tag: ISO speed rating.
Definition tiff.h:1700
#define EXIFTAG_CUSTOMRENDERED
EXIF tag: Custom image processing.
Definition tiff.h:1780
#define EXIFTAG_MAXAPERTUREVALUE
EXIF tag: Maximum lens aperture.
Definition tiff.h:1724
#define EXIFTAG_COMPRESSEDBITSPERPIXEL
EXIF tag: Image compression mode.
Definition tiff.h:1714
#define EXIFTAG_DEVICESETTINGDESCRIPTION
EXIF tag: Device settings description.
Definition tiff.h:1800
#define EXIFTAG_SHARPNESS
EXIF tag: Sharpness.
Definition tiff.h:1798
#define EXIFTAG_EXPOSUREBIASVALUE
EXIF tag: Exposure bias.
Definition tiff.h:1722
#define EXIFTAG_SATURATION
EXIF tag: Saturation.
Definition tiff.h:1796
#define EXIFTAG_FOCALPLANEXRESOLUTION
EXIF tag: Focal plane X resolution.
Definition tiff.h:1762
#define EXIFTAG_SOURCEEXPOSURETIMESOFCOMPOSITEIMAGE
EXIF tag: Source exposure times of composite image.
Definition tiff.h:1880
#define EXIFTAG_SUBJECTDISTANCE
EXIF tag: Subject distance.
Definition tiff.h:1726
#define EXIFTAG_SUBSECTIMEDIGITIZED
EXIF tag: DateTimeDigitized subseconds.
Definition tiff.h:1746
#define EXIFTAG_OECF
EXIF tag: Optoelectric conversion factor.
Definition tiff.h:1704
#define EXIFTAG_FOCALPLANERESOLUTIONUNIT
EXIF tag: Focal plane resolution unit.
Definition tiff.h:1766
#define EXIFTAG_LIGHTSOURCE
EXIF tag: Light source.
Definition tiff.h:1730
#define EXIFTAG_SPATIALFREQUENCYRESPONSE
EXIF tag: Spatial frequency response.
Definition tiff.h:1760
#define EXIFTAG_CAMERAELEVATIONANGLE
EXIF tag: Camera elevation/depression angle in degrees, from -180 to +180.
Definition tiff.h:1855
#define EXIFTAG_SPECTRALSENSITIVITY
EXIF tag: Spectral sensitivity.
Definition tiff.h:1696
#define EXIFTAG_STANDARDOUTPUTSENSITIVITY
EXIF tag: This tag indicates the standard output sensitivity value of a camera or input device define...
Definition tiff.h:1816
#define EXIFTAG_WATERDEPTH
EXIF tag: WaterDepth as the ambient situation at the shot in meter (m).
Definition tiff.h:1846
#define EXIFTAG_LENSMODEL
EXIF tag: The lens model name and model number.
Definition tiff.h:1870
#define EXIFTAG_FOCALPLANEYRESOLUTION
EXIF tag: Focal plane Y resolution.
Definition tiff.h:1764
#define EXIFTAG_FLASHPIXVERSION
EXIF tag: Supported Flashpix version.
Definition tiff.h:1748
#define EXIFTAG_EXPOSURETIME
EXIF tag: Exposure time.
Definition tiff.h:1690
#define EXIFTAG_PRESSURE
EXIF tag: Pressure as the ambient situation at the shot hecto-Pascal (hPa).
Definition tiff.h:1841
#define EXIFTAG_IMAGEUNIQUEID
EXIF tag: Unique image ID.
Definition tiff.h:1804
#define EXIFTAG_FOCALLENGTHIN35MMFILM
EXIF tag: Focal length in 35 mm film.
Definition tiff.h:1788
#define EXIFTAG_SUBJECTDISTANCERANGE
EXIF tag: Subject distance range.
Definition tiff.h:1802
#define EXIFTAG_BODYSERIALNUMBER
EXIF tag: Serial number of the body of the camera.
Definition tiff.h:1859
#define EXIFTAG_FNUMBER
EXIF tag: F number.
Definition tiff.h:1692
#define EXIFTAG_LENSMAKE
EXIF tag: The lens manufacturer.
Definition tiff.h:1868
#define EXIFTAG_RELATEDSOUNDFILE
EXIF tag: Related audio file.
Definition tiff.h:1756
#define EXIFTAG_SENSITIVITYTYPE
EXIF tag: The SensitivityType tag indicates which one of the parameters of ISO12232 is the Photograph...
Definition tiff.h:1811
#define EXIFTAG_SUBSECTIMEORIGINAL
EXIF tag: DateTimeOriginal subseconds.
Definition tiff.h:1744
#define EXIFTAG_SCENETYPE
EXIF tag: Scene type.
Definition tiff.h:1776
#define EXIFTAG_SUBJECTAREA
EXIF tag: Subject area.
Definition tiff.h:1736
#define EXIFTAG_SUBSECTIME
EXIF tag: DateTime subseconds.
Definition tiff.h:1742
#define EXIFTAG_SCENECAPTURETYPE
EXIF tag: Scene capture type.
Definition tiff.h:1790
#define EXIFTAG_FLASH
EXIF tag: Flash.
Definition tiff.h:1732
#define EXIFTAG_ISOSPEEDLATITUDEZZZ
EXIF tag: ISO speed latitude zzz.
Definition tiff.h:1824
#define EXIFTAG_FLASHENERGY
EXIF tag: Flash energy.
Definition tiff.h:1758
#define EXIFTAG_ACCELERATION
EXIF tag: Scalar acceleration at capture, in mGal (10^-5 m/s^2).
Definition tiff.h:1848
#define EXIFTAG_GAMMA
EXIF tag: Value of coefficient gamma.
Definition tiff.h:1874
#define EXIFTAG_WHITEBALANCE
EXIF tag: White balance.
Definition tiff.h:1784
#define EXIFTAG_RECOMMENDEDEXPOSUREINDEX
EXIF tag: Recommended exposure index.
Definition tiff.h:1818
#define EXIFTAG_LENSSERIALNUMBER
EXIF tag: The serial number of the interchangeable lens.
Definition tiff.h:1872
#define EXIFTAG_DATETIMEORIGINAL
EXIF tag: Date and time of original data generation.
Definition tiff.h:1708
#define EXIFTAG_PIXELXDIMENSION
EXIF tag: Valid image width.
Definition tiff.h:1752
#define EXIFTAG_EXPOSUREINDEX
EXIF tag: Exposure index.
Definition tiff.h:1770
#define EXIFTAG_SHUTTERSPEEDVALUE
EXIF tag: Shutter speed.
Definition tiff.h:1716
#define EXIFTAG_CONTRAST
EXIF tag: Contrast.
Definition tiff.h:1794
#define EXIFTAG_DATETIMEDIGITIZED
EXIF tag: Date and time of digital data generation.
Definition tiff.h:1710
#define EXIFTAG_EXIFVERSION
EXIF tag: Exif version.
Definition tiff.h:1706
#define EXIFTAG_FILESOURCE
EXIF tag: File source.
Definition tiff.h:1774
#define EXIFTAG_HUMIDITY
EXIF tag: Humidity as the ambient situation at the shot in percent.
Definition tiff.h:1836
#define EXIFTAG_APERTUREVALUE
EXIF tag: Aperture.
Definition tiff.h:1718
#define EXIFTAG_COLORSPACE
EXIF tag: Color space information.
Definition tiff.h:1750
#define EXIFTAG_GAINCONTROL
EXIF tag: Gain control.
Definition tiff.h:1792
#define EXIFTAG_COMPONENTSCONFIGURATION
EXIF tag: Meaning of each component.
Definition tiff.h:1712
int TIFFFieldIsAnonymous(const TIFFField *fip)
Test whether a field was registered as an unknown tag.
const TIFFField * TIFFFieldWithTag(TIFF *tif, uint32_t tag)
Find a registered field by tag number.
int TIFFDataWidth(TIFFDataType type)
Report the on-disk byte width of a TIFF data type.
int TIFFMergeFieldInfo(TIFF *tif, const TIFFFieldInfo info[], uint32_t n)
Register legacy application field definitions on a handle.
const TIFFField * TIFFFieldWithName(TIFF *tif, const char *field_name)
Find a registered field by name.
int TIFFFieldReadCount(const TIFFField *fip)
Read a field descriptor's getter count rule.
TIFFDataType TIFFFieldDataType(const TIFFField *fip)
Read a field descriptor's on-disk data type.
int TIFFFieldWriteCount(const TIFFField *fip)
Read a field descriptor's setter count rule.
uint32_t TIFFFieldTag(const TIFFField *fip)
Read a field descriptor's tag number.
const TIFFField * TIFFFindField(TIFF *tif, uint32_t tag, TIFFDataType dt)
Find a registered field by tag number and file data type.
int TIFFFieldPassCount(const TIFFField *fip)
Test whether a field passes an explicit count argument.
const char * TIFFFieldName(const TIFFField *fip)
Read a field descriptor's name.
int TIFFFieldSetGetCountSize(const TIFFField *fip)
Report the count width encoded by a field's set/get representation.
int TIFFFieldSetGetSize(const TIFFField *fip)
Report the internal element storage width of a field.
#define GPSTAG_SPEED
GPS tag: Indicates the speed of GPS receiver movement.
Definition tiff.h:1929
#define GPSTAG_ALTITUDE
GPS tag: Indicates the altitude based on the reference in GPSAltitudeRef.
Definition tiff.h:1909
#define GPSTAG_DOP
GPS tag: Indicates the GPS DOP (data degree of precision).
Definition tiff.h:1922
#define GPSTAG_LONGITUDEREF
GPS tag: Indicates whether the longitude is east or west longitude.
Definition tiff.h:1900
#define GPSTAG_DESTDISTANCEREF
GPS tag: Indicates the unit used to express the distance to the destination point.
Definition tiff.h:1976
#define GPSTAG_DESTBEARING
GPS tag: Indicates the bearing to the destination point.
Definition tiff.h:1971
#define GPSTAG_TIMESTAMP
GPS tag: Indicates the time as UTC (Coordinated Universal Time).
Definition tiff.h:1911
#define GPSTAG_SPEEDREF
GPS tag: Indicates the unit used to express the GPS receiver speed of movement.
Definition tiff.h:1927
#define GPSTAG_SATELLITES
GPS tag: Indicates the GPS satellites used for measurements.
Definition tiff.h:1913
#define GPSTAG_TRACK
GPS tag: Indicates the direction of GPS receiver movement.
Definition tiff.h:1936
#define GPSTAG_STATUS
GPS tag: Indicates the status of the GPS receiver when the image is recorded.
Definition tiff.h:1918
#define GPSTAG_DESTLATITUDEREF
GPS tag: Indicates whether the latitude of the destination point is north or south latitude.
Definition tiff.h:1955
#define GPSTAG_DESTLONGITUDEREF
GPS tag: Indicates whether the longitude of the destination point is east or west longitude.
Definition tiff.h:1962
#define GPSTAG_MEASUREMODE
GPS tag: Indicates the GPS measurement mode.
Definition tiff.h:1920
#define GPSTAG_DESTBEARINGREF
GPS tag: Indicates the reference used for giving the bearing to the destination point.
Definition tiff.h:1969
#define GPSTAG_TRACKREF
GPS tag: Indicates the reference for giving the direction of GPS receiver movement.
Definition tiff.h:1934
#define GPSTAG_PROCESSINGMETHOD
GPS tag: A character string recording the name of the method used for location finding.
Definition tiff.h:1983
#define GPSTAG_DESTLONGITUDE
GPS tag: Indicates the longitude of the destination point.
Definition tiff.h:1964
#define GPSTAG_VERSIONID
GPS tag: Indicates the version of GPSInfoIFD.
Definition tiff.h:1890
#define GPSTAG_DIFFERENTIAL
GPS tag: Indicates whether differential correction is applied to the GPS receiver.
Definition tiff.h:1995
#define GPSTAG_MAPDATUM
GPS tag: Indicates the geodetic survey data used by the GPS receiver. (e.g. WGS-84).
Definition tiff.h:1950
#define GPSTAG_GPSHPOSITIONINGERROR
GPS tag: Indicates horizontal positioning errors in meters.
Definition tiff.h:1997
#define GPSTAG_AREAINFORMATION
GPS tag: A character string recording the name of the GPS area.
Definition tiff.h:1985
#define GPSTAG_IMGDIRECTIONREF
GPS tag: Indicates the reference for giving the direction of the image when it is captured.
Definition tiff.h:1941
#define GPSTAG_DESTLATITUDE
GPS tag: Indicates the latitude of the destination point.
Definition tiff.h:1957
#define GPSTAG_DATESTAMP
GPS tag: A character string recording date and time information relative to UTC (Coordinated Universa...
Definition tiff.h:1990
#define GPSTAG_IMGDIRECTION
GPS tag: Indicates the direction of the image when it was captured.
Definition tiff.h:1945
#define GPSTAG_ALTITUDEREF
GPS tag: Indicates the altitude used as the reference altitude.
Definition tiff.h:1904
#define GPSTAG_LATITUDE
GPS tag: Indicates the latitude.
Definition tiff.h:1896
#define GPSTAG_LONGITUDE
GPS tag: Indicates the longitude.
Definition tiff.h:1902
#define GPSTAG_DESTDISTANCE
GPS tag: Indicates the distance to the destination point.
Definition tiff.h:1978
#define GPSTAG_LATITUDEREF
GPS tag: Indicates whether the latitude is north or south latitude.
Definition tiff.h:1894
void _TIFFmemset(void *p, int v, tmsize_t c)
Fill a byte range with one repeated byte.
Definition tif_unix.c:495
#define TIFFTAG_PERSAMPLE
Pseudo-tag: Interface for per sample tags.
Definition tiff.h:1635
#define TIFFTAG_BITSPERSAMPLE
TIFF tag: Bits per channel (sample).
Definition tiff.h:298
#define TIFFTAG_RESOLUTIONUNIT
TIFF tag: Units of resolutions.
Definition tiff.h:516
#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN
TIFF tag: Pixar world-to-screen transformation matrix.
Definition tiff.h:797
#define TIFFTAG_VERSIONYEAR
TIFF tag: TIFF/FX version year (introduced in TIFF 6.0).
Definition tiff.h:691
#define TIFFTAG_DATETIME
TIFF tag: Creation date and time.
Definition tiff.h:542
#define COMPRESSION_PIXARLOG
Pixar companded 11bit ZIP.
Definition tiff.h:347
#define COMPRESSION_ZSTD
Zstandard compression; not registered in the Adobe-maintained registry.
Definition tiff.h:372
#define TIFFTAG_WHITEPOINT
TIFF tag: Image white point.
Definition tiff.h:556
#define TIFFTAG_DOTRANGE
TIFF tag: 0% and 100% dot codes (introduced in TIFF 6.0).
Definition tiff.h:596
#define TIFFTAG_SUBIFD
TIFF tag: Subimage descriptors.
Definition tiff.h:584
#define TIFFTAG_IMAGELAYER
TIFF tag: TIFF/FX image layer information (introduced in TIFF 6.0).
Definition tiff.h:912
#define COMPRESSION_CCITTFAX3
CCITT Group 3 fax encoding.
Definition tiff.h:306
#define COMPRESSION_CCITTRLE
CCITT modified Huffman RLE.
Definition tiff.h:304
#define TIFFTAG_JPEGDCTABLES
TIFF tag: DCT table offsets (introduced in TIFF 6.0).
Definition tiff.h:723
#define TIFFTAG_FAXDCS
TIFF tag: Encoded fax-session parameters from Table 2/T.30.
Definition tiff.h:930
#define TIFFTAG_GROUP3OPTIONS
TIFF tag: 32 flag bits.
Definition tiff.h:500
#define TIFFTAG_INDEXED
TIFF tag: Indexed [Adobe TIFF Technote 3] (introduced after TIFF 6.0).
Definition tiff.h:643
#define TIFFTAG_GROUP4OPTIONS
TIFF tag: 32 flag bits.
Definition tiff.h:510
#define TIFFTAG_PIXAR_TEXTUREFORMAT
TIFF tag: Texture map format.
Definition tiff.h:791
#define TIFFTAG_DOCUMENTNAME
TIFF tag: Name of the source document.
Definition tiff.h:428
#define TIFFTAG_FILLORDER
TIFF tag: Data order within a byte.
Definition tiff.h:422
#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA
TIFF tag: Pixar world-to-camera transformation matrix.
Definition tiff.h:799
#define TIFFTAG_XMLPACKET
TIFF tag: XMP XML packet (introduced after TIFF 6.0).
Definition tiff.h:741
#define COMPRESSION_OJPEG
6.0 JPEG (introduced in TIFF 6.0).
Definition tiff.h:316
#define TIFFTAG_SAMPLESPERPIXEL
TIFF tag: Samples per pixel.
Definition tiff.h:456
#define TIFFTAG_CONSECUTIVEBADFAXLINES
TIFF tag: Max consecutive bad lines.
Definition tiff.h:582
#define TIFFTAG_PIXAR_IMAGEFULLLENGTH
TIFF tag: Original uncropped image height in pixels.
Definition tiff.h:786
#define TIFFTAG_MODEL
TIFF tag: Scanner model name/number.
Definition tiff.h:434
#define TIFFTAG_EXTRACAMERAPROFILES
TIFF tag: Offsets to additional DNG camera profiles.
Definition tiff.h:1508
#define TIFFTAG_INKSET
TIFF tag: Inks in separated image (introduced in TIFF 6.0).
Definition tiff.h:586
#define TIFFTAG_DATATYPE
TIFF tag: Legacy sample-type indicator; superseded by TIFFTAG_SAMPLEFORMAT (obsoleted by TIFF 6....
Definition tiff.h:770
#define COMPRESSION_DEFLATE
Deflate compression, legacy tag.
Definition tiff.h:349
#define TIFFTAG_JPEGQTABLES
TIFF tag: Q matrix offsets (introduced in TIFF 6.0).
Definition tiff.h:721
#define COMPRESSION_SGILOG
SGI Log Luminance RLE.
Definition tiff.h:358
#define TIFFTAG_FREEOFFSETS
TIFF tag: Byte offset to free block (obsoleted by TIFF 5.0).
Definition tiff.h:482
#define TIFFTAG_YPOSITION
TIFF tag: Y page offset of image lhs.
Definition tiff.h:480
#define TIFFTAG_PRIMARYCHROMATICITIES
TIFF tag: Primary chromaticities (introduced in TIFF 6.0).
Definition tiff.h:558
#define TIFFTAG_LERC_PARAMETERS
TIFF tag: Stores LERC version and additional compression method.
Definition tiff.h:958
#define COMPRESSION_CCITTRLEW
CCITT modified Huffman RLE with word alignment.
Definition tiff.h:329
#define TIFFTAG_EXIFIFD
TIFF tag: Pointer to EXIF private directory.
Definition tiff.h:905
#define TIFFTAG_GRAYRESPONSECURVE
TIFF tag: Gray scale response curve (obsoleted by TIFF 6.0).
Definition tiff.h:498
#define TIFFTAG_COLORMAP
TIFF tag: RGB map for palette image.
Definition tiff.h:560
#define TIFFTAG_MODENUMBER
TIFF tag: TIFF/FX mode number (introduced in TIFF 6.0).
Definition tiff.h:693
#define TIFFTAG_FAXRECVTIME
TIFF tag: Receive time (secs).
Definition tiff.h:928
#define TIFFTAG_JPEGIFBYTECOUNT
TIFF tag: JFIF stream length (introduced in TIFF 6.0).
Definition tiff.h:713
#define TIFFTAG_IMAGEDEPTH
TIFF tag: Z depth of image.
Definition tiff.h:772
#define TIFFTAG_PHOTOMETRIC
TIFF tag: Photometric interpretation.
Definition tiff.h:382
#define TIFFTAG_JPEGACTABLES
TIFF tag: AC coefficient offsets (introduced in TIFF 6.0).
Definition tiff.h:725
#define TIFFTAG_HOSTCOMPUTER
TIFF tag: Machine where created.
Definition tiff.h:546
#define TIFFTAG_TILELENGTH
TIFF tag: Tile height in pixels (introduced in TIFF 6.0).
Definition tiff.h:566
#define TIFFTAG_COLORRESPONSEUNIT
TIFF tag: Color curve accuracy (obsoleted by TIFF 6.0).
Definition tiff.h:526
#define TIFFTAG_OSUBFILETYPE
TIFF tag: Old subfile classification; superseded by TIFFTAG_SUBFILETYPE (obsoleted by TIFF 5....
Definition tiff.h:286
#define TIFFTAG_JPEGRESTARTINTERVAL
TIFF tag: Restart interval length (introduced in TIFF 6.0).
Definition tiff.h:715
#define TIFFTAG_MAXSAMPLEVALUE
TIFF tag: Maximum sample value (obsoleted by TIFF 5.0).
Definition tiff.h:464
#define TIFFTAG_TILEDEPTH
TIFF tag: Z depth/data tile.
Definition tiff.h:774
#define TIFFTAG_GLOBALPARAMETERSIFD
TIFF tag: TIFF/FX global parameters directory offset (introduced in TIFF 6.0).
Definition tiff.h:655
#define TIFFTAG_PIXAR_WRAPMODES
TIFF tag: S & t wrap modes.
Definition tiff.h:793
#define COMPRESSION_LZMA
LZMA2.
Definition tiff.h:367
#define TIFFTAG_EXTRASAMPLES
TIFF tag: Info about extra samples (introduced in TIFF 6.0).
Definition tiff.h:600
#define TIFFTAG_T82OPTIONS
TIFF tag: TIFF/FX T.82 options (introduced in TIFF 6.0).
Definition tiff.h:699
#define TIFFTAG_IMAGEWIDTH
TIFF tag: Image width in pixels.
Definition tiff.h:294
#define TIFFTAG_YCBCRCOEFFICIENTS
TIFF tag: RGB -> YCbCr transform (introduced in TIFF 6.0).
Definition tiff.h:727
#define TIFFTAG_MAKE
TIFF tag: Scanner manufacturer name.
Definition tiff.h:432
#define COMPRESSION_JBIG
ISO JBIG.
Definition tiff.h:356
#define TIFFTAG_XRESOLUTION
TIFF tag: Pixels/resolution in x.
Definition tiff.h:466
#define TIFFTAG_CELLLENGTH
TIFF tag: Dithering matrix height (obsoleted by TIFF 5.0).
Definition tiff.h:420
#define COMPRESSION_LERC
ESRI LERC compression.
Definition tiff.h:364
#define TIFFTAG_ORIENTATION
TIFF tag: Image orientation (obsoleted by TIFF 5.0).
Definition tiff.h:438
#define COMPRESSION_ADOBE_DEFLATE
Deflate compression, as recognized by Adobe.
Definition tiff.h:351
#define COMPRESSION_PACKBITS
Macintosh RLE.
Definition tiff.h:331
#define TIFFTAG_HALFTONEHINTS
TIFF tag: Highlight+shadow info (introduced in TIFF 6.0).
Definition tiff.h:562
#define TIFFTAG_MATTEING
TIFF tag: Legacy alpha indicator; superseded by TIFFTAG_EXTRASAMPLES (obsoleted by TIFF 6....
Definition tiff.h:765
#define TIFFTAG_GPSIFD
TIFF tag: Pointer to EXIF GPS private directory.
Definition tiff.h:921
#define TIFFTAG_IMAGEDESCRIPTION
TIFF tag: Info about image.
Definition tiff.h:430
#define TIFFTAG_MINSAMPLEVALUE
TIFF tag: Minimum sample value (obsoleted by TIFF 5.0).
Definition tiff.h:462
#define TIFFTAG_NUMBEROFINKS
TIFF tag: Number of inks (introduced in TIFF 6.0).
Definition tiff.h:594
#define TIFFTAG_PIXAR_FOVCOT
TIFF tag: Cotangent of the field of view for environment maps.
Definition tiff.h:795
#define TIFFTAG_TRANSFERFUNCTION
TIFF tag: Colorimetry info (introduced in TIFF 6.0).
Definition tiff.h:538
#define TIFFTAG_YCLIPPATHUNITS
TIFF tag: YClipPathUnits [Adobe TIFF technote 2] (introduced after TIFF 6.0).
Definition tiff.h:639
#define TIFFTAG_IMAGEBASECOLOR
TIFF tag: TIFF/FX image base colour (introduced in TIFF 6.0).
Definition tiff.h:697
#define TIFFTAG_ICCPROFILE
TIFF tag: ICC profile data.
Definition tiff.h:908
#define TIFFTAG_YRESOLUTION
TIFF tag: Pixels/resolution in y.
Definition tiff.h:468
#define COMPRESSION_LZW
Lempel-Ziv & Welch.
Definition tiff.h:314
#define TIFFTAG_SOFTWARE
TIFF tag: Name & release.
Definition tiff.h:540
#define TIFFTAG_FREEBYTECOUNTS
TIFF tag: Sizes of free blocks (obsoleted by TIFF 5.0).
Definition tiff.h:484
#define TIFFTAG_TILEBYTECOUNTS
TIFF tag: Byte counts for tiles (introduced in TIFF 6.0).
Definition tiff.h:570
#define TIFFTAG_JPEGIFOFFSET
TIFF tag: Pointer to SOI marker (introduced in TIFF 6.0).
Definition tiff.h:711
#define TIFFTAG_IMAGESOURCEDATA
TIFF tag: Photoshop image source data.
Definition tiff.h:941
#define TIFFTAG_INTEROPERABILITYIFD
TIFF tag: Pointer to EXIF Interoperability private directory.
Definition tiff.h:943
#define TIFFTAG_STRIPBYTECOUNTS
TIFF tag: Bytes counts for strips.
Definition tiff.h:460
#define TIFFTAG_SMINSAMPLEVALUE
TIFF tag: Variable MinSampleValue (introduced in TIFF 6.0).
Definition tiff.h:622
#define TIFFTAG_CLEANFAXDATA
TIFF tag: Regenerated line info.
Definition tiff.h:574
#define TIFFTAG_YCBCRSUBSAMPLING
TIFF tag: YCbCr subsampling factors (introduced in TIFF 6.0).
Definition tiff.h:729
#define TIFFTAG_TILEOFFSETS
TIFF tag: Offsets to data tiles (introduced in TIFF 6.0).
Definition tiff.h:568
#define TIFFTAG_ROWSPERSTRIP
TIFF tag: Rows per strip of data.
Definition tiff.h:458
#define TIFFTAG_SMAXSAMPLEVALUE
TIFF tag: Variable MaxSampleValue (introduced in TIFF 6.0).
Definition tiff.h:624
#define COMPRESSION_SGILOG24
SGI Log 24-bit packed.
Definition tiff.h:360
#define TIFFTAG_SAMPLEFORMAT
TIFF tag: Data sample format (introduced in TIFF 6.0).
Definition tiff.h:608
#define TIFFTAG_COPYRIGHT
TIFF tag: Copyright string.
Definition tiff.h:811
#define TIFFTAG_FAXRECVPARAMS
TIFF tag: Encoded Class 2 fax-session parameters.
Definition tiff.h:924
#define TIFFTAG_TARGETPRINTER
TIFF tag: Separation target (introduced in TIFF 6.0).
Definition tiff.h:598
#define TIFFTAG_ARTIST
TIFF tag: Creator of image.
Definition tiff.h:544
#define TIFFTAG_REFERENCEBLACKWHITE
TIFF tag: Colorimetry info (introduced in TIFF 6.0).
Definition tiff.h:737
#define TIFFTAG_TILEWIDTH
TIFF tag: Tile width in pixels (introduced in TIFF 6.0).
Definition tiff.h:564
#define TIFFTAG_PROFILETYPE
TIFF tag: TIFF/FX profile type (introduced in TIFF 6.0).
Definition tiff.h:657
#define TIFFTAG_IMAGELENGTH
TIFF tag: Image height in pixels.
Definition tiff.h:296
#define TIFFTAG_PAGENUMBER
TIFF tag: Page numbers of multi-page.
Definition tiff.h:524
#define TIFFTAG_FAXSUBADDRESS
TIFF tag: Received SubAddr string.
Definition tiff.h:926
#define TIFFTAG_BADFAXLINES
TIFF tag: Lines w/ wrong pixel count.
Definition tiff.h:572
#define TIFFTAG_COMPRESSION
TIFF tag: Data compression technique.
Definition tiff.h:300
#define TIFFTAG_GRAYRESPONSEUNIT
TIFF tag: Gray scale curve accuracy (obsoleted by TIFF 6.0).
Definition tiff.h:486
#define TIFFTAG_JPEGPROC
TIFF tag: JPEG processing algorithm (introduced in TIFF 6.0).
Definition tiff.h:705
#define TIFFTAG_CELLWIDTH
TIFF tag: Dithering matrix width (obsoleted by TIFF 5.0).
Definition tiff.h:418
#define TIFFTAG_PLANARCONFIG
TIFF tag: Storage organization.
Definition tiff.h:470
#define TIFFTAG_STRIPOFFSETS
TIFF tag: Offsets to data strips.
Definition tiff.h:436
#define COMPRESSION_CCITTFAX4
CCITT Group 4 fax encoding.
Definition tiff.h:310
#define TIFFTAG_STONITS
TIFF tag: Sample value to Nits.
Definition tiff.h:933
#define TIFFTAG_CLIPPATH
TIFF tag: ClipPath [Adobe TIFF technote 2] (introduced after TIFF 6.0).
Definition tiff.h:629
#define COMPRESSION_NEXT
NeXT 2-bit RLE.
Definition tiff.h:327
#define TIFFTAG_CODINGMETHODS
TIFF tag: TIFF/FX coding methods (introduced in TIFF 6.0).
Definition tiff.h:677
#define TIFFTAG_FAXPROFILE
TIFF tag: TIFF/FX fax profile (introduced in TIFF 6.0).
Definition tiff.h:663
#define TIFFTAG_SUBFILETYPE
TIFF tag: Subfile data descriptor.
Definition tiff.h:275
#define TIFFTAG_DECODE
TIFF tag: TIFF/FX decode (introduced in TIFF 6.0).
Definition tiff.h:695
#define TIFFTAG_XPOSITION
TIFF tag: X page offset of image lhs.
Definition tiff.h:478
#define TIFFTAG_PHOTOSHOP
TIFF tag: Photoshop image resource data.
Definition tiff.h:898
#define TIFFTAG_XCLIPPATHUNITS
TIFF tag: XClipPathUnits [Adobe TIFF technote 2] (introduced after TIFF 6.0).
Definition tiff.h:634
#define TIFFTAG_PREDICTOR
TIFF tag: Prediction scheme applied before compression.
Definition tiff.h:548
#define TIFFTAG_STRIPROWCOUNTS
TIFF tag: TIFF/FX strip row counts (introduced in TIFF 6.0).
Definition tiff.h:739
#define TIFFTAG_PAGENAME
TIFF tag: Page name image is from.
Definition tiff.h:476
#define TIFFTAG_YCBCRPOSITIONING
TIFF tag: Subsample positioning (introduced in TIFF 6.0).
Definition tiff.h:731
#define TIFFTAG_INKNAMES
TIFF tag: Ascii names of inks (introduced in TIFF 6.0).
Definition tiff.h:592
#define TIFFTAG_THRESHHOLDING
TIFF tag: Thresholding used on data (obsoleted by TIFF 5.0).
Definition tiff.h:410
#define TIFFTAG_JPEGTABLES
TIFF tag: JPEG table stream (introduced after TIFF 6.0).
Definition tiff.h:645
#define TIFFTAG_RICHTIFFIPTC
TIFF tag: RichTIFF IPTC metadata.
Definition tiff.h:844
#define COMPRESSION_JPEG
JPEG DCT compression (introduced after TIFF 6.0).
Definition tiff.h:318
#define TIFFTAG_PIXAR_IMAGEFULLWIDTH
TIFF tag: Original uncropped image width in pixels.
Definition tiff.h:784
#define COMPRESSION_THUNDERSCAN
ThunderScan RLE.
Definition tiff.h:333
TIFF_SSIZE_T tmsize_t
Represent a signed memory or I/O size in bytes.
Definition tiffio.h:89
TIFFDataType
Identify the on-disk representation of a TIFF directory field.
Definition tiff.h:229
uint32_t ttag_t
Represent a legacy directory tag identifier.
Definition tiffio.h:102
@ TIFF_SSHORT
Signed 16-bit integer.
Definition tiff.h:247
@ TIFF_SLONG
Signed 32-bit integer.
Definition tiff.h:249
@ TIFF_BYTE
Unsigned 8-bit integer.
Definition tiff.h:233
@ TIFF_SBYTE
Signed 8-bit integer.
Definition tiff.h:243
@ TIFF_IFD
Unsigned 32-bit IFD byte offset.
Definition tiff.h:257
@ TIFF_SHORT
Unsigned 16-bit integer.
Definition tiff.h:237
@ TIFF_UNDEFINED
Untyped 8-bit data.
Definition tiff.h:245
@ TIFF_LONG
Unsigned 32-bit integer.
Definition tiff.h:239
@ TIFF_SLONG8
BigTIFF signed 64-bit integer.
Definition tiff.h:261
@ TIFF_LONG8
BigTIFF unsigned 64-bit integer.
Definition tiff.h:259
@ TIFF_ASCII
Sequence of 8-bit bytes ending in a null byte.
Definition tiff.h:235
@ TIFF_NOTYPE
Placeholder for an unspecified field type.
Definition tiff.h:231
@ TIFF_FLOAT
32-bit IEEE floating-point value.
Definition tiff.h:253
@ TIFF_DOUBLE
64-bit IEEE floating-point value.
Definition tiff.h:255
@ TIFF_IFD8
BigTIFF unsigned 64-bit IFD byte offset.
Definition tiff.h:263
@ TIFF_SRATIONAL
Signed 32-bit numerator and denominator.
Definition tiff.h:251
@ TIFF_RATIONAL
Unsigned 32-bit numerator and denominator.
Definition tiff.h:241
uint16_t td_compression
COMPRESSION_* codec identifier.
Definition tif_dir.h:172
Describe a tag using the legacy field-registration interface.
Definition tiffio.h:5531
uint32_t field_tag
Numeric tag identifier.
Definition tiffio.h:5533
const char * field_name
Borrowed null-terminated tag name; keep valid while registered.
Definition tiffio.h:5558
unsigned char field_passcount
Nonzero if a count argument accompanies the value in field access calls.
Definition tiffio.h:5553
short field_readcount
Expected read count, or a TIFF_VARIABLE, TIFF_VARIABLE2, or TIFF_SPP marker.
Definition tiffio.h:5538
unsigned char field_oktochange
Nonzero if the field may change after writing has begun.
Definition tiffio.h:5548
TIFFDataType field_type
On-disk TIFFDataType.
Definition tiffio.h:5544
unsigned short field_bit
Field-presence bit; use FIELD_CUSTOM for custom fields.
Definition tiffio.h:5546
short field_writecount
Expected write count, or a variable/per-sample count marker.
Definition tiffio.h:5542
Describe a borrowed schema or owned compatibility batch.
Definition tif_dir.h:962
TIFFFieldArrayType type
Namespace/category of the schema.
Definition tif_dir.h:964
uint32_t count
Number of valid descriptors in fields.
Definition tif_dir.h:972
uint32_t allocated_size
Descriptor capacity when owned; zero identifies a static schema.
Definition tif_dir.h:970
TIFFField * fields
Descriptor array; static/borrowed or owned according to allocated_size and creator.
Definition tif_dir.h:978
Describe a field's file type and internal argument contract.
Definition tif_dir.h:993
unsigned char field_oktochange
Nonzero to permit changes after writing starts; ImageLength is separately exempt.
Definition tif_dir.h:1028
TIFFDataType field_type
On-disk TIFFDataType, distinct from the argument representation.
Definition tif_dir.h:1009
unsigned char field_passcount
Nonzero for an explicit count argument; tag-specific exceptions still apply.
Definition tif_dir.h:1033
const char * field_name
Borrowed or anonymous-owned null-terminated name; must remain live while used.
Definition tif_dir.h:1038
unsigned short field_bit
FIELD_* presence index; FIELD_CUSTOM shares storage through the custom list.
Definition tif_dir.h:1023
uint32_t field_anonymous
Nonzero for an automatically created unknown-tag descriptor.
Definition tif_dir.h:1013
uint32_t field_tag
Tag identifier in this schema namespace.
Definition tif_dir.h:995
short field_readcount
Fixed getter count or TIFF_VARIABLE/TIFF_VARIABLE2/TIFF_SPP rule.
Definition tif_dir.h:1001
TIFFSetGetFieldType set_get_field_type
Internal storage/count representation for tag access and conversion.
Definition tif_dir.h:1018
TIFFFieldArray * field_subfields
Borrowed child-directory schema, or NULL; not recursively freed here.
Definition tif_dir.h:1043
short field_writecount
Fixed setter count or variable/sample-count sentinel.
Definition tif_dir.h:1003
Hold private state for one open TIFF library instance.
Definition tiffiop.h:389
int tif_warn_about_unknown_tags
Nonzero to emit warnings for unknown tags.
Definition tiffiop.h:777
const TIFFField * tif_foundfield
Borrowed cached field descriptor; valid only while that descriptor lives.
Definition tiffiop.h:740
size_t tif_nfields
Number of entries in tif_fields.
Definition tiffiop.h:735
TIFFField ** tif_fields
Owned sorted array of field pointers; descriptors have mixed ownership.
Definition tiffiop.h:733
char * tif_name
Current filename pointer; may refer to inline or client-supplied storage.
Definition tiffiop.h:394
TIFFDirectory tif_dir
Inline representation of the current image directory.
Definition tiffiop.h:572
size_t tif_nfieldscompat
Number of entries in tif_fieldscompat.
Definition tiffiop.h:753
TIFFFieldArray * tif_fieldscompat
Owned array of legacy field-registration batches.
Definition tiffiop.h:751
Declare private library state, callbacks, and implementation helpers.