Class FriendlyImageCropperTemplateExtensions
- Namespace
 - Umbraco.Extensions
 
- Assembly
 - Umbraco.Web.Common.dll
 
public static class FriendlyImageCropperTemplateExtensions
  - Inheritance
 - 
      
      FriendlyImageCropperTemplateExtensions
 
- Inherited Members
 
Methods
GetCropUrl(string, int?, int?, string?, string?, int?, ImageCropMode??, ImageCropAnchor??, bool, bool, string?, string?)
Gets the underlying image processing service URL from the image path.
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
imageUrlstringThe image URL.
widthint?The width of the output image.
heightint?The height of the output image.
imageCropperValuestringThe JSON data from the Umbraco Core Image Cropper property editor.
cropAliasstringThe crop alias.
qualityint?Quality percentage of the output image.
imageCropModeImageCropMode?The image crop mode.
imageCropAnchorImageCropAnchor?The image crop anchor.
preferFocalPointboolUse focal point to generate an output image using the focal point instead of the predefined crop if there is one.
useCropDimensionsboolUse crop dimensions to have the output image sized according to the predefined crop sizes, this will override the width and height parameters.
cacheBusterValuestringAdd a serialized date of the last edit of the item to ensure client cache refresh when updated.
furtherOptionsstringThese are any query string parameters (formatted as query strings) that the underlying image processing service supports. For example: <example>furtherOptions: "bgcolor=fff"
Returns
- string
 The URL of the cropped image.
GetCropUrl(string, ImageCropperValue, int?, int?, string?, int?, ImageCropMode??, ImageCropAnchor??, bool, bool, string?, string?)
Gets the underlying image processing service URL from the image path.
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
imageUrlstringThe image URL.
cropDataSetImageCropperValueThe crop data set.
widthint?The width of the output image.
heightint?The height of the output image.
cropAliasstringThe crop alias.
qualityint?Quality percentage of the output image.
imageCropModeImageCropMode?The image crop mode.
imageCropAnchorImageCropAnchor?The image crop anchor.
preferFocalPointboolUse focal point to generate an output image using the focal point instead of the predefined crop if there is one.
useCropDimensionsboolUse crop dimensions to have the output image sized according to the predefined crop sizes, this will override the width and height parameters.
cacheBusterValuestringAdd a serialized date of the last edit of the item to ensure client cache refresh when updated.
furtherOptionsstringThese are any query string parameters (formatted as query strings) that the underlying image processing service supports. For example: <example>furtherOptions: "bgcolor=fff"
Returns
- string
 The URL of the cropped image.
GetCropUrl(MediaWithCrops, int?, int?, string, string?, int?, ImageCropMode??, ImageCropAnchor??, bool, bool, bool, string?, UrlMode?)
Gets the underlying image processing service URL from the MediaWithCrops item.
public static string? GetCropUrl(this MediaWithCrops mediaWithCrops, 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 = 0)
  Parameters
mediaWithCropsMediaWithCropsThe MediaWithCrops item.
widthint?The width of the output image.
heightint?The height of the output image.
propertyAliasstringProperty alias of the property containing the JSON data.
cropAliasstringThe crop alias.
qualityint?Quality percentage of the output image.
imageCropModeImageCropMode?The image crop mode.
imageCropAnchorImageCropAnchor?The image crop anchor.
preferFocalPointboolUse focal point, to generate an output image using the focal point instead of the predefined crop.
useCropDimensionsboolUse crop dimensions to have the output image sized according to the predefined crop sizes, this will override the width and height parameters.
cacheBusterboolAdd a serialized date of the last edit of the item to ensure client cache refresh when updated.
furtherOptionsstringThese are any query string parameters (formatted as query strings) that the underlying image processing service supports. For example: <example>furtherOptions: "bgcolor=fff"
urlModeUrlModeThe url mode.
Returns
- 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.
public static string? GetCropUrl(this MediaWithCrops mediaWithCrops, string propertyAlias, string cropAlias, UrlMode urlMode = 0)
  Parameters
mediaWithCropsMediaWithCropsThe MediaWithCrops item.
propertyAliasstringThe property alias of the property containing the JSON data e.g. umbracoFile.
cropAliasstringThe crop alias e.g. thumbnail.
urlModeUrlModeThe url mode.
Returns
- 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.
public static string? GetCropUrl(this MediaWithCrops mediaWithCrops, string cropAlias, UrlMode urlMode = 0)
  Parameters
mediaWithCropsMediaWithCropsThe MediaWithCrops item.
cropAliasstringThe crop alias e.g. thumbnail.
urlModeUrlModeThe url mode.
Returns
- string
 The URL of the cropped image.
GetCropUrl(IPublishedContent, int?, int?, string, string?, int?, ImageCropMode??, ImageCropAnchor??, bool, bool, bool, string?, UrlMode?)
Gets the underlying image processing service URL from the IPublishedContent item.
public static string? GetCropUrl(this IPublishedContent mediaItem, 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 = 0)
  Parameters
mediaItemIPublishedContentThe IPublishedContent item.
widthint?The width of the output image.
heightint?The height of the output image.
propertyAliasstringProperty alias of the property containing the JSON data.
cropAliasstringThe crop alias.
qualityint?Quality percentage of the output image.
imageCropModeImageCropMode?The image crop mode.
imageCropAnchorImageCropAnchor?The image crop anchor.
preferFocalPointboolUse focal point, to generate an output image using the focal point instead of the predefined crop.
useCropDimensionsboolUse crop dimensions to have the output image sized according to the predefined crop sizes, this will override the width and height parameters.
cacheBusterboolAdd a serialized date of the last edit of the item to ensure client cache refresh when updated.
furtherOptionsstringThese are any query string parameters (formatted as query strings) that the underlying image processing service supports. For example: <example>furtherOptions: "bgcolor=fff"
urlModeUrlModeThe url mode.
Returns
- 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.
public static string? GetCropUrl(this IPublishedContent mediaItem, string propertyAlias, string cropAlias, UrlMode urlMode = 0)
  Parameters
mediaItemIPublishedContentThe IPublishedContent item.
propertyAliasstringThe property alias of the property containing the JSON data e.g. umbracoFile.
cropAliasstringThe crop alias e.g. thumbnail.
urlModeUrlModeThe url mode.
Returns
- 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.
public static string? GetCropUrl(this IPublishedContent mediaItem, string cropAlias, UrlMode urlMode = 0)
  Parameters
mediaItemIPublishedContentThe IPublishedContent item.
cropAliasstringThe crop alias e.g. thumbnail.
urlModeUrlModeThe url mode.
Returns
- string
 The URL of the cropped image.
GetCropUrl(IPublishedContent, ImageCropperValue, string, UrlMode)
Gets the crop URL by using only the specified imageCropperValue.
public static string? GetCropUrl(this IPublishedContent mediaItem, ImageCropperValue imageCropperValue, string cropAlias, UrlMode urlMode = 0)
  Parameters
mediaItemIPublishedContentThe media item.
imageCropperValueImageCropperValueThe image cropper value.
cropAliasstringThe crop alias.
urlModeUrlModeThe url mode.
Returns
- string
 The image crop URL.