.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "TIFFGETFIELD" "3tiff" "Sep 08, 2023" "4.6" "LibTIFF" .SH NAME TIFFGetField \- get the value(s) of a tag in an open TIFF file .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C #include #include .ft P .fi .UNINDENT .UNINDENT .INDENT 0.0 .TP .B int TIFFGetField(TIFF *tif, ttag_t tag, \&...) .UNINDENT .INDENT 0.0 .TP .B int TIFFVGetField(TIFF *tif, ttag_t tag, va_list ap) .UNINDENT .INDENT 0.0 .TP .B int TIFFGetFieldDefaulted(TIFF *tif, ttag_t tag, \&...) .UNINDENT .INDENT 0.0 .TP .B int TIFFVGetFieldDefaulted(TIFF *tif, ttag_t tag, va_list ap) .UNINDENT .SH DESCRIPTION .sp \fI\%TIFFGetField()\fP returns the value of a tag or pseudo\-tag associated with the the current directory of the opened TIFF file \fItif\fP\&. (A \fIpseudo\-tag\fP is a parameter that is used to control the operation of the TIFF library but whose value is not read or written to the underlying file.) The file must have been previously opened with \fI\%TIFFOpen()\fP\&. The tag is identified by \fItag\fP, one of the values defined in the include file \fBtiff.h\fP (see also the table below). The type and number of values returned is dependent on the tag being requested. The programming interface uses a variable argument list as prescribed by the \fBstdarg.h\fP interface. The returned values should only be interpreted if \fI\%TIFFGetField()\fP returns 1. .sp \fI\%TIFFVGetField()\fP is functionally equivalent to \fI\%TIFFGetField()\fP except that it takes a pointer to a variable argument list. \fI\%TIFFVGetField()\fP is useful for layering interfaces on top of the functionality provided by \fI\%TIFFGetField()\fP\&. .sp \fI\%TIFFGetFieldDefaulted()\fP and \fI\%TIFFVGetFieldDefaulted()\fP are identical to \fI\%TIFFGetField()\fP and \fI\%TIFFVGetField()\fP, respectively, except that if a tag is not defined in the current directory and it has a default value, then the default value is returned. .sp The tags understood by \fBlibtiff\fP the number of parameter values, and the types for the returned values are shown below. The data types are specified as in C and correspond to the types used to specify tag values to \fI\%TIFFSetField()\fP\&. Remember that \fI\%TIFFGetField()\fP returns parameter values, so all the listed data types are pointers to storage where values should be returned. Consult the TIFF specification (or relevant industry specification) for information on the meaning of each tag and their possible values. .INDENT 0.0 .INDENT 3.5 .SH TAG PROPERTIES .TS center; |l|l|l|l|. _ T{ Tag name T} T{ Count T} T{ Types T} T{ Notes T} _ T{ \fBTIFFTAG_ARTIST\fP T} T{ 1 T} T{ const char** T} T{ T} _ T{ \fBTIFFTAG_BADFAXLINES\fP T} T{ 1 T} T{ uint32_t* T} T{ T} _ T{ \fBTIFFTAG_BITSPERSAMPLE\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_CLEANFAXDATA\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_COLORMAP\fP T} T{ 3 T} T{ const uint16_t** T} T{ 1 << BitsPerSample arrays T} _ T{ \fBTIFFTAG_COMPRESSION\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_CONSECUTIVEBADFAXLINES\fP T} T{ 1 T} T{ uint32_t* T} T{ T} _ T{ \fBTIFFTAG_COPYRIGHT\fP T} T{ 1 T} T{ const char** T} T{ T} _ T{ \fBTIFFTAG_DATATYPE\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_DATETIME\fP T} T{ 1 T} T{ const char** T} T{ T} _ T{ \fBTIFFTAG_DOCUMENTNAME\fP T} T{ 1 T} T{ const char** T} T{ T} _ T{ \fBTIFFTAG_DOTRANGE\fP T} T{ 2 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_EXTRASAMPLES\fP T} T{ 2 T} T{ uint16_t*, const uint16_t** T} T{ count, types array T} _ T{ \fBTIFFTAG_FAXFILLFUNC\fP T} T{ 1 T} T{ TIFFFaxFillFunc* T} T{ G3/G4 compression pseudo\-tag T} _ T{ \fBTIFFTAG_FAXMODE\fP T} T{ 1 T} T{ int* T} T{ G3/G4 compression pseudo\-tag T} _ T{ \fBTIFFTAG_FILLORDER\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_GROUP3OPTIONS\fP T} T{ 1 T} T{ uint32_t* T} T{ T} _ T{ \fBTIFFTAG_GROUP4OPTIONS\fP T} T{ 1 T} T{ uint32_t* T} T{ T} _ T{ \fBTIFFTAG_HALFTONEHINTS\fP T} T{ 2 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_HOSTCOMPUTER\fP T} T{ 1 T} T{ const char** T} T{ T} _ T{ \fBTIFFTAG_ICCPROFILE\fP T} T{ 2 T} T{ const uint32_t*, const void** T} T{ count, profile data‡ T} _ T{ \fBTIFFTAG_IMAGEDEPTH\fP T} T{ 1 T} T{ uint32_t* T} T{ T} _ T{ \fBTIFFTAG_IMAGEDESCRIPTION\fP T} T{ 1 T} T{ const char** T} T{ T} _ T{ \fBTIFFTAG_IMAGELENGTH\fP T} T{ 1 T} T{ uint32_t* T} T{ T} _ T{ \fBTIFFTAG_IMAGEWIDTH\fP T} T{ 1 T} T{ uint32_t* T} T{ T} _ T{ \fBTIFFTAG_INKNAMES\fP T} T{ 1 T} T{ const char** T} T{ T} _ T{ \fBTIFFTAG_INKSET\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_JPEGCOLORMODE\fP T} T{ 1 T} T{ int* T} T{ JPEG pseudo\-tag T} _ T{ \fBTIFFTAG_JPEGQUALITY\fP T} T{ 1 T} T{ int* T} T{ JPEG pseudo\-tag T} _ T{ \fBTIFFTAG_JPEGTABLES\fP T} T{ 2 T} T{ uint32_t*, const void** T} T{ count, tables T} _ T{ \fBTIFFTAG_JPEGTABLESMODE\fP T} T{ 1 T} T{ int* T} T{ JPEG pseudo\-tag T} _ T{ \fBTIFFTAG_MAKE\fP T} T{ 1 T} T{ const char** T} T{ T} _ T{ \fBTIFFTAG_MATTEING\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_MAXSAMPLEVALUE\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_MINSAMPLEVALUE\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_MODEL\fP T} T{ 1 T} T{ const char** T} T{ T} _ T{ \fBTIFFTAG_ORIENTATION\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_PAGENAME\fP T} T{ 1 T} T{ const char** T} T{ T} _ T{ \fBTIFFTAG_PAGENUMBER\fP T} T{ 2 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_PHOTOMETRIC\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_PHOTOSHOP\fP T} T{ 2 T} T{ uint32_t*, const void** T} T{ count, data T} _ T{ \fBTIFFTAG_PLANARCONFIG\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_PREDICTOR\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_PRIMARYCHROMATICITIES\fP T} T{ 1 T} T{ const float** T} T{ 6\-entry array T} _ T{ \fBTIFFTAG_REFERENCEBLACKWHITE\fP T} T{ 1 T} T{ const float** T} T{ 6\-entry array T} _ T{ \fBTIFFTAG_RESOLUTIONUNIT\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_RICHTIFFIPTC\fP T} T{ 2 T} T{ uint32_t*, const void** T} T{ count, data T} _ T{ \fBTIFFTAG_ROWSPERSTRIP\fP T} T{ 1 T} T{ uint32_t* T} T{ T} _ T{ \fBTIFFTAG_SAMPLEFORMAT\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_SAMPLESPERPIXEL\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_SMAXSAMPLEVALUE\fP T} T{ 1 T} T{ double* T} T{ T} _ T{ \fBTIFFTAG_SMINSAMPLEVALUE\fP T} T{ 1 T} T{ double* T} T{ T} _ T{ \fBTIFFTAG_SOFTWARE\fP T} T{ 1 T} T{ const char** T} T{ T} _ T{ \fBTIFFTAG_STONITS\fP T} T{ 1 T} T{ double* T} T{ T} _ T{ \fBTIFFTAG_STRIPBYTECOUNTS\fP T} T{ 1 T} T{ const uint64_t** T} T{ T} _ T{ \fBTIFFTAG_STRIPOFFSETS\fP T} T{ 1 T} T{ const uint64_t** T} T{ T} _ T{ \fBTIFFTAG_SUBFILETYPE\fP T} T{ 1 T} T{ uint32_t* T} T{ T} _ T{ \fBTIFFTAG_SUBIFD\fP T} T{ 2 T} T{ uint16_t*, const uint64_t** T} T{ count, offsets array T} _ T{ \fBTIFFTAG_TARGETPRINTER\fP T} T{ 1 T} T{ const char** T} T{ T} _ T{ \fBTIFFTAG_THRESHHOLDING\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_TILEBYTECOUNTS\fP T} T{ 1 T} T{ const uint64_t** T} T{ T} _ T{ \fBTIFFTAG_TILEDEPTH\fP T} T{ 1 T} T{ uint32_t* T} T{ T} _ T{ \fBTIFFTAG_TILELENGTH\fP T} T{ 1 T} T{ uint32_t* T} T{ T} _ T{ \fBTIFFTAG_TILEOFFSETS\fP T} T{ 1 T} T{ const uint64_t** T} T{ T} _ T{ \fBTIFFTAG_TILEWIDTH\fP T} T{ 1 T} T{ uint32_t* T} T{ T} _ T{ \fBTIFFTAG_TRANSFERFUNCTION\fP T} T{ 1 or 3\(dg T} T{ const uint16_t** T} T{ 1 << BitsPerSample entry arrays T} _ T{ \fBTIFFTAG_WHITEPOINT\fP T} T{ 1 T} T{ const float** T} T{ 2\-entry array T} _ T{ \fBTIFFTAG_XMLPACKET\fP T} T{ 2 T} T{ uint32_t*, const void** T} T{ count, data T} _ T{ \fBTIFFTAG_XPOSITION\fP T} T{ 1 T} T{ float* T} T{ T} _ T{ \fBTIFFTAG_XRESOLUTION\fP T} T{ 1 T} T{ float* T} T{ T} _ T{ \fBTIFFTAG_YCBCRCOEFFICIENTS\fP T} T{ 1 T} T{ const float** T} T{ 3\-entry array T} _ T{ \fBTIFFTAG_YCBCRPOSITIONING\fP T} T{ 1 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_YCBCRSUBSAMPLING\fP T} T{ 2 T} T{ uint16_t* T} T{ T} _ T{ \fBTIFFTAG_YPOSITION\fP T} T{ 1 T} T{ float* T} T{ T} _ T{ \fBTIFFTAG_YRESOLUTION\fP T} T{ 1 T} T{ float* T} T{ T} _ .TE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \(dg: If \fBSamplesPerPixel\fP is one, then a single array is returned; otherwise three arrays are returned. .TP .B ‡: The contents of this field are quite complex. See “The ICC Profile Format Specification”, Annex B.3 “Embedding ICC Profiles in TIFF Files” (available at \fI\%http://www.color.org\fP) for an explanation. .UNINDENT .SH AUTOREGISTERED TAGS .sp If you can’t find the tag in the table above that means this is an unsupported tag and is not directly supported by the \fBlibtiff\fP library. You will still be able to read it’s value if you know the data type of that tag. For example, if you want to read the \fBLONG\fP value from the tag 33424 and \fBASCII\fP string from the tag 36867 you can use the following code: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C uint32_t count; void *data; TIFFGetField(tiff, 33424, &count, &data); printf(\(dqTag %d: %d, count %d\en\(dq, 33424, *(uint32_t *)data, count); TIFFGetField(tiff, 36867, &count, &data); printf(\(dqTag %d: %s, count %d\en\(dq, 36867, (char *)data, count); .ft P .fi .UNINDENT .UNINDENT .SH RETURN VALUES .sp 1 is returned if the tag is defined in the current directory; otherwise a 0 is returned. .SH DIAGNOSTICS .sp All error messages are directed to the \fI\%TIFFErrorExtR()\fP routine. .sp \fBUnknown field, tag 0x%x\fP: .INDENT 0.0 .INDENT 3.5 An unknown tag was supplied. .UNINDENT .UNINDENT .SH SEE ALSO .sp \fI\%TIFFOpen\fP (3tiff), \fI\%TIFFSetField\fP (3tiff), \fI\%TIFFSetDirectory\fP (3tiff), \fI\%TIFFReadDirectory\fP (3tiff), \fI\%TIFFWriteDirectory\fP (3tiff), \fI\%libtiff\fP (3tiff) .SH AUTHOR LibTIFF contributors .SH COPYRIGHT 1988-2022, LibTIFF contributors .\" Generated by docutils manpage writer. .