TIFFQUERY(3tiff)

NAME
TIFFquery - query routines

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)

tstrip_t TIFFCurrentStrip(TIFF *tif)

ttile_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

The following query routines return status information about the directory structure of an open TIFF file.

TIFFCurrentDirectory() returns the index of the current directory (directories are numbered starting at 0). This number is suitable for use with the TIFFSetDirectory() routine. A value of 65535 (non-existing directory) is returned if the directory has not yet been written to the file after opening it.

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.

TIFFLastDirectory() returns a non-zero value if the current directory is the last directory in the file; otherwise zero is returned.

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() or TIFFReadDirectory().

The following query routines return information about an open TIFF file and its image data.

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.

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.

SEE ALSO

libtiff (3tiff), TIFFOpen (3tiff)

AUTHOR
LibTIFF contributors

COPYRIGHT
1988-2022, LibTIFF contributors