Fix incorrect data type for GDAL layers with gain/offset (fix #11573)

Test was incorrectly checking for both offset and gain, when it
should have been testing for either.
This commit is contained in:
Nyall Dawson 2015-03-06 15:11:44 +11:00
parent b83b59dc77
commit 914ecc9c09

View File

@ -2650,9 +2650,9 @@ void QgsGdalProvider::initBaseDataset()
// define if the band has scale and offset to apply
double myScale = bandScale( i );
double myOffset = bandOffset( i );
if ( myScale != 1.0 && myOffset != 0.0 )
if ( !qgsDoubleNear( myScale, 1.0 ) || !qgsDoubleNear( myOffset, 0.0 ) )
{
// if the band has scale and offset to apply change dataType
// if the band has scale or offset to apply change dataType
switch ( myGdalDataType )
{
case GDT_Unknown: