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?
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
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
Thanks Ravi,
I'm inside an Angular view in the backoffice — maybe that wasn't as obvious :-)
/Chriztian
can you get find the ID ? or is that what you are looking for?
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
is working on a reply...