[QGIS Commit] r9688 - in trunk/qgis/src: app core/raster
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sun Nov 23 17:58:53 EST 2008
Author: ersts
Date: 2008-11-23 17:58:53 -0500 (Sun, 23 Nov 2008)
New Revision: 9688
Modified:
trunk/qgis/src/app/qgsrasterlayerproperties.cpp
trunk/qgis/src/core/raster/qgsrasterlayer.cpp
Log:
-Prevent internal pyramids from being built on rasters with JPEG compression
-closes ticket #1357
Modified: trunk/qgis/src/app/qgsrasterlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsrasterlayerproperties.cpp 2008-11-23 20:02:14 UTC (rev 9687)
+++ trunk/qgis/src/app/qgsrasterlayerproperties.cpp 2008-11-23 22:58:53 UTC (rev 9688)
@@ -1587,11 +1587,15 @@
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
}
}
Modified: trunk/qgis/src/core/raster/qgsrasterlayer.cpp
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.cpp 2008-11-23 20:02:14 UTC (rev 9687)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.cpp 2008-11-23 22:58:53 UTC (rev 9688)
@@ -982,6 +982,11 @@
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 );
More information about the QGIS-commit
mailing list