Skip to content
Permalink
Browse files

Slightly larger default renderchecker image in html, and fix divide/0…

… issue if control image is missing
  • Loading branch information
dakcarto committed Feb 19, 2014
1 parent 916706f commit 4915c9e7e69cbbcda95db9825cb17a779f2b3bb7
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/core/qgsrenderchecker.cpp
@@ -93,10 +93,10 @@ bool QgsRenderChecker::isKnownAnomaly( QString theDiffImageFile )
QString myAnomalyHash = imageToHash( controlImagePath() + mControlName
+ QDir::separator() + myFile );
QString myHashMessage = QString(
"Checking if anomaly %1 (hash %2)" )
"Checking if anomaly %1 (hash %2)<br>" )
.arg( myFile )
.arg( myAnomalyHash );
myHashMessage += QString( " matches %1 (hash %2)" )
myHashMessage += QString( "&nbsp; matches %1 (hash %2)" )
.arg( theDiffImageFile )
.arg( myImageHash );
//foo CDash
@@ -246,8 +246,13 @@ bool QgsRenderChecker::compareImages( QString theTestName,
mReport += "Actual Duration : " + QString::number( mElapsedTime ) + "ms<br>";

// limit image size in page to something reasonable
int imgWidth = qMin( myExpectedImage.width(), 400 );
int imgHeight = myExpectedImage.height() * imgWidth / myExpectedImage.width();
int imgWidth = 420;
int imgHeight = 280;
if ( ! myExpectedImage.isNull() )
{
imgWidth = qMin( myExpectedImage.width(), imgWidth );
imgHeight = myExpectedImage.height() * imgWidth / myExpectedImage.width();
}
QString myImagesString = "</td></tr>"
"<tr><td>Test Result:</td><td>Expected Result:</td><td>Difference (all blue is good, any red is bad)</td></tr>\n"
"<tr><td><img width=" + QString::number( imgWidth ) +

0 comments on commit 4915c9e

Please sign in to comment.
You can’t perform that action at this time.