Skip to content

Commit

Permalink
Fix incorrect data type for GDAL layers with gain/offset (fix #11573)
Browse files Browse the repository at this point in the history
Test was incorrectly checking for both offset and gain, when it
should have been testing for either.
  • Loading branch information
nyalldawson committed Mar 10, 2015
1 parent 47d04db commit 326b498
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/gdal/qgsgdalprovider.cpp
Original file line number Diff line number Diff line change
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 326b498

Please sign in to comment.