示例#1
0
        public IActionResult Process(List <IFormFile> files)
        {
            if (files.Count != 2)
            {
                return(BadRequest());
            }

            var left  = Image.FromStream(files[0].OpenReadStream()) as Bitmap;
            var right = Image.FromStream(files[1].OpenReadStream()) as Bitmap;

            return(File(ImageHelper.ImageToByteArray(_imageComparerManager.GetImage(_imageComparerManager.Process(left,
                                                                                                                  right, 20))), "image/jpeg"));
        }
示例#2
0
 public void Process_LeftIsNull_ThrowsArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() => _comparerManager.Process(null, _image, Threshold));
 }