From 2d2f57a71bdb7c6e5809890736dbfed5c3b4f8d2 Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Thu, 20 Mar 2014 13:22:45 +0000 Subject: [PATCH] GetCropUrl - needed to get the url from within the json within the check for a crop otherwise a exception can occur --- src/Umbraco.Web/ImageCropperTemplateExtensions.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web/ImageCropperTemplateExtensions.cs b/src/Umbraco.Web/ImageCropperTemplateExtensions.cs index 5dea93d9a8..163200dae2 100644 --- a/src/Umbraco.Web/ImageCropperTemplateExtensions.cs +++ b/src/Umbraco.Web/ImageCropperTemplateExtensions.cs @@ -56,15 +56,15 @@ namespace Umbraco.Web if (mediaItem.HasPropertyAndValueAndCrop(propertyAlias, cropAlias)) { imageCropperValue = mediaItem.GetPropertyValue(propertyAlias); + + //get the raw value (this will be json) + var urlValue = mediaItem.GetPropertyValue(propertyAlias); + + mediaItemUrl = urlValue.DetectIsJson() + ? urlValue.SerializeToCropDataSet().Src + : urlValue; } - //get the raw value (this will be json) - var urlValue = mediaItem.GetPropertyValue(propertyAlias); - - mediaItemUrl = urlValue.DetectIsJson() - ? urlValue.SerializeToCropDataSet().Src - : urlValue; - return mediaItemUrl != null ? GetCropUrl(mediaItemUrl, width, height, quality, imageCropMode, imageCropAnchor, imageCropperValue, cropAlias, furtherOptions) : string.Empty;