Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx-w.one.com (mx-w.one.com [195.47.247.148])
	by mail6.local (Postfix) with ESMTP id 26B483000C5DA9
	for <filtered@awaresystems.be>; Thu, 24 Apr 2014 05:11:57 +0000 (UTC)
X-Virus-Scanned: by one.com
Received-SPF: pass (mx-w: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.217.178 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178])
	by mx-w.one.com (Postfix) with ESMTP id ED825260711B3
	for <filtered@awaresystems.be>; Thu, 24 Apr 2014 05:11:56 +0000 (UTC)
Received: by mail-lb0-f178.google.com with SMTP id s7so1611160lbd.9
        for <filtered@awaresystems.be>; Wed, 23 Apr 2014 22:11:56 -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
         :message-id:in-reply-to:references:date:from:to:user-agent
         :mime-version:importance:subject:precedence:list-id:list-unsubscribe
         :list-archive:list-post:list-help:list-subscribe:content-type
         :content-transfer-encoding:sender:errors-to;
        bh=DOBlT05KigZJoHNiqgyLnZ5O8pzY7H99tk8fHi83C3w=;
        b=eS3bFXxrK6jD3z2YvrPIy4R1u/Dmf7hc/egBG3alsdj9uMfaFieRtS1hd01dTT3PRX
         2nRY5UJRlgVtWJpy05onOk5C9vs7PRynBcgZOKh73me9q3ALsMBaH06egMuhzirGA1/U
         76GGvgWmA+DvpB7SsYI2nX3vQD+sE6EXCbsv6vL+QCWOAmOCYjEL7QTLgXX19TZ0GEX/
         f+viGJtC01nJVgrwkN/rEnYaVoEPXXVb+qAJ9KJgwqmqhWyWouzvcmUjbQzXYVnK39fA
         ZGldFV8UoDP2iKvyhUs8G8Ov+8BMbT5RZzUSaPUGlHr2jBDcxAxR/9jRp5eWw7NMbUc8
         yanQ==
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.160.168 with SMTP id xl8mr34728708lbb.3.1398316316551;
        Wed, 23 Apr 2014 22:11:56 -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.11.132 with SMTP id q4csp59498ldb;
        Wed, 23 Apr 2014 22:11:55 -0700 (PDT)
X-Received: by 10.152.5.202 with SMTP id u10mr34024lau.42.1398316314333;
        Wed, 23 Apr 2014 22:11:54 -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.61;
Received: by 10.112.18.7 with POP3 id s7mf1194039lbd.3;
        Wed, 23 Apr 2014 22:11:54 -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-n.one.com (mx-n.one.com [91.198.169.61])
	by mail6.local (Postfix) with ESMTP id AC5623000C5DA1
	for <info@awaresystems.be>; Thu, 24 Apr 2014 04:57:34 +0000 (UTC)
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-n.one.com (Postfix) with ESMTP id 85713296A173C
	for <info@awaresystems.be>; Thu, 24 Apr 2014 04:57:34 +0000 (UTC)
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 92A5335C03B;
	Wed, 23 Apr 2014 23:56:51 -0500 (EST)
Received: from mail.sidefx.com (mail.sidefx.com [38.99.137.163])
	by lists.maptools.org (Postfix) with ESMTPS id A25C535C033
	for <tiff@lists.maptools.org>; Wed, 23 Apr 2014 23:56:12 -0500 (EST)
Received: from www.sidefx.com (www.sidefx.com [38.99.137.165])
	by mail.sidefx.com (Postfix) with ESMTP id 8D8C95C160
	for <tiff@lists.maptools.org>; Thu, 24 Apr 2014 00:56:10 -0400 (EDT)
Received: from 99.237.207.178 (SquirrelMail authenticated user edward)
	by www.sidefx.com with HTTP; Thu, 24 Apr 2014 00:56:10 -0400 (EDT)
Message-ID: <55312.99.237.207.178.1398315370.squirrel@www.sidefx.com>
In-Reply-To: <CA+dQZa=4eUTTNpfOdEx2oiv3aXBKaCUJQbhcjm9mQ_d4zaxs5w@mail.gmail.com>
References: <CA+dQZa=4eUTTNpfOdEx2oiv3aXBKaCUJQbhcjm9mQ_d4zaxs5w@mail.gmail.com>
Date: Thu, 24 Apr 2014 00:56:10 -0400 (EDT)
From: "Edward Lam" <edward@sidefx.com>
To: tiff@lists.maptools.org
User-Agent: SquirrelMail/1.4.9a
MIME-Version: 1.0
X-Priority: 3 (Normal)
Importance: Normal
Subject: Re: [Tiff] Custom EXIF write does not work for stream writer
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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

On Tue, April 22, 2014 22:13, Chia-Kai Liang wrote:
> I tried to use the  EXIF directory read/write as described in
> http://www.asmail.be/msg0055060707.html, and find it would fail for
> stringstream
>
> If I replace
>
>    tif = TIFFOpen(filename, "w+");
>
> in the example code to
>
>     std::stringstream buf_stream;
>
>     tif = TIFFStreamOpen("MemTIFF", (std::ostream*)&buf_stream);
>
> I would get the following error at TIFFSetDirectory(tif, 0):
>
> TIFFFetchDirectory: MemTIFF: Can not read TIFF directory count.
> TIFFReadDirectory: Failed to read directory at offset 22688648.

Does using ostringstream instead of stringstream make a difference?

-Edward

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