Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas011.isp.belgacom.be (localhost [127.0.0.1])
        by inav002.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id k16HPL3N030302
        for <joris.at.lebbeke@skynet.be>; Mon, 6 Feb 2006 18:25:22 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx015.isp.belgacom.be (inmx015.isp.belgacom.be [195.238.4.218])
        by inas011.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id k16HPBHW006276
        for <joris.at.lebbeke@skynet.be>; Mon, 6 Feb 2006 18:25:12 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx015.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id k16HP6H3028413
        for <joris.at.lebbeke@skynet.be>; Mon, 6 Feb 2006 18:25:07 +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 k16HDFZS018017;
	Mon, 6 Feb 2006 12:15:33 -0500
Received: from helios.sciencephoto.co.uk (helios.sciencephoto.co.uk
	[194.200.237.129])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id k16HDCRq018013
	for <tiff@lists.maptools.org>; Mon, 6 Feb 2006 12:13:13 -0500
Received: from [194.200.237.140] (helo=[194.200.237.140])
	by helios.sciencephoto.co.uk with esmtp (Exim 3.16 #3)
	id 1F69vL-0003O6-00
	for tiff@lists.maptools.org; Mon, 06 Feb 2006 17:13:11 +0000
From: "Dermot Paikkos" <dermot@sciencephoto.com>
To: tiff@lists.maptools.org
Date: Mon, 06 Feb 2006 17:12:29 -0000
MIME-Version: 1.0
Message-ID: <43E7837D.14127.61B05230@dermot.sciencephoto.co.uk>
Priority: normal
X-mailer: Pegasus Mail for Windows (4.31)
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body
Subject: [Tiff] Mega newbie question
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: dermot@sciencephoto.com
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.0000125b
X-MSP-STORE: Mon, 06 Feb 2006 18:25:31 +0100
Status:   

Hi,

I'll apologise in advance as I am very green with C. 

I have been reading the docs at awaresystems.com on accessing the 
PhotoShop thumbnails within a tiff file.

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?

What I am trying to do is loop from the start of this PHOTOSHOP tag 
to the end. I want to try and extract the various fields along the 
way. Ultimately I'd like extract the thumbnail within if one exists 
but I think I am a way of that yet.

So can someone give me a few tips and possibly explain how to use the 
return value from TIFFGetField I could make a start.

Thanx.
Dp.

=======================
#include <stdio.h>
#include <tiffio.h>

main()
{
  int hasPSfield;


  TIFF* tif = TIFFOpen("test.tif", "r");
  if (tif == NULL) {
         printf("Failed to open file\n");
         exit(8);
  }
  TIFFGetField(tif,TIFFTAG_PHOTOSHOP &hasPSfield);
  if (hasPSfield >= 1) {
     printf("Value of GetField = %d\n", hasPSfield );

  }

  TIFFClose(tif);
  return 0;
}

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