.\" 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 "TIFFSETDIRECTORY" "3tiff" "Jan 27, 2024" "4.5" "LibTIFF" .SH NAME TIFFSetDirectory \- set the current directory for an open TIFF file .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX #include .EE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B int TIFFSetDirectory(TIFF *tif, tdir_t dirnum) .UNINDENT .INDENT 0.0 .TP .B int TIFFSetSubDirectory(TIFF *tif, uint64_t diroff) .UNINDENT .SH DESCRIPTION .sp \fI\%TIFFSetDirectory()\fP changes the current directory and reads its contents with \fI\%TIFFReadDirectory()\fP\&. The parameter \fIdirnum\fP specifies the subfile/directory as an integer number, with the first directory numbered zero. \fI\%TIFFSetDirectory()\fP only works with main\-IFD chains because allways starts with the first main\-IFD and thus is able to reset the SubIFD reading chain to the main\-IFD chain. .sp \fI\%TIFFSetSubDirectory()\fP acts like \fI\%TIFFSetDirectory()\fP, except the directory is specified as a file offset instead of an index; this is required for accessing subdirectories linked through a \fBSubIFD\fP tag. (see \fI\%MultiPage SubIFD\fP) .sp Directory query functions \fI\%TIFFCurrentDirectory()\fP, \fI\%TIFFCurrentDirOffset()\fP, \fI\%TIFFLastDirectory()\fP and \fI\%TIFFNumberOfDirectories()\fP retrieve information about directories in an open TIFF file. Be aware that until a directory is not written to file AND read back, the query functions won\(aqt retrieve the correct information! .SH RETURN VALUES .sp On successful return 1 is returned. Otherwise, 0 is returned if \fIdirnum\fP or \fIdiroff\fP specifies a non\-existent directory, or if an error was encountered while reading the directory\(aqs contents. .SH DIAGNOSTICS .sp All error messages are directed to the \fI\%TIFFErrorExtR()\fP routine. .sp \fB\(dq%s: Error fetching directory count\(dq\fP: .INDENT 0.0 .INDENT 3.5 An error was encountered while reading the \(dqdirectory count\(dq field. .UNINDENT .UNINDENT .sp \fB\(dq%s: Error fetching directory link\(dq\fP: .INDENT 0.0 .INDENT 3.5 An error was encountered while reading the \(dqlink value\(dq that points to the next directory in a file. .UNINDENT .UNINDENT .SH SEE ALSO .sp \fI\%TIFFquery\fP (3tiff), \fI\%TIFFOpen\fP (3tiff), \fI\%TIFFCreateDirectory\fP (3tiff), \fI\%TIFFCustomDirectory\fP (3tiff), \fI\%TIFFWriteDirectory\fP (3tiff), \fI\%TIFFReadDirectory\fP (3tiff), \fI\%Multi Page / Multi Image TIFF\fP, \fI\%libtiff\fP (3tiff) .SH AUTHOR LibTIFF contributors .SH COPYRIGHT 1988-2024, LibTIFF contributors .\" Generated by docutils manpage writer. .