Skip to content
Permalink
Browse files
wms provider: log error message, if a faulty image is returned.
  • Loading branch information
jef-n committed Dec 6, 2011
1 parent c12b9ba commit 8432ddbad34a6b895253b42964da7110798cd311
Showing with 18 additions and 4 deletions.
  1. +18 −4 src/providers/wms/qgswmsprovider.cpp
@@ -848,8 +848,15 @@ void QgsWmsProvider::tileReplyFinished()

// myLocalImage.save( QString( "%1/%2-tile-%3.png" ).arg( QDir::tempPath() ).arg( mTileReqNo ).arg( tileNo ) );

QPainter p( cachedImage );
p.drawImage( dst, myLocalImage );
if ( !myLocalImage.isNull() )
{
QPainter p( cachedImage );
p.drawImage( dst, myLocalImage );
}
else
{
QgsMessageLog::logMessage( tr( "Returned image is flawed [%1]" ).arg( reply->url().toString() ), tr( "WMS" ) );
}

#if 0
p.drawRect( dst ); // show tile bounds
@@ -919,8 +926,15 @@ void QgsWmsProvider::cacheReplyFinished()
if ( contentType.startsWith( "image/" ) )
{
QImage myLocalImage = QImage::fromData( cacheReply->readAll() );
QPainter p( cachedImage );
p.drawImage( 0, 0, myLocalImage );
if ( !myLocalImage.isNull() )
{
QPainter p( cachedImage );
p.drawImage( 0, 0, myLocalImage );
}
else
{
QgsMessageLog::logMessage( tr( "Returned image is flawed [%1]" ).arg( cacheReply->url().toString() ), tr( "WMS" ) );
}
}
else
{

0 comments on commit 8432ddb

Please sign in to comment.