TIFFFIELDQUERY(3tiff)

✨ NAME ✨

TIFFFieldQuery β€” the little squad of routines that let you ask questions about TIFF fields πŸ’… no cap, they just hand you info.


πŸŽ€ SYNOPSIS πŸŽ€

#include <tiffio.h>

const TIFFField *TIFFFieldWithName(TIFF *tif, const char *field_name)

const TIFFField *TIFFFieldWithTag(TIFF *tif, uint32_t tag)

const TIFFField *TIFFFindField(TIFF *tif, uint32_t tag, TIFFDataType dt)

int TIFFFieldIsAnonymous(const TIFFField *fip)

int TIFFFieldSetGetSize(const TIFFField *fip)

int TIFFFieldSetGetCountSize(const TIFFField *fip)

πŸ’– DESCRIPTION πŸ’–

okay so bestie, first up we got the lookups πŸ‘‘

TIFFFieldWithName() and TIFFFieldWithTag() hand you back a pointer to the TIFF field info structure fip, found either by the tag's field_name or by its tag number. cute, right?

TIFFFindField() goes hunting for the TIFF field info structure fip for a given tag number plus a specific TIFFDataType dt. And when dt== TIFF_ANY, it behaves exactly the same as TIFFFieldWithTag(). same energy, fr fr.

🚨 all three of these return NULL when the tag isn't registered inside libtiff (peep Default Tag Auto-registration for the lore).

A TIFFDataType-dependent search like this could be useful when the same tag is defined twice but with different data types β€” which is true for rare cases like TIFFTAG_XCLIPPATHUNITS. However, the libtiff does currently not support multiple definitions of the same tag. so like… don't count on it πŸ™ˆ


🌸 the status-info girlies 🌸

The following routines return status information about TIFF fields.

fip is a field information pointer previously returned by TIFFFindField(), TIFFFieldWithTag(), or TIFFFieldWithName(). she's a returning character πŸ’«

  • TIFFFieldIsAnonymous() β€” returns true (nonzero) if the field, read from file, is unknown to libtiff and an anonymous field has been auto-registered. Return is zero "0" if the field is known to libtiff. See Default Tag Auto-registration for more info πŸ‘€
  • TIFFFieldSetGetSize() β€” returns the data size in bytes of the field data type used for libtiff internal storage. This is also the data size of the parameter you gotta hand over to TIFFSetField() and TIFFGetField(). Custom TIFF_RATIONAL values can be stored internally either as float or double β€” and TIFFFieldSetGetSize() would then return "4" or "8", respectively. it's giving flexible πŸ’…
  • TIFFFieldSetGetCountSize() β€” returns size of the count parameter of TIFFSetField() and TIFFGetField(), and also whether it's required: 0=none, 2=uint16_t, 4=uint32_t. See also the description of TIFFFieldReadCount(). numbers don't lie ⭐

πŸ’€ DIAGNOSTICS πŸ’€

None. literally nothing. she's chill, no drama, no errors to report 😌


πŸ¦‹ SEE ALSO πŸ¦‹

  • TIFFFieldDataType (3tiff)
  • TIFFFieldName (3tiff)
  • TIFFFieldPassCount (3tiff)
  • TIFFFieldReadCount (3tiff)
  • TIFFFieldTag (3tiff)
  • TIFFFieldWriteCount (3tiff)
  • libtiff (3tiff)

the whole friend group, go say hi 🫢


πŸ‘‘ AUTHOR πŸ‘‘

LibTIFF contributors β€” iconic collective behavior, we love to see it 🌈


1988-2025, LibTIFF contributors


and that's the tea bestie πŸ“ this page is from LibTIFF 4.7, dated Jun 27, 2026 β€” screenshot it, memorise it, slay with it. periodt. πŸ’…βœ¨πŸŽ€