@@ -15,8 +15,8 @@ public static bool PixelMatch(string screenShotFile, byte[] screenshot)
1515 const int pixelThreshold = 10 ;
1616 const decimal totalTolerance = 0.05m ;
1717
18- var baseImage = Image . Load ( Path . Combine ( TestUtils . FindParentDirectory ( "Screenshots" ) , TestConstants . IsChrome ? "golden-chromium" : "golden-firefox" , screenShotFile ) ) ;
19- var compareImage = Image . Load ( screenshot ) ;
18+ var baseImage = Image . Load < Rgb24 > ( Path . Combine ( TestUtils . FindParentDirectory ( "Screenshots" ) , TestConstants . IsChrome ? "golden-chromium" : "golden-firefox" , screenShotFile ) ) ;
19+ var compareImage = Image . Load < Rgb24 > ( screenshot ) ;
2020
2121 //Just for debugging purpose
2222 compareImage . Save ( Path . Combine ( TestUtils . FindParentDirectory ( "Screenshots" ) , TestConstants . IsChrome ? "golden-chromium" : "golden-firefox" , "test.png" ) ) ;
@@ -26,19 +26,14 @@ public static bool PixelMatch(string screenShotFile, byte[] screenshot)
2626 return false ;
2727 }
2828
29- var rgb1 = default ( Rgb24 ) ;
30- var rgb2 = default ( Rgb24 ) ;
3129 var invalidPixelsCount = 0 ;
3230
3331 for ( var y = 0 ; y < baseImage . Height ; y ++ )
3432 {
3533 for ( var x = 0 ; x < baseImage . Width ; x ++ )
3634 {
37- var pixelA = baseImage [ x , y ] ;
38- var pixelB = compareImage [ x , y ] ;
39-
40- pixelA . ToRgb24 ( ref rgb1 ) ;
41- pixelB . ToRgb24 ( ref rgb2 ) ;
35+ var rgb1 = baseImage [ x , y ] ;
36+ var rgb2 = compareImage [ x , y ] ;
4237
4338 if ( Math . Abs ( rgb1 . R - rgb2 . R ) > pixelThreshold ||
4439 Math . Abs ( rgb1 . G - rgb2 . G ) > pixelThreshold ||
0 commit comments