When upgrading from 8.0.2 to 8.1.4, the IPublishedContent .GetCropUrl returns nothing. I can't seem to find a change regarding this, am I missing something?
var test = expert.Url.GetCropUrl(); // returns URL of the IPublishedContent (this is the item which contains an image, so it's not correct
var test2 = expert.Value<IPublishedContent>("expertPicture"); // returns null, while I can see the property in the Properties list
var test3 = expert.GetCropUrl("expertPicture", "Expert Picture"); // returns an empty string
I would expect test2 to work correctly, but it is not. Is it because the value is of a different type, something media related?
Edit:
var test = expert.Value<ImageCropperValue>("expertPicture");
var test2 = test.GetCropUrl("Expert Picture");
test is returning the correct value. test2 is returning a querystring (without url: "?anchor=center&mode=crop&width=500&height=500")
Edit 2: current workaround solution (if this is not intended):
var picture = expert.Value<ImageCropperValue>("expertPicture");
var url = picture.Url;
var cropUrl = url + picture.GetCropUrl("Expert Picture");
GetCropUrl
When upgrading from 8.0.2 to 8.1.4, the IPublishedContent .GetCropUrl returns nothing. I can't seem to find a change regarding this, am I missing something?
Hi,
Does this work for you?
IPublishedContent.Url.GetCropUrl
Cheers,
Shaishav
I would expect test2 to work correctly, but it is not. Is it because the value is of a different type, something media related?
Edit:
test is returning the correct value. test2 is returning a querystring (without url: "?anchor=center&mode=crop&width=500&height=500")
Edit 2: current workaround solution (if this is not intended):
I'm using the same workaround as edit 2 but I find it strange that this is not default available.
Hi Shaishav, I'm facing kind of simmilar issuess, and way to fix you have been share is working well for me site best regards
I wrote an extension method that helps with this issue in v8. See: https://our.umbraco.com/forum/umbraco-8/95932-getcropurl-returns-empty#comment-332558
is working on a reply...