Table of Contents

Class FormatWebProcessor

Namespace
SixLabors.ImageSharp.Web.Processors
Assembly
SixLabors.ImageSharp.Web.dll

Allows the changing of image formats.

public class FormatWebProcessor : IImageWebProcessor
Inheritance
FormatWebProcessor
Implements
Inherited Members

Constructors

FormatWebProcessor(IOptions<ImageSharpMiddlewareOptions>)

Initializes a new instance of the FormatWebProcessor class.

public FormatWebProcessor(IOptions<ImageSharpMiddlewareOptions> options)

Parameters

options IOptions<ImageSharpMiddlewareOptions>

The middleware configuration options.

Fields

Format

The command constant for format.

public const string Format = "format"

Field Value

string

Properties

Commands

Gets the collection of recognized command keys.

public IEnumerable<string> Commands { get; }

Property Value

IEnumerable<string>

Methods

Process(FormattedImage, ILogger, CommandCollection, CommandParser, CultureInfo)

Processes the image based on the given commands.

public FormattedImage Process(FormattedImage image, ILogger logger, CommandCollection commands, CommandParser parser, CultureInfo culture)

Parameters

image FormattedImage

The image to process.

logger ILogger

The type used for performing logging.

commands CommandCollection

The ordered collection containing the processing commands.

parser CommandParser

The command parser use for parting commands.

culture CultureInfo

The CultureInfo to use as the current parsing culture.

Returns

FormattedImage

The FormattedImage.

RequiresTrueColorPixelFormat(CommandCollection, CommandParser, CultureInfo)

Returns a value indicating whether the image to be processed should be decoded using a 32 bit True Color pixel format - 8 bits per color component plus an 8 bit alpha channel https://en.wikipedia.org/wiki/Color_depth#True_color_(24-bit).

This method is used to determine whether optimizations can be enabled to reduce memory consumption during processing.

public bool RequiresTrueColorPixelFormat(CommandCollection commands, CommandParser parser, CultureInfo culture)

Parameters

commands CommandCollection

The ordered collection containing the processing commands.

parser CommandParser

The command parser use for parting commands.

culture CultureInfo

The CultureInfo to use as the current parsing culture.

Returns

bool

The bool indicating whether a 32 bit True Color pixel format is required.