Ticket #3933 (closed defect: fixed)
Certain ESRI FLTs broken by update to ehdrdataset.cpp
| Reported by: | rprinceley | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.8.1 |
| Component: | GDAL_Raster | Version: | 1.8.0 |
| Severity: | major | Keywords: | EHDR |
| Cc: | gaopeng, rouault |
Description
Some FLT files (those that don't specify nbits in the header) no longer work with recent changes (r21238). Pixel size check is skipped, returns as byte instead of float.
/* If we have a negative nodata value, let's assume that the */
/* pixel type is signed. This is necessary for datasets from */
/* http://www.worldclim.org/futdown.htm */
if( bNoDataSet && dfNoData < 0 && chPixelType == 'N' )
{
chPixelType = 'S';
}
Since chPixelType is set, size check is not performed:
if( nBits == -1 && chPixelType == 'N' )
{
VSIStatBufL sStatBuf;
if( VSIStatL( poOpenInfo->pszFilename, &sStatBuf ) == 0 )
{
size_t nBytes = sStatBuf.st_size/nCols/nRows/nBands;
if( nBytes > 0 && nBytes != 3 )
nBits = nBytes*8;
if( nBytes == 4 )
chPixelType = 'F';
}
}
FLT header:
ncols 1620 nrows 1195 xllcorner 4487961 yllcorner 5477345 cellsize 2 NODATA_value -9999 byteorder LSBFIRST
Change History
Note: See
TracTickets for help on using
tickets.
