TIFFQUERY(3tiff)
β¨ TIFFQUERY β¨ (the 3tiff girlies' manual page)
okay so bestie, welcome to the LibTIFF query zone π this is the page where we ask a TIFF file nosy little questions and it tells us everything. no cap.
πΈ NAME πΈ
TIFFquery β the query routines π (yes that's it, that's the name, iconic)
π¦ SYNOPSIS π¦
#include <tiffio.h>
tdir_t TIFFCurrentDirectory(TIFF *tif)
uint64_t TIFFCurrentDirOffset(TIFF *tif)
int TIFFLastDirectory(TIFF *tif)
tdir_t TIFFNumberOfDirectories(TIFF *tif)
uint32_t TIFFCurrentRow(TIFF *tif)
uint32_t TIFFCurrentStrip(TIFF *tif)
uint32_t TIFFCurrentTile(TIFF *tif)
int TIFFFileno(TIFF *tif)
char *TIFFFileName(TIFF *tif)
int TIFFGetMode(TIFF *tif)
int TIFFIsTiled(TIFF *tif)
int TIFFIsBigEndian(TIFF *tif)
int TIFFIsBigTIFF(TIFF *tif)
int TIFFIsByteSwapped(TIFF *tif)
int TIFFIsMSB2LSB(TIFF *tif)
int TIFFIsUpSampled(TIFF *tif)
const char *TIFFGetVersion(void)
π DESCRIPTION π
so the vibes are simple: these routines spill the tea β about the directory structure of an open TIFF file. they return status info, that's the whole job, and they do it flawlessly.
TIFFCurrentDirectory() returns the index of the current Image File Directory (IFD). Directories are numbered starting at 0. This number is suitable for use with the TIFFSetDirectory() routine. There are IFDs in the file and an "active" IFD in memory, from which fields are "set" and "get". The index of the current directory returned is:
a. 65535 (non-existing directory) if there is no IFD in the file after opening, or the state is unknown, or the last read (i.e. TIFFFetchDirectory()) failed, or a custom directory was written.
b. IFD index of last IFD written in the file. In this case the active IFD is a new (empty) one and the current directory offset from TIFFCurrentDirOffset() is zero. If writing fails, the IFD index is not changed.
c. IFD index of IFD read from file into memory (=active IFD), even if IFD is corrupt and TIFFReadDirectory() returns 0. Then the current directory offset is the offset of the IFD in the file.
d. IFD index β0β, whenever a custom directory or an unchained SubIFD was read.
TIFFCurrentDirOffset() returns the file offset of the current directory (instead of an index). The file offset is suitable for use with the TIFFSetSubDirectory() routine. This is required for accessing subdirectories linked through a SubIFD tag. See also SubIFD access. π«Ά
TIFFLastDirectory() returns a non-zero value if the current directory is the last directory in the file; otherwise zero is returned. A new (empty) directory in the memory (after TIFFWriteDirectory() or TIFFCreateDirectory()) also counts as the last directory, even if it has not yet been written to a file.
TIFFNumberOfDirectories() returns the number of directories in a file. Be aware that just created directories, which are not "written" to file do not count. π
NOTE: Be aware that the return value of the above directory query functions is not valid until the directory is "written" to file AND read back e.g.TIFFSetDirectory()orTIFFReadDirectory(). like pls don't trust it before then, it's giving unreliable narrator π
the following query routines return information about an open TIFF file and its image data. main character energy fr fr π₯
TIFFCurrentRow(), TIFFCurrentStrip(), and TIFFCurrentTile() return the current row, strip, and tile, respectively, that is being read or written. These values are updated each time a read or write is done.
TIFFFileno() returns the underlying file descriptor used to access the TIFF image in the filesystem.
TIFFFileName() returns the pathname argument passed to TIFFOpen() or TIFFFdOpen().
TIFFGetMode() returns the mode with which the underlying file was opened. On UNIX systems, this is the value passed to the open() (2) system call.
TIFFIsTiled() returns a non-zero value if the image data has a tiled organization. Zero is returned if the image data is organized in strips.
TIFFIsBigEndian() returns a non-zero value if the file is BigEndian and zero if the file is LittleEndian.
TIFFIsBigTIFF() returns a non-zero value if the file is in BigTIFF style.
TIFFIsByteSwapped() returns a non-zero value if the image data was in a different byte-order than the host machine. Zero is returned if the TIFF file and local host byte-orders are the same. Note that TIFFReadTile(), TIFFReadEncodedStrip() and TIFFReadScanline() functions already normally perform byte swapping to local host order if needed. so like, it's handled, bestie, don't stress β¨
TIFFIsMSB2LSB() returns a non-zero value if the image data is being returned with bit 0 as the most significant bit.
TIFFIsUpSampled() returns a non-zero value if image data returned through the read interface routines is being up-sampled. This can be useful to applications that want to calculate I/O buffer sizes to reflect this usage (though the usual strip and tile size routines already do this).
TIFFGetVersion() returns an ASCII string that has a version stamp for the TIFF library software. π
π DIAGNOSTICS π
None. literally none. not a single error, we ate and left no crumbs π
π SEE ALSO π
libtiff(3tiff)TIFFOpen(3tiff)
π AUTHOR π
LibTIFF contributors β the collective, the squad, the it-girls of image formats π«Ά
β COPYRIGHT β
1988-2025, LibTIFF contributors
and that's the whole page bestie!! πβ¨ this gorgeous little manual was served to you by version 4.7, dated Jun 27, 2026 β LibTIFF stays iconic, no cap. go forth and query responsibly πΈπ¦π
π¦ 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