Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-g.b-one.net (mx-g.one.com [91.198.169.54])
	by mail9.b-one.net (Postfix) with ESMTP id 2949D40013D
	for <info@awaresystems.be>; Tue, 30 Jun 2009 16:21:52 +0200 (CEST)
X-Virus-Scanned: by one.com
X-Spam-Score: 0.001
X-Spam-Level: 
X-Spam-Status: No, score=0.001 tagged_above=0 required=6
	tests=[HTML_MESSAGE=0.001]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144])
	by mx-g.b-one.net (Postfix) with ESMTP id 897921408BF2
	for <info@awaresystems.be>; Tue, 30 Jun 2009 16:21:49 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 414FA1D31A53E;
	Tue, 30 Jun 2009 09:21:16 -0500 (EST)
Received: from snt0-omc1-s22.snt0.hotmail.com (snt0-omc1-s22.snt0.hotmail.com
	[65.55.90.33])
	by lists.maptools.org (Postfix) with ESMTP id 313CB1D201E75
	for <tiff@lists.maptools.org>; Tue, 30 Jun 2009 09:20:55 -0500 (EST)
Received: from SNT119-W28 ([65.55.90.7]) by snt0-omc1-s22.snt0.hotmail.com
	with Microsoft SMTPSVC(6.0.3790.3959); 
	Tue, 30 Jun 2009 07:20:54 -0700
Message-ID: <SNT119-W2854BA00CDF89E03937EFEB4310@phx.gbl>
X-Originating-IP: [192.88.212.34]
From: Ercan Yalvac <ercanyalvac@hotmail.com>
To: <tiff@lists.maptools.org>
Date: Tue, 30 Jun 2009 14:20:54 +0000
Importance: Normal
MIME-Version: 1.0
X-OriginalArrivalTime: 30 Jun 2009 14:20:54.0859 (UTC)
	FILETIME=[FAB439B0:01C9F98D]
Subject: [Tiff] How to parse private ifd tags!
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>
Content-Type: multipart/mixed; boundary="===============2136409087=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

--===============2136409087==
Content-Type: multipart/alternative;
	boundary="_9fe1ef11-f5d9-4927-861e-4c97e068a3d0_"

--_9fe1ef11-f5d9-4927-861e-4c97e068a3d0_
Content-Type: text/plain; charset="windows-1254"
Content-Transfer-Encoding: 8bit



Hi,

I am a newbee about tiff parsing. I need to parse a tiff image which has a private ifd directory (non image) and private tags in it. I couldnt figure out how to do it with libtiff 3.6.1. Below is the source I have tried. TIFFSetSubDirectory gives error. The message says the directory is not valid since there is no imagelength. Actually this directory is not an image directory anyway. I just want to parse the ASCII  data that the vendor of the image has put there.

         toff_t tiff_ifd_offset;
        // get the offset to the directory
        if ( ! TIFFGetField(tif, PRIVATE_TAG,
            &tiff_ifd_offset) ) {
                printf("Couldn't find the private IFD Offset);
                return -2;
        }

            if (!TIFFSetSubDirectory(tif,tiff_ifd_offset)){
                printf("Couldn't set the directory.");
                //return -2;
            }

            char *sValue;
            var2 = TIFFGetField(tif, PRIVATE_TAG_DESCRIPTION, sValue); 
            printf(sValue);

Other question is I have seen some source code about this parsing but its in Libtiff Ver 3.8.3. I couldnt find the download of this version. I need to compile the library in VS 2003. Where can I find this download?

I really appreciate any help,

Thanks

Ercan

_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
--_9fe1ef11-f5d9-4927-861e-4c97e068a3d0_
Content-Type: text/html; charset="windows-1254"
Content-Transfer-Encoding: 8bit

<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<br>Hi,<br><br>I am a newbee about tiff parsing. I need to parse a tiff image which has a private ifd directory (non image) and private tags in it. I couldnt figure out how to do it with libtiff 3.6.1. Below is the source I have tried. <font style="" color="#c0504d">TIFFSetSubDirectory gives error.</font> The message says the directory is not valid since there is no imagelength. Actually this directory is not an image directory anyway. I just want to parse the ASCII&nbsp; data that the vendor of the image has put there.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; toff_t tiff_ifd_offset;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // get the offset to the directory<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( ! TIFFGetField(tif, PRIVATE_TAG,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &amp;tiff_ifd_offset) ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("Couldn't find the private IFD O
 ffset);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return -2;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;<font style="" color="#c0504d">&nbsp; if (!TIFFSetSubDirectory(tif,tiff_ifd_offset)){</font><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printf("Couldn't set the directory.");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //return -2;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; char *sValue;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var2 = TIFFGetField(tif, PRIVATE_TAG_DESCRIPTION, sValue); <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printf(sValue);<br><br>Other question is I have seen some source code about this parsing but its in Libtiff Ver 3.8.3. I couldnt find
  the download of this version. I need to compile the library in VS 2003. Where can I find this download?<br><br>I really appreciate any help,<br><br>Thanks<br><br>Ercan<br><br /><hr />Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! <a href='http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us' target='_new'>Try it!</a></body>
</html>
--_9fe1ef11-f5d9-4927-861e-4c97e068a3d0_--

--===============2136409087==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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