Skip to content

Commit

Permalink
wms provider: log error message, if a faulty image is returned.
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Dec 6, 2011
1 parent c12b9ba commit 8432ddb
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/providers/wms/qgswmsprovider.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit 8432ddb

Please sign in to comment.