Search Results for

    Show / Hide Table of Contents
    View Source

    Class ImagesController

    A controller used to return images for media

    Inheritance
    System.Object
    Microsoft.AspNetCore.Mvc.ControllerBase
    UmbracoApiControllerBase
    UmbracoApiController
    UmbracoAuthorizedApiController
    Namespace: Umbraco.Cms.Web.BackOffice.Controllers
    Assembly: Umbraco.Web.BackOffice.dll
    Syntax
    [PluginController("UmbracoApi")]
    public class ImagesController : UmbracoAuthorizedApiController, IUmbracoFeature, IDiscoverable

    Constructors

    View Source

    ImagesController(MediaFileManager, IImageUrlGenerator)

    Declaration
    public ImagesController(MediaFileManager mediaFileManager, IImageUrlGenerator imageUrlGenerator)
    Parameters
    Type Name Description
    MediaFileManager mediaFileManager
    IImageUrlGenerator imageUrlGenerator
    View Source

    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 Source

    GetBigThumbnail(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.

    View Source

    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.

    View Source

    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.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • ImagesController(MediaFileManager, IImageUrlGenerator)
      • ImagesController(MediaFileManager, IImageUrlGenerator, IOptionsMonitor<ContentSettings>)
    • Methods
      • GetBigThumbnail(String)
      • GetProcessedImageUrl(String, Nullable<Int32>, Nullable<Int32>, Nullable<Decimal>, Nullable<Decimal>, ImageCropMode, String, Nullable<Decimal>, Nullable<Decimal>, Nullable<Decimal>, Nullable<Decimal>)
      • GetResized(String, Int32)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX