Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas016.isp.belgacom.be (localhost [127.0.0.1])
        by inav004.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id jADHHNSU012280
        for <joris.at.lebbeke@skynet.be>; Sun, 13 Nov 2005 18:17:23 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx015.isp.belgacom.be (inmx015.isp.belgacom.be [195.238.4.218])
        by inas016.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id jADHHEKA022284
        for <joris.at.lebbeke@skynet.be>; Sun, 13 Nov 2005 18:17: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 inmx015.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id jADHH7Zl024298
        for <joris.at.lebbeke@skynet.be>; Sun, 13 Nov 2005 18:17:08 +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 jADH6MtD004306;
	Sun, 13 Nov 2005 12:08:01 -0500
Received: from cgp.spb.edu (vlan3.cgp.spb.edu [195.70.196.207])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id jADH6JlQ004303
	for <tiff@lists.maptools.org>; Sun, 13 Nov 2005 12:06:20 -0500
Received: from wg.pu.ru ([193.124.85.219] verified)
	by cgp.spb.edu (CommuniGate Pro SMTP 4.3c5)
	with ESMTP id 15324491 for tiff@lists.maptools.org;
	Sun, 13 Nov 2005 20:02:02 +0300
Received: (from uucp@localhost)
	by wg.pu.ru (8.9.1a/8.9.1) with UUCP id RAA23481
	for tiff@lists.maptools.org; Sun, 13 Nov 2005 17:06:15 GMT
Received: from ak4719.spb.edu (localhost [127.0.0.1])
	by ak4719.spb.edu (8.13.5/8.13.5/Debian-3) with ESMTP id jADGnnRK009613
	for <tiff@lists.maptools.org>; Sun, 13 Nov 2005 19:49:49 +0300
Received: (from dron@localhost)
	by ak4719.spb.edu (8.13.5/8.13.5/Submit) id jADGnmwj009608
	for tiff@lists.maptools.org; Sun, 13 Nov 2005 19:49:48 +0300
From: Andrey Kiselev <dron@ak4719.spb.edu>
Date: Sun, 13 Nov 2005 19:49:48 +0300
To: tiff@lists.maptools.org
Subject: Re: [Tiff] Calculate Offset and can't read ASCII
Message-ID: <20051113164948.GA8954@ak4719.spb.edu>
Mail-Followup-To: tiff@lists.maptools.org
References: <000d01c5e5e3$d51ad6d0$e95305c7@FLMED.LOC>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <000d01c5e5e3$d51ad6d0$e95305c7@FLMED.LOC>
X-GnuPG-Key: http://www.srces.spb.org/dron/export.home.key
X-Face: "t+se9s~+y~[XUH]L|pmeO3Pt/Q@DNv**S, d@_1-C=}/,
	c%<3Qp]eu!ok<"2lYJm$!9qVcg F?7o*L; |$`6|Q|>Rt-cU%2_y@6tQ|`!Li}TsvZvEKx;
	>fuY=fc(=sX^`7Wmw8%SsR`AvM$a; 0U/eN\ P?B\FTyqD, 0np$U2!*'z_4D,
	VPlFf?bN0&zYf"zF0s!7Tl7?$we)xD0@lL>[h|8bhys0i.g|zLnu@C
	Ti@d]i=[!:j1CB\5/TF[m]`lfHfaqSN[0qn@T3zeosV/[LAss{@p_?],x*j8P_9t[}uHD^X-;
	j~\M! gyTly;fj`}&Y~i{<#bN.#QmkE}#T`dxP.I1\.)_MEN{@#W
User-Agent: Mutt/1.5.9i
X-Virus-Scanned: ClamAV version 0.87, clamav-milter version 0.87 on ak4719
X-Virus-Status: Clean
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.00000e25
X-MSP-STORE: Sun, 13 Nov 2005 18:17:25 +0100
Status:   

On Thu, Nov 10, 2005 at 11:44:49AM +0100, Thomas Oldenkott wrote:
> 1) I need a way to calculate the offset of an image. I want to export
> it in a csv-File. Is there a tag? How do I make this?

Yes, it is a tag called StripOffsets (273) and it contains an array of
image chunks offsets. I some cases (ususally when the file is small)
the whole data will be paced in the single chunk, but much more often
there will be several chunks. Corrsponding tag StripByteCounts contains
array of chunks sizes.

> 2) By reading tags in an ASCII format (for example TIFFTAG_DATETIME)
> to an char array I get crazy values.
>     Where is the problem?
>  
>     Example:
>     char IMAGEDATETIME[50];
>     TIFFGetField(tif,306,&IMAGEDATETIME);
>     printf("\nIMAGEDATETIME= %s", IMAGEDATETIME);
>     TIFFSetField(out,306,IMAGEDATETIME);

Hmm, this should work with one except: you don't need to allocate array
for the string, you will get a pointer to already allocated buffer which
you shouldn't free. So it should look like that:

    char *IMAGEDATETIME;
    TIFFGetField(tif,306,&IMAGEDATETIME);
    printf("\nIMAGEDATETIME= %s", IMAGEDATETIME);
    TIFFSetField(out,306,IMAGEDATETIME);

    // If we need to copy data for further needs
    char *NEWDATETIME[20];
    strncmp(NEWDATETIME, IMAGEDATETIME, 20);
    NEWDATETIME[19] = '\0';

Regards,
Andrey


-- 
Andrey V. Kiselev
Home phone:  +7 812 5970603  ICQ# 26871517
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
