Class FriendlyImageCropperTemplateExtensions
Inheritance
Namespace: Umbraco.Extensions
Assembly: Umbraco.Web.Common.dll
Syntax
public static class FriendlyImageCropperTemplateExtensions
Methods
View SourceGetCropUrl(IPublishedContent, ImageCropperValue, String, UrlMode)
Gets the crop URL by using only the specified imageCropperValue
.
Declaration
public static string GetCropUrl(this IPublishedContent mediaItem, ImageCropperValue imageCropperValue, string cropAlias, UrlMode urlMode = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | mediaItem | The media item. |
ImageCropperValue | imageCropperValue | The image cropper value. |
System.String | cropAlias | The crop alias. |
UrlMode | urlMode | The url mode. |
Returns
Type | Description |
---|---|
System.String | The image crop URL. |
GetCropUrl(IPublishedContent, 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, int? width = null, int? height = null, string propertyAlias = null, 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 = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | mediaItem | The IPublishedContent item. |
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 the underlying image processing service
supports. For example:
|
UrlMode | urlMode | The url mode. |
Returns
Type | Description |
---|---|
System.String | The URL of the cropped image. |
GetCropUrl(IPublishedContent, String, String, 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, UrlMode urlMode = null)
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. |
UrlMode | urlMode | The url mode. |
Returns
Type | Description |
---|---|
System.String | The URL of the cropped image. |
GetCropUrl(IPublishedContent, String, 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, UrlMode urlMode = null)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | mediaItem | The IPublishedContent item. |
System.String | cropAlias | The crop alias e.g. thumbnail. |
UrlMode | urlMode | The url mode. |
Returns
Type | Description |
---|---|
System.String | The URL of the cropped image. |
GetCropUrl(MediaWithCrops, 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, int? width = null, int? height = null, string propertyAlias = null, 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 = null)
Parameters
Type | Name | Description |
---|---|---|
MediaWithCrops | mediaWithCrops | The MediaWithCrops item. |
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 the underlying image processing service
supports. For example:
|
UrlMode | urlMode | The url mode. |
Returns
Type | Description |
---|---|
System.String | The URL of the cropped image. |
GetCropUrl(MediaWithCrops, String, String, 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, string propertyAlias, string cropAlias, UrlMode urlMode = null)
Parameters
Type | Name | Description |
---|---|---|
MediaWithCrops | mediaWithCrops | The MediaWithCrops 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. |
UrlMode | urlMode | The url mode. |
Returns
Type | Description |
---|---|
System.String | The URL of the cropped image. |
GetCropUrl(MediaWithCrops, String, 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, UrlMode urlMode = null)
Parameters
Type | Name | Description |
---|---|---|
MediaWithCrops | mediaWithCrops | The MediaWithCrops item. |
System.String | cropAlias | The crop alias e.g. thumbnail. |
UrlMode | urlMode | The url mode. |
Returns
Type | Description |
---|---|
System.String | The URL of the cropped image. |
GetCropUrl(String, 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, 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. |
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(String, 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, 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. |
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. |