Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas021.isp.belgacom.be (localhost [127.0.0.1])
        by inav019.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AV-3.00) with ESMTP id l055HNQw018074
        for <joris.at.lebbeke@skynet.be>; Fri, 5 Jan 2007 06:17:23 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx003.isp.belgacom.be (inmx003.isp.belgacom.be [195.238.5.11])
        by inas021.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AS-2.03) with ESMTP id l055HGG7009778
        for <joris.at.lebbeke@skynet.be>; Fri, 5 Jan 2007 06:17:18 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx003.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id l055HDYA006348
        for <joris.at.lebbeke@skynet.be>; Fri, 5 Jan 2007 06:17:14 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l0559oSC030945;
	Fri, 5 Jan 2007 00:10:56 -0500
Received: from admin1.aeromap.com (209-193-48-179-cdsl-rb1.anc.acsalaska.net
	[209.193.48.179])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l0559lW9030941
	for <tiff@lists.maptools.org>; Fri, 5 Jan 2007 00:09:48 -0500
Content-Class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0
Subject: FW: [Tiff] removing tiff tag in-place
Date: Thu, 4 Jan 2007 20:08:20 -0900
Message-ID: <3054411AF4728548AD6D7137190D56B302B5784D@admin1.aeromap.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [Tiff] removing tiff tag in-place
thread-index: AcclW07ilgkiIzURTZmK6yt3XYjzQgJDV/hQAIE1MBAABmTFwA==
From: "Gennady Khokhorin" <gok@aerometric-ak.com>
To: "Gerben Vos" <Gerben@zylab.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by duke.maptools.org id
	l0559lW9030941
Cc: tiff@lists.maptools.org
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.00001f15
X-MSP-STORE: Fri, 05 Jan 2007 06:17:33 +0100
Status:   

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:Gerben@ZyLAB.COM]
Sent: Tuesday, January 02, 2007 3:37 AM
To: Gennady Khokhorin
Cc: tiff@lists.maptools.org
Subject: Re: [Tiff] removing tiff tag in-place


Gennady Khokhorin wrote:

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

					Gerben Vos.

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
