I am having an issue getting the crop URL from the image cropper in Razor. I tried to change the upload of the media type and also used it as new field. However, specifying the Blur works but not the getcrop. Tried all steps mentioned in the article with no luck. Please assist anyone.
I used all the methods suggested in the Video ,but the GetCropUrl gets me an empty string. So basically the following code,
@{
var im = Umbraco.Media(@item.blogPostImage);
}
Image.Id: @im.id
Original Url: @im.Url
Original Crop Url: @im.GetCropUrl("Thumb")
Wide Crop: @im.GetCropUrl("Thumb", "wide")
Tall Crop: @im.GetCropUrl("Thumb", "tall")
yields the result as
Image.Id: 2550 Original Url: Original Crop Url: Wide Crop: Tall Crop:
tried Umbraco.TypedMedia too with no result.
@{
var media = Umbraco.TypedMedia(1297);
var image = media.Url;
var crop = media.GetCropUrl("Thumb");
var height = media.GetPropertyValue<int>("umbracoHeight");
}
<div>@media</div>
<div>@image</div>
<div>@height</div>
<div>@crop</div>
Image Cropper
I am having an issue getting the crop URL from the image cropper in Razor. I tried to change the upload of the media type and also used it as new field. However, specifying the Blur works but not the getcrop. Tried all steps mentioned in the article with no luck. Please assist anyone.
Image-Cropper
Hi Venkata,
Perhaps it can help you to get the crop url by watching the uHangOut episode 30 http://uhangout.co.uk/videos/ep030-with-jeavon-leopold-responsive-imaging-cropping/ where Jeavon Leopold is showing how the image cropper is working.
Hope this helps,
/Dennis
I used all the methods suggested in the Video ,but the GetCropUrl gets me an empty string. So basically the following code,
yields the result as
Image.Id: 2550 Original Url: Original Crop Url: Wide Crop: Tall Crop:
tried Umbraco.TypedMedia too with no result.
gives me
Finally was able to resolve the issue! Deleted all crops and recreated them again. Opened and saved each image. Also used
int.Parse
to get the id. :)Hello venkata,
Can you please explain what u did , I am getting the same issue empty src.
Thanking u in advance.
is working on a reply...