Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: System.AccessViolationException when comparing two images

$
0
0
I figured as much. Until then, and for verification, I'll keep the guard clauses in :).

Good news. Just got a successful run on my deployment machine (this is a first!).

So, it definitely looks like that comparing images with different dimensions is the issue.

Code I used to guard for reference:
/// <summary>
/// Compare the actual to the expected with resulting comparison image and error info
/// </summary>
public void Compare()
{
    if (ImageDimensionsEqual = CheckImageDimensions())
    {
        Error = Actual.Image.Compare(Expected.Image);
        Actual.Image.Compare(Expected.Image, ErrorMetric.Fuzz, Comparison.Image);
    }
}

private bool CheckImageDimensions()
{
    return (Actual.Image.Width == Expected.Image.Width 
        && Actual.Image.Height == Expected.Image.Height);
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>