Copied to clipboard

Flag this post as spam?

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

  • WURMi 4 posts 74 karma points
    Mar 25, 2017 @ 22:48

    GetCropUrl with imageCropMode


    I'm using Umbraco version 7.5.9 and I have some difficulties using predefined crops with crop mode other than "Crop". I'd like to use predefined crop size with crop mode "Max".

    Let me write some samples:

    @mediaItem.GetCropUrl(cropAlias: "thumb_landscape", useCropDimensions: true)

    this work and return string is:


    @mediaItem.GetCropUrl(cropAlias: "thumb_landscape", useCropDimensions: true, quality: 50)

    if I add some custom attributes like 'quality', it work as well:


    @mediaItem.GetCropUrl(cropAlias: "thumb_landscape", useCropDimensions: true, quality: 50, imageCropMode: ImageCropMode.Max)

    but why if I add imageCropMode with something other than 'Crop' width and height attributes disappears???


    I spend couple of hours trying to understand if this is a some special feature or bug, but more and more I think it's a bug ;-/



  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Mar 27, 2017 @ 18:53
    Dan Diplo

    The Umbraco image cropper actually utilises Image Processor in the background - the docs for resize modes are here -

    Many of the crop modes keep the image's aspect ratio and only change the dimension of either height OR width, so it doesn't make sense to specify the exact size for both - they are dynamically calculated at runtime.

  • Josef Henryson 24 posts 98 karma points
    Oct 18, 2023 @ 08:43
    Josef Henryson

    That link goes to a russian site. Feels unsafe.

  • Sven Geusens 169 posts 881 karma points c-trib
    Mar 28, 2017 @ 08:05
    Sven Geusens

    But if you look at the max documentation, you will see you can specify both, so WURMi seems to be right to assume that there is a bug using the cropalias together with something else than crop

    Resize Max

    Resizes the image to the given dimensions. If the set dimensions do not match the aspect ratio of the original image then the output is resized to the maximum possible value in each direction while aintaining the original aspect ratio.


  • WURMi 4 posts 74 karma points
    Mar 28, 2017 @ 08:27

    You're right Sven. This is exactly what I need to achieve. Using both dimensions (defined in crop alias) together with crop mode Resize Max

  • Sven Geusens 169 posts 881 karma points c-trib
    Mar 28, 2017 @ 11:57
    Sven Geusens

    What happens if you put the height and width parameters in the generated url? Do you get the image in the correct format then? If so, maybe make a bug/feature report on the issue tracker

  • WURMi 4 posts 74 karma points
    Mar 28, 2017 @ 12:36

    Yes, it work like described in documentation => the image is resized to the maximum possible dimensions in consideration of aspect ratio. So I will create a bug report on the issue tracker. Thanks for confirmation of my assumption ;)

  • Perry Cope 31 posts 195 karma points
    Jul 11, 2018 @ 15:03
    Perry Cope

    I know this is old but was this ever fixed Im still seeing the same issue and googling only ever brings up this question.

  • Christian Reinholdt 2 posts 73 karma points
    Mar 11, 2021 @ 13:44
    Christian Reinholdt

    I'm still seeing this issue 4 years later in 2021.

    Bug reported:

  • Hallie 1 post 71 karma points
    Mar 17, 2021 @ 04:06

    One of the greatest challenges that come with creating a responsive, mobile-friendly site is to adapt your images for various smaller resolutions so that they're not the bandwidth-eating monsters you normally get on a desktop resolution.

Please Sign in or register to post replies

Write your reply to: