GetCropUrl - needed to get the url from within the json within the check for a crop otherwise a exception can occur

This commit is contained in:
Jeavon Leopold
2014-03-20 13:22:45 +00:00
parent 7e8aaebfce
commit 2d2f57a71b

View File

@@ -56,15 +56,15 @@ namespace Umbraco.Web
if (mediaItem.HasPropertyAndValueAndCrop(propertyAlias, cropAlias))
{
imageCropperValue = mediaItem.GetPropertyValue<string>(propertyAlias);
//get the raw value (this will be json)
var urlValue = mediaItem.GetPropertyValue<string>(propertyAlias);
mediaItemUrl = urlValue.DetectIsJson()
? urlValue.SerializeToCropDataSet().Src
: urlValue;
}
//get the raw value (this will be json)
var urlValue = mediaItem.GetPropertyValue<string>(propertyAlias);
mediaItemUrl = urlValue.DetectIsJson()
? urlValue.SerializeToCropDataSet().Src
: urlValue;
return mediaItemUrl != null
? GetCropUrl(mediaItemUrl, width, height, quality, imageCropMode, imageCropAnchor, imageCropperValue, cropAlias, furtherOptions)
: string.Empty;