Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx05.one.com (mx05.one.com [195.47.247.76])
	by mail6.b-one.net (Postfix) with ESMTP id 197F8801670EE
	for <filtered@awaresystems.be>; Tue, 25 Sep 2012 17:59:00 +0200 (CEST)
X-Virus-Scanned: by one.com
X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "MIME-Version"
Received-SPF: pass (mx05: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.220.176 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176])
	by mx05.one.com (Postfix) with ESMTP id A739B5AAFC53
	for <filtered@awaresystems.be>; Tue, 25 Sep 2012 15:58:59 +0000 (UTC)
Received: by vcbgb22 with SMTP id gb22so10026904vcb.21
        for <filtered@awaresystems.be>; Tue, 25 Sep 2012 08:58:59 -0700 (PDT)
Received: by 10.52.33.130 with SMTP id r2mr7587099vdi.43.1348588738903;
        Tue, 25 Sep 2012 08:58:58 -0700 (PDT)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.58.70.138 with SMTP id m10csp1195988veu;
        Tue, 25 Sep 2012 08:58:58 -0700 (PDT)
Received: by 10.52.31.66 with SMTP id y2mr7639234vdh.122.1348588737610;
        Tue, 25 Sep 2012 08:58:57 -0700 (PDT)
Received-SPF: neutral (google.com: 91.198.169.58 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) client-ip=91.198.169.58;
Received: by 10.220.20.141 with POP3 id f13mf221758vcb.15;
        Tue, 25 Sep 2012 08:58:57 -0700 (PDT)
X-Gmail-Fetch-Info: info@awaresystems.be 1 pop.awaresystems.be 110 info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-k.one.com (mx-k.one.com [91.198.169.58])
	by mail6.b-one.net (Postfix) with ESMTP id A9C8E801049E9
	for <info@awaresystems.be>; Tue, 25 Sep 2012 17:49:05 +0200 (CEST)
X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "MIME-Version"
X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144])
	by mx-k.one.com (Postfix) with ESMTP id 495A85F0DFC
	for <info@awaresystems.be>; Tue, 25 Sep 2012 15:49:05 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 27A2343A016;
	Tue, 25 Sep 2012 10:47:29 -0500 (EST)
Received: from mail-ob0-f172.google.com (mail-ob0-f172.google.com
	[209.85.214.172])
	by lists.maptools.org (Postfix) with ESMTPS id 5E4D143A016
	for <tiff@lists.maptools.org>; Tue, 25 Sep 2012 10:41:05 -0500 (EST)
Received: by obqv19 with SMTP id v19so310516obq.3
	for <tiff@lists.maptools.org>; Tue, 25 Sep 2012 08:41:06 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.60.170.110 with SMTP id al14mr5847568oec.120.1348587666845;
	Tue, 25 Sep 2012 08:41:06 -0700 (PDT)
Received: by 10.76.85.8 with HTTP; Tue, 25 Sep 2012 08:41:06 -0700 (PDT)
Date: Tue, 25 Sep 2012 17:41:06 +0200
Message-ID: <CADH5xWqC9fXQwyZDM8AGKo0CDsDWL9jBo6Ptnd0BUPw16Am52A@mail.gmail.com>
From: Jorge Martin <jormarfe@gmail.com>
To: tiff@lists.maptools.org
Subject: [Tiff] Error writing multi-page TIFF
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="===============1889670511=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

--===============1889670511==
Content-Type: multipart/alternative; boundary=bcaec54ee1c0d4b22e04ca888813

--bcaec54ee1c0d4b22e04ca888813
Content-Type: text/plain; charset=ISO-8859-1

Hello,

       I get the following error message when calling TIFFWriteDirectory
for a multi-page generation: "TIFFLinkDirectory: Error fetching directory
count. ". This error appears when TIFFWriteDirectory is used to write the
second image. I have never seen this type of error generating multi-page
TIFF files

       Please find below a brief fragment of my code:


   NumSubImage = 4;

   TIFF * m_TIFFptr = XTIFFOpen(FileName, "w");

   for(int i = 0; i < NumSubImage ; i++)
   {

    // Function that writes the TAGs
    WriteTags(TIFF_ptr);

    // Function that writes the tiff values
    WriteTiff(TIFF_ptr);

      // Check to not call TIFFWriteDirectory in last page
     if(  ( i + 1 )  < NumSubImage )
     {
          if( TIFFWriteDirectory(TIFF_ptr ) == 0)
          {
               cout<<"Error in TIFFWriteDirectory" <<endl;
          }
      }

    }


Best Regards,

Jorge

--bcaec54ee1c0d4b22e04ca888813
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello,<div><br></div><div>=A0 =A0 =A0 =A0I get the following error message =
when calling TIFFWriteDirectory for a multi-page generation: &quot;TIFFLink=
Directory: Error fetching directory count. &quot;. This error appears when =
TIFFWriteDirectory is used to write the second image. I have never seen thi=
s type of error generating multi-page TIFF files</div>
<div><br></div><div>=A0 =A0 =A0 =A0Please find below a brief fragment of my=
 code:</div><div><br></div><div>=A0 =A0</div><div>=A0 =A0NumSubImage =3D 4;=
</div><div><br></div><div>=A0 =A0TIFF * m_TIFFptr =3D XTIFFOpen(FileName, &=
quot;w&quot;);</div>
<div><br></div><div>=A0 =A0for(int i =3D 0; i &lt;=A0NumSubImage=A0; i++)</=
div><div>=A0 =A0{</div><div><br></div><div>=A0 =A0 // Function that writes =
the TAGs</div><div>=A0 =A0 WriteTags(TIFF_ptr);</div><div><br></div><div><d=
iv>=A0 =A0 // Function that writes the tiff values</div>
<div>=A0 =A0 WriteTiff(TIFF_ptr);</div></div><div><br></div><div>=A0 =A0 =
=A0 // Check to not call TIFFWriteDirectory in last page</div><div>=A0 =A0 =
=A0if( =A0( i + 1 ) =A0&lt;=A0NumSubImage=A0)</div><div>=A0 =A0 =A0{</div><=
div>=A0 =A0 =A0 =A0 =A0 if( TIFFWriteDirectory(TIFF_ptr=A0) =3D=3D 0)</div>
<div>=A0 =A0 =A0 =A0 =A0 {</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cout&lt=
;&lt;&quot;Error in=A0TIFFWriteDirectory&quot; &lt;&lt;endl;</div><div>=A0 =
=A0 =A0 =A0 =A0 }</div><div>=A0 =A0 =A0 }</div><div><br></div><div>=A0 =A0 =
}=A0=A0</div><div><br></div><div><br></div><div>
Best Regards,</div><div><br></div><div>Jorge</div>

--bcaec54ee1c0d4b22e04ca888813--

--===============1889670511==
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/
--===============1889670511==--
