Skip to content

IImageProcessor

Namespace: MJCZone.MediaMatic.Processors

Assembly: MJCZone.MediaMatic

Summary

Provides image processing operations (resize, convert, optimize).

abstract public

Note: This is an interface that defines a contract. Look for implementing classes in the same or related namespaces.

Contents

Methods (3)

Methods

ResizeAsync

Resizes an image to the specified dimensions.

csharp
Task<ProcessedImage> ResizeAsync(
    Stream inputStream,
    Int32} width,
    Int32} height,
    ImageProcessingOptions options,
    CancellationToken cancellationToken)

Parameters

  • inputStream (Stream) - The input image stream.
  • width (Int32}) - Target width (optional).
  • height (Int32}) - Target height (optional).
  • options (ImageProcessingOptions) - Processing options.
  • cancellationToken (CancellationToken) - Cancellation token.

Returns

Type: Task<ProcessedImage>

Processed image with metadata.

ConvertFormatAsync

Converts an image to a different format.

csharp
Task&lt;ProcessedImage&gt; ConvertFormatAsync(
    Stream inputStream,
    ImageFormat targetFormat,
    int quality,
    CancellationToken cancellationToken)

Parameters

  • inputStream (Stream) - The input image stream.
  • targetFormat (ImageFormat) - Target image format.
  • quality (int) - Quality setting (0-100).
  • cancellationToken (CancellationToken) - Cancellation token.

Returns

Type: Task<ProcessedImage>

Processed image with metadata.

GenerateVariantsAsync

Generates multiple image variants (formats and sizes).

csharp
Task&lt;List&lt;ProcessedImage&gt;&gt; GenerateVariantsAsync(
    Stream inputStream,
    ImageUploadOptions options,
    CancellationToken cancellationToken)

Parameters

  • inputStream (Stream) - The input image stream.
  • options (ImageUploadOptions) - Upload options specifying desired variants.
  • cancellationToken (CancellationToken) - Cancellation token.

Returns

Type: Task<List<ProcessedImage>>

List of processed images.