Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi there,
I've been trying to find a way to get the crop urls from a media-picker file.
here is my code that displays the "topImage" from the media picker, what do I have to add to get a specific crop?
@{ if (Model.Content.HasValue("topImage", true)) { var mediaItem = Umbraco.TypedMedia(Model.Content.GetPropertyValue("topImage", true)); <img src="@mediaItem.GetPropertyValue("umbracoFile")" alt="@mediaItem.GetPropertyValue("Name")" /> }}
I've been google-ing for hours without finding exactly what i need.
mvh
Hey, check out last weeks uHangOut where I went through the cropper in detail. You can find the example site used in uHangOut here Specifically what you are looking for is here
Thanks Jeavon,
Does that also work for Umbraco 6.1.6 ?
Ah no, for v6 you should take a look at the documentation here
However I would recommend also taking a look at CropUp which is the inspiration behind the v7 cropper
I ended up using the CropUp as I couldn't get the normal cropper to work.
This then worked for me.
Great, CropUp is definitely the best cropping solution for v6 projects.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Getting Image Crop from media-picker file
Hi there,
I've been trying to find a way to get the crop urls from a media-picker file.
here is my code that displays the "topImage" from the media picker, what do I have to add to get a specific crop?
I've been google-ing for hours without finding exactly what i need.
mvh
Hey, check out last weeks uHangOut where I went through the cropper in detail. You can find the example site used in uHangOut here Specifically what you are looking for is here
Thanks Jeavon,
Does that also work for Umbraco 6.1.6 ?
Ah no, for v6 you should take a look at the documentation here
However I would recommend also taking a look at CropUp which is the inspiration behind the v7 cropper
Thanks Jeavon,
I ended up using the CropUp as I couldn't get the normal cropper to work.
This then worked for me.
@{if (Model.Content.HasValue("topImage", true)) {var mediaItem = Umbraco.TypedMedia(Model.Content.GetPropertyValue("topImage", true));var newURL = @mediaItem.GetPropertyValue("umbracoFile");<img src="@CropUp.GetUrl(newURL.ToString(), new ImageSizeArguments { Width = 960, Height = 201 })" />}}Great, CropUp is definitely the best cropping solution for v6 projects.
is working on a reply...