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
mediaFileManagerMediaFileManagerimageUrlGeneratorIImageUrlGenerator
ImagesController(MediaFileManager, IImageUrlGenerator, IOptionsMonitor<ContentSettings>)
[ActivatorUtilitiesConstructor]
public ImagesController(MediaFileManager mediaFileManager, IImageUrlGenerator imageUrlGenerator, IOptionsMonitor<ContentSettings> contentSettingsMonitor)
Parameters
mediaFileManagerMediaFileManagerimageUrlGeneratorIImageUrlGeneratorcontentSettingsMonitorIOptionsMonitor<ContentSettings>
Methods
GetBigThumbnail(string)
Gets the big thumbnail image for the original image path.
public IActionResult GetBigThumbnail(string originalImagePath)
Parameters
originalImagePathstring
Returns
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
imagePathstringwidthint?heightint?focalPointLeftdecimal?focalPointTopdecimal?modeImageCropModecacheBusterValuestringcropX1decimal?cropX2decimal?cropY1decimal?cropY2decimal?
Returns
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
Returns
Remarks
If there is no media, image property or image file is found then this will return not found.