Get Dimensions of Media Item (Image)

Topics: Customizing Orchard
Jan 5, 2015 at 10:38 PM
How would you go about grabbing the dimensions of an image that is contained in another content part? I can use the following:

((MediaLibraryPickerField)i.Fields.Single(f => f.Name == "Picture")).MediaParts.First().MediaUrl

to grab the MediaUrl from the Picture field contained in my content part, but I don't know how to access the ImagePart for this field. Thank you.