Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Venkata Wunnava 10 posts 112 karma points
    Nov 03, 2015 @ 18:59
    Venkata Wunnava
    0

    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

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Nov 03, 2015 @ 20:03
    Dennis Aaen
    0

    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

  • Venkata Wunnava 10 posts 112 karma points
    Nov 04, 2015 @ 21:12
    Venkata Wunnava
    0

    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>
    

    gives me

    <div>
    Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache+DictionaryPublishedContent
    </div>
    <div></div>
    <div></div>
    <div>83</div>
    <div></div>
    
  • Venkata Wunnava 10 posts 112 karma points
    Nov 04, 2015 @ 23:49
    Venkata Wunnava
    100

    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. :)

  • k 256 posts 654 karma points
    Jan 11, 2016 @ 16:22
    k
    0

    Hello venkata,

    Can you please explain what u did , I am getting the same issue empty src.

    Thanking u in advance.

Please Sign in or register to post replies

Write your reply to:

Draft