Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-f.b-one.net (mx-f.one.com [91.198.169.53])
	by mail9.b-one.net (Postfix) with ESMTP id F13A8400122
	for <info@awaresystems.be>; Tue,  7 Apr 2009 16:20:44 +0200 (CEST)
X-Virus-Scanned: by one.com
X-Spam-Score: 0
X-Spam-Level: 
X-Spam-Status: No, score=0 tagged_above=0 required=6 tests=[none]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144])
	by mx-f.b-one.net (Postfix) with ESMTP id 461302800130
	for <info@awaresystems.be>; Tue,  7 Apr 2009 16:20:44 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 79C5A1D185AE0;
	Tue,  7 Apr 2009 09:20:10 -0500 (EST)
Received: from mail.sidefx.com (mail.sidefx.com [38.99.137.163])
	by lists.maptools.org (Postfix) with ESMTP id BDBFF1D185AE0
	for <tiff@lists.maptools.org>; Tue,  7 Apr 2009 09:13:57 -0500 (EST)
Message-ID: <49DB5F9F.4070707@sidefx.com>
Date: Tue, 07 Apr 2009 10:13:51 -0400
From: Edward Lam <edward@sidefx.com>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Christian Henning <chhenning@gmail.com>
References: <949801310904060835p31b40e63h37e6c4a2073124f6@mail.gmail.com>	<Pine.SOC.4.64.0904061126010.29632@freddy.simplesystems.org>	<949801310904061110l46100831x4ca81e87b2855361@mail.gmail.com>	<Pine.SOC.4.64.0904061337240.29632@freddy.simplesystems.org>
	<949801310904070644l7ca0acr7654ab64e060d01c@mail.gmail.com>
In-Reply-To: <949801310904070644l7ca0acr7654ab64e060d01c@mail.gmail.com>
Cc: libtiff - Liste <tiff@lists.maptools.org>
Subject: Re: [Tiff] Writing tiff to in-memory buffer
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

Christian Henning wrote:
> Fixing that gives me a valid TIFF*. I also need to setup my seek_proc
> to prohibit it from seeking on an empty ostream. Doing though would
> raise the failbit. I don't understand why TIFFClientOpen is calling
> seek_proc( 0,0). It seems redundant to me.

This was noted a while back when tif_stream.cxx was tested (see 
http://www.asmail.be/msg0055045547.html). It was thought to be a bug at 
the time, but then later resolved to be correct. Unfortunately, I can no 
longer find the subsequent discussion that resolved it in libtiff bug 
database. (I forget whether the bug was logged before the libtiff bugdb 
migration.)

Here is the current comment from the trunk source:
/*
  * The doc for "fopen" for some STD_C_LIBs says that if you
  * open a file for modify ("+"), then you must fseek (or
  * fflush?) between any freads and fwrites.  This is not
  * necessary on most systems, but has been shown to be needed
  * on Solaris.
  */
TIFFSeekFile( tif, 0, SEEK_SET );

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