Skip to content
Permalink
Browse files
-Prevent internal pyramids from being built on rasters with JPEG comp…
…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 e8d65308f052c08aea38c756883e2e0dc5c24391
Showing with 10 additions and 1 deletion.
  1. +5 −1 src/app/qgsrasterlayerproperties.cpp
  2. +5 −0 src/core/raster/qgsrasterlayer.cpp
@@ -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
}

}
@@ -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 );

0 comments on commit e8d6530

Please sign in to comment.