1) If you've just added the Crop after you uploaded the media item; try going back into Umbraco, opening up the image, and resaving it, to ensure the crop data is there.
2) Otherwise to troubleshoot this I would get the Media Object back using Umbraco.TypedMedia and use GetCropUrl off of that...
eg
var relatedMedia = Umbraco.TypedMedia(content.GetPropertyValue("bannerImage"))
var cropUrl = "";
if (relatedMedia != null){
cropUrl = relatedMedia.GetCropUrl("bannerImage");
{
var viewM = new WidgetViewModel
{
Id = content.Id,
Title = content.Name,
Url = content.Url,
BannerImageSrc = cropUrl
if you get the gist, at least you'll be able to set a breakpoint, and see if the media item is returned etc.....
Image Cropper broken URL with strongly typed view
Hi
I have umbaraco 7.3 and trying to get the image cropper to work with strongly typed view.
I have a custom media folder type and custom media image type.
Custom media image type (property alias umbracoFile) has a property of a custom image cropper.
My document type has a property of type custom media picker that points to the custom image type.
When I get content in the method below I only get
"1127?mode=pad&rnd=130948364990000000" for the BannerImageSrc.
Although 1127 is the node id of the bannerImage. Any ideas?
Hi Euge
A couple of things could be going wrong here;
1) If you've just added the Crop after you uploaded the media item; try going back into Umbraco, opening up the image, and resaving it, to ensure the crop data is there.
2) Otherwise to troubleshoot this I would get the Media Object back using Umbraco.TypedMedia and use GetCropUrl off of that...
eg
if you get the gist, at least you'll be able to set a breakpoint, and see if the media item is returned etc.....
cheers
Marc
Nice one Marc
Works a treat!!
Beers owed x2
is working on a reply...