Gennady,
hmm, I can't find anything about FIELD_CUSTOM in the libtiff sources, but that could be because we still use version 3.5.7 here (sorry everyone!).
That may also mean my other advice doesn't work for newer versions. I'm afraid I don't know enough to help you, nor have the time to research this further.
Anyway, the best route would be a nice clean public function, as already said.
Good luck and happy programming,
Gerben Vos.
-----Original Message-----
From: Gennady Khokhorin [mailto:***@aerometric-ak.com]
Sent: Friday, January 05, 2007 6:08 AM
To: Gerben Vos
Cc: ***@lists.maptools.org
Subject: [SPAM HEADER] - FW: [Tiff] removing tiff tag in-place - Email found in subject
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
-----Original Message-----
From: Gerben Vos [mailto:***@ZyLAB.COM]
Sent: Tuesday, January 02, 2007 3:37 AM
To: Gennady Khokhorin
Cc: ***@lists.maptools.org
Subject: Re: [Tiff] removing tiff tag in-place
Post by Gennady KhokhorinI 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.
Gerben Vos.
_______________________________________________
Tiff mailing list: ***@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/