Copied to clipboard

Flag this post as spam?

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


  • Jonas Widenberg 9 posts 80 karma points
    Feb 27, 2019 @ 10:31
    Jonas Widenberg
    1

    GetCropUrl returns empty

    Hi, I'm trying out v. 8 for a bit this morning. I'm having trouble rendering cropped image urls though. I did this the other day in v.7 without issues. Has anything changed or am I missing something?

    testimonial.Image is a MediaPicker and I've defined a crop called "Testimonial".

    @testimonial.Image.Url renders an URL fine.

    @testimonial.Image.GetCropUrl("Testimonial") renders nothing.

    @Url.GetCropUrl(testimonial.Image, "Testimonial") renders nothing.

    Thanks!

  • Jonas Widenberg 9 posts 80 karma points
    Feb 27, 2019 @ 10:47
    Jonas Widenberg
    0

    If I go and edit the crop. The image renders afterwards. It seems you dont get a default crop?

    I don't see this behaviour in v. 7.

  • Murat 3 posts 73 karma points
    May 16, 2019 @ 14:51
    Murat
    0

    I'm using umbraco 8. How is the idea of how to solve this problem?

  • Josip 92 posts 381 karma points
    May 16, 2019 @ 15:35
    Josip
    1

    Hi,

    Probably there are better ways to do this but this is how i did it:

     @if (Image != null)
                        {
                            <img class="img-fluid d-block" src="@Image.GetCropUrl(250,150)" alt="@Image.Name" />
                        }
    
  • Murat 3 posts 73 karma points
    May 16, 2019 @ 15:47
    Murat
    0

    thanks for the answer, it solved

  • Ginu Jose 3 posts 73 karma points
    23 days ago
    Ginu Jose
    0

    I don't think this solves the question since the extension with crop alias is not working in Umbraco 8.

Please Sign in or register to post replies

Write your reply to:

Draft