X-Account-Key: account1
X-UIDL: 4996ae930a5a7369c959c3c70fb03714
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
X-Mozilla-Keys:                                                                                 
Received: from lists.maptools.org (localhost [127.0.0.1])
	by mail.howardsilvan.com (Postfix) with ESMTPS id B21C6C420B6
	for <faxguy@howardsilvan.com>; Mon, 16 Feb 2015 10:34:29 -0800 (PST)
Received: from lists.maptools.org ([94.23.4.142] helo=lists.maptools.org)
	by fangorn.howardsilvan.com with SMTP (2.3.3); 16 Feb 2015 10:34:28 -0800
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 8F80335C037;
	Mon, 16 Feb 2015 13:33:48 -0500 (EST)
Received: from mail-ie0-f174.google.com (mail-ie0-f174.google.com	[209.85.223.174])
	by lists.maptools.org (Postfix) with ESMTPS id 83BFF35C023
	for <tiff@lists.maptools.org>; Mon, 16 Feb 2015 13:32:49 -0500 (EST)
Received: by iecar1 with SMTP id ar1so35743095iec.11
	for <tiff@lists.maptools.org>; Mon, 16 Feb 2015 10:32:58 -0800 (PST)
X-Received: by 10.107.10.70 with SMTP id u67mr30772897ioi.80.1424111578763;
	Mon, 16 Feb 2015 10:32:58 -0800 (PST)
Received: from glados.ssec.wisc.edu ([2607:f388:1090:0:2899:2a54:4455:cf07])
	by mx.google.com with ESMTPSA id g20sm8705775igt.14.2015.02.16.10.32.57
	for <tiff@lists.maptools.org>	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);	Mon, 16 Feb 2015 10:32:57 -0800 (PST)
Message-ID: <54E237D8.6020304@gmail.com>
Date: Mon, 16 Feb 2015 12:32:56 -0600
From: David Hoese <dhoese@gmail.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10;	rv:31.0)
 Gecko/20100101 Thunderbird/31.4.0
MIME-Version: 1.0
To: tiff@lists.maptools.org
Subject: [Tiff] custom tags between 3.9 and 4.0
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
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-Assp-ID: fangorn.howardsilvan.com m1-11669-06582
X-Assp-Session: 7F0703541860 (mail 1)
X-Assp-Detected-RIP: 2607:f388:1090:0:2899:2a54:4455:cf07, 209.85.223.174
X-Assp-Source-IP: 2607:f388:1090:0:2899:2a54:4455:cf07
X-Assp-Envelope-From: tiff-bounces@lists.maptools.org
X-Assp-Intended-For: faxguy@howardsilvan.com
X-Assp-Version: 2.3.3(14029) on fangorn.howardsilvan.com
X-Assp-Server-TLS: yes
X-Assp-Delay: not delayed (whitelisted); 16 Feb 2015 10:34:29 -0800
X-Assp-Message-Score: -40 (KnownGoodHelo)
X-Assp-IP-Score: -40 (KnownGoodHelo)
X-Assp-Whitelisted: Yes (whitelistdb)
Return-Path: tiff-bounces@lists.maptools.org
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

I'm debugging some code that used to use libtiff 3.9.4, but now doesn't work with libtiff 4.0.3. A while ago I added the ability to add custom tags to the pylibtiff package specifically the libtiff_ctypes.py module (https://code.google.com/p/pylibtiff/). This uses the 3.9 method of TIFFMergeFieldInfo which doesn't seem recommended/supported anymore after looking at the 4.0 source in tif_dirinfo.c.

The problem I'm running in to is after creating a custom tag with readcount=1 and passcount=0 and type "TIFF_SLONG", the type assigned by "_TIFFSetGetFieldtype" is "TIFF_SETGET_SINT32". When reading a file with this custom tag I get the "Assertion failed: (0), function TIFFFetchNormalTag, file tif_dirread.c, line 5353." error and then the program aborts. It looks like this happens because "TIFF_SETGET_SINT32" isn't actually handled by "TIFFFetchNormalTag" (along with a lot of other types).

Can anyone suggest a path for me to fix this? It looks like "_TIFFCreateAnonField" or "_TIFFSetupFields" are the only ways to create custom fields. Is there any updated documentation for adding custom tags that someone could point me to?

Thanks for any help. Please CC me in any replies.

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


