Return-Path: <tiff-bounces@remotesensing.org>
Received: from inmx014.isp.belgacom.be (inmx014.isp.belgacom.be [195.238.2.217])
        by mailst035.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id iB9ACe04031021
        for <joris.at.lebbeke@skynet.be>; Thu, 9 Dec 2004 11:12:40 +0100
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx014.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id iB9ACSkw015770
        for <joris.at.lebbeke@skynet.be>; Thu, 9 Dec 2004 11:12:30 +0100
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id 2ABCB4EBA62; Thu,  9 Dec 2004 05:12:14 -0500 (EST)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from outmx014.isp.belgacom.be (outmx014.isp.belgacom.be
	[195.238.2.69])
	by xserve.flids.com (Postfix) with ESMTP id 760AA4EBA4C
	for <tiff@remotesensing.org>; Thu,  9 Dec 2004 05:12:11 -0500 (EST)
Received: from outmx014.isp.belgacom.be (localhost [127.0.0.1])
	by outmx014.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with
	ESMTP id iB9AC7ba018556
	for <tiff@remotesensing.org>; Thu, 9 Dec 2004 11:12:07 +0100
	(envelope-from <joris.at.lebbeke@skynet.be>)
Received: from dfgrrxsknr4e (159-180.245.81.adsl.skynet.be [81.245.180.159])
	by outmx014.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with SMTP
	id iB9AC6Lh018513; Thu, 9 Dec 2004 11:12:06 +0100
	(envelope-from <joris.at.lebbeke@skynet.be>)
Message-ID: <001701c4ddd7$a0a76a90$9fb4f551@dfgrrxsknr4e>
From: "Joris" <joris.at.lebbeke@skynet.be>
To: <tiff@remotesensing.org>, "Chris Losinger" <losinger@earthlink.net>
References: <003701c4dc9d$b2c52fe0$5eb1f551@dfgrrxsknr4e><BDDBEC9A.2C99E%eric.vergnaud@jlynx.com><6.2.0.14.2.20041207212848.02cd6880@pop.earthlink.net><b35303704120801317626cafb@mail.gmail.com><6.2.0.14.2.20041208073835.02cf9be8@pop.earthlink.net><000c01c4dd24$40ed9650$7abaf551@dfgrrxsknr4e>
	<6.2.0.14.2.20041208212744.02dac138@pop.earthlink.net>
Subject: Re: [Tiff] Q: writing tiled TIFFs
Date: Thu, 9 Dec 2004 11:12:39 +0100
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Cc: 
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
X-UIDL: 5aba7f5efe4fb8676be4961ffe5bb6f6

> if i have a tile size of 256x256 and a 200x200 image, how should i
> fill the tile buffer before calling TIFFWriteTile? LibTiff doesn't give me
> any errors when i go to write it, so i assume it's a legal tile size. but,
> the image pixels are messed up (looks like row length is wrong somewhere).

Are you properly padding stuff, so as to end up with 256 lines of 256 pixels? If
not, you ought to.

However, I wouldn't write such a TIFF as tiled, even though you can. If you
consider 256x256 good tile sizes, then the following is not necessary, but it is
'smart' tiff writing with all benefits of tiled storage where they are real
benefits, and never much padding compared to image size:

if image width and image height are both <= 256 then
  write as single strip, strip height equal to image height
else if image width <= 256 then
  write as strip TIFF, strip height 256
else if image height <= 256 then
  write as tile TIFF, tile size 256 x image height
else
  write as tile TIFF, tile size 256 x 256


Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html

_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
