Copied to clipboard

Flag this post as spam?

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


  • Truyen 9 posts 110 karma points
    Sep 24, 2021 @ 23:40
    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 38 posts 351 karma points MVP 3x c-trib
    Sep 25, 2021 @ 23:25
    Jason Elkin
    101

    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 9 posts 110 karma points
    Sep 27, 2021 @ 17:13
    Truyen
    1

    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

  • Gurumurthy 54 posts 127 karma points
    Apr 10, 2023 @ 06:35
    Gurumurthy
    0

    Hi Jason,

    This plugin was very helpful, but the question I have here is, how we can confirm that a image format is different other then the extension that it has ? from your screenshot below that you posted earlier.

    enter image description here

    Is there any tool to identify this ? we have this type of issue with certain images, which is not loading with crop URLs, just to confirm that these images are with WEBP internally and with jpg/jpeg extensions.

    Thanks, Gurumurthy J V

Please Sign in or register to post replies

Write your reply to:

Draft