Hello all,
I am kind of stuck here ![]()
I created a new Data Type based on (Umbraco.ImageCropper)
In the Crop options I Have a few Crop option EX: Alias “small“ Width “480” Height “0” etc..
I am trying to extract the URL of each cropped images to store them in a var.
var cimage below, definitely returns an object with the src of the image and an array of Aliases which returns the name of the alias and the width height etc..
Not too sure how to get the cropped URL though.. Code below doesn’t work unfortunately? it doesn’t like “cropAlias“.
Any idea please?
Thanks !
Christophe
var cimage = Model.Value<ImageCropperValue>("heroImage");
string smallUrl = null;
string mediumUrl = null;
string largeUrl = null;
string xlargeUrl = null;
if (cimage != null)
{
smallUrl = cimage.GetCropUrl(cropAlias: "small");
mediumUrl = cimage.GetCropUrl(cropAlias: "medium");
largeUrl = cimage.GetCropUrl(cropAlias: "large");
xlargeUrl = cimage.GetCropUrl(cropAlias: "Xlarge");
}