Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-l.b-one.net (mx-l.one.com [91.198.169.59])
	by mail9.b-one.net (Postfix) with ESMTP id 8DA24400122
	for <info@awaresystems.be>; Tue, 14 Apr 2009 18:45:04 +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-l.b-one.net (Postfix) with ESMTP id B8CEC1D1B407
	for <info@awaresystems.be>; Tue, 14 Apr 2009 18:45:03 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id E4BE51D1E46F0;
	Tue, 14 Apr 2009 11:44:29 -0500 (EST)
Received: from blade.simplesystems.org (blade.simplesystems.org [65.66.246.74])
	by lists.maptools.org (Postfix) with ESMTPS id 792DB1D1E46E3
	for <tiff@lists.maptools.org>; Tue, 14 Apr 2009 11:42:53 -0500 (EST)
Received: from freddy.simplesystems.org (freddy.simplesystems.org
	[65.66.246.65])
	by blade.simplesystems.org (8.13.8+Sun/8.13.8) with ESMTP id
	n3EGgoEw003296; Tue, 14 Apr 2009 11:42:50 -0500 (CDT)
Date: Tue, 14 Apr 2009 11:42:50 -0500 (CDT)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@freddy.simplesystems.org
To: Christian Henning <chhenning@gmail.com>
In-Reply-To: <949801310904140852p11d06dc9kc8bed8b6a951a297@mail.gmail.com>
Message-ID: <Pine.SOC.4.64.0904141137220.1450@freddy.simplesystems.org>
References: <949801310904081356r2528fa98tfefc596b77ccf988@mail.gmail.com>
	<949801310904130750m50f35d0fkb17fbc04b38c5b23@mail.gmail.com>
	<49E3636E.9030405@pobox.com>
	<949801310904140852p11d06dc9kc8bed8b6a951a297@mail.gmail.com>
MIME-Version: 1.0
Cc: libtiff - Liste <tiff@lists.maptools.org>
Subject: Re: [Tiff] writing 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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

On Tue, 14 Apr 2009, Christian Henning wrote:
>
> I believe there are two bugs in tif_stream.cxx. For some reasons
> libtiff is try to seek before writing anything. This has two
> ramifications:

A seek followed by a write is commonly used to establish the file 
length, or sometimes just because it is possible.  Operating systems 
arrange to "fill in the gap" via various approaches, which often 
result in zero-valued bytes.  If the seek is past the current length, 
then it is reasonable to memset the difference with null bytes.

> The newest beta of libtiff4 still doesn't work. The console output is
> as follows:
>
> seek: 0
> write: 8
> seek: 0
> error: Maximum TIFF file size exceeded

Note that libtiff4 uses 64-bit offsets and returns -1 cast to a 64-bit 
type to report errors for functions which return an offset or 64-bit 
size.  Without great care this can cause problems.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
