Copied to clipboard

Flag this post as spam?

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


  • Abilash Ashok 63 posts 418 karma points
    Dec 26, 2017 @ 06:55
    Abilash Ashok
    0

    Get crop URL of images in Media Library

    Hello,

    I have few images in my Media library which are uploaded through back-office. A sample image below:

    image-backoffice

    I am trying to get the crop URL for the images based on the hotspot (the green dot). Since, those images are not uploaded via Image Cropper, there are no crop regions define like thumbnail, header, etc. I have seen Image Cropper documentation but that didn't helped much.

    I would like to know whether it is possible to get cropped image with respect to hotspot on height & width; something like - GetCropUrl(propertyAlias: "heroImage", height: 400, width: 400) method.

    Any help will be appreciated. Thank you.

  • Rune Hem Strand 147 posts 911 karma points hq c-trib
    Dec 26, 2017 @ 13:21
    Rune Hem Strand
    100

    Hi Abilash,

    you can define crops on images uploaded to the media library by going to Settings > Media Types and then open the Image media type. Here you can edit the Upload Image (alias: umbracoFile) property, which uses the Image Cropper, and add any crops you would like. These should then be accessible by using the examples in Image Cropper docs.

    enter image description here

    Hope that helps :)

    All the best
    Rune

    Ps.: Alternatively you can add the crops by going to Developer > Data Types > Image Cropper. This is the saved configuration (Data Type) used on the Upload Image property, so will be the exact same outcome.

  • Abilash Ashok 63 posts 418 karma points
    Jan 02, 2018 @ 09:24
    Abilash Ashok
    1

    Sorry for the delay in replying back.

    Thanks for the detailed reply. Exactly what I was looking for. That helps a lot.

  • Rune Hem Strand 147 posts 911 karma points hq c-trib
    Jan 02, 2018 @ 09:37
    Rune Hem Strand
    0

    You're so very welcome - glad it helped :)

    Happy new year 🎉

    /Rune

Please Sign in or register to post replies

Write your reply to:

Draft