Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas009.isp.belgacom.be (localhost [127.0.0.1])
        by inav013.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id k16HnG8x023134
        for <joris.at.lebbeke@skynet.be>; Mon, 6 Feb 2006 18:49:17 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx001.isp.belgacom.be (inmx001.isp.belgacom.be [195.238.5.1])
        by inas009.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id k16HnCC3025631
        for <joris.at.lebbeke@skynet.be>; Mon, 6 Feb 2006 18:49:14 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx001.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id k16Hn2A1006697
        for <joris.at.lebbeke@skynet.be>; Mon, 6 Feb 2006 18:49:03 +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 k16HgFGA018627;
	Mon, 6 Feb 2006 12:42:38 -0500
Received: from outmx028.isp.belgacom.be (outmx028.isp.belgacom.be
	[195.238.5.49])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id k16HgDbH018624
	for <tiff@lists.maptools.org>; Mon, 6 Feb 2006 12:42:13 -0500
Received: from outmx028.isp.belgacom.be (localhost [127.0.0.1])
	by outmx028.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with
	ESMTP id k16Hfxxb008679
	for <tiff@lists.maptools.org>; Mon, 6 Feb 2006 18:41:59 +0100
	(envelope-from <joris.at.lebbeke@skynet.be>)
Received: from dfgrrxsknr4e (170-198.244.81.adsl.skynet.be [81.244.198.170])
	by outmx028.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with SMTP
	id k16HfuUe008635; Mon, 6 Feb 2006 18:41:56 +0100
	(envelope-from <joris.at.lebbeke@skynet.be>)
Message-ID: <002e01c62b44$a64443e0$aac6f451@dfgrrxsknr4e>
From: "Joris" <joris.at.lebbeke@skynet.be>
To: <dermot@sciencephoto.com>, <tiff@lists.maptools.org>
References: <43E7837D.14127.61B05230@dermot.sciencephoto.co.uk>
Subject: Re: [Tiff] Mega newbie question
Date: Mon, 6 Feb 2006 18:42:06 +0100
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Cc: 
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.0000125c
X-MSP-STORE: Mon, 06 Feb 2006 18:49:25 +0100
Status:   

Dermot Paikkos wrote:
> I have been reading the docs at awaresystems.com on accessing the
> PhotoShop thumbnails within a tiff file.

That's .be, man... http://www.awaresystems.be/. Not all that glitters,
is .com.

> I am not sure what I am getting back from GetField. If I run the
> program below I get
>
> Value of GetField = 10124416
>
> Does that mean that the length of the block is 10124416 bytes? Or is
> this just it's unique identifier?

See section 'AUTOREGISTERED TAGS' on
http://www.remotesensing.org/libtiff/man/TIFFGetField.3tiff.html.

<quote>

If you can't find the tag in the table above that means this is
unsupported tag. But you still be able to read it's value if you know
the data type of that tag. For example, if you want to read the LONG
value from the tag 33424 and ASCII string from the tag 36867 you can use
the following code:

uint16 count;
void *data;

TIFFGetField(tiff, 33424, &count, &data);
printf("Tag %d: %d, count %d0, 33424, *(uint32 *)data, count);
TIFFGetField(tiff, 36867, &count, &data);
printf("Tag %d: %s, count %d0, 36867, (char *)data, count);

</quote>

I'm not too sure why count is declared uint16 here... It should be
uint32 if you ask me. Plenty of tags have potentially over 64K of data,
and in any case, the count in tags in actual file normal TIFF (not
BigTIFF) is unsigned 32bit. I'm also unsure why datatype is not returned
by this interface... I think it should be if it is to be used in a
robust manner. Otherwise, if the calling code supposes LONG datatype,
but the actual (possibly invalid) file states BYTE datatype, calling
code is next going to boom in an access violation when accessing past
1/4 of what is supposes is actual data.

Good luck. Don't be shy to post your results, I would welcome any good
actual code contribution to the Photoshop tag page.

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html

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