Copied to clipboard

Flag this post as spam?

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


  • SC 6 posts 96 karma points
    Sep 09, 2019 @ 12:13
    SC
    0

    GetCropUrl

    When upgrading from 8.0.2 to 8.1.4, the IPublishedContent .GetCropUrl returns nothing. I can't seem to find a change regarding this, am I missing something?

  • Shaishav Karnani from digitallymedia.com 330 posts 1537 karma points
    Sep 09, 2019 @ 12:17
    Shaishav Karnani from digitallymedia.com
    0

    Hi,

    Does this work for you?

    IPublishedContent.Url.GetCropUrl

    Cheers,

    Shaishav

  • SC 6 posts 96 karma points
    Sep 09, 2019 @ 12:22
    SC
    0
    var test = expert.Url.GetCropUrl(); // returns URL of the IPublishedContent (this is the item which contains an image, so it's not correct
    
    var test2 = expert.Value<IPublishedContent>("expertPicture"); // returns null, while I can see the property in the Properties list
    
    var test3 = expert.GetCropUrl("expertPicture", "Expert Picture"); // returns an empty string
    

    I would expect test2 to work correctly, but it is not. Is it because the value is of a different type, something media related?

    Edit:

    var test = expert.Value<ImageCropperValue>("expertPicture");
    var test2 = test.GetCropUrl("Expert Picture");
    

    test is returning the correct value. test2 is returning a querystring (without url: "?anchor=center&mode=crop&width=500&height=500")

    Edit 2: current workaround solution (if this is not intended):

    var picture = expert.Value<ImageCropperValue>("expertPicture");
    var url = picture.Url;
    var cropUrl = url + picture.GetCropUrl("Expert Picture");
    
Please Sign in or register to post replies

Write your reply to:

Draft