Copied to clipboard

Flag this post as spam?

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


  • Rickard Liljeberg 23 posts 114 karma points
    Dec 20, 2015 @ 12:10
    Rickard Liljeberg
    0

    Image cropper gives blank crops in controller

    So I am using an Image cropper which is set up like so: https://db.tt/uzTZyTWL

    Then I put that picker on my News document type.

    Then I go ahead and create a news item like so https://db.tt/xJ9qT2Ei

    As can be seen there, there is a great looking cropped image.


    Now here is where my problems start, I prefer many things in pre-populated view models and then I use "Route hijacking" to populate them.

    This screenshot shows my problem https://db.tt/WEPZPcpq

    As you can see I do news.GetCropUrl(propertyAlias: "bild", height: 300, width: 400) Now I don't show that, but that works... 100% but that is not using my defined crop but rather just a height and width.

    My problem is in the watch window (debugger) below. When I try to ask for my cropAlias it returns null. I have also tried just GetCropUrl("bild", "myAlias") and that did not work either.

    So on the line below you see I get the image as property and there you can see on the line Value that towards the end the "crops" is empty.

    This seems to be my problem, even tho everything should be set up correctly.

    As a final thing I am showing the whole code for the Controller, should anyone be interested. It's the lower half (under News) that is of interest, the upper part works fine.

    https://db.tt/T1EXQzQO

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Dec 20, 2015 @ 16:45
    Jeavon Leopold
    0

    You are right, to use the predefined crop it should be like this: GetCropUrl(propertyAlias:"bild", cropAlias:"myAlias") Double check that your aliases are both correct

  • Rickard Liljeberg 23 posts 114 karma points
    Dec 20, 2015 @ 17:35
    Rickard Liljeberg
    0

    So now that you answered that I went back there and guess what, the same Watch now reported my alias.

    Before I had another bug and cleared all temp data and republished everything.

    So most likely there was something problematic there that was cleared at the same time.

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Dec 20, 2015 @ 18:17
    Jeavon Leopold
    0

    Hurrah!

Please Sign in or register to post replies

Write your reply to:

Draft