Skip to content

Commit 4915c9e

Browse files
committedFeb 19, 2014
Slightly larger default renderchecker image in html, and fix divide/0 issue if control image is missing
1 parent 916706f commit 4915c9e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed
 

‎src/core/qgsrenderchecker.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ bool QgsRenderChecker::isKnownAnomaly( QString theDiffImageFile )
9393
QString myAnomalyHash = imageToHash( controlImagePath() + mControlName
9494
+ QDir::separator() + myFile );
9595
QString myHashMessage = QString(
96-
"Checking if anomaly %1 (hash %2)" )
96+
"Checking if anomaly %1 (hash %2)<br>" )
9797
.arg( myFile )
9898
.arg( myAnomalyHash );
99-
myHashMessage += QString( " matches %1 (hash %2)" )
99+
myHashMessage += QString( "&nbsp; matches %1 (hash %2)" )
100100
.arg( theDiffImageFile )
101101
.arg( myImageHash );
102102
//foo CDash
@@ -246,8 +246,13 @@ bool QgsRenderChecker::compareImages( QString theTestName,
246246
mReport += "Actual Duration : " + QString::number( mElapsedTime ) + "ms<br>";
247247

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

0 commit comments

Comments
 (0)
Please sign in to comment.