1 <!-- Creator : groff version 1.18.1 -->
2 <!-- CreationDate: Mon Mar 13 18:03:08 2006 -->
5 <meta name=
"generator" content=
"groff -Thtml, see www.gnu.org">
6 <meta name=
"Content-Style" content=
"text/css">
7 <title>TIFFGetField
</title>
11 <h1 align=center
>TIFFGetField
</h1>
12 <a href=
"#NAME">NAME
</a><br>
13 <a href=
"#SYNOPSIS">SYNOPSIS
</a><br>
14 <a href=
"#DESCRIPTION">DESCRIPTION
</a><br>
15 <a href=
"#AUTOREGISTERED TAGS">AUTOREGISTERED TAGS
</a><br>
16 <a href=
"#RETURN VALUES">RETURN VALUES
</a><br>
17 <a href=
"#DIAGNOSTICS">DIAGNOSTICS
</a><br>
18 <a href=
"#SEE ALSO">SEE ALSO
</a><br>
24 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
25 cols=
"2" cellspacing=
"0" cellpadding=
"0">
26 <tr valign=
"top" align=
"left">
29 <p>TIFFGetField, TIFFVGetField
− get the value(s) of a
30 tag in an open
<small>TIFF
</small> file
</p>
33 <a name=
"SYNOPSIS"></a>
36 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
37 cols=
"2" cellspacing=
"0" cellpadding=
"0">
38 <tr valign=
"top" align=
"left">
41 <p><b>#include
<tiffio.h
></b></p>
43 <p><b>int TIFFGetField(TIFF *
</b><i>tif
</i><b>, ttag_t
</b>
44 <i>tag
</i><b>,
</b> <i>...
</i><b>)
</b></p>
46 <p><b>#include
<stdarg.h
></b></p>
48 <p><b>int TIFFVGetField(TIFF *
</b><i>tif
</i><b>, ttag_t
</b>
49 <i>tag
</i><b>, va_list
</b> <i>ap
</i><b>)
<br>
50 int TIFFGetFieldDefaulted(TIFF *
</b><i>tif
</i><b>,
51 ttag_t
</b> <i>tag
</i><b>,
</b> <i>...
</i><b>)
<br>
52 int TIFFVGetFieldDefaulted(TIFF *
</b><i>tif
</i><b>,
53 ttag_t
</b> <i>tag
</i><b>, va_list
</b> <i>ap
</i><b>)
</b></p>
56 <a name=
"DESCRIPTION"></a>
59 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
60 cols=
"2" cellspacing=
"0" cellpadding=
"0">
61 <tr valign=
"top" align=
"left">
64 <p><i>TIFFGetField
</i> returns the value of a tag or
65 pseudo-tag associated with the the current directory of the
66 opened
<small>TIFF
</small> file
<i>tif
</i>. (A
67 <i>pseudo-tag
</i> is a parameter that is used to control the
68 operation of the
<small>TIFF
</small> library but whose value
69 is not read or written to the underlying file.) The file
70 must have been previously opened with
71 <i>TIFFOpen
</i>(
3TIFF). The tag is identified by
<i>tag
</i>,
72 one of the values defined in the include file
<b>tiff.h
</b>
73 (see also the table below). The type and number of values
74 returned is dependent on the tag being requested. The
75 programming interface uses a variable argument list as
76 prescribed by the
<i>stdarg
</i>(
3) interface. The returned
77 values should only be interpreted if
<i>TIFFGetField
</i>
80 <p><i>TIFFVGetField
</i> is functionally equivalent to
81 <i>TIFFGetField
</i> except that it takes a pointer to a
82 variable argument list.
<i>TIFFVGetField
</i> is useful for
83 layering interfaces on top of the functionality provided by
84 <i>TIFFGetField
</i>.
</p>
86 <p><i>TIFFGetFieldDefaulted
</i> and
87 <i>TIFFVGetFieldDefaulted
</i> are identical to
88 <i>TIFFGetField
</i> and
<i>TIFFVGetField
</i>, except that if
89 a tag is not defined in the current directory and it has a
90 default value, then the default value is returned.
</p>
92 <p>The tags understood by
<i>libtiff(
3TIFF),
</i> the number
93 of parameter values, and the types for the returned values
94 are shown below. The data types are specified as in C and
95 correspond to the types used to specify tag values to
96 <i>TIFFSetField
</i>(
3TIFF). Remember that
97 <i>TIFFGetField
</i> returns parameter values, so all the
98 listed data types are pointers to storage where values
99 should be returned. Consult the
<small>TIFF
</small>
100 specification (or relevant industry specification) for
101 information on the meaning of each tag and their possible
106 <p><i>Tag Name Count Types Notes
</i></p>
108 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
109 cols=
"5" cellspacing=
"0" cellpadding=
"0">
110 <tr valign=
"top" align=
"left">
114 <p>TIFFTAG_ARTIST
</p>
126 <tr valign=
"top" align=
"left">
130 <p>TIFFTAG_BADFAXLINES
</p>
142 <tr valign=
"top" align=
"left">
146 <p>TIFFTAG_BITSPERSAMPLE
</p>
158 <tr valign=
"top" align=
"left">
162 <p>TIFFTAG_CLEANFAXDATA
</p>
174 <tr valign=
"top" align=
"left">
178 <p>TIFFTAG_COLORMAP
</p>
190 <p>1<<BitsPerSample arrays
</p>
192 <tr valign=
"top" align=
"left">
196 <p>TIFFTAG_COMPRESSION
</p>
208 <tr valign=
"top" align=
"left">
212 <p>TIFFTAG_CONSECUTIVEBADFAXLINES
</p>
224 <tr valign=
"top" align=
"left">
228 <p>TIFFTAG_COPYRIGHT
</p>
240 <tr valign=
"top" align=
"left">
244 <p>TIFFTAG_DATATYPE
</p>
256 <tr valign=
"top" align=
"left">
260 <p>TIFFTAG_DATETIME
</p>
272 <tr valign=
"top" align=
"left">
276 <p>TIFFTAG_DOCUMENTNAME
</p>
288 <tr valign=
"top" align=
"left">
292 <p>TIFFTAG_DOTRANGE
</p>
304 <tr valign=
"top" align=
"left">
308 <p>TIFFTAG_EXTRASAMPLES
</p>
316 <p>uint16*,uint16**
</p>
320 <p>count
& types array
</p>
322 <tr valign=
"top" align=
"left">
326 <p>TIFFTAG_FAXFILLFUNC
</p>
334 <p>TIFFFaxFillFunc*
</p>
338 <p>G3/G4 compression pseudo-tag
</p>
340 <tr valign=
"top" align=
"left">
344 <p>TIFFTAG_FAXMODE
</p>
356 <p>G3/G4 compression pseudo-tag
</p>
358 <tr valign=
"top" align=
"left">
362 <p>TIFFTAG_FILLORDER
</p>
374 <tr valign=
"top" align=
"left">
378 <p>TIFFTAG_GROUP3OPTIONS
</p>
390 <tr valign=
"top" align=
"left">
394 <p>TIFFTAG_GROUP4OPTIONS
</p>
406 <tr valign=
"top" align=
"left">
410 <p>TIFFTAG_HALFTONEHINTS
</p>
422 <tr valign=
"top" align=
"left">
426 <p>TIFFTAG_HOSTCOMPUTER
</p>
438 <tr valign=
"top" align=
"left">
442 <p>TIFFTAG_ICCPROFILE
</p>
450 <p>uint32*,void**
</p>
454 <p>count, profile data
</p>
456 <tr valign=
"top" align=
"left">
460 <p>TIFFTAG_IMAGEDEPTH
</p>
472 <tr valign=
"top" align=
"left">
476 <p>TIFFTAG_IMAGEDESCRIPTION
</p>
488 <tr valign=
"top" align=
"left">
492 <p>TIFFTAG_IMAGELENGTH
</p>
504 <tr valign=
"top" align=
"left">
508 <p>TIFFTAG_IMAGEWIDTH
</p>
520 <tr valign=
"top" align=
"left">
524 <p>TIFFTAG_INKNAMES
</p>
536 <tr valign=
"top" align=
"left">
540 <p>TIFFTAG_INKSET
</p>
552 <tr valign=
"top" align=
"left">
556 <p>TIFFTAG_JPEGCOLORMODE
</p>
568 <p>JPEG pseudo-tag
</p>
570 <tr valign=
"top" align=
"left">
574 <p>TIFFTAG_JPEGQUALITY
</p>
586 <p>JPEG pseudo-tag
</p>
588 <tr valign=
"top" align=
"left">
592 <p>TIFFTAG_JPEGTABLES
</p>
600 <p>uint32*,void**
</p>
604 <p>count
& tables
</p>
606 <tr valign=
"top" align=
"left">
610 <p>TIFFTAG_JPEGTABLESMODE
</p>
622 <p>JPEG pseudo-tag
</p>
624 <tr valign=
"top" align=
"left">
640 <tr valign=
"top" align=
"left">
644 <p>TIFFTAG_MATTEING
</p>
656 <tr valign=
"top" align=
"left">
660 <p>TIFFTAG_MAXSAMPLEVALUE
</p>
672 <tr valign=
"top" align=
"left">
676 <p>TIFFTAG_MINSAMPLEVALUE
</p>
688 <tr valign=
"top" align=
"left">
704 <tr valign=
"top" align=
"left">
708 <p>TIFFTAG_ORIENTATION
</p>
720 <tr valign=
"top" align=
"left">
724 <p>TIFFTAG_PAGENAME
</p>
736 <tr valign=
"top" align=
"left">
740 <p>TIFFTAG_PAGENUMBER
</p>
752 <tr valign=
"top" align=
"left">
756 <p>TIFFTAG_PHOTOMETRIC
</p>
768 <tr valign=
"top" align=
"left">
772 <p>TIFFTAG_PHOTOSHOP
</p>
780 <p>uint32*,void**
</p>
786 <tr valign=
"top" align=
"left">
790 <p>TIFFTAG_PLANARCONFIG
</p>
802 <tr valign=
"top" align=
"left">
806 <p>TIFFTAG_PREDICTOR
</p>
818 <tr valign=
"top" align=
"left">
822 <p>TIFFTAG_PRIMARYCHROMATICITIES
</p>
836 <tr valign=
"top" align=
"left">
840 <p>TIFFTAG_REFERENCEBLACKWHITE
</p>
852 <p>2*SamplesPerPixel array
</p>
854 <tr valign=
"top" align=
"left">
858 <p>TIFFTAG_RESOLUTIONUNIT
</p>
870 <tr valign=
"top" align=
"left">
874 <p>TIFFTAG_RICHTIFFIPTC
</p>
882 <p>uint32*,void**
</p>
888 <tr valign=
"top" align=
"left">
892 <p>TIFFTAG_ROWSPERSTRIP
</p>
904 <tr valign=
"top" align=
"left">
908 <p>TIFFTAG_SAMPLEFORMAT
</p>
920 <tr valign=
"top" align=
"left">
924 <p>TIFFTAG_SAMPLESPERPIXEL
</p>
936 <tr valign=
"top" align=
"left">
940 <p>TIFFTAG_SMAXSAMPLEVALUE
</p>
952 <tr valign=
"top" align=
"left">
956 <p>TIFFTAG_SMINSAMPLEVALUE
</p>
968 <tr valign=
"top" align=
"left">
972 <p>TIFFTAG_SOFTWARE
</p>
984 <tr valign=
"top" align=
"left">
988 <p>TIFFTAG_STONITS
</p>
1000 <tr valign=
"top" align=
"left">
1001 <td width=
"8%"></td>
1004 <p>TIFFTAG_STRIPBYTECOUNTS
</p>
1016 <tr valign=
"top" align=
"left">
1017 <td width=
"8%"></td>
1020 <p>TIFFTAG_STRIPOFFSETS
</p>
1032 <tr valign=
"top" align=
"left">
1033 <td width=
"8%"></td>
1036 <p>TIFFTAG_SUBFILETYPE
</p>
1048 <tr valign=
"top" align=
"left">
1049 <td width=
"8%"></td>
1052 <p>TIFFTAG_SUBIFD
</p>
1060 <p>uint16*,uint32**
</p>
1064 <p>count
& offsets array
</p>
1066 <tr valign=
"top" align=
"left">
1067 <td width=
"8%"></td>
1070 <p>TIFFTAG_TARGETPRINTER
</p>
1082 <tr valign=
"top" align=
"left">
1083 <td width=
"8%"></td>
1086 <p>TIFFTAG_THRESHHOLDING
</p>
1098 <tr valign=
"top" align=
"left">
1099 <td width=
"8%"></td>
1102 <p>TIFFTAG_TILEBYTECOUNTS
</p>
1114 <tr valign=
"top" align=
"left">
1115 <td width=
"8%"></td>
1118 <p>TIFFTAG_TILEDEPTH
</p>
1130 <tr valign=
"top" align=
"left">
1131 <td width=
"8%"></td>
1134 <p>TIFFTAG_TILELENGTH
</p>
1146 <tr valign=
"top" align=
"left">
1147 <td width=
"8%"></td>
1150 <p>TIFFTAG_TILEOFFSETS
</p>
1162 <tr valign=
"top" align=
"left">
1163 <td width=
"8%"></td>
1166 <p>TIFFTAG_TILEWIDTH
</p>
1178 <tr valign=
"top" align=
"left">
1179 <td width=
"8%"></td>
1182 <p>TIFFTAG_TRANSFERFUNCTION
</p>
1186 <p>1 or
3†</p>
1188 <td width=
"23%"></td>
1191 <p>uint16**
1<<BitsPerSample entry arrays
</p>
1193 <tr valign=
"top" align=
"left">
1194 <td width=
"8%"></td>
1197 <p>TIFFTAG_WHITEPOINT
</p>
1209 <p>2-entry array
</p>
1211 <tr valign=
"top" align=
"left">
1212 <td width=
"8%"></td>
1215 <p>TIFFTAG_XMLPACKET
</p>
1223 <p>uint32*,void**
</p>
1229 <tr valign=
"top" align=
"left">
1230 <td width=
"8%"></td>
1233 <p>TIFFTAG_XPOSITION
</p>
1245 <tr valign=
"top" align=
"left">
1246 <td width=
"8%"></td>
1249 <p>TIFFTAG_XRESOLUTION
</p>
1261 <tr valign=
"top" align=
"left">
1262 <td width=
"8%"></td>
1265 <p>TIFFTAG_YCBCRCOEFFICIENTS
</p>
1277 <p>3-entry array
</p>
1279 <tr valign=
"top" align=
"left">
1280 <td width=
"8%"></td>
1283 <p>TIFFTAG_YCBCRPOSITIONING
</p>
1295 <tr valign=
"top" align=
"left">
1296 <td width=
"8%"></td>
1299 <p>TIFFTAG_YCBCRSUBSAMPLING
</p>
1311 <tr valign=
"top" align=
"left">
1312 <td width=
"8%"></td>
1315 <p>TIFFTAG_YPOSITION
</p>
1327 <tr valign=
"top" align=
"left">
1328 <td width=
"8%"></td>
1331 <p>TIFFTAG_YRESOLUTION
</p>
1339 <p>float*
‡</p>
1344 <!-- INDENTATION -->
1345 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
1346 cols=
"2" cellspacing=
"0" cellpadding=
"0">
1347 <tr valign=
"top" align=
"left">
1348 <td width=
"8%"></td>
1350 <p>† If
<i>SamplesPerPixel
</i> is one, then a single
1351 array is returned; otherwise three arrays are returned.
<br>
1352 ‡ The contents of this field are quite complex. See
1353 <i>The ICC Profile Format Specification
</i>, Annex B
.3
1354 "Embedding ICC Profiles in TIFF Files
" (available
1355 at http://www.color.org) for an explanation.
</p>
1358 <a name=
"AUTOREGISTERED TAGS"></a>
1359 <h2>AUTOREGISTERED TAGS
</h2>
1360 <!-- INDENTATION -->
1361 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
1362 cols=
"2" cellspacing=
"0" cellpadding=
"0">
1363 <tr valign=
"top" align=
"left">
1364 <td width=
"8%"></td>
1366 <p>If you can
’t find the tag in the table above that
1367 means this is unsupported tag. But you still be able to read
1368 it
’s value if you know the data type of that tag. For
1369 example, if you want to read the LONG value from the tag
1370 33424 and ASCII string from the tag
36867 you can use the
1374 <!-- INDENTATION -->
1375 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
1376 cols=
"2" cellspacing=
"0" cellpadding=
"0">
1377 <tr valign=
"top" align=
"left">
1378 <td width=
"17%"></td>
1383 TIFFGetField(tiff,
33424,
&count,
&data);
1384 printf(
"Tag %d: %d, count %d0,
33424, *(uint32 *)data, count);
1385 TIFFGetField(tiff,
36867,
&count,
&data);
1386 printf(
"Tag %d: %s, count %d0,
36867, (char *)data, count);
1390 <!-- INDENTATION -->
1392 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
1393 cols=
"2" cellspacing=
"0" cellpadding=
"0">
1394 <tr valign=
"top" align=
"left">
1395 <td width=
"8%"></td>
1397 <p>is not supported by
<b>libtiff(
3TIFF),
</b> library
</p>
1400 <a name=
"RETURN VALUES"></a>
1401 <h2>RETURN VALUES
</h2>
1402 <!-- INDENTATION -->
1403 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
1404 cols=
"2" cellspacing=
"0" cellpadding=
"0">
1405 <tr valign=
"top" align=
"left">
1406 <td width=
"8%"></td>
1408 <p>1 is returned if the tag is defined in the current
1409 directory; otherwise a
0 is returned.
</p>
1412 <a name=
"DIAGNOSTICS"></a>
1413 <h2>DIAGNOSTICS
</h2>
1414 <!-- INDENTATION -->
1415 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
1416 cols=
"2" cellspacing=
"0" cellpadding=
"0">
1417 <tr valign=
"top" align=
"left">
1418 <td width=
"8%"></td>
1420 <p>All error messages are directed to the
1421 <b>TIFFError
</b>(
3TIFF) routine.
</p>
1422 <!-- INDENTATION -->
1423 <p><b>Unknown field, tag
0x%x
</b>. An unknown tag was
1427 <a name=
"SEE ALSO"></a>
1429 <!-- INDENTATION -->
1430 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
1431 cols=
"2" cellspacing=
"0" cellpadding=
"0">
1432 <tr valign=
"top" align=
"left">
1433 <td width=
"8%"></td>
1435 <p><b>TIFFOpen
</b>(
3TIFF),
<b>TIFFSetField
</b>(
3TIFF),
1436 <b>TIFFSetDirectory
</b>(
3TIFF),
1437 <b>TIFFReadDirectory
</b>(
3TIFF),
1438 <b>TIFFWriteDirectory
</b>(
3TIFF)
<b>libtiff
</b>(
3TIFF),
</p>
1439 <!-- INDENTATION -->
1440 <p>Libtiff library home page:
1441 <b>http://www.remotesensing.org/libtiff/
</b></p>