Copied to clipboard

Flag this post as spam?

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

  • Ryan Davis 4 posts 96 karma points
    Oct 18, 2018 @ 13:22
    Ryan Davis

    Unable to set ImageCropAnchor when ImageCropMode is set to crop

    Umbraco Version: 7.10.4

    When trying to use GetCropUrl on a media image I'm unable to overwrite the default anchor=center on the image when the ImageCropMode is set to crop.

    I'm current having to do

    umbracoHelper.TypedMedia(x.GetValue<int>("profilePicture")).GetCropUrl(230, 130).Replace("anchor=center", "anchor=top")

    Instead of being able to do

    umbracoHelper.TypedMedia(x.GetValue<int>("profilePicture")).GetCropUrl(230, 130, imageCropAnchor: Umbraco.Web.Models.ImageCropAnchor.Top)

    Is this intentional or a bug? Thanks for any help.

  • Shaishav Karnani from 350 posts 1634 karma points
    Aug 20, 2019 @ 10:34
    Shaishav Karnani from

    Please can you try. I have added Url and seems to work fine for me.

    umbracoHelper.TypedMedia(x.GetValue<int>("profilePicture")).Url.GetCropUrl(230, 130, imageCropAnchor: Umbraco.Web.Models.ImageCropAnchor.Top)
Please Sign in or register to post replies

Write your reply to: