public virtual void HandleImageUpload(IMedia mediaFile)
        {
            var umbracoFile = mediaFile.Properties["umbracoFile"];

            if (umbracoFile != null)
            {
                var umbracoFileValue = umbracoFile.GetValue();
                var umbracoFileJson  = JObject.Parse(umbracoFileValue.ToString());
                var focalPoint       = umbracoFileJson["focalPoint"];

                string localFilePath = umbracoFileJson["src"].ToString();

                FocalPoint autoFocalPoint = Task.Run <FocalPoint>(async() => await GetFocalPointByLocalPath(localFilePath)).Result;

                var jsonString = string.Format(@"{{""left"": ""{0}"", ""top"": ""{1}""}}", autoFocalPoint.Left, autoFocalPoint.Top);

                if (focalPoint == null)
                {
                    umbracoFileJson.First.AddAfterSelf(new JProperty("focalPoint", JObject.Parse(jsonString)));
                    focalPoint = umbracoFileJson["focalPoint"];
                }
                else
                {
                    focalPoint["left"] = autoFocalPoint.Left.ToString();
                    focalPoint["top"]  = autoFocalPoint.Top.ToString();
                }

                umbracoFile.SetValue(umbracoFileJson.ToString());
            }
        }
        public virtual async Task <FocalPoint> GetFacePoint(JArray faceArray, int imageWidth, int imageHeight)
        {
            //TODO: get face with highest ["faceattributes"]["smile"] score

            var        face   = faceArray.First();
            int        top    = int.Parse(face["faceRectangle"]["top"].ToString());
            int        left   = int.Parse(face["faceRectangle"]["left"].ToString());
            int        width  = int.Parse(face["faceRectangle"]["width"].ToString());
            int        height = int.Parse(face["faceRectangle"]["height"].ToString());
            FocalPoint point  = new FocalPoint();

            point.Populate(left, top, width, height, imageWidth, imageHeight);
            return(point);
        }