Class ImageCropperTemplateCoreExtensions
Inheritance
Namespace: Umbraco.Extensions
Assembly: Umbraco.Web.Common.dll
Syntax
public static class ImageCropperTemplateCoreExtensions
Methods
View SourceGetCropUrl(String, IImageUrlGenerator, Nullable<Int32>, Nullable<Int32>, String, String, Nullable<Int32>, Nullable<ImageCropMode>, Nullable<ImageCropAnchor>, Boolean, Boolean, String, String)
Gets the underlying image processing service URL from the image path.
Declaration
public static string GetCropUrl(this string imageUrl, IImageUrlGenerator imageUrlGenerator, int? width = null, int? height = null, string imageCropperValue = null, string cropAlias = null, int? quality = null, ImageCropMode? imageCropMode = null, ImageCropAnchor? imageCropAnchor = null, bool preferFocalPoint = false, bool useCropDimensions = false, string cacheBusterValue = null, string furtherOptions = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | imageUrl | The image URL. |
IImageUrlGenerator | imageUrlGenerator | The image URL generator. |
System.Nullable<System.Int32> | width | The width of the output image. |
System.Nullable<System.Int32> | height | The height of the output image. |
System.String | imageCropperValue | The Json data from the Umbraco Core Image Cropper property editor. |
System.String | cropAlias | The crop alias. |
System.Nullable<System.Int32> | quality | Quality percentage of the output image. |
System.Nullable<ImageCropMode> | imageCropMode | The image crop mode. |
System.Nullable<ImageCropAnchor> | imageCropAnchor | The image crop anchor. |
System.Boolean | preferFocalPoint | Use focal point to generate an output image using the focal point instead of the predefined crop if there is one. |
System.Boolean | useCropDimensions | Use crop dimensions to have the output image sized according to the predefined crop sizes, this will override the width and height parameters. |
System.String | cacheBusterValue | Add a serialized date of the last edit of the item to ensure client cache refresh when updated. |
System.String | furtherOptions | These are any query string parameters (formatted as query strings) that the underlying image processing service
supports. For example:
|
Returns
Type | Description |
---|---|
System.String | The URL of the cropped image. |
GetCropUrl(String, IImageUrlGenerator, ImageCropperValue, Nullable<Int32>, Nullable<Int32>, String, Nullable<Int32>, Nullable<ImageCropMode>, Nullable<ImageCropAnchor>, Boolean, Boolean, String, String)
Gets the underlying image processing service URL from the image path.
Declaration
public static string GetCropUrl(this string imageUrl, IImageUrlGenerator imageUrlGenerator, ImageCropperValue cropDataSet, int? width = null, int? height = null, string cropAlias = null, int? quality = null, ImageCropMode? imageCropMode = null, ImageCropAnchor? imageCropAnchor = null, bool preferFocalPoint = false, bool useCropDimensions = false, string cacheBusterValue = null, string furtherOptions = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | imageUrl | The image URL. |
IImageUrlGenerator | imageUrlGenerator | The generator that will process all the options and the image URL to return a full image URLs with all processing options appended. |
ImageCropperValue | cropDataSet | The crop data set. |
System.Nullable<System.Int32> | width | The width of the output image. |
System.Nullable<System.Int32> | height | The height of the output image. |
System.String | cropAlias | The crop alias. |
System.Nullable<System.Int32> | quality | Quality percentage of the output image. |
System.Nullable<ImageCropMode> | imageCropMode | The image crop mode. |
System.Nullable<ImageCropAnchor> | imageCropAnchor | The image crop anchor. |
System.Boolean | preferFocalPoint | Use focal point to generate an output image using the focal point instead of the predefined crop if there is one. |
System.Boolean | useCropDimensions | Use crop dimensions to have the output image sized according to the predefined crop sizes, this will override the width and height parameters. |
System.String | cacheBusterValue | Add a serialized date of the last edit of the item to ensure client cache refresh when updated. |
System.String | furtherOptions | These are any query string parameters (formatted as query strings) that the underlying image processing service
supports. For example:
|
Returns
Type | Description |
---|---|
System.String | The URL of the cropped image. |
GetCropUrl(MediaWithCrops, String, IImageUrlGenerator, IPublishedValueFallback, IPublishedUrlProvider, UrlMode)
Gets the underlying image processing service URL by the crop alias (from the "umbracoFile" property alias in the MediaWithCrops content item) on the MediaWithCrops item.
Declaration
public static string GetCropUrl(this MediaWithCrops mediaWithCrops, string cropAlias, IImageUrlGenerator imageUrlGenerator, IPublishedValueFallback publishedValueFallback, IPublishedUrlProvider publishedUrlProvider, UrlMode urlMode = UrlMode.Default)
Parameters
Type | Name | Description |
---|---|---|
MediaWithCrops | mediaWithCrops | The MediaWithCrops item. |
System.String | cropAlias | The crop alias e.g. thumbnail. |
IImageUrlGenerator | imageUrlGenerator | The image URL generator. |
IPublishedValueFallback | publishedValueFallback | The published value fallback. |
IPublishedUrlProvider | publishedUrlProvider | The published URL provider. |
UrlMode | urlMode | The url mode. |
Returns
Type | Description |
---|---|
System.String | The URL of the cropped image. |
GetCropUrl(MediaWithCrops, IImageUrlGenerator, IPublishedValueFallback, IPublishedUrlProvider, Nullable<Int32>, Nullable<Int32>, String, String, Nullable<Int32>, Nullable<ImageCropMode>, Nullable<ImageCropAnchor>, Boolean, Boolean, Boolean, String, UrlMode)
Gets the underlying image processing service URL from the MediaWithCrops item.
Declaration
public static string GetCropUrl(this MediaWithCrops mediaWithCrops, IImageUrlGenerator imageUrlGenerator, IPublishedValueFallback publishedValueFallback, IPublishedUrlProvider publishedUrlProvider, int? width = null, int? height = null, string propertyAlias = "umbracoFile", string cropAlias = null, int? quality = null, ImageCropMode? imageCropMode = null, ImageCropAnchor? imageCropAnchor = null, bool preferFocalPoint = false, bool useCropDimensions = false, bool cacheBuster = true, string furtherOptions = null, UrlMode urlMode = UrlMode.Default)
Parameters
Type | Name | Description |
---|---|---|
MediaWithCrops | mediaWithCrops | The MediaWithCrops item. |
IImageUrlGenerator | imageUrlGenerator | The image URL generator. |
IPublishedValueFallback | publishedValueFallback | The published value fallback. |
IPublishedUrlProvider | publishedUrlProvider | The published URL provider. |
System.Nullable<System.Int32> | width | The width of the output image. |
System.Nullable<System.Int32> | height | The height of the output image. |
System.String | propertyAlias | Property alias of the property containing the JSON data. |
System.String | cropAlias | The crop alias. |
System.Nullable<System.Int32> | quality | Quality percentage of the output image. |
System.Nullable<ImageCropMode> | imageCropMode | The image crop mode. |
System.Nullable<ImageCropAnchor> | imageCropAnchor | The image crop anchor. |
System.Boolean | preferFocalPoint | Use focal point, to generate an output image using the focal point instead of the predefined crop. |
System.Boolean | useCropDimensions | Use crop dimensions to have the output image sized according to the predefined crop sizes, this will override the width and height parameters. |
System.Boolean | cacheBuster | Add a serialized date of the last edit of the item to ensure client cache refresh when updated. |
System.String | furtherOptions | These are any query string parameters (formatted as query strings) that ImageProcessor supports. For example:
|
UrlMode | urlMode | The url mode. |
Returns
Type | Description |
---|---|
System.String | The URL of the cropped image. |
GetCropUrl(MediaWithCrops, IPublishedValueFallback, IPublishedUrlProvider, String, String, IImageUrlGenerator, UrlMode)
Gets the underlying image processing service URL by the crop alias using the specified property containing the image cropper JSON data on the MediaWithCrops content item.
Declaration
public static string GetCropUrl(this MediaWithCrops mediaWithCrops, IPublishedValueFallback publishedValueFallback, IPublishedUrlProvider publishedUrlProvider, string propertyAlias, string cropAlias, IImageUrlGenerator imageUrlGenerator, UrlMode urlMode = UrlMode.Default)
Parameters
Type | Name | Description |
---|---|---|
MediaWithCrops | mediaWithCrops | The MediaWithCrops item. |
IPublishedValueFallback | publishedValueFallback | The published value fallback. |
IPublishedUrlProvider | publishedUrlProvider | The published URL provider. |
System.String | propertyAlias | The property alias of the property containing the JSON data e.g. umbracoFile. |
System.String | cropAlias | The crop alias e.g. thumbnail. |
IImageUrlGenerator | imageUrlGenerator | The image URL generator. |
UrlMode | urlMode | The url mode. |
Returns
Type | Description |
---|---|
System.String | The URL of the cropped image. |
GetCropUrl(IPublishedContent, String, String, IImageUrlGenerator, IPublishedValueFallback, IPublishedUrlProvider, UrlMode)
Gets the underlying image processing service URL by the crop alias using the specified property containing the image cropper JSON data on the IPublishedContent item.
Declaration
public static string GetCropUrl(this IPublishedContent mediaItem, string propertyAlias, string cropAlias, IImageUrlGenerator imageUrlGenerator, IPublishedValueFallback publishedValueFallback, IPublishedUrlProvider publishedUrlProvider, UrlMode urlMode = UrlMode.Default)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | mediaItem | The IPublishedContent item. |
System.String | propertyAlias | The property alias of the property containing the JSON data e.g. umbracoFile. |
System.String | cropAlias | The crop alias e.g. thumbnail. |
IImageUrlGenerator | imageUrlGenerator | The image URL generator. |
IPublishedValueFallback | publishedValueFallback | The published value fallback. |
IPublishedUrlProvider | publishedUrlProvider | The published URL provider. |
UrlMode | urlMode | The url mode. |
Returns
Type | Description |
---|---|
System.String | The URL of the cropped image. |
GetCropUrl(IPublishedContent, String, IImageUrlGenerator, IPublishedValueFallback, IPublishedUrlProvider, UrlMode)
Gets the underlying image processing service URL by the crop alias (from the "umbracoFile" property alias) on the IPublishedContent item.
Declaration
public static string GetCropUrl(this IPublishedContent mediaItem, string cropAlias, IImageUrlGenerator imageUrlGenerator, IPublishedValueFallback publishedValueFallback, IPublishedUrlProvider publishedUrlProvider, UrlMode urlMode = UrlMode.Default)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | mediaItem | The IPublishedContent item. |
System.String | cropAlias | The crop alias e.g. thumbnail. |
IImageUrlGenerator | imageUrlGenerator | The image URL generator. |
IPublishedValueFallback | publishedValueFallback | The published value fallback. |
IPublishedUrlProvider | publishedUrlProvider | The published URL provider. |
UrlMode | urlMode | The url mode. |
Returns
Type | Description |
---|---|
System.String | The URL of the cropped image. |
GetCropUrl(IPublishedContent, IImageUrlGenerator, IPublishedValueFallback, IPublishedUrlProvider, Nullable<Int32>, Nullable<Int32>, String, String, Nullable<Int32>, Nullable<ImageCropMode>, Nullable<ImageCropAnchor>, Boolean, Boolean, Boolean, String, UrlMode)
Gets the underlying image processing service URL from the IPublishedContent item.
Declaration
public static string GetCropUrl(this IPublishedContent mediaItem, IImageUrlGenerator imageUrlGenerator, IPublishedValueFallback publishedValueFallback, IPublishedUrlProvider publishedUrlProvider, int? width = null, int? height = null, string propertyAlias = "umbracoFile", string cropAlias = null, int? quality = null, ImageCropMode? imageCropMode = null, ImageCropAnchor? imageCropAnchor = null, bool preferFocalPoint = false, bool useCropDimensions = false, bool cacheBuster = true, string furtherOptions = null, UrlMode urlMode = UrlMode.Default)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | mediaItem | The IPublishedContent item. |
IImageUrlGenerator | imageUrlGenerator | The image URL generator. |
IPublishedValueFallback | publishedValueFallback | The published value fallback. |
IPublishedUrlProvider | publishedUrlProvider | The published URL provider. |
System.Nullable<System.Int32> | width | The width of the output image. |
System.Nullable<System.Int32> | height | The height of the output image. |
System.String | propertyAlias | Property alias of the property containing the JSON data. |
System.String | cropAlias | The crop alias. |
System.Nullable<System.Int32> | quality | Quality percentage of the output image. |
System.Nullable<ImageCropMode> | imageCropMode | The image crop mode. |
System.Nullable<ImageCropAnchor> | imageCropAnchor | The image crop anchor. |
System.Boolean | preferFocalPoint | Use focal point, to generate an output image using the focal point instead of the predefined crop. |
System.Boolean | useCropDimensions | Use crop dimensions to have the output image sized according to the predefined crop sizes, this will override the width and height parameters. |
System.Boolean | cacheBuster | Add a serialized date of the last edit of the item to ensure client cache refresh when updated. |
System.String | furtherOptions | These are any query string parameters (formatted as query strings) that ImageProcessor supports. For example:
|
UrlMode | urlMode | The url mode. |
Returns
Type | Description |
---|---|
System.String | The URL of the cropped image. |
GetCropUrl(IPublishedContent, ImageCropperValue, String, IImageUrlGenerator, IPublishedValueFallback, IPublishedUrlProvider, UrlMode)
Gets the crop URL by using only the specified imageCropperValue
.
Declaration
public static string GetCropUrl(this IPublishedContent mediaItem, ImageCropperValue imageCropperValue, string cropAlias, IImageUrlGenerator imageUrlGenerator, IPublishedValueFallback publishedValueFallback, IPublishedUrlProvider publishedUrlProvider, UrlMode urlMode = UrlMode.Default)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | mediaItem | The media item. |
ImageCropperValue | imageCropperValue | The image cropper value. |
System.String | cropAlias | The crop alias. |
IImageUrlGenerator | imageUrlGenerator | The image URL generator. |
IPublishedValueFallback | publishedValueFallback | The published value fallback. |
IPublishedUrlProvider | publishedUrlProvider | The published URL provider. |
UrlMode | urlMode | The url mode.s |
Returns
Type | Description |
---|---|
System.String | The image crop URL. |