Badges.Controllers.StudentController.CropAndSave C# (CSharp) Method

CropAndSave() private method

Crops the image to the given size, saves, and returns the url of the final blob
private CropAndSave ( System.Web.HttpPostedFileBase image, string queryString ) : string
image System.Web.HttpPostedFileBase
queryString string
return string
        private string CropAndSave(HttpPostedFileBase image, string queryString)
        {
            var cropResizer = new ResizeSettings(queryString);

            using (var stream = new MemoryStream())
            {
                ImageBuilder.Current.Build(image.InputStream, stream, cropResizer, disposeSource: false);

                //Save cropped and original image (for possible processing later)
                var blob = _fileService.Save(image.InputStream, stream, image.ContentType, publicAccess: true);

                return blob.Uri.AbsoluteUri;
            }
        }