Image Resizer : API Documentation

Type IEncoder

Namespace ImageResizer.Encoding

An image encoder. Exposes methods for suitability checking, encoding, transparency compatibility checking, and mime-type/extension calculation.

Methods

Properties

Public instance methods

IEncoder CreateIfSuitable(ResizeSettings settings, object original)

If the encoder can handle the requirements specified by 'settings' and 'source', it should return an encoder instance. If not, it should return null.
Parameters
ResizeSettings settings
Request settings, like format, quality, colors, dither, etc.
object original
May be a Drawing.Image instance, a path, or null. To provide both, set Image.tag to the path. Helps the encoder detect the original format if the format was not specified. May also be used for palette generation hinting by some encoders.

void Write(Image i, Stream s)

Encodes the image to the specified stream

Public properties

string Extension get;

Returns a file extension appropriate for the output format as currently configured, without a leading dot.

string MimeType get;

Returns the appropriate mime-time for the output format as currently configured.

bool SupportsTransparency get;

True if the output format will support transparency as it is currently configured.