Image Resizer : API Documentation

Type ImageJob

Namespace ImageResizer

Public instance methods

ImageJob Build()

Shorthand method for ImageBuilder.Current.Build(this)

ImageJob CreateDir()

Sets CreateParentDirectory to true. Provided for easy chaining so you can do one-liners. new ImageJob(source,dest,settings).CreateDir().Build()

string ResolveTemplatedPath(string path, VariableResolverCallback resolver)

Public properties

bool AddFileExtension get; set;

If true, the appropriate extension for the encoding format will be added to the destination path, and the result will be stored in FinalPath in physical path form.

bool AllowDestinationPathVariables get; set;

If true (the default), destination paths can include variables that are expanded during the image build process. Ex. Dest = "~/folder/." will expand to "C:\WWW\App\folder\1ddadaadaddaa75da75ad34ad33da3a.jpg".

bool CreateParentDirectory get; set;

Defaults to false. When true, the parent directory of the destination filename will be created if it doesn't already exist.

object Dest get; set;

The destination Stream, physical path, or app-relative virtual path. If a Bitmap instance is desired, set this to typeof(System.Drawing.Bitmap). The result will be stored in.Result

bool DisposeDestinationStream get; set;

If true, and if 'dest' is a Stream instance, it will be disposed after the image has been written. Defaults to false.

bool DisposeSourceObject get; set;

If true, and if 'source' is a IDisposable instead like Bitmap or Stream instance, it will be disposed after it has been used. Defaults to true.

string FinalPath get; set;

Contains the final physical path to the image (if 'dest' was a path - null otherwise)

Instructions Instructions get; set;

The image processing instructions

List<string> RequestedInfo get; set;

A list of strings which define properties that can be returned to the caller. "source.width", "source.height", "result.ext", "result.mime" are the most commonly used. Defaults to none

bool ResetSourceStream get; set;

If true, and if 'source' is seekable, the stream will be reset to its previous position after being read. Always true for HttpPostedFile(Base) instances, defaults to false for all others.

object Result get; set;

The result if a Bitmap, BitmapSource, or IWICBitmapSource instance is requested.

string ResultFileExtension get;

The correct file extension for the resulting file stream, without a leading dot. Will be null if the result is not an encoded image.

Dictionary<string, object> ResultInfo get; set;

A dictionary of key/value pairs provided along with the result.

string ResultMimeType get;

The correct mime type for the resulting file stream, without a leading dot. Will be null if the result is not an encoded image.

ResizeSettings Settings get; set;

The image processing settings

object Source get; set;

The source image's physical path, app-relative virtual path, or a Stream, byte array, Bitmap, VirtualFile, IVirtualFile, HttpPostedFile, or HttpPostedFileBase instance.

Nullable<int> SourceHeight get;

The height, in pixels, of the first frame or page in the source image file

string SourcePathData get; set;

If 'source' contains any path-related data, it is copied into this member for use by format detetction code, so decoding can be optimized. May be a physical or virtual path, or just a file name.

Nullable<int> SourceWidth get;

The width, in pixels, of the first frame or page in the source image file