Class ImageCropperTemplateCoreExtensions
- Namespace
 - Umbraco.Extensions
 
- Assembly
 - Umbraco.Web.Common.dll
 
public static class ImageCropperTemplateCoreExtensions
  - Inheritance
 - 
      
      ImageCropperTemplateCoreExtensions
 
- Inherited Members
 
Methods
GetCropUrl(string, IImageUrlGenerator, 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, 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
imageUrlstringThe image URL.
imageUrlGeneratorIImageUrlGeneratorThe image URL generator.
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, IImageUrlGenerator, 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, 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
imageUrlstringThe image URL.
imageUrlGeneratorIImageUrlGeneratorThe generator that will process all the options and the image URL to return a full image URLs with all processing options appended.
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, 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.
public static string? GetCropUrl(this MediaWithCrops mediaWithCrops, string cropAlias, IImageUrlGenerator imageUrlGenerator, IPublishedValueFallback publishedValueFallback, IPublishedUrlProvider publishedUrlProvider, UrlMode urlMode = 0)
  Parameters
mediaWithCropsMediaWithCropsThe MediaWithCrops item.
cropAliasstringThe crop alias e.g. thumbnail.
imageUrlGeneratorIImageUrlGeneratorThe image URL generator.
publishedValueFallbackIPublishedValueFallbackThe published value fallback.
publishedUrlProviderIPublishedUrlProviderThe published URL provider.
urlModeUrlModeThe url mode.
Returns
- string
 The URL of the cropped image.
GetCropUrl(MediaWithCrops, IImageUrlGenerator, IPublishedValueFallback, IPublishedUrlProvider, 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, 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 = 0)
  Parameters
mediaWithCropsMediaWithCropsThe MediaWithCrops item.
imageUrlGeneratorIImageUrlGeneratorThe image URL generator.
publishedValueFallbackIPublishedValueFallbackThe published value fallback.
publishedUrlProviderIPublishedUrlProviderThe published URL provider.
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 ImageProcessor supports. For example: <example>furtherOptions: "bgcolor=fff"
urlModeUrlModeThe url mode.
Returns
- 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.
public static string? GetCropUrl(this MediaWithCrops mediaWithCrops, IPublishedValueFallback publishedValueFallback, IPublishedUrlProvider publishedUrlProvider, string propertyAlias, string cropAlias, IImageUrlGenerator imageUrlGenerator, UrlMode urlMode = 0)
  Parameters
mediaWithCropsMediaWithCropsThe MediaWithCrops item.
publishedValueFallbackIPublishedValueFallbackThe published value fallback.
publishedUrlProviderIPublishedUrlProviderThe published URL provider.
propertyAliasstringThe property alias of the property containing the JSON data e.g. umbracoFile.
cropAliasstringThe crop alias e.g. thumbnail.
imageUrlGeneratorIImageUrlGeneratorThe image URL generator.
urlModeUrlModeThe url mode.
Returns
- 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.
public static string? GetCropUrl(this IPublishedContent mediaItem, string propertyAlias, string cropAlias, IImageUrlGenerator imageUrlGenerator, IPublishedValueFallback publishedValueFallback, IPublishedUrlProvider publishedUrlProvider, 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.
imageUrlGeneratorIImageUrlGeneratorThe image URL generator.
publishedValueFallbackIPublishedValueFallbackThe published value fallback.
publishedUrlProviderIPublishedUrlProviderThe published URL provider.
urlModeUrlModeThe url mode.
Returns
- 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.
public static string? GetCropUrl(this IPublishedContent mediaItem, string cropAlias, IImageUrlGenerator imageUrlGenerator, IPublishedValueFallback publishedValueFallback, IPublishedUrlProvider publishedUrlProvider, UrlMode urlMode = 0)
  Parameters
mediaItemIPublishedContentThe IPublishedContent item.
cropAliasstringThe crop alias e.g. thumbnail.
imageUrlGeneratorIImageUrlGeneratorThe image URL generator.
publishedValueFallbackIPublishedValueFallbackThe published value fallback.
publishedUrlProviderIPublishedUrlProviderThe published URL provider.
urlModeUrlModeThe url mode.
Returns
- string
 The URL of the cropped image.
GetCropUrl(IPublishedContent, IImageUrlGenerator, IPublishedValueFallback, IPublishedUrlProvider, 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, 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 = 0)
  Parameters
mediaItemIPublishedContentThe IPublishedContent item.
imageUrlGeneratorIImageUrlGeneratorThe image URL generator.
publishedValueFallbackIPublishedValueFallbackThe published value fallback.
publishedUrlProviderIPublishedUrlProviderThe published URL provider.
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 ImageProcessor supports. For example: <example>furtherOptions: "bgcolor=fff"
urlModeUrlModeThe url mode.
Returns
- 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.
public static string? GetCropUrl(this IPublishedContent mediaItem, ImageCropperValue imageCropperValue, string cropAlias, IImageUrlGenerator imageUrlGenerator, IPublishedValueFallback publishedValueFallback, IPublishedUrlProvider publishedUrlProvider, UrlMode urlMode = 0)
  Parameters
mediaItemIPublishedContentThe media item.
imageCropperValueImageCropperValueThe image cropper value.
cropAliasstringThe crop alias.
imageUrlGeneratorIImageUrlGeneratorThe image URL generator.
publishedValueFallbackIPublishedValueFallbackThe published value fallback.
publishedUrlProviderIPublishedUrlProviderThe published URL provider.
urlModeUrlModeThe url mode.s
Returns
- string
 The image crop URL.