TIFFCREATEDIRECTORY(3tiff)
π TIFFCREATEDIRECTORY π (that's a 3tiff man page bestie, from the LibTIFF crew)
okay so. you're out here making directories inside TIFF files and you need the tea?? say less. this is TIFFCreateDirectory and its little friend group β the routines that create a directory and pull info about directories. let's get into it π
β¨ NAME β¨
TIFFCreateDirectory β routines to create a directory and retrieve information about directories ποΈβ¨
πΈ SYNOPSIS πΈ
#include <tiffio.h>
int TIFFCreateDirectory(TIFF *tif)
int TIFFFreeDirectory(TIFF *tif)
int TIFFUnlinkDirectory(TIFF *tif, tdir_t dirn)
π¦ DESCRIPTION π¦
The following routines create or release a directory. iconic behaviour honestly.
TIFFCreateDirectory() sets up for a directory in an open TIFF file. the newly created directory will not exist on the file till TIFFWriteDirectory(), TIFFCheckpointDirectory(), TIFFFlush() or TIFFClose() is called. Also, TIFFWriteDirectory() also creates a new directory, frees the *tif structure and sets up a new one. it's giving double duty π
TIFFFreeDirectory() releases allocated storage associated with a directory, especially custom-fields. however, the main part of the directory is not touched. Routine TIFFCleanup() calls TIFFFreeDirectory() to release the directory part of the tif structure. teamwork fr fr π«Ά
TIFFUnlinkDirectory() unlinks the specified directory from the directory chain. The parameter dirn specifies the subfile/directory as an integer number, with the first directory numbered one (1). π¨ This is different to TIFFSetDirectory() or TIFFCurrentDirectory() where the first directory starts with zero (0). yes bestie, the off-by-one is real, watch your step π
Directory query functions TIFFCurrentDirectory(), TIFFCurrentDirOffset(), TIFFLastDirectory() and TIFFNumberOfDirectories() 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't retrieve the correct information! not me warning you twice about this, i'm just looking out for you π
π NOTES π
Be aware:
- that until a directory is not written to file AND read back, the query functions won't retrieve the correct information! π
- that the newly created directory will not exist on the file till
TIFFWriteDirectory(),TIFFCheckpointDirectory(),TIFFFlush()orTIFFClose()has been called. - that
TIFFCreateDirectory()andTIFFWriteDirectory()create a new directory, free the*tifstructure and set up a new one. - that unlike
TIFFWriteDirectory(),TIFFCheckpointDirectory()does not free up the directory data structures in memory.
After libtiff version 4.6.0 TIFFCreateDirectory() also releases the directory part of the tif structure by calling TIFFFreeDirectory(), which should have been called by the user application before creating a new directory. so yeah, that's on you to have handled already, no cap π§
π₯ DIAGNOSTICS π₯
All error messages are directed to the TIFFErrorExtR() routine. Likewise, warning messages are directed to the TIFFWarningExtR() routine. they're literally just the messengers, don't shoot them π
π SEE ALSO π
libtiff(3tiff)TIFFCustomDirectory(3tiff)TIFFquery(3tiff)TIFFSetDirectory(3tiff)TIFFWriteDirectory(3tiff)
π AUTHOR π
LibTIFF contributors π«Ά absolute main characters.
β COPYRIGHT β
1988-2025, LibTIFF contributors
okay that's the whole page bestie, go forth and unlink responsibly πβ¨
this was LibTIFF version 4.7, dated Jun 27, 2026 β mwah, stan, periodt π
π¦ where this page comes from
- fedora 43: libtiff-devel 4.7.2-1.fc43
- fedora 43: libtiff-devel 4.7.2-1.fc43
- fedora 43: libtiff-devel 4.7.2-3.fc43 Β· libtiff
- fedora 43: libtiff-devel 4.7.2-3.fc43 Β· libtiff
- fedora 44: libtiff-devel 4.7.2-1.fc44
- fedora 44: libtiff-devel 4.7.2-1.fc44
- fedora 44: libtiff-devel 4.7.2-3.fc44 Β· libtiff
- fedora 44: libtiff-devel 4.7.2-3.fc44 Β· libtiff
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms