
Thread
2005.10.25 11:21 "Re[2]: [Tiff] How can I remove tag from IFD?", by Шебеко Евгений
I am not aware of a public functions to "unset" a flag in a loaded directory, though it wouldn't be all that hard to add.
I get this. Seems it's work.
int TIFFEraseField(TIFF* tif, ttag_t tag)
{
const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY);
TIFFDirectory* td = &tif->tif_dir;
int i;
if(!fip||isPseudoTag(tag))return 0;
if(fip->field_bit!=FIELD_CUSTOM)
{
TIFFClrFieldBit(tif,fip->field_bit);
return 1;
}
for (i=0;i<td->td_customValueCount;i++)
{
TIFFTagValue *tv = td->td_customValues + i;
if (tv->info->field_tag != tag)
continue;
if (tv->value)_TIFFfree(tv->value); memmove(tv,tv+1,(td->td_customValueCount-1-i)*sizeof(TIFFTagValue)); --td->td_customValueCount;
return 1;
}
return 0;
}