I have a problem with 'getProperty' on a Media object.
I have this code:
var media = umbraco.cms.businesslogic.media.Media.GetRootMedias(); var employees = (from m in media where m.Text == "Employees" select m).First(); foreach(var img in employees.Children) { var text = img.Text; var id = img.Id; var width = img.getProperty("umbracoWidth"); var height = img.getProperty("umbracoHeight"); var file = img.getProperty("umbracoFile"); var all = img.getProperties; }
'text' and 'id' contains the correct values.
But 'width', 'height', 'file' are all null, and 'all' has a count of 0
In the umbraco backend i can see the width, height and more.
I am trying to make a little program, going through all the pictures in the 'Employees' folder, make sure all of them have a width and a height, some of them was created without this data.
The images i am playing with at the moment does have height and width.
The version is: umbraco v 4.0.2.1 (Assembly version: 1.0.3441.17657) (i know it is ancient, and i can't upgrade)
media getProperty always returning null
I have a problem with 'getProperty' on a Media object.
I have this code:
'text' and 'id' contains the correct values.
But 'width', 'height', 'file' are all null, and 'all' has a count of 0
In the umbraco backend i can see the width, height and more.
I am trying to make a little program, going through all the pictures in the 'Employees' folder, make sure all of them have a width and a height, some of them was created without this data.
The images i am playing with at the moment does have height and width.
The version is: umbraco v 4.0.2.1 (Assembly version: 1.0.3441.17657) (i know it is ancient, and i can't upgrade)
is working on a reply...