Merge pull request #327 from Jeavon/7.1.0-ImageCropper-JeavonWIP

7.1.0 image cropper - GetCropUrl not using .Url anymore
This commit is contained in:
Sebastiaan Janssen
2014-03-20 15:45:24 +01:00

View File

@@ -51,15 +51,26 @@ namespace Umbraco.Web
{
string imageCropperValue = null;
string mediaItemUrl = null;
string mediaItemUrl;
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;
}
else
{
mediaItemUrl = mediaItem.Url;
}
return mediaItem.Url != null
? GetCropUrl(mediaItem.Url, width, height, quality, imageCropMode, imageCropAnchor, imageCropperValue, cropAlias, furtherOptions)
return mediaItemUrl != null
? GetCropUrl(mediaItemUrl, width, height, quality, imageCropMode, imageCropAnchor, imageCropperValue, cropAlias, furtherOptions)
: string.Empty;
}