Table of Contents

Class ImageExtensions

Namespace
The.Documents
Assembly
Instagile.dll
public static class ImageExtensions
Inheritance
ImageExtensions
Inherited Members

Methods

GetFlippedHorizontallyAsync(ImageDocument, IPrincipal?, CancellationToken?, DocumentAccessRule?)

Retrieve a copy of the image flipped on the Y axis

public static Task<ImageDocument> GetFlippedHorizontallyAsync(this ImageDocument source, IPrincipal? principal = null, CancellationToken? cancellationToken = null, DocumentAccessRule? access = null)

Parameters

source ImageDocument
principal IPrincipal
cancellationToken CancellationToken?
access DocumentAccessRule

Returns

Task<ImageDocument>

GetFlippedVerticallyAsync(ImageDocument, IPrincipal?, CancellationToken?, DocumentAccessRule?)

Retrieve a copy of the image flipped on the Y axis

public static Task<ImageDocument> GetFlippedVerticallyAsync(this ImageDocument source, IPrincipal? principal = null, CancellationToken? cancellationToken = null, DocumentAccessRule? access = null)

Parameters

source ImageDocument
principal IPrincipal
cancellationToken CancellationToken?
access DocumentAccessRule

Returns

Task<ImageDocument>

GetRotationAsync(ImageDocument, int, IPrincipal?, CancellationToken?, DocumentAccessRule?)

Retrieve a copy of the image rotated 90 clockwise the specified number of times.

public static Task<ImageDocument> GetRotationAsync(this ImageDocument source, int rotation, IPrincipal? principal = null, CancellationToken? cancellationToken = null, DocumentAccessRule? access = null)

Parameters

source ImageDocument
rotation int

The number of 90-degree clockwise rotations to apply.

principal IPrincipal
cancellationToken CancellationToken?
access DocumentAccessRule

Returns

Task<ImageDocument>

GetThumbnailAsync(ImageDocument, int?, int?, string?, IPrincipal?, CancellationToken?)

Retrieve or create a thumbnail that will fit the given bounds and optionally has the desired MIME type

public static Task<ImageDocument> GetThumbnailAsync(this ImageDocument source, int? maxWidth, int? maxHeight, string? targetMimeType = null, IPrincipal? principal = null, CancellationToken? cancellationToken = null)

Parameters

source ImageDocument
maxWidth int?

Either maxWidth or maxHeight must be set. The image will be resized according to its aspect ratio and the smaller of the two parameters.

maxHeight int?

Either maxWidth or maxHeight must be set. The image will be resized according to its aspect ratio and the smaller of the two parameters.

targetMimeType string

The desired MIME type of the thumbnail. If null is passed, the source image's MIME type is used.

principal IPrincipal
cancellationToken CancellationToken?

Returns

Task<ImageDocument>

GetThumbnailAsync(ImageDocument, ImageMetadata, int?, int?, string?, IPrincipal?, CancellationToken?)

Retrieve or create a thumbnail that will fit the given bounds and optionally has the desired MIME type

public static Task<ImageDocument> GetThumbnailAsync(this ImageDocument source, ImageMetadata metadata, int? maxWidth, int? maxHeight, string? targetMimeType = null, IPrincipal? principal = null, CancellationToken? cancellationToken = null)

Parameters

source ImageDocument
metadata ImageMetadata

Pre-loaded metadata containing existing thumbnails.

maxWidth int?

Either maxWidth or maxHeight must be set. The image will be resized according to its aspect ratio and the smaller of the two parameters.

maxHeight int?

Either maxWidth or maxHeight must be set. The image will be resized according to its aspect ratio and the smaller of the two parameters.

targetMimeType string

The desired MIME type of the thumbnail. If null is passed, the source image's MIME type is used.

principal IPrincipal
cancellationToken CancellationToken?

Returns

Task<ImageDocument>