Copied to clipboard

Flag this post as spam?

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

  • Proxicode 127 posts 323 karma points
    Aug 04, 2023 @ 15:48

    v12 GetCropUrl/ImageSharp

    Good day all!

    I have a new v12 site and am attempting to use the ImageCropper. I am following the docs from this page -

    Whether I try

    <img src="@Url.GetCropUrl(Model.Photo,"cropName")" />

    or (preferred)

    <img src="@Url.GetCropUrl(Model.Photo, height: 300, width: 400)" alt="@Model.Photo.Name" />

    On render I get the modified URL as expected


    but no change to the image. It seems that the query string parameters are ignored. Should I need to do any of the


    or should it "just work" out of the box? Does this have to do with the new licensing for ImageSharp?

    Happy to share more details if necessary.



  • Justin Neville 19 posts 131 karma points c-trib
    Aug 08, 2023 @ 10:00
    Justin Neville

    It should just work out of the box, can you check your URL is not HTML encoded?

    Try this in your address bar and see if it returns the processed image:


    I don't know if the forum added the encoding or if that has come from your end?

    Even in it's simplest form, this should resize an image:


    If that doesn't work, maybe check for any errors in the logs as Image Sharp should be added automatically by Umbraco.

  • Proxicode 127 posts 323 karma points
    Aug 08, 2023 @ 12:20

    Yep, you nailed it! Using your examples with non-encoded URLs works as expected! Not sure why they are being encoded in the first place (or why that didn't jump out at me), but that is absolutely the problem!

    Thanks Justin for helping me out on this H5YR!!

  • Proxicode 127 posts 323 karma points
    Aug 08, 2023 @ 12:33

    All good :-)

    var img = slide.Value<IPublishedContent>("slideImage");
    <img src="@Url.GetCropUrl(img, height: 300, width: 400, htmlEncode: false)" />
  • Justin Neville 19 posts 131 karma points c-trib
    Aug 08, 2023 @ 12:22
    Justin Neville

    No problem, glad that was the answer!

Please Sign in or register to post replies

Write your reply to: