Class ImagesController
A controller used to return images for media
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Namespace: Umbraco.Cms.Web.BackOffice.Controllers
Assembly: Umbraco.Web.BackOffice.dll
Syntax
[PluginController("UmbracoApi")]
public class ImagesController : UmbracoAuthorizedApiController, IUmbracoFeature, IDiscoverable
Constructors
View SourceImagesController(MediaFileManager, IImageUrlGenerator)
Declaration
public ImagesController(MediaFileManager mediaFileManager, IImageUrlGenerator imageUrlGenerator)
Parameters
Type | Name | Description |
---|---|---|
Media |
mediaFileManager | |
IImage |
imageUrlGenerator |
ImagesController(MediaFileManager, IImageUrlGenerator, IOptionsMonitor<ContentSettings>)
Declaration
[ActivatorUtilitiesConstructor]
public ImagesController(MediaFileManager mediaFileManager, IImageUrlGenerator imageUrlGenerator, IOptionsMonitor<ContentSettings> contentSettingsMonitor)
Parameters
Type | Name | Description |
---|---|---|
Media |
mediaFileManager | |
IImage |
imageUrlGenerator | |
Microsoft. |
contentSettingsMonitor |
Methods
View SourceGetBigThumbnail(String)
Gets the big thumbnail image for the original image path
Declaration
public IActionResult GetBigThumbnail(string originalImagePath)
Parameters
Type | Name | Description |
---|---|---|
System. |
originalImagePath |
Returns
Type | Description |
---|---|
Microsoft. |
Remarks
If there is no original image is found then this will return not found.
GetProcessedImageUrl(String, Nullable<Int32>, Nullable<Int32>, Nullable<Decimal>, Nullable<Decimal>, ImageCropMode, String, Nullable<Decimal>, Nullable<Decimal>, Nullable<Decimal>, Nullable<Decimal>)
Gets a processed image for the image at the given path
Declaration
public string GetProcessedImageUrl(string imagePath, int? width = null, int? height = null, decimal? focalPointLeft = null, decimal? focalPointTop = null, ImageCropMode mode = ImageCropMode.Max, string cacheBusterValue = "", decimal? cropX1 = null, decimal? cropX2 = null, decimal? cropY1 = null, decimal? cropY2 = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
imagePath | |
System. |
width | |
System. |
height | |
System. |
focalPointLeft | |
System. |
focalPointTop | |
Image |
mode | |
System. |
cacheBusterValue | |
System. |
cropX1 | |
System. |
cropX2 | |
System. |
cropY1 | |
System. |
cropY2 |
Returns
Type | Description |
---|---|
System. |
Remarks
If there is no media, image property or image file is found then this will return not found.
GetResized(String, Int32)
Gets a resized image for the image at the given path
Declaration
public IActionResult GetResized(string imagePath, int width)
Parameters
Type | Name | Description |
---|---|---|
System. |
imagePath | |
System. |
width |
Returns
Type | Description |
---|---|
Microsoft. |
Remarks
If there is no media, image property or image file is found then this will return not found.