Skip to content
Permalink
Browse files

use band numbers in transparency tab if color interpretation is undef…

…ined
  • Loading branch information
alexbruy committed Jul 4, 2012
1 parent 835416f commit fd2f34151621545b66f08d5d5f9ebbc670fa5bf2
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/app/qgsrasterlayerproperties.cpp
@@ -247,9 +247,18 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
{
cboxTransparencyBand->addItem( tr( "None" ), -1 );
int nBands = provider->bandCount();
QString bandName;
for ( int i = 1; i <= nBands; ++i ) //band numbering seem to start at 1
{
cboxTransparencyBand->addItem( provider->colorInterpretationName( i ), i );
bandName = provider->colorInterpretationName( i );
if ( bandName == "Undefined" )
{
cboxTransparencyBand->addItem( provider->generateBandName( i ), i );
}
else
{
cboxTransparencyBand->addItem( bandName, i );
}
}

if ( renderer )

0 comments on commit fd2f341

Please sign in to comment.
You can’t perform that action at this time.