From 914ecc9c0980012b27b15ce5616cf5541da66f55 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 6 Mar 2015 15:11:44 +1100 Subject: [PATCH] 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. --- src/providers/gdal/qgsgdalprovider.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/providers/gdal/qgsgdalprovider.cpp b/src/providers/gdal/qgsgdalprovider.cpp index 9033a0098e9..ff1c20b95c2 100644 --- a/src/providers/gdal/qgsgdalprovider.cpp +++ b/src/providers/gdal/qgsgdalprovider.cpp @@ -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: