Return-Path: <tiff-bounces@lists.maptools.org>
Delivered-To: info@awaresystems.be
Received: (qmail 1833 invoked from network); 18 Nov 2008 02:18:27 -0000
Received: from janet.telenet-ops.be ([195.130.136.6])
          (envelope-sender <tiff-bounces@lists.maptools.org>)
          by angelia.telenet-ops.be (qmail-ldap-1.03) with SMTP
          for <info@awaresystems.be>; 18 Nov 2008 02:18:27 -0000
Received: from mindy.telenet-ops.be (mindy.telenet-ops.be [195.130.136.8])
	by janet.telenet-ops.be (8.13.1/8.13.1) with ESMTP id mAI2IRqW003977
	for <info@awaresystems.be>; Tue, 18 Nov 2008 03:18:27 +0100
Received: from localhost (localhost.localdomain [127.0.0.1])
	by mindy.telenet-ops.be (Postfix) with SMTP id 809B860007
	for <info@awaresystems.be>; Tue, 18 Nov 2008 03:18:27 +0100 (CET)
Received: from penia.telenet-ops.be (penia.telenet-ops.be [195.130.132.39])
	by mindy.telenet-ops.be (Postfix) with ESMTP id 7A1DD60005
	for <info@awaresystems.be>; Tue, 18 Nov 2008 03:18:27 +0100 (CET)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153])
	by penia.telenet-ops.be (Postfix) with ESMTP id 1B21F33E604
	for <info@awaresystems.be>; Tue, 18 Nov 2008 03:18:26 +0100 (CET)
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 mAI2Ecow032026;
	Mon, 17 Nov 2008 21:16:09 -0500
Received: from emailgw01.pnl.gov (emailgw01.pnl.gov [192.101.109.33])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id mAI2EZ3E032023
	for <tiff@lists.maptools.org>; Mon, 17 Nov 2008 21:14:35 -0500
X-IronPort-AV: E=Sophos;i="4.33,621,1220252400"; d="scan'208";a="86314969"
Received: from emailbh03.pnl.gov ([130.20.249.81])
	by emailgw01.pnl.gov with ESMTP; 17 Nov 2008 18:14:33 -0800
Received: from EMAIL01.pnl.gov ([130.20.128.220]) by emailbh03.pnl.gov with
	Microsoft SMTPSVC(6.0.3790.1830); Mon, 17 Nov 2008 18:14:33 -0800
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Date: Mon, 17 Nov 2008 18:14:32 -0800
Message-ID: <9EA84B4DE79CD74F89F814624913B70506AF4143@EMAIL01.pnl.gov>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Creating a tiled tiff from scratch (essentially)
Thread-Index: AclJI2VT4Rf1z3CaSMqldZWVTg+EjA==
From: "Beck, Tucker A" <Tucker.Beck@pnl.gov>
To: <tiff@lists.maptools.org>
X-OriginalArrivalTime: 18 Nov 2008 02:14:33.0193 (UTC)
	FILETIME=[6579BD90:01C94923]
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by duke.maptools.org id
	mAI2EZ3E032023
Subject: [Tiff] Creating a tiled tiff from scratch (essentially)
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-SpamCatcher-Score: 50 [XX]


I am using libtiff in an image processing application.  The input images are tiled, multi-image, JPEG compressed tiff files.  I have had great success in opening, converting, and processing the image data using libtiff.  Now, I need to be able to store the results of processing in a new tiff file.  I have encountered a few problems along the way.

When I create the tiff file, I would like to set up each directory when I create the file.  I do not want to store any image data in them at creation, I just want them to be ready for writing data when it needs to be done.  There are somewhere between 3 and 7 directories that I need to make.  It seems like the only way to do this is to set all the fields for the directory, write a single dummy tile (using TIFFWriteTile) and then write the directory (TIFFWriteDirectory).  This seems like an ugly way to do things; I'd rather not have to write any data until absolutely necessary.  If I try to write the directory without having written a tile, I get a message that says, "MissingRequired: lib/op.svs: TIFF directory is missing required "TileOffsets" field."  Is there any way to set up the directory with all the fields correctly assigned, but no data yet written?

Are there any tutorials/guides/example code out there that show a tiled tif being built from scratch?  I would love to see a similar example to what I am trying to do.

Any help is greatly appreciated.

Tucker Beck
Software Developer
Washington State University / Pacific Northwest National Laboratory  

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