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 |
---|---|---|
MediaFileManager | mediaFileManager | |
IImageUrlGenerator | imageUrlGenerator |
ImagesController(MediaFileManager, IImageUrlGenerator, IOptionsMonitor<ContentSettings>)
Declaration
[ActivatorUtilitiesConstructor]
public ImagesController(MediaFileManager mediaFileManager, IImageUrlGenerator imageUrlGenerator, IOptionsMonitor<ContentSettings> contentSettingsMonitor)
Parameters
Type | Name | Description |
---|---|---|
MediaFileManager | mediaFileManager | |
IImageUrlGenerator | imageUrlGenerator | |
Microsoft.Extensions.Options.IOptionsMonitor<ContentSettings> | 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.String | originalImagePath |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Mvc.IActionResult |
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.String | imagePath | |
System.Nullable<System.Int32> | width | |
System.Nullable<System.Int32> | height | |
System.Nullable<System.Decimal> | focalPointLeft | |
System.Nullable<System.Decimal> | focalPointTop | |
ImageCropMode | mode | |
System.String | cacheBusterValue | |
System.Nullable<System.Decimal> | cropX1 | |
System.Nullable<System.Decimal> | cropX2 | |
System.Nullable<System.Decimal> | cropY1 | |
System.Nullable<System.Decimal> | cropY2 |
Returns
Type | Description |
---|---|
System.String |
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.String | imagePath | |
System.Int32 | width |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Mvc.IActionResult |
Remarks
If there is no media, image property or image file is found then this will return not found.