| 1 |
TIFFSetDirectory |
| 2 |
================ |
| 3 |
|
| 4 |
Synopsis |
| 5 |
-------- |
| 6 |
|
| 7 |
.. highlight:: c |
| 8 |
|
| 9 |
:: |
| 10 |
|
| 11 |
#include <tiffio.h> |
| 12 |
|
| 13 |
.. c:function:: int TIFFSetDirectory(TIFF* tif, tdir_t dirnum) |
| 14 |
|
| 15 |
.. c:function:: int TIFFSetSubDirectory(TIFF* tif, uint64_t diroff) |
| 16 |
|
| 17 |
Description |
| 18 |
----------- |
| 19 |
|
| 20 |
:c:func:`TIFFSetDirectory` changes the current directory and reads its |
| 21 |
contents with :c:func:`TIFFReadDirectory`. The parameter *dirnum* |
| 22 |
specifies the subfile/directory as an integer number, with the first |
| 23 |
directory numbered zero. |
| 24 |
:c:func:`TIFFSetDirectory()` only works with main-IFD chains because |
| 25 |
allways starts with the first main-IFD and thus is able to reset |
| 26 |
the SubIFD reading chain to the main-IFD chain. |
| 27 |
|
| 28 |
:c:func:`TIFFSetSubDirectory` acts like :c:func:`TIFFSetDirectory`, |
| 29 |
except the directory is specified as a file offset instead of an index; |
| 30 |
this is required for accessing subdirectories linked through a |
| 31 |
``SubIFD`` tag. (see :ref:`MultiPage SubIFD <SubIFDAccess>`) |
| 32 |
|
| 33 |
Directory query functions :c:func:`TIFFCurrentDirectory`, |
| 34 |
:c:func:`TIFFCurrentDirOffset`, :c:func:`TIFFLastDirectory` and |
| 35 |
:c:func:`TIFFNumberOfDirectories` retrieve information about directories |
| 36 |
in an open TIFF file. Be aware that until a directory is |
| 37 |
not written to file AND read back, the query functions won't retrieve |
| 38 |
the correct information! |
| 39 |
|
| 40 |
Return values |
| 41 |
------------- |
| 42 |
|
| 43 |
On successful return 1 is returned. Otherwise, 0 is returned if *dirnum* |
| 44 |
or *diroff* specifies a non-existent directory, or if an error was |
| 45 |
encountered while reading the directory's contents. |
| 46 |
|
| 47 |
Diagnostics |
| 48 |
----------- |
| 49 |
|
| 50 |
All error messages are directed to the :c:func:`TIFFErrorExtR` routine. |
| 51 |
|
| 52 |
``"%s: Error fetching directory count"``: |
| 53 |
|
| 54 |
An error was encountered while reading the "directory count" field. |
| 55 |
|
| 56 |
``"%s: Error fetching directory link"``: |
| 57 |
|
| 58 |
An error was encountered while reading the "link value" that points to the |
| 59 |
next directory in a file. |
| 60 |
|
| 61 |
See also |
| 62 |
-------- |
| 63 |
|
| 64 |
:doc:`TIFFquery` (3tiff), |
| 65 |
:doc:`TIFFOpen` (3tiff), |
| 66 |
:doc:`TIFFCreateDirectory` (3tiff), |
| 67 |
:doc:`TIFFCustomDirectory` (3tiff), |
| 68 |
:doc:`TIFFWriteDirectory` (3tiff), |
| 69 |
:doc:`TIFFReadDirectory` (3tiff), |
| 70 |
:doc:`/multi_page`, |
| 71 |
:doc:`libtiff` (3tiff) |