Received: from mailgate003.isp.belgacom.be (mailgate003.isp.belgacom.be [195.238.6.88])
	by maildelivery005.isp.belgacom.be (Postfix) with ESMTP id C1183164002
	for <joris.at.lebbeke@skynet.be>; Fri, 17 Aug 2007 21:23:28 +0200 (CEST)
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 17 Aug 2007 21:23:28 +0200
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 l7HJA55f012078;
	Fri, 17 Aug 2007 15:10:10 -0400
Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.244])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l7HJA2Vb012075
	for <tiff@lists.maptools.org>; Fri, 17 Aug 2007 15:10:02 -0400
Received: by an-out-0708.google.com with SMTP id d31so63032and
	for <tiff@lists.maptools.org>; Fri, 17 Aug 2007 12:10:00 -0700 (PDT)
DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta;
	h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
	b=Nevj/B7rLJccBcn7rhqlNY2p8ACjFRbsOcbIfAJgXGBs/V4xdMsbsgfTANwTvk9TlGasnjtv+9t5b6vIUQbgXiSK7fMqkuY3EPZW/6D2POPTGRqSEohqnRZx7ccua+cR9dE4o20p3TKYyxR3BJ8PW12n25Tvco3cdCLXYAi5XIg=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta;
	h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
	b=BJPCGHjsT0cLTLsW+ZZls8naShqSeHRqSsq/IZzpAjejn2qQx2iZsiZzTU5RZMXYx3RNAWQ700U36vtm1si+WI0GmO5EYgId+knAjxCuXaxpz9DJLJarb5lQz2vSsEarDXtC+KbjpE5Suiy0wgx3R/8/mHC7YMSwGZV42UeGJYY=
Received: by 10.90.113.20 with SMTP id l20mr5086383agc.1187377800490;
	Fri, 17 Aug 2007 12:10:00 -0700 (PDT)
Received: by 10.100.151.10 with HTTP; Fri, 17 Aug 2007 12:10:00 -0700 (PDT)
Message-ID: <949801310708171210j4de26bc2x3bad1d429605b27a@mail.gmail.com>
Date: Fri, 17 Aug 2007 15:10:00 -0400
From: "Christian Henning" <chhenning@gmail.com>
To: "libtiff - Liste" <tiff@lists.maptools.org>
Subject: [Tiff] How to write a planar tiff file
In-Reply-To: <949801310708171209o6b60d93cp88032fdbb2bba49d@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <949801310708171200t73fe2ea5q34947d3efc918844@mail.gmail.com>
	<466E156D-2F4E-43E6-B348-A31D70F0AA05@smartgames.ca>
	<949801310708171209o6b60d93cp88032fdbb2bba49d@mail.gmail.com>
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.0000272d
X-MSP-STORE: Fri, 17 Aug 2007 21:23:28 +0200
Status:   

---------- Forwarded message ----------
From: Christian Henning <chhenning@gmail.com>
Date: Aug 17, 2007 3:09 PM
Subject: Re: [Tiff] How to write a planar tiff file
To: Toby Thain <toby@smartgames.ca>


On 8/17/07, Toby Thain <toby@smartgames.ca> wrote:
>
> On 17-Aug-07, at 4:00 PM, Christian Henning wrote:
>
> > Hi there, I'm having problems writing a planar image file. Can
> > somebody spot the problem in the following code. It's the most basic
> > writer I can think of.
>
> What kind of problem are you having?

No reader can open the file. Though, I think it's my fault.

>
> --Toby
>
>
> >
> > int main()
> > {
> >    TIFF* file = TIFFOpen( "write_test.tif", "w" );
> >
> >    TIFFSetField( file, TIFFTAG_IMAGEWIDTH  , 100 );
> >    TIFFSetField( file, TIFFTAG_IMAGELENGTH , 100 );
> >    TIFFSetField( file, TIFFTAG_COMPRESSION, COMPRESSION_LZW );
> >    TIFFSetField( file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_SEPARATE );
> >    TIFFSetField( file, TIFFTAG_BITSPERSAMPLE  , 8 );
> >    TIFFSetField( file, TIFFTAG_SAMPLESPERPIXEL, 3 );
> >
> >
> >    std::vector< unsigned char > row( 100 );
> >
> >    for( int c = 0; c < 3; ++c )
> >    {
> >       for( int y = 0; y < 100; ++y )
> >       {
> >          int size = TIFFWriteScanline( file
> >                                      , &row.front()
> >                                      , y
> >                                      , c           );
> >
> >          io_error_if( size == -1, "Write error." );
> >       }
> >    }
> >
> >    TIFFClose( file );
> > }
> >
> >
> > Thanks ahead,
> > Christian
> > _______________________________________________
> > Tiff mailing list: Tiff@lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/tiff
> > http://www.remotesensing.org/libtiff/
>
>
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
