public Task <IImage> GetImageAsync(string name) { using (var imageStream = _imageDataProvider.GetImage(name)) { var image = _imageFactory.CreateImage(name, imageStream); return(Task.FromResult(image)); } }
public ActionResult <List <Coordinate> > Locations(string gRef) { try { if (!_grid.ValidGridReference(gRef)) { return(BadRequest("Invalid Grid Reference")); } if (!Helper.AmIAGridRef(gRef)) { return(BadRequest("Please provide grid reference of image")); } IImage t = _factory.CreateImage(); List <Coordinate> locations = t.WhereAmI(gRef); return(Ok(locations)); } catch (Exception ex) { return(StatusCode(500, ex.Message)); } }
/// <summary> /// Adds an image to the image dictionary, based on the key thats passed in (filepath) /// </summary> /// <param name="pKey">The filepath of the image to be added to the collection</param> public void AddImage(string pKey) { // _imageDict.Add(pKey, _imageFact.CreateImage(pKey)); }