Adding checks for predefined crops that are still set to default and where a specific resize parameter has been passed into GetCropUrl so that output crop is in same ratio as the predefined crop

This commit is contained in:
Jeavon Leopold
2015-08-19 16:54:03 +01:00
parent 367ba5cddf
commit 3595dd3339
3 changed files with 61 additions and 17 deletions

View File

@@ -81,6 +81,7 @@
{
return null;
}
if ((preferFocalPoint && cropDataSet.HasFocalPoint()) || (crop != null && crop.Coordinates == null && cropDataSet.HasFocalPoint()) || (string.IsNullOrEmpty(cropAlias) && cropDataSet.HasFocalPoint()))
{
cropUrl.Append("?center=" + cropDataSet.FocalPoint.Top.ToString(CultureInfo.InvariantCulture) + "," + cropDataSet.FocalPoint.Left.ToString(CultureInfo.InvariantCulture));
@@ -100,6 +101,7 @@
cropUrl.Append("?anchor=center");
cropUrl.Append("&mode=crop");
}
return cropUrl.ToString();
}
}