Reputation: 1757
I currently have an image cropper set up as an added property to set thumbnail images on my Image media type
I am currently running into an issue where the Umbraco.Media(id).GetCropUrl() on the Media object is correctly returning the url for the original image but not returning any thing when I request the cropped image url by name my debug dump and current setup looks as follows
@foreach (var image in sliderData)
{
<pre>
@{ var m = Umbraco.Media(image.img.id); }
Image.Id: @m.id
Original Crop Url: @m.GetCropUrl("gallerythumbnail")
Wide Crop: @m.GetCropUrl("gallerythumbnail", "wide")
Tall Crop: @m.GetCropUrl("gallerythumbnail", "tall")
</pre>
}
Upvotes: 0
Views: 1870
Reputation: 538
Maybe try using a typed media instead of just media i.e. var m = Umbraco.TypedMedia(image.img.id); .
Personally i don't put the cropper in the content media but in the actual media area and just have a normal media picker in the content which give me the id of the media image. then i just get the cropper direct without having to reference the alias of the content picker so in your example above i would then be using:
@m.GetCropUrl("wide") instead of @m.GetCropUrl("gallerythumbnail", "wide") not sure how much of a difference that makes but u definitely used the typed media and that works fine.
Upvotes: 2