DataWeb
Search Results for

    Show / Hide Table of Contents

    Interface IImageService

    Represents a service for manipulating images.

    Namespace: DataWeb.Media
    Assembly: DataWeb.Core.dll
    Syntax
    public interface IImageService

    Properties

    Name

    Gets the name of the service.

    Declaration
    string Name { get; }
    Property Value
    Type Description
    string

    Methods

    CreateThumbnail(IFile, ThumbnailDefinition, int, int, ResizeMode, bool, bool, string, Func<object, Task>, CancellationToken)

    Creates a thumbnail for the specified file with the specified dimensions and resize mode.

    Declaration
    Task CreateThumbnail(IFile file, ThumbnailDefinition thumbnailDefinition, int width, int height, ResizeMode resizeMode = ResizeMode.Fix, bool isMetaDataRemoval = false, bool isCutDisabled = false, string imageContext = null, Func<object, Task> imageProcessDelegate = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    IFile file

    The IFile to create the thumbnail for.

    ThumbnailDefinition thumbnailDefinition
    int width

    The desired width of the thumbnail.

    int height

    The desired height of the thumbnail.

    ResizeMode resizeMode

    The ResizeMode of the thumbnail.

    bool isMetaDataRemoval

    Removes meta data from thumbnail.

    bool isCutDisabled
    string imageContext
    Func<object, Task> imageProcessDelegate
    CancellationToken cancellationToken
    Returns
    Type Description
    Task

    DeleteThumbnailsAsync(CancellationToken)

    Deletes all thumbnails generated by the service.

    Declaration
    Task DeleteThumbnailsAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task

    GetImageFormatAsync(Stream, CancellationToken)

    Gets the image format of the specified stream.

    Declaration
    Task<string> GetImageFormatAsync(Stream stream, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Stream stream

    The stream to get the image format for.

    CancellationToken cancellationToken
    Returns
    Type Description
    Task<string>

    The image format of the specified stream, or null if the format is unknown.

    GetThumbnailDefinition(IFile, bool)

    Gets the thumbnail definition.

    Declaration
    ThumbnailDefinition GetThumbnailDefinition(IFile file, bool isContextOriginalFormat = false)
    Parameters
    Type Name Description
    IFile file

    The IFile to create the thumbnail for.

    bool isContextOriginalFormat

    Forces the original format of the images.

    Returns
    Type Description
    ThumbnailDefinition

    A ThumbnailDefinition for thumbnail handling

    GetThumbnailStreamAsync(IFile, ThumbnailDefinition, int, int, ResizeMode, bool, string, CancellationToken)

    Gets a stream containing the thumbnail for the specified file with the specified dimensions and resize mode.

    Declaration
    Task<Stream> GetThumbnailStreamAsync(IFile file, ThumbnailDefinition thumbnailDefinition, int width, int height, ResizeMode resizeMode = ResizeMode.Fix, bool isCutDisabled = false, string imageContext = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    IFile file

    The IFile to retrieve the thumbnail for.

    ThumbnailDefinition thumbnailDefinition
    int width

    The desired width of the thumbnail.

    int height

    The desired height of the thumbnail.

    ResizeMode resizeMode

    The ResizeMode of the thumbnail.

    bool isCutDisabled
    string imageContext
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<Stream>

    A stream containing the thumbnail for the specified file, or null if the thumbnail does not exist.

    IsThumbnailAsync(IFile, ThumbnailDefinition, int, int, ResizeMode, bool, string, CancellationToken)

    Determines whether the specified file has a thumbnail with the specified dimensions and resize mode.

    Declaration
    Task<bool> IsThumbnailAsync(IFile file, ThumbnailDefinition thumbnailDefinition, int width, int height, ResizeMode resizeMode = ResizeMode.Fix, bool isCutDisabled = false, string imageContext = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    IFile file

    The IFile to check.

    ThumbnailDefinition thumbnailDefinition
    int width

    The desired width of the thumbnail.

    int height

    The desired height of the thumbnail.

    ResizeMode resizeMode

    The ResizeMode of the thumbnail.

    bool isCutDisabled
    string imageContext
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<bool>

    true if the thumbnail exists; otherwise, false.

    In this article
    Back to top Generated by DocFX