Received: from mailgate002.isp.belgacom.be (mailgate002.isp.belgacom.be [195.238.6.87])
	by maildelivery017.isp.belgacom.be (Postfix) with ESMTP id 8C730C065
	for <joris.at.lebbeke@skynet.be>; Mon, 19 May 2008 13:05:35 +0200 (CEST)
Authentication-Results: in.mx.skynet.be; dkim=neutral (message not signed) header.i=none
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 19 May 2008 13:05:34 +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 m4JAf1ho015728;
	Mon, 19 May 2008 06:43:07 -0400
Received: from zynlfw01.zylab.com (mx.zylab.com [194.178.9.130])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m4JAexIt015722
	for <tiff@lists.maptools.org>; Mon, 19 May 2008 06:40:59 -0400
Received: from zynlms01.ZyLAB.WAN (zynlms01.zylab.wan [192.168.1.10])
	by zynlfw01.zylab.com (Postfix) with ESMTP id 9B6F363B
	for <tiff@lists.maptools.org>; Mon, 19 May 2008 12:40:56 +0200 (CEST)
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Subject: Re: [Tiff] Re: 32 bit samples
Date: Mon, 19 May 2008 12:36:54 +0200
Message-ID: <FC840EC0BF7BFA45A0F94548AF36920D04E600A1@zynlms01.ZyLAB.WAN>
In-Reply-To: <0ecf01c8b96b$fffcb590$fff620b0$@net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [Tiff] Re: 32 bit samples
Thread-Index: Aci5AGB8aJmYhs3aRjq9+I3ib70vBgAacQuAAAqL5mA=
References: <200805181600.m4IG0BdH020142@duke.maptools.org>
	<0ecf01c8b96b$fffcb590$fff620b0$@net>
From: "Gerben Vos" <Gerben@zylab.com>
To: <tiff@lists.maptools.org>
X-MIME-Autoconverted: from quoted-printable to 8bit by duke.maptools.org id
	m4JAexIt015722
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
Content-Transfer-Encoding: quoted-printable
X-UIDL: 000000000023ceae.00002ca9
X-MSP-STORE: Mon, 19 May 2008 13:04:17 +0200
Status:   

Garry Petrie wrote:

> Interesting comments concerning RGB inputs. I assumed there
> were tags in the file declaring it as a BW image at least.

There are. (I've downloaded some geotiff data and looked at the
TIFF headers.) But the sample format is also declared as "IEEE
floating point", and this is not widely implemented. In each
case, the libtiff simple RGBA interface doesn't implement it.
And since floating point data is not part of "baseline TIFF",
you cannot expect image viewers to support it.

That you got an error from TIFFRGBAImageOK is logical: it checks
whether the rest of the TIFFRGBA* code will understand this
TIFF, which it won't.

You should forget about the RGBA interface. However, you can
read the data quite easily using TIFFReadScanline() or some
other libtiff function. These functions are really not so hard
to work with. They'll simply return a buffer containing a 32-bit
float for every pixel.

Unfortunately, I too don't know much about TIFFs with
geographical data (yet). There are some people on this list that
do. But I think this should help you a bit further.

For other interested people, here's the tiffdump output of the
sample I downloaded:

NED_09317122.tif:
Magic: 0x4949 <little-endian> Version: 0x2a
Directory 0: offset 31493876 (0x1e08ef4) next 0 (0)
ImageWidth (256) SHORT (3) 1<2793>
ImageLength (257) SHORT (3) 1<2819>
BitsPerSample (258) SHORT (3) 1<32>
Compression (259) SHORT (3) 1<1>
Photometric (262) SHORT (3) 1<1>
StripOffsets (273) LONG (4) 2819<8 11180 22352 33524 44696 55868 67040 78=
212 89384 100556 111728 122900 134072 145244 156416 167588 178760 189932 =
201104 212276 223448 234620 245792 256964 ...>
Orientation (274) SHORT (3) 1<1>
SamplesPerPixel (277) SHORT (3) 1<1>
RowsPerStrip (278) SHORT (3) 1<1>
StripByteCounts (279) LONG (4) 2819<11172 11172 11172 11172 11172 11172 1=
1172 11172 11172 11172 11172 11172 11172 11172 11172 11172 11172 11172 11=
172 11172 11172 11172 11172 11172 ...>
XResolution (282) RATIONAL (5) 1<1>
YResolution (283) RATIONAL (5) 1<1>
PlanarConfig (284) SHORT (3) 1<1>
ResolutionUnit (296) SHORT (3) 1<1>
Software (305) ASCII (2) 126<IMAGINE TIFF Support\nCop ...>
SampleFormat (339) SHORT (3) 1<3>
33550 (0x830e) DOUBLE (12) 3<0.000277778 0.000277778 0>
33922 (0x8482) DOUBLE (12) 6<0 0 0 -102.612 43.8022 0>
34735 (0x87af) SHORT (3) 24<1 1 0 5 1024 0 1 2 1025 0 1 1 1026 34737 230 =
0 2048 0 1 4269 2054 0 1 9102>
34737 (0x87b1) ASCII (2) 231<IMAGINE GeoTIFF Support\n ...>

					Gerben.

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