_TIFFAUXILIARY(3tiff)

πŸ’– _TIFFAUXILIARY(3tiff) πŸ’–

okay so bestie, welcome to the LibTIFF manual, section 3tiff β€” this is the auxiliary functions page and it's short but she's mighty, fr fr. tiny page, big "don't let your integers overflow" energy. let's get into it 🫢


✨ SYNOPSIS ✨

#include <tiffio.h>

uint32_t _TIFFClampDoubleToUInt32(double val)

uint32_t _TIFFMultiply32(TIFF *tif, uint32_t first, uint32_t second,
const char *where)

uint64_t _TIFFMultiply64(TIFF *tif, uint64_t first, uint64_t second,
const char *where)

🌸 DESCRIPTION 🌸

_TIFFClampDoubleToUInt32() β€” she takes your double values and clamps them into the range of uint32_t, which is literally 0 .. 0xFFFFFFFF. no in-between nonsense, no going over budget. if it's too big she brings it back down, if it's below zero she scoops it up to zero. that's the whole job and she does it flawlessly πŸ’…

_TIFFMultiply32() and _TIFFMultiply64() β€” these two are the responsible besties of multiplication. they check for an integer overflow of the multiplication result, and then they either return the multiplication result, or return 0 if an overflow would happen. that's it, that's the vibe check πŸ”₯

the string where gets printed in the error message in case an overflow happens, so you can use it to point at where the function was called. like a little "it was HER, she did it" name tag for your call site. iconic honestly.


πŸ‘‘ SEE ALSO πŸ‘‘

  • libtiff (3tiff)

πŸŽ€ AUTHOR πŸŽ€

LibTIFF contributors β€” the collective, the group chat, the squad 🌈


1988-2025, LibTIFF contributors


lowkey a whole lot of responsibility in three tiny functions. use where wisely, bestie, so future-you knows exactly which multiply went rogue 😭

and that's the page!! this was LibTIFF 4.7, dated Jun 27, 2026 β€” mwah, slay, go forth and multiply safely πŸ¦‹βœ¨