I am using ImageGen on Umbraco v7.1. So far so good and am able to get crop urls through my Razor code.
However, I need to get the crop url on my Api controller but am unsure how to do this.
This is how I am currently trying to get it.
ModelImage = Services.MediaService.GetById(galleryId).GetValue("modelImage").ToString()
...where ModelImage
is an alias for the "Image Cropper" datatype.
This returns the image url in the src property along with crop information (line breaks added):
ModelImage: "{
"focalPoint": {
"left": 0.5,
"top": 0.5
},
"src": "/media/1828/bob-marley-thumbnail-update.jpg",
"crops": [
{
"alias": "modelListCrop",
"width": 298,
"height": 380,
"coordinates": {
"x1": 0.071221447830289469,
"y1": .051177864855964005,
"x2": 0.42344542232622806,
"y2": 0.45016601603464318
}
}
]
}"
Does anyone know how I can get the crop url instead of the original image url?