Return-Path: <tiff-bounces@lists.maptools.org>
Delivered-To: info@awaresystems.be
Received: (qmail 25030 invoked from network); 8 Aug 2008 05:19:31 -0000
Received: from cheryl.telenet-ops.be ([195.130.136.3])
          (envelope-sender <tiff-bounces@lists.maptools.org>)
          by angelia.telenet-ops.be (qmail-ldap-1.03) with SMTP
          for <info@awaresystems.be>; 8 Aug 2008 05:19:31 -0000
Received: from vijay.telenet-ops.be (vijay.telenet-ops.be [195.130.136.9])
	by cheryl.telenet-ops.be (8.13.1/8.13.1) with ESMTP id m785JVQY004252
	for <info@awaresystems.be>; Fri, 8 Aug 2008 07:19:31 +0200
Received: from localhost (localhost.localdomain [127.0.0.1])
	by vijay.telenet-ops.be (Postfix) with SMTP id B0B3A60005
	for <info@awaresystems.be>; Fri,  8 Aug 2008 07:19:31 +0200 (CEST)
Received: from ladon.telenet-ops.be (ladon.telenet-ops.be [195.130.132.50])
	by vijay.telenet-ops.be (Postfix) with ESMTP id A9C5D60004
	for <info@awaresystems.be>; Fri,  8 Aug 2008 07:19:31 +0200 (CEST)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153])
	by ladon.telenet-ops.be (Postfix) with ESMTP id 487A8312762
	for <info@awaresystems.be>; Fri,  8 Aug 2008 07:19:31 +0200 (CEST)
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 m785FV1I021294;
	Fri, 8 Aug 2008 01:17:14 -0400
Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.235])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m785FSkp021289
	for <tiff@lists.maptools.org>; Fri, 8 Aug 2008 01:15:29 -0400
Received: by rv-out-0506.google.com with SMTP id f6so725133rvb.9
	for <tiff@lists.maptools.org>; Thu, 07 Aug 2008 22:15:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:message-id:date:from:to
	:subject:mime-version:content-type:content-transfer-encoding
	:content-disposition;
	bh=JUT7mVhdxxDhoJvGDi8/guLSr5rGTfCckFD8D5WVytc=;
	b=F9jHoSlqosaLq4JWR6iKwfXHUw/OQW3woaNQM6vfXYEJ6PCo8v40Xi32kt1ZFF2WDv
	ja4eKsaaMJyRQhgq4HDJMEmrIX7K5IGHBVh2Ak4P5Z2oI4D4msgAMZsLpCz7nXIZb7VG
	qCeXmpVBY94F1N31txU02FSVkuqX2qPcr4yF4=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=message-id:date:from:to:subject:mime-version:content-type
	:content-transfer-encoding:content-disposition;
	b=R4JiDWB9lAtH6UjETa2/nVyMtx/IOhn02RY4XmSCC+Bsx5ivCAAZJWFoD0glJwFxix
	vRrfYpU8YWC10wLrsp/Xb1SMVo467602eyMO74loJY0JQ0suaMLNjRQSfQVtHuxYeVce
	wflmLzQ5moehKlvEKwAzvz1Vn6DwybKxcwDnA=
Received: by 10.141.211.13 with SMTP id n13mr1184774rvq.12.1218172526623;
	Thu, 07 Aug 2008 22:15:26 -0700 (PDT)
Received: by 10.141.128.2 with HTTP; Thu, 7 Aug 2008 22:15:26 -0700 (PDT)
Message-ID: <aa19747c0808072215jed0386fu5013cf5c0780981c@mail.gmail.com>
Date: Fri, 8 Aug 2008 15:15:26 +1000
From: "Tom Harris" <celephicus@gmail.com>
To: tiff@lists.maptools.org
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Subject: [Tiff] Writing custom fields with big counts.
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-SpamCatcher-Score: 50 [XX]

Greetings,

I am playing with an idea to add arbitrary extra fields to a vanilla
RGB TIFF, these extra tags will hold the source image that was used to
create the RGB image. I want to do this so tht I have data files from
a scientific intrument that contain all sorts of strange data, but to
the users look like normal multi-image 24 bit RGB files.

I can add the extra field OK, but I find that although the spec allows
4 bytes for the count, libtiff only seems to use 2 bytes, so the
maximum count is 65535. The TIFFFieldInfo struct only uses shorts for
field_readcount & field_writecount, so I suppose this is why. However,
even if I have -1 for these values (indicating that the number of
values is set in the call to TIFFSetField), the maximum count that I
seem to be able to write is 65535. Tiffdump will only report the field
count as correct if it is less than 32768, any more and it gives me a
count of zero, even though inspecting a hex dump of the tiff file
shows the correct count.

Am I doing something wrong?

I was hoping to save my private data as an array of 1024*1024*4
unsigned shorts, but it looks like this will not work with libtiff.
Perhaps I should be looking at writing a table of offsets to data in
strips (exactly how images are saved at present).

-- 

Tom Harris <celephicus(AT)gmail(DOT)com>
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
