public JsonNetResult CropAvatar(int width, int height, int x, int y) { var bytes = GlobalUtilities.GetExternalImageBytes(GlobalUtilities.GetUncroppedCustomerAvatarUrl(Identity.Current.CustomerID)); var croppedBytes = GlobalUtilities.Crop(bytes, width, height, x, y); Exigo.Images().SetCustomerAvatar(Identity.Current.CustomerID, croppedBytes, true); return(new JsonNetResult(new { success = true })); }
public JsonNetResult CropAvatar(int width, int height, int x, int y, string rawBytes) { var bytes = Convert.FromBase64String(rawBytes); var croppedBytes = GlobalUtilities.Crop(bytes, width, height, x, y); Exigo.Images().SetCustomerAvatar(Identity.Current.CustomerID, croppedBytes, true); return(new JsonNetResult(new { success = true })); }