Copied to clipboard

Flag this post as spam?

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


  • Wojciech 5 posts 96 karma points
    Jun 07, 2024 @ 07:04
    Wojciech
    0

    Images are not rendered in the size defined in cropper. Umbraco 13

    Hey, i pass model down to partial view and in partial view i want to render cropped image. I followed the documentation and used .GetCropUrl("alias here");

    Links generated by the GetCropUrl() seems to be fine, however the dimensions are not applied for some reason. Help me please i cannot solve this.

    In addition i wanted to say that I've changed the directory of storing medias.

    Here are the photos:

    Partial View enter image description here

    Website with links enter image description here

    enter image description here enter image description here

  • Adriano Fabri 469 posts 1633 karma points
    Jun 07, 2024 @ 09:13
    Adriano Fabri
    0

    Hi Wojciech, first of all I would like to suggest you to update your website to at least Umbraco v10 which is much more performing and powerful then v9.

    In the past I had the same problem with Umbraco v11.5.0 using the "ImageCropper" datatype.

    My solution has been to use, instead of image cropper, the "Media Picker" datatype configured with the crops.

    You can find information about the datatype at these links:

    Media Picker 3 for Umbraco 9

    Media Picker 3 for Umbraco 10+

    I hope this help you.

    Adriano

  • Wojciech 5 posts 96 karma points
    Jun 07, 2024 @ 13:37
    Wojciech
    101

    I use Umbraco 13. I managed to solve the problem.

    This line of code solved it for me.

    app.UseImageSharp();
    

    In Program.cs just right above

    app.UseStaticFiles(...);
    

    IMPORTANT: Seems like the issue was triggered by having media source directory out of wwwroot.

    By the way it didn't matter whether i used Image Media Picker or Image Cropper, the issue persisted anyway and i tried all of the variations.

  • Nemanja Stankovic 9 posts 99 karma points
    Jul 18, 2024 @ 10:27
    Nemanja Stankovic
    0

    You are a lifesaver!!! H5YR!!!

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Jun 07, 2024 @ 09:59
    Huw Reddick
    0

    check that the classes you are using are not overriding the image sizes

Please Sign in or register to post replies

Write your reply to:

Draft