Skip to content

Commit e8d6530

Browse files
author
ersts
committedNov 23, 2008
-Prevent internal pyramids from being built on rasters with JPEG compression
-closes ticket #1357 git-svn-id: http://svn.osgeo.org/qgis/trunk@9688 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b96224a commit e8d6530

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
 

‎src/app/qgsrasterlayerproperties.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1587,11 +1587,15 @@ void QgsRasterLayerProperties::on_buttonBuildPyramids_clicked()
15871587
QMessageBox::warning( this, tr( "Building pyramids failed." ),
15881588
tr( "Building pyramid overviews is not supported on this type of raster." ) );
15891589
}
1590+
else if ( res == "ERROR_JPEG_COMPRESSION" )
1591+
{
1592+
QMessageBox::warning( this, tr( "Building pyramids failed." ),
1593+
tr( "Building internal pyramid overviews is not supported on raster layers with JPEG compression." ) );
1594+
}
15901595
else if ( res == "ERROR_VIRTUAL" )
15911596
{
15921597
QMessageBox::warning( this, tr( "Building pyramids failed." ),
15931598
tr( "Building pyramid overviews is not supported on this type of raster." ) );
1594-
//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
15951599
}
15961600

15971601
}

‎src/core/raster/qgsrasterlayer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,11 @@ QString QgsRasterLayer::buildPyramids( RasterPyramidList const & theRasterPyrami
982982

983983
if ( theTryInternalFlag )
984984
{
985+
QString myCompressionType = QString( GDALGetMetadataItem( mGdalDataset, "COMPRESSION", "IMAGE_STRUCTURE" ) );
986+
if( "JPEG" == myCompressionType )
987+
{
988+
return "ERROR_JPEG_COMPRESSION";
989+
}
985990
//close the gdal dataset and reopen it in read / write mode
986991
GDALClose( mGdalDataset );
987992
mGdalBaseDataset = GDALOpen( QFile::encodeName( mDataSource ).constData(), GA_Update );

0 commit comments

Comments
 (0)
Please sign in to comment.