Opened 20 years ago

Last modified 20 years ago

#596 closed defect (fixed)

Reading compressed IMG floating point rasters broken

Reported by: sam.gillingham@… Owned by: warmerdam
Priority: high Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords:
Cc:

Description

frmts/hfa/hfaband.cpp line 757. Should copy nDataValue into the array rather
than cast. Should be something like the following:

        else if( nDataType == EPT_f32 )
        {
            int		i;
            float fDataValue;

            memcpy( &fDataValue, &nDataValue, 4);
            for( i = 0; i < nRepeatCount; i++ )
            {
                ((float *) pabyDest)[nPixelsOutput++] = fDataValue;
            }
        }

Attachments (1)

jimcom.img (9.6 KB ) - added by sam.gillingham@… 20 years ago.
Compressed Floating point Raster

Download all attachments as: .zip

Change History (4)

comment:1 by warmerdam, 20 years ago

Change applied.  Would you happen to have a smallish example file that
demonstrates the problem I could test with? 

comment:2 by warmerdam, 20 years ago

Closing since the bug is fixed.

by sam.gillingham@…, 20 years ago

Attachment: jimcom.img added

Compressed Floating point Raster

comment:3 by warmerdam, 20 years ago

Thanks Sam.  This seems to be working properly now with your change. 

Note: See TracTickets for help on using tickets.