Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas013.isp.belgacom.be (localhost [127.0.0.1])
        by inav018.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id k0QE6NES004303
        for <joris.at.lebbeke@skynet.be>; Thu, 26 Jan 2006 15:06:23 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx005.isp.belgacom.be (inmx005.isp.belgacom.be [195.238.5.148])
        by inas013.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id k0QE68XN030784
        for <joris.at.lebbeke@skynet.be>; Thu, 26 Jan 2006 15:06:19 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx005.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id k0QE60BZ004899
        for <joris.at.lebbeke@skynet.be>; Thu, 26 Jan 2006 15:06:00 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id k0QE0MdY028317;
	Thu, 26 Jan 2006 09:00:53 -0500
Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.194])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id k0QE0IWA028314
	for <tiff@lists.maptools.org>; Thu, 26 Jan 2006 09:00:19 -0500
Received: by zproxy.gmail.com with SMTP id i28so351021nzi
	for <tiff@lists.maptools.org>; Thu, 26 Jan 2006 06:00:18 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com;
	h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
	b=UsBaWLy7TtrBR6FPO3NPioGiB1Ge5JhWCMvfKlqWPjvi+avJidMxr8BgHaU+cyQLE4/TCiGgmjDfEj6x8qLWUsWuXG1l54ViSS3k7biBoxeRkgFTKP0Cd2CMbR7F/Dq5FdzQBuS+hW/Zrum32VvlzlikrC65loKxjiYEYH3zeOY=
Received: by 10.65.113.8 with SMTP id q8mr1372654qbm;
	Thu, 26 Jan 2006 06:00:17 -0800 (PST)
Received: by 10.65.151.20 with HTTP; Thu, 26 Jan 2006 06:00:17 -0800 (PST)
Message-ID: <931f8ea90601260600h4b7245efq137ee4be9c8b4a3c@mail.gmail.com>
Date: Thu, 26 Jan 2006 09:00:17 -0500
From: Frank Warmerdam <warmerdam@pobox.com>
To: Roland Richter <roland@flll.jku.at>
Subject: Re: [Tiff] Dead directories after TIFFRewriteDirectory()
In-Reply-To: <43D693BD.7040402@flll.jku.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: inline
References: <43D693BD.7040402@flll.jku.at>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by duke.maptools.org id
	k0QE0IWA028314
Cc: tiff@lists.maptools.org
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
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>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.000011d9
X-MSP-STORE: Thu, 26 Jan 2006 15:06:25 +0100
Status:   

On 1/24/06, Roland Richter <roland@flll.jku.at> wrote:
>   As far as I can tell from the directory offsets, it
>   simply appended the new directoy 1 to the end of the
>   file, and didn't remove directory 2.
>
>   So, obviously I've got two "dead" directories within
>   that TIFF:
>
>   (old1) (old2) new1

Roland,

You are correct.  Rewriting directories will generally
result in dead ones getting left behind.

>   How can I prevent that?
>
>   Or, is there a way to "defrag" the TIFF file, i.e.
>   get rid of those dead directories?

Copying the file with tiffcp will get rid of the dead
directories, but it will also lose custom tags.   You
might want to build your own "copier" to defrag the
files, if this is important enough to you.  It might also
be that there are copying programs that will carry along
all existing tags (custom or otherwise) but libtiff is not
very handy for this.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

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