Copied to clipboard

Flag this post as spam?

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


  • Martin Rud 232 posts 902 karma points c-trib
    May 29, 2022 @ 08:24
    Martin Rud
    0

    Image cropper sometimes doesn´t crop (but just adds some padding to make the image suite the dimensions)

    Hi,

    I have a site (was 8.10.x, but have just upgraded to 8.18.4 because I hoped to solve my problem that way). The problem is that image cropper sometimes doesn´t crop the images, but just adds some padding to make the image suite the dimensions.

    The site is https://uge30.glrye.dk and you can see on the two attached images how padding is added instead of cropping the image.

    Image with black padding Image with transparent padding

    Touching the web.config file or deleting the /App_Data/cache/ folder doesn´t solve the problem.

  • Dennis 75 posts 397 karma points MVP
    May 30, 2022 @ 11:17
    Dennis
    0

    Hi Martin,

    Images are not always up-scaled if they are smaller than the size that you're looking for. You should check out the option imageCropMode in .GetCropUrl( ... ). Some options support up-scaling, others don't. Some of them add padding. So you should check if your images are smaller than the provided width and height and check which crop mode you are using. Try some different settings, see which works how you expect.

  • Martin Rud 232 posts 902 karma points c-trib
    May 31, 2022 @ 03:14
    Martin Rud
    100

    Thanks for the suggestion. I gave tried several different options (found in https://github.com/umbraco/Umbraco-CMS/blob/95cd32ad8ce27993d9550a86950d821a1b4683ad/src/Umbraco.Web/ImageCropperTemplateExtensions.cs):

    upScale: true seemed right, but didn´t do any change.

    The 'funny' thing is that the image is smaller than the size I request from GetCropUrl() (and that could explain why) but it works on the initial upload and the error (padding) comes after I go cropping the image in the backend.

Please Sign in or register to post replies

Write your reply to:

Draft