Copied to clipboard

Flag this post as spam?

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


  • Truyen 7 posts 107 karma points
    24 days ago
    Truyen
    0

    Image Cropper Not Cropping For Certain Images

    Hi,

    I'm using ImageCropper to crop an image but for some reason the cropped image url is not returning correct size. The original image size is 5120x2880 px and the crop size is 500x500px. However, if I resize the original image to 1920x1080 px and re-upload then the cropped image size is correct. Wondering if there is any settings that needs to be changed or it has something to do with specific resolution. enter image description here enter image description here

    Here's the syntax of the rendered image:

    <img src="@Url.GetCropUrl(Model.HeroBackgroundImage, "Background")" class="img-fluid" alt="" title="" />
    

    I've included the original image also: enter image description here

    Thanks

  • Jason Elkin 35 posts 304 karma points c-trib
    23 days ago
    Jason Elkin
    100

    Hi Truyen,

    I just took a look at your image. It's not actually a JPEG but a WebP image that happens to have a .jpg extension.

    Umbraco and ImageProcessor (which handles resizing etc. in Umbraco) won't work with WebP out of the box but it can be enabled - (see https://www.youtube.com/watch?v=u_ec8gEF9eY).

    You'll also want to make sure that your file extensions match the type of file that it actually is as this can cause other problems.

    enter image description here

  • Truyen 7 posts 107 karma points
    22 days ago
    Truyen
    0

    Hi Jason,

    It was the cause, these images are uploaded by content editors so I didn't know it was from a different format. After adding the changes, it's cropping correctly now.

    Thanks again

Please Sign in or register to post replies

Write your reply to:

Draft