Changeset 14710

Show
Ignore:
Timestamp:
06/14/08 19:47:17 (6 months ago)
Author:
rouault
Message:

Fix HFA EPT_f32 readuced precision (#1000)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.5/gdal/frmts/hfa/hfaband.cpp

    r13359 r14710  
    568568                ((GUInt32 *) pabyDest)[nPixelsOutput] = nDataValue; 
    569569            } 
    570 /* -------------------------------------------------------------------- */ 
    571 /*      Note, floating point values are handled somewhat                */ 
    572 /*      differently, and I've only been able to test f32 with a         */ 
    573 /*      16bit offset value (see bug #1000 and                           */ 
    574 /*      data/imagine/bug1000/float.img)                                 */ 
    575 /* -------------------------------------------------------------------- */ 
    576570            else if( nDataType == EPT_f32 ) 
    577571            { 
    578                 float fValue = *((float *) &nDataMin); 
    579  
    580                 if( nNumBits == 16 ) 
    581                     fValue = fValue + 0.25 * (nRawValue / 65536.0); 
    582                 else 
    583                     CPLAssert( FALSE ); 
    584                  
    585                 ((float *) pabyDest)[nPixelsOutput] = fValue; 
     572/* -------------------------------------------------------------------- */ 
     573/*      Note, floating point values are handled as if they were signed  */ 
     574/*      32-bit integers (bug #1000).                                    */ 
     575/* -------------------------------------------------------------------- */ 
     576                ((float *) pabyDest)[nPixelsOutput] = *((float*)( &nDataValue )); 
    586577            } 
    587578            else