Return-Path: <tiff-bounces@remotesensing.org>
Received: from inmx014.isp.belgacom.be (inmx014.isp.belgacom.be [195.238.2.217])
        by mailst006.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id i6QDVK6X026994
        for <joris.at.lebbeke@skynet.be>; Mon, 26 Jul 2004 15:31:20 +0200
        (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 i6QDV96Z013662
        for <joris.at.lebbeke@skynet.be>; Mon, 26 Jul 2004 15:31:10 +0200
        (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 BD107167E17; Mon, 26 Jul 2004 09:30:53 -0400 (EDT)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from outmx006.isp.belgacom.be (outmx006.isp.belgacom.be
	[195.238.2.99])
	by xserve.flids.com (Postfix) with ESMTP id 2C0FB167DF2
	for <tiff@remotesensing.org>; Mon, 26 Jul 2004 09:30:51 -0400 (EDT)
Received: from outmx006.isp.belgacom.be (localhost [127.0.0.1])
	by outmx006.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with
	ESMTP id i6QDUh2K011648
	for <tiff@remotesensing.org>; Mon, 26 Jul 2004 15:30:43 +0200
	(envelope-from <joris.at.lebbeke@skynet.be>)
Received: from dfgrrxsknr4e (145-15.241.81.adsl.skynet.be [81.241.15.145])
	by outmx006.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with SMTP
	id i6QDUb5Z011570
	for <tiff@remotesensing.org>; Mon, 26 Jul 2004 15:30:37 +0200
	(envelope-from <joris.at.lebbeke@skynet.be>)
Message-ID: <002201c47314$c14d1110$910ff151@dfgrrxsknr4e>
From: "Joris" <joris.at.lebbeke@skynet.be>
To: <tiff@remotesensing.org>
References: <s104a371.047@lucius.provo.novell.com>
Subject: Re: [Tiff] Saving multiple images to a tiff file...
Date: Mon, 26 Jul 2004 15:30:44 +0200
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
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: f3f51aef1bf423e642d3900a7c26c00c

> TIFFSetField (tiff, TIFFTAG_SAMPLESPERPIXEL, 4); /* Hardcoded
> 32bbps*/
> TIFFSetField (tiff, TIFFTAG_BITSPERSAMPLE, 8);
> ...
> Now when i try to reload the image from my program, the saved file is
> not recognized as a valid tiff file.

Just guessing here: are there truely 4 samples?

Either
1) Your source data is 3 samples, R, G, and B, and there's a padding byte, which
is common at least on windows systems nowadays. In this case, the padding byte
should *not* be given to LibTiff. You'll need to tell it your data is 3 sampels
wide, cause it really is, and convert from '32bit' RGB+padding byte to true
24bit RGB, in your clue code interfacing between the windows DIB (is it?) and
LibTiff
2) Or either you do intent to write 4 real samples, and the fourth sample most
probably is alpha. In that case, you should indicate this by properly setting
TIFFTAG_EXTRASAMPLES.


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
