Class ImageUrlGeneratorController
The API controller used for getting URLs for images with parameters
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Namespace: Umbraco.Cms.Web.BackOffice.Controllers
Assembly: Umbraco.Web.BackOffice.dll
Syntax
public class ImageUrlGeneratorController : UmbracoAuthorizedJsonController
Remarks
This controller allows for retrieving URLs for processed images, such as resized, cropped, or otherwise altered. These can be different based on the IImageUrlGenerator implementation in use, and so the BackOffice could should not rely on hard-coded string building to generate correct URLs
Constructors
View SourceImageUrlGeneratorController(IImageUrlGenerator)
Declaration
public ImageUrlGeneratorController(IImageUrlGenerator imageUrlGenerator)
Parameters
Type | Name | Description |
---|---|---|
IImageUrlGenerator | imageUrlGenerator |
Methods
View SourceGetCropUrl(String, Nullable<Int32>, Nullable<Int32>, Nullable<ImageCropMode>)
Declaration
public string GetCropUrl(string mediaPath, int? width = null, int? height = null, ImageCropMode? imageCropMode = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | mediaPath | |
System.Nullable<System.Int32> | width | |
System.Nullable<System.Int32> | height | |
System.Nullable<ImageCropMode> | imageCropMode |
Returns
Type | Description |
---|---|
System.String |