Copied to clipboard

Flag this post as spam?

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


  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Apr 25, 2016 @ 08:51
    Chriztian Steinmeier
    0

    How to get Image width/height in a Property Editor view

    Hi all,

    I'm building a Property Editor where I currently have a prevalue that's using the "imagepicker" view (i.e., the image is selected in the configuration of the property editor, thus can't be changed on the document type using the property editor).

    The value returned from this is just the path to the image.

    I'd really like to get to the width & height properties as well - can I use the mediaHelper service for that? How would I go about doing that?

    /Chriztian

  • Ravi Motha 290 posts 500 karma points MVP 8x c-trib
    Apr 25, 2016 @ 09:00
    Ravi Motha
    0

    https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/media-picker

    but should be able to get the typed media item and then use umbracoWidth and umbracoHeight

    Ravi

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Apr 25, 2016 @ 09:04
    Chriztian Steinmeier
    0

    Thanks Ravi,

    I'm inside an Angular view in the backoffice — maybe that wasn't as obvious :-)

    /Chriztian

  • Ravi Motha 290 posts 500 karma points MVP 8x c-trib
    Apr 25, 2016 @ 11:23
    Ravi Motha
    0

    can you get find the ID ? or is that what you are looking for?

  • Ravi Motha 290 posts 500 karma points MVP 8x c-trib
    Apr 25, 2016 @ 11:25
    Ravi Motha
    0

    also can you you use : http://umbraco.github.io/Belle/#/api/umbraco.services.mediaHelper scaleto maxsize to get the height and width you require???

    Ravi

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies