Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx-r.one.com (mx-r.one.com [91.198.169.249])
	by mail6.local (Postfix) with ESMTP id 0D5EE300238325
	for <filtered@awaresystems.be>; Fri, 20 Jun 2014 13:48:37 +0000 (UTC)
X-Virus-Scanned: by one.com
X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "MIME-Version"
Received-SPF: pass (mx-r: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.217.181 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181])
	by mx-r.one.com (Postfix) with ESMTP id D3C1F205A33F9
	for <filtered@awaresystems.be>; Fri, 20 Jun 2014 13:48:36 +0000 (UTC)
Received: by mail-lb0-f181.google.com with SMTP id p9so2327698lbv.40
        for <filtered@awaresystems.be>; Fri, 20 Jun 2014 06:48:36 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-original-authentication-results:delivered-to:delivered-to
         :mime-version:message-id:from:to:date:importance:sensitivity
         :in-reply-to:references:cc:subject:precedence:list-id
         :list-unsubscribe:list-archive:list-post:list-help:list-subscribe
         :content-type:mime-version:sender:errors-to;
        bh=XcuqFF1MFt5G7KSqvG3ixU+1npp4T+V6jzwG0+DqaLE=;
        b=ctXWn4RwtV3rOOVQVxSLu2M3ZO9aEhvMd9Cy3dTs1S+1Hzyk+K2oL7ks+RHeN2Wvct
         Be8v5rYjQBnMYFiaLAPAlqgMsfKcprI8c8XCOg44W7Lc9KHNc+aj8hkm7kxs0Menv14j
         reRoqArEvncIbdU9jsB+aj0yUwO2hVl/QYkH9HnHgF9RLl+sSTF+K41bDcVssCqWni0h
         a2Qmas/oDpnxnqMmWcEimQaFSvf84sKTEq0KJzJJ7Fchxb4q/20b56Wg0jW2RiyQrFcw
         lNknEt3KtdCiJpJDG0f/ZGgT4+UQFupT4XzYdOIMs9uYjmsrQW7Wf0E569aFs9t4wm9j
         hLGQ==
X-Original-Authentication-Results: mx.google.com;       spf=neutral (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) smtp.mail=tiff-bounces@lists.maptools.org
X-Received: by 10.112.16.40 with SMTP id c8mr2469544lbd.17.1403272116463;
        Fri, 20 Jun 2014 06:48:36 -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.114.18.137 with SMTP id w9csp178069ldd;
        Fri, 20 Jun 2014 06:48:35 -0700 (PDT)
X-Received: by 10.112.64.33 with SMTP id l1mr1532735lbs.79.1403272115206;
        Fri, 20 Jun 2014 06:48:35 -0700 (PDT)
Authentication-Results: mx.google.com;
       spf=neutral (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) smtp.mail=tiff-bounces@lists.maptools.org
Received-SPF: none (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) client-ip=91.198.169.63;
Received: by 10.112.73.132 with POP3 id l4mf1417999lbv.37;
        Fri, 20 Jun 2014 06:48:35 -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-p.one.com (mx-p.one.com [91.198.169.63])
	by mail6.local (Postfix) with ESMTP id 07029300238320
	for <info@awaresystems.be>; Fri, 20 Jun 2014 13:24:31 +0000 (UTC)
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 (ks365428.kimsufi.com [94.23.4.142])
	by mx-p.one.com (Postfix) with ESMTP id 95D1740A600D3
	for <info@awaresystems.be>; Fri, 20 Jun 2014 13:24:30 +0000 (UTC)
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 797C935C023;
	Fri, 20 Jun 2014 08:23:45 -0500 (EST)
Received: from mout.gmx.net (mout.gmx.net [212.227.17.21])
	by lists.maptools.org (Postfix) with ESMTPS id 9D42335C023
	for <tiff@lists.maptools.org>; Fri, 20 Jun 2014 08:23:19 -0500 (EST)
Received: from [146.140.216.16] by 3capp-gmx-bs36.server.lan (via HTTP);
	Fri, 20 Jun 2014 15:23:19 +0200
MIME-Version: 1.0
Message-ID: <trinity-42718f24-e251-4e52-9ac4-145ab0691709-1403270598852@3capp-gmx-bs36>
From: =?UTF-8?Q?=22Benedikt_F=C3=BChrer=22?= <Banshee999@gmx.de>
To: "Olivier Paquet" <olivier.paquet@gmail.com>
Date: Fri, 20 Jun 2014 15:23:19 +0200
Importance: normal
Sensitivity: Normal
In-Reply-To: <CAAcuQeb-zYkKaHXxCzqmxvG-27eMjwVUMtcQ+EfCa_3uQtpQww@mail.gmail.com>
References: <trinity-402562ba-f539-4e48-8b23-f04357aa30b7-1402998363797@3capp-gmx-bs38>,
	<CAAcuQeb-zYkKaHXxCzqmxvG-27eMjwVUMtcQ+EfCa_3uQtpQww@mail.gmail.com>
X-UI-Message-Type: mail
X-Priority: 3
X-Provags-ID: V03:K0:ctoRqpl45JuiOoAhkmnfDftpIe1uBV4UE09v95/DGYW
	q5NEMaeOJeOE76ekk+UGoBds5sQ/RHO61ZYyHlo7iZxDcYjRK3
	vLD0rBJr7gHStYKEx88aCe7qz4j83eow7qmdRy9+iim+NZurjv
	Y6hVkXqgiZpLyntxd5E/oygyrHmhc7n3Bikd5owxgGbLXbYXL+
	/jDnD9unc9PoieRda0XzSd9qHMdyZ//nr8BopuG2M4tcmLA88s
	goqoJYTuwZQDSZPnJtQeyUbRZE2gO5vWF7uDM3KLWNis7IiPdL 4XVWEA=
Cc: TIFF mailing list <tiff@lists.maptools.org>
Subject: Re: [Tiff] In-memory tiffs
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="===============0390156844=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

--===============0390156844==
Content-Type: text/html; charset=UTF-8

<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hey Olivier,</div>

<div>&nbsp;</div>

<div>yes, you&#39;re completely right. I&#39;ve also tracked it down thus far by myself already.</div>

<div>I finally succeeded in compiling libtiff with debug information (just had to add the according compiler flag in a make config file) and can now step through the source - really helpful.</div>

<div>I&#39;ve also tried using a stringstream already but the same problem still persists: When trying to write a 2nd directory, libtiff tries to read the first directory from the stream. Now as you said, the ostringstream interface doesn&#39;t support reading. However, even if I&#39;m using a stringstream which inherits both, istream and ostream, I&#39;m still forced to interpret it as either one when passing the pointer to TIFFStreamOpen. Interpreting it as an istream doesn&#39;t make any sense at that point because libtiff will then try to read an existing tiff image from memory and fail when it can&#39;t read a tiff header from the empty stream. So I&#39;m still forced to adhere to the ostream interface which still doesn&#39;t support reading (_tiffosRead contains of only one statement: return 0).</div>

<div>&nbsp;</div>

<div>And that I find, is somewhat strange because I doubt I&#39;m the first person who wants to use it like that. How was this supposed to be done then?</div>

<div>&nbsp;
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b>&nbsp;Donnerstag, 19. Juni 2014 um 23:48 Uhr<br/>
<b>Von:</b>&nbsp;&quot;Olivier Paquet&quot; &lt;olivier.paquet@gmail.com&gt;<br/>
<b>An:</b>&nbsp;&quot;Benedikt F&uuml;hrer&quot; &lt;Banshee999@gmx.de&gt;<br/>
<b>Cc:</b>&nbsp;&quot;TIFF mailing list&quot; &lt;tiff@lists.maptools.org&gt;<br/>
<b>Betreff:</b>&nbsp;Re: [Tiff] In-memory tiffs</div>

<div name="quoted-content">
<div>
<div class="gmail_extra">
<div class="gmail_quote">2014-06-17 5:46 GMT-04:00 &quot;Benedikt F&uuml;hrer&quot; <span>&lt;<a href="Banshee999@gmx.de" target="_parent">Banshee999@gmx.de</a>&gt;</span>:

<blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>&nbsp;</div>

<div>1) I&#39;m using the helper functions TIFFStreamOpen to try to write multi-directory tiffs into an ostringstream in binary mode. It works perfectly fine for the first directory but as soon as I call TIFFWriteDirectory the 2nd time, it will fail with the error message &quot;Couldn&#39;t fetch directory count&quot;. What am I doing wrong here? I&nbsp;</div>
</div>
</div>
</blockquote>

<div>&nbsp;</div>

<div>I haven&#39;t use those in a long time but I think ostringstream is write-only. The only thing you can read is the completed &quot;string&quot;. You should probably use a stringstream instead so you can both read and write. I&#39;m fairly certain libtiff needs to be able to read back data it has previously written to a file.</div>

<div>&nbsp;</div>

<div>Olivier</div>
</div>
</div>
</div>
_______________________________________________ Tiff mailing list: Tiff@lists.maptools.org <a href="http://lists.maptools.org/mailman/listinfo/tiff" target="_blank">http://lists.maptools.org/mailman/listinfo/tiff</a> <a href="http://www.remotesensing.org/libtiff/" target="_blank">http://www.remotesensing.org/libtiff/</a></div>
</div>
</div>
</div></div></body></html>

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