2007.01.05 05:08 "FW: [Tiff] removing tiff tag in-place", by Gennady Khokhorin
Gerben,
I did a bit futher search, following did not work either:
const TIFFFieldInfo* fip = TIFFFindFieldInfo(in, TIFFTAG_DOCUMENTNAME, TIFF_ANY); TIFFClrFieldBit(in, fip->field_tag);
Output image' empty tags still there.
It could be other ways to make tags cleaning...
Gennady
-----Original Message-----
From: Gennady Khokhorin
Sent: Thursday, January 04, 2007 6:47 PM
To: 'Gerben Vos'
Subject: RE: [Tiff] removing tiff tag in-place
Hi, Gerben.
Can not make it work this way. No any FIELD tag for ascii data in the directory (tif_dir.h). All text data are marked as FIELD_CUSTOM (tif_dirinfo.c) probably because of variable length.
Was trying to invent those missing fields like that:
{ TIFFTAG_DOCUMENTNAME, -1,-1, TIFF_ASCII, FIELD_DOCUMENTNAME,
1, 0, "DocumentName" },
where #define FIELD_DOCUMENTNAME 50
And did break TIFFTAG<name> - FIELD<name> link, TIFFGetField() can not find documentName field anymore.
I'm going to put a request for this command in bug list.
Happy programming!
Gennady
I have an empty tags which want to remove from tif wout copying process. I tried TIFFSetField(tif, TIFFTAG_DOCUMENTNAME, ""); but tag still seats in the file. Is it possible to drop an empty ascii tags?
Try TIFFClrFieldBit(tif, FIELD_DOCUMENTNAME), a macro defined in tif_dir.h. Note: use FIELD_DOCUMENTNAME, not TIFFTAG_DOCUMENTNAME! I've never used it, but it looks like it does what you want. I don't think there currently is a public function for this, but I think it would be a good idea to have one.