3 changes: 2 additions & 1 deletion python/core/qgsrastertransparency.sip
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public:

struct TransparentSingleValuePixel
{
double pixelValue;
double min;
double max;
double percentTransparent;
};

Expand Down
9 changes: 4 additions & 5 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3954,10 +3954,10 @@ void QgisApp::saveAsRasterFile()
return;
}
// add projector if necessary
if ( d.outputCrs() != rasterLayer->dataProvider()->crs() )
if ( d.outputCrs() != rasterLayer->crs() )
{
QgsRasterProjector * projector = new QgsRasterProjector;
projector->setCRS( rasterLayer->dataProvider()->crs(), d.outputCrs() );
projector->setCRS( rasterLayer->crs(), d.outputCrs() );
if ( !pipe->set( projector ) )
{
QgsDebugMsg( "Cannot set pipe projector" );
Expand All @@ -3977,18 +3977,17 @@ void QgisApp::saveAsRasterFile()
delete pipe;
return;
}
projector->setCRS( rasterLayer->dataProvider()->crs(), d.outputCrs() );
projector->setCRS( rasterLayer->crs(), d.outputCrs() );
}

if ( !pipe->last() )
{
delete pipe;
return;
}
QgsRasterIterator iterator( pipe->last() );
fileWriter.setCreateOptions( d.createOptions() );

fileWriter.writeRaster( &iterator, d.nColumns(), d.nRows(), d.outputRectangle(), d.outputCrs(), &pd );
fileWriter.writeRaster( pipe, d.nColumns(), d.nRows(), d.outputRectangle(), d.outputCrs(), &pd );
delete pipe;
}
}
Expand Down
Loading