Skip to content

Commit fd2f341

Browse files
committed
use band numbers in transparency tab if color interpretation is undefined
1 parent 835416f commit fd2f341

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/app/qgsrasterlayerproperties.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,18 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
247247
{
248248
cboxTransparencyBand->addItem( tr( "None" ), -1 );
249249
int nBands = provider->bandCount();
250+
QString bandName;
250251
for ( int i = 1; i <= nBands; ++i ) //band numbering seem to start at 1
251252
{
252-
cboxTransparencyBand->addItem( provider->colorInterpretationName( i ), i );
253+
bandName = provider->colorInterpretationName( i );
254+
if ( bandName == "Undefined" )
255+
{
256+
cboxTransparencyBand->addItem( provider->generateBandName( i ), i );
257+
}
258+
else
259+
{
260+
cboxTransparencyBand->addItem( bandName, i );
261+
}
253262
}
254263

255264
if ( renderer )

0 commit comments

Comments
 (0)