Skip to content

Commit

Permalink
-Prevent internal pyramids from being built on rasters with JPEG comp…
Browse files Browse the repository at this point in the history
…ression

-closes ticket #1357

git-svn-id: http://svn.osgeo.org/qgis/trunk@9688 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
ersts committed Nov 23, 2008
1 parent b96224a commit e8d6530
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1587,11 +1587,15 @@ void QgsRasterLayerProperties::on_buttonBuildPyramids_clicked()
QMessageBox::warning( this, tr( "Building pyramids failed." ),
tr( "Building pyramid overviews is not supported on this type of raster." ) );
}
else if ( res == "ERROR_JPEG_COMPRESSION" )
{
QMessageBox::warning( this, tr( "Building pyramids failed." ),
tr( "Building internal pyramid overviews is not supported on raster layers with JPEG compression." ) );
}
else if ( res == "ERROR_VIRTUAL" )
{
QMessageBox::warning( this, tr( "Building pyramids failed." ),
tr( "Building pyramid overviews is not supported on this type of raster." ) );
//TODO: should really read -- Building pyramid overviews is not supported for 'warped virtual dataset'. -- But in feature freeze, and translation requests have already gone out PJE20080912
}

}
Expand Down
5 changes: 5 additions & 0 deletions src/core/raster/qgsrasterlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,11 @@ QString QgsRasterLayer::buildPyramids( RasterPyramidList const & theRasterPyrami

if ( theTryInternalFlag )
{
QString myCompressionType = QString( GDALGetMetadataItem( mGdalDataset, "COMPRESSION", "IMAGE_STRUCTURE" ) );
if( "JPEG" == myCompressionType )
{
return "ERROR_JPEG_COMPRESSION";
}
//close the gdal dataset and reopen it in read / write mode
GDALClose( mGdalDataset );
mGdalBaseDataset = GDALOpen( QFile::encodeName( mDataSource ).constData(), GA_Update );
Expand Down

0 comments on commit e8d6530

Please sign in to comment.