Skip to content

Commit 326b498

Browse files
committed
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.
1 parent 47d04db commit 326b498

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/providers/gdal/qgsgdalprovider.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2650,9 +2650,9 @@ void QgsGdalProvider::initBaseDataset()
26502650
// define if the band has scale and offset to apply
26512651
double myScale = bandScale( i );
26522652
double myOffset = bandOffset( i );
2653-
if ( myScale != 1.0 && myOffset != 0.0 )
2653+
if ( !qgsDoubleNear( myScale, 1.0 ) || !qgsDoubleNear( myOffset, 0.0 ) )
26542654
{
2655-
// if the band has scale and offset to apply change dataType
2655+
// if the band has scale or offset to apply change dataType
26562656
switch ( myGdalDataType )
26572657
{
26582658
case GDT_Unknown:

0 commit comments

Comments
 (0)