TIFFERROR(3tiff)
π TIFFERROR π
okay bestie, gather round, because this is the TIFFError page from the LibTIFF manuals and it's literally the whole library error-handling interface. yes, the whole vibe. no cap. π«Ά
β¨ NAME β¨
TIFFError β the library error handling interface. that's it, that's the girl. π
πΈ SYNOPSIS πΈ
#include <tiffio.h>
#include <stdarg.h>
void TIFFError(const char *module, const char *fmt, ...)
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,
...)
void TIFFErrorExtR(TIFF *tif, const char *module, const char *fmt, ...)
typedef void (*TIFFErrorHandler)(const char *module, const char *fmt,
va_list ap)
typedef void (*TIFFErrorHandlerExt)(thandle_t fd, const char *module,
const char *fmt, va_list ap)
typedef int (*TIFFErrorHandlerExtR)(TIFF *tif, void *user_data, const
char *module, const char *fmt, va_list ap)
TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler handler)
TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt handler)
look at all those function signatures, so organized, we love a structured queen π
π¦ DESCRIPTION π¦
okay so first up: TIFFError() invokes the library-wide error handler function to (normally) write an error message to stderr. the fmt parameter is a printf() format string, and any number of arguments can be supplied. the module parameter is interpreted as a string that, if non-zero, should be printed before the message β it's typically used to identify the software module in which an error is detected. it's giving "who did this" energy. π
apps that want to capture control the moment an error happens should use TIFFSetErrorHandler() to override the default error handler. and listen β a NULL (0) error handler function may be installed to suppress error messages. silent treatment, but make it intentional. π
Two more application-specific error handler callbacks are available, each with different call parameters and passing parameters to the handler. Each handler is also linked with an error message function, i.e. TIFFErrorExt() and TIFFErrorExtR() if the application intends to call the handler with those extended parameters.
TIFFErrorExt() provides a file handle as parameter. Within libtiff, TIFFErrorExt() is called passing tif->tif_clientdata as fd, which represents the TIFF file handle (file descriptor). the application-specific and library-wide handler for TIFFErrorExt() is set up with TIFFSetErrorHandlerExt(). slay. β¨
TIFFErrorExtR() (introduced with libtiff 4.5) is called with its TIFF handle and thus provides access to a per-TIFF handle (re-entrant) error handler. That means for different TIFF handles, different error handlers can be set up. this application-specific handler can be set up when a TIFF file is opened with one of the following functions: TIFFOpenExt(), TIFFOpenWExt(), TIFFFdOpenExt() or TIFFClientOpenExt(). Furthermore, a custom defined data structure user_data for the error handler can be given along. customization?? obsessed. π
Please refer to TIFFOpenOptions for how to set up the application-specific handler introduced with libtiff 4.5.
β οΈ NOTE β οΈ
pay attention bestie, this part is the lore π
Both functions TIFFError() and TIFFErrorExt() each attempt to call both handler functions if they are defined. First TIFFErrorHandler() is called and then TIFFErrorHandlerExt(). However, TIFFError() passes a "0" as a file handle to TIFFErrorHandlerExt().
TIFFErrorExtR() tries first to call the per-TIFF handle defined error handler. If TIFFErrorHandlerExtR() is not defined or returns 0, TIFFErrorHandler() and then TIFFErrorHandlerExt() are called. From libtiff 4.5 onwards, TIFFErrorExtR() is used within the libtiff library where the TIFF handle is available. Otherwise, TIFFErrorExt() is used!
π RETURN VALUES π
TIFFSetErrorHandler() and TIFFSetErrorHandlerExt() return a reference to the previous error handler function. giving you the receipts of who was here before. π
TIFFErrorHandlerExtR() returns an integer as "stop" to control the call of further error handler functions within TIFFErrorExtR():
0: both functionsTIFFErrorHandler()andTIFFErrorHandlerExt()are called.- non-zero: no further error message function is called. β that's a wrap, everyone go home.
π SEE ALSO π
TIFFWarning(3tiff)TIFFOpen(3tiff)TIFFOpenOptionslibtiff(3tiff)printf(3)
π AUTHOR π
LibTIFF contributors β the icons who built all of this fr fr π
π COPYRIGHT π
1988-2025, LibTIFF contributors
aaand that's the whole page, bestie, you ate it up πβ¨ this was TIFFERROR(3tiff) from LibTIFF version 4.7, dated Jun 27, 2026 β tysm for reading, mwah, go handle those errors like the main character you are πππ¦
π¦ 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