Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
-Prevent internal pyramids from being built on rasters with JPEG comp…
Loading branch information
Showing
2 changed files
with
10 additions
and
1 deletion .
+5
−1
src/app/qgsrasterlayerproperties.cpp
+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 );
Toggle all file notes