AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
October 2005

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2005.10.24 07:07 "How can I remove tag from IFD?", by Eugene Shebeko
2005.10.24 18:11 "Re: How can I remove tag from IFD?", by Frank Warmerdam
2005.10.25 09:53 "Re: How can I remove tag from IFD?", by Eugene Shebeko
2005.10.25 11:21 "Re: How can I remove tag from IFD?", by Eugene Shebeko

2005.10.25 11:21 "Re: How can I remove tag from IFD?", by Eugene Shebeko

> 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;
}