Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nyalldawson committed Mar 6, 2015
1 parent b83b59d commit 914ecc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/gdal/qgsgdalprovider.cpp
Expand Up @@ -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:
Expand Down

0 comments on commit 914ecc9

Please sign in to comment.