2006.12.21 23:54 "[Tiff] removing tiff tag in-place", by Gennady Khokhorin

2007.01.08 13:20 "Re: [Tiff] removing tiff tag in-place", by Gerben Vos

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.

Subject: [SPAM HEADER] - FW: [Tiff] removing tiff tag in-place - Email found in subject

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...

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.