Table of Contents

Class ImagesController

Namespace
Umbraco.Cms.Web.BackOffice.Controllers
Assembly
Umbraco.Web.BackOffice.dll

A controller used to return images for media.

public class ImagesController : UmbracoAuthorizedApiController
Inheritance
ImagesController
Inherited Members

Constructors

ImagesController(MediaFileManager, IImageUrlGenerator)

[Obsolete("Use non obsolete-constructor. Scheduled for removal in Umbraco 13.")]
public ImagesController(MediaFileManager mediaFileManager, IImageUrlGenerator imageUrlGenerator)

Parameters

mediaFileManager MediaFileManager
imageUrlGenerator IImageUrlGenerator

ImagesController(MediaFileManager, IImageUrlGenerator, IOptionsMonitor<ContentSettings>)

[ActivatorUtilitiesConstructor]
public ImagesController(MediaFileManager mediaFileManager, IImageUrlGenerator imageUrlGenerator, IOptionsMonitor<ContentSettings> contentSettingsMonitor)

Parameters

mediaFileManager MediaFileManager
imageUrlGenerator IImageUrlGenerator
contentSettingsMonitor IOptionsMonitor<ContentSettings>

Methods

GetBigThumbnail(string)

Gets the big thumbnail image for the original image path.

public IActionResult GetBigThumbnail(string originalImagePath)

Parameters

originalImagePath string

Returns

IActionResult

Remarks

If there is no original image is found then this will return not found.

GetProcessedImageUrl(string, int?, int?, decimal?, decimal?, ImageCropMode?, string?, decimal?, decimal?, decimal?, decimal?)

Gets a processed image for the image at the given path

public string? GetProcessedImageUrl(string imagePath, int? width = null, int? height = null, decimal? focalPointLeft = null, decimal? focalPointTop = null, ImageCropMode? mode = 1, string? cacheBusterValue = null, decimal? cropX1 = null, decimal? cropX2 = null, decimal? cropY1 = null, decimal? cropY2 = null)

Parameters

imagePath string
width int?
height int?
focalPointLeft decimal?
focalPointTop decimal?
mode ImageCropMode
cacheBusterValue string
cropX1 decimal?
cropX2 decimal?
cropY1 decimal?
cropY2 decimal?

Returns

string

Remarks

If there is no media, image property or image file is found then this will return not found.

GetResized(string, int)

Gets a resized image for the image at the given path.

public IActionResult GetResized(string imagePath, int width)

Parameters

imagePath string
width int

Returns

IActionResult

Remarks

If there is no media, image property or image file is found then this will return not found.