ImageResizer Represents the widths of edges of a box. Create a box with all edges the same width. Create a box, specifying individual widths for each size Copies the specified BoxEdges instance Sets the width of all edges, returning a new instance Gets edge offsets as a clockwise array, starting with Top. Returns double.NaN unless all edges are the same width, in which case that width is returned Returns an instance with a width of 0 Returns true if th Provides culture-invariant parsing of byte, int, double, float, bool, and enum values. Provides culture-invariant parsing of byte, int, double, float, bool, and enum values. Provides culture-invariant parsing of byte, int, double, float, bool, and enum values. Serializes the given value by calling .ToString(). If the value is null, the key is removed. Provides culture-invariant serialization of value types, in lower case for querystring readability. Setting a key to null removes it. Writes the diagnostic message at the specified level. The log level. A to be written. Writes the diagnostic message at the Trace level. A to be written. Writes the diagnostic message at the Debug level. A to be written. Writes the diagnostic message at the Info level. A to be written. Writes the diagnostic message at the Warn level. A to be written. Writes the diagnostic message at the Error level. A to be written. Writes the diagnostic message at the Fatal level. A to be written. Checks if the specified log level is enabled. The log level. A value indicating whether the specified log level is enabled. Gets a value indicating whether the Trace level is enabled. Gets a value indicating whether the Debug level is enabled. Gets a value indicating whether the Info level is enabled. Gets a value indicating whether the Warn level is enabled. Gets a value indicating whether the Error level is enabled. Gets a value indicating whether the Fatal level is enabled. Gets or sets the logger name. Loads NLog configuration from the specified file. The name of the file to load NLog configuration from. Creates the specified logger object and assigns a LoggerName to it. Logger name. The new logger instance. Provides automatic download of native dependencies (which VS doesn't see). Gets the correct bitness as well - very nice if you're changing app pool bitness and forgot to change binaries. Returns a copy of the list of reported issues. Adds the specified issue to the list unless it is an exact duplicate of another instance. Thread safe countdown class Extends enumerations by allowing them to define alternate strings with the [EnumString("Alternate Name",true)] attribute, and support it through TryParse and ToPreferredString Attempts case-insensitive parsing of the specified enum. Returns the specified default value if parsing fails. Supports [EnumString("Alternate Value")] attributes and parses flags. If any segment of a comma-delimited list isn't parsed as either a number or string, defaultValue will be returned. Attempts case-insensitive parsing of the specified enum. Returns null if parsing failed. Supports [EnumString("Alternate Value")] attributes and parses flags. If any segment of a comma-delimited list isn't parsed as either a number or string, null will be returned. Retuns the string representation for the given enumeration Provides culture-invariant parsing of int, double, float, bool, and enum values. Provides culture-invariant parsing of int, double, float, bool, and enum values. Provides culture-invariant parsing of int, double, float, bool, and enum values. Provides culture-invariant parsing of int, double, float, bool, and enum values. Serializes the given value by calling .ToString(). If the value is null, the key is removed. Provides culture-invariant serialization of value types, in lower case for querystring readability. Setting a key to null removes it. Parses a comma-delimited list of primitive values. If there are unparsable items in the list, they will be replaced with 'fallbackValue'. If fallbackValue is null, the function will return null Returns true if any of the specified keys contain a value Normalizes a command that has two possible names. If either of the commands has a null or empty value, those keys are removed. If both the the primary and secondary are present, the secondary is removed. Otherwise, the secondary is renamed to the primary name. Creates and returns a new NameValueCollection instance that contains only the specified keys from the current collection. Creates and returns a new NameValueCollection instance that contains all of the keys/values from 'q', and any keys/values from 'defaults' that 'q' does not already contain. The settings specific to a particular query Default settings to use when not overridden by 'q'. Provides extension methods for copying streams Copies the remaining data in the current stream to a new MemoryStream instance. Copies the current stream into a new MemoryStream instance. True to copy entire stream if seeakable, false to only copy remaining data Copies the current stream into a new MemoryStream instance. True to copy entire stream if seeakable, false to only copy remaining data The buffer size to use (in bytes) if a buffer is required. Default: 4KiB Copies the remaining data in the current stream to a byte[] array of exact size. Copies the current stream into a byte[] array of exact size. True to copy entire stream if seeakable, false to only copy remaining data Copies the remaining data from the this stream into the given stream. The stream to write to Copies this stream into the given stream The stream to write to True to copy entire stream if seeakable, false to only copy remaining data Copies this stream into the given stream The stream to write to True to copy entire stream if seeakable, false to only copy remaining data True to copy entire stream if seeakable, false to only copy remaining data Copies the current stream into a byte[] array of exact size True to copy entire stream if seeakable, false to only copy remaining data. The buffer size to use (in bytes) if a buffer is required. Default: 4KiB Attempts to return a byte[] array containing the remaining portion of the stream. Unlike CopyToBytes(), does not return a byte[] array of exact length, and may re-use the actual Stream's byte array, making it unsafe to write to in the future. Creates an ImageJob that won't run a full build - it will only do enough work in order to supply the requested data fields. Pass null to use "source.width","source.height", "result.ext","result.mime". Shorthand method for ImageBuilder.Current.Build(this) Sets CreateParentDirectory to true. Provided for easy chaining so you can do one-liners. new ImageJob(source,dest,settings).CreateDir().Build() Internal use only. Resolves the specified (potenetially templated) path into a physical path. Applies the AddFileExtension setting using the 'ext' variable. Supplies the guid, settings.*, filename, path, and originalExt variables. The resolver method should supply 'ext', 'width', and 'height' (all of which refer to the final image). If AllowDestinationPathVariables=False, only AddFileExtenson will be processed. 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 A dictionary of key/value pairs provided along with the result. The source image's physical path, app-relative virtual path, or a Stream, byte array, Bitmap, VirtualFile, IVirtualFile, HttpPostedFile, or HttpPostedFileBase instance. 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 The result if a Bitmap, BitmapSource, or IWICBitmapSource instance is requested. The width, in pixels, of the first frame or page in the source image file The height, in pixels, of the first frame or page in the source image file The correct file extension for the resulting file stream, without a leading dot. Will be null if the result is not an encoded image. The correct mime type for the resulting file stream, without a leading dot. Will be null if the result is not an encoded image. The image processing settings The image processing instructions 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. 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. If true, and if 'dest' is a Stream instance, it will be disposed after the image has been written. Defaults to false. Contains the final physical path to the image (if 'dest' was a path - null otherwise) 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. 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. If true (the default), destination paths can include variables that are expanded during the image build process. Ex. Dest = "~/folder/<guid>.<ext>" will expand to "C:\WWW\App\folder\1ddadaadaddaa75da75ad34ad33da3a.jpg". Defaults to false. When true, the parent directory of the destination filename will be created if it doesn't already exist. A name/value collection of image processsing instructions. The successor to ResizeSettings. Just because a key doesn't have a property wrapper doesn't mean you can't use it. i["key"] = value; isnt' that scary. Returns a human-friendly representation of the instruction set. Not suitable for URL usage; use ToQueryString() for that. Returns a URL-safe querystring containing the instruction set Creates an empty instructions collection. Copies the specified collection into a new Instructions instance. Parses the specified querystring into name/value pairs. Supports standard and semicolon syntaxes. The most readable format is 'key=value;key2=value2' Discards everything after the first '#' character as a URL fragment. The width in pixels to constrain the image to. See 'Mode' and 'Scale' for constraint logic. The height in pixels to constrain the image to. See 'Mode' and 'Scale' for constraint logic. The fit mode to use when both Width and Height are specified. Defaults to Pad. The alignment to use when cropping or padding the image automatically. Defaults to MiddleCenter. Flip instruction to perform immediately after loading source image. Maps to 'sflip' and 'sourceFlip'. Flip instruction to perform after rendering is complete Control how upscaling is performed. Defaults to DownscaleOnly. Allows disk caching to be forced or prevented. Allows processing to be forced or prevented. The frame of the animated GIF to display. 1-based The page of the TIFF file to display. 1-based Determines Jpeg encoding quality. Maps to 'quality' setting. Maps to 'subsampling'. Requires encoder=wic|freeimage or builder=wic|freeimage to take effect. Not supported by the GDI pipeline. Maps to 'colors'. Sets the palette size for the final png or gif image (not relevant for jpegs). Set to 'null' to use the largest palette size available in the format. Requires the PrettyGifs or WicEncoder plugin. A multiplier to apply to all sizing settings (still obeys Scale=down, though). Useful when you need to apply a page-wide scaling factor, such as for mobile devices. Defines the horizontal width of the crop rectangle's coordinate space. For example, setting this to 100 makes the crop X1 and X2 values percentages of the image width. Defines the vertical height of the crop rectangle's coordinate space. For example, setting this to 100 makes the crop Y1 and Y1 values percentages of the image height. An X1,Y1,X2,Y2 array of coordinates. Unless CropXUnits and CropYUnits are specified, these are in the coordinate space of the original image. An X1,Y1,X2,Y2 array of coordinates. Unless CropXUnits and CropYUnits are specified, these are in the coordinate space of the original image. Automatically rotates images based on gravity sensor data embedded in Exif. Requires the AutoRotate plugin Maps to 'srotate'. Rotates the source image prior to processing. Only 90 degree angles are currently supported. Maps to 'rotate'. Rotates the image during rendering. Arbitrary angles are supported. Use 'OutputFormat' unless you need a custom value. Determines the format and encoding of the output image. Selects the image encoding format. Maps to 'format'. Returns null if the format is unspecified or if it isn't defined in the enumeration. If true, the ICC profile will be discared instead of being evaluated server side (which typically causes inconsistent and unexpected effects). The fallback image to redirect to if the original image doesn't exist. Must be the name of a pre-defined 404 image or a filename in the default 404 images directory. Requires the Image404 plugin to be installed. The color of margin and padding regions. Defaults to Transparent, or White (when jpeg is the selected output color). Defaults to 'bgcolor'. Allows a separate color to be used for padding areas vs. margins. The color to draw the border with, if a border width is specified. The name of a pre-defined preset, or a comma-delimited list of presets to apply. These may overwrite other settings. Requires the Presets plugin. The name of a pre-defined watermark layer or group from Web.config, or a comma-delimited list of names. Requires the Watermark plugin. Applies a Negative filter to the image. Requires the SimpleFilters plugin Applies a Sepia filter to the image. Requires the SimpleFilters plugin Applies the specified kind of grayscale filter to the image. Requires the SimpleFilters plugin Value between 0 and 1. Makes the rendered image transparent. Does not affect borders or background colors - those accept 4-byte colors with alpha channels, however. Requires the SimpleFilters plugin. Unless the output format is PNG, the image will be blended against white or the background color. -1..1 Adjust the brightness of the image. Requires the SimpleFilters plugin -1..1 Adjust the contrast of the image. Requires the SimpleFilters plugin -1..1 Adjust the saturation of the image. Requires the SimpleFilters plugin Setting this enables automatic whitespace trimming using an energy function. 50 is safe, even 255 rarely cuts anything off except a shadow. Set TrimPadding to pad the result slightly and improve appearance. Requires the WhitespaceTrimmer plugin. Set TrimThreshold first. This specifies a percentage of the image size to 'add' to the crop rectangle. Setting to 0.5 or 1 usually produces good results. Requires the WhitespaceTrimmer plugin. Guassian Blur. Requires the AdvancedFilters plugin. Unsharp Mask. Requires the AdvancedFilters plugin. Safe noise removal. Requires the AdvancedFilters plugin. Controls dithering when rendering to an 8-bit PNG or GIF image. Requires PrettyGifs or WicEncoder. Accepted values for PrettyGifs: true|false|4pass|30|50|79|[percentage]. Accepted values for WicEncoder: true|false. Specify a preferred encoder for compressing the output image file. Defaults to 'gdi'. Other valid values are 'freeimage' and 'wic', which require the FreeImageEncoder and WicEncoder plugins respectively. FreeImage offers faster jpeg encoding, while WIC offers faster PNG and GIF encoding. Both, however, require full trust. Specify a preferred decoder for parsing the original image file. Defaults to 'gdi'. Other values include 'freeimage', 'wic', and 'psdreader'. The preferred decoder gets the first chance at reading the files. If that fails, all other decoders try, in order of declaration in Web.config. Requires the matching FreeImageDecoder, WicDecoder, or PsdReader plugin to be installed. Specify the image processing pipeline to use. Defaults to 'gdi'. If FreeImageBuilder or WicBuilder is installed, you can specify 'freeimage' or 'wic' to use that pipeline instead. The WIC pipeline offers a 2-8X performance increase of GDI, at the expense of slightly reduced image quality, the full trust requirement, and support for only basic resize and crop commands. FreeImage offers *nix-level image support, and handles many images that gdi and wic can't deal with. It is also restricted to a subset of the full command series. Gets or sets a 1 or 4-element array defining cornder radii. If the array is 1 element, it applies to all corners. If it is 4 elements, each corner gets an individual radius. Values are percentages of the image width or height, whichever is smaller. Requires the SimpleFilters plugin. ["paddingWidth"]: Gets/sets the width(s) of padding inside the image border. ["margin"]: Gets/sets the width(s) of the margin outside the image border and effects. Friendly get/set accessor for the ["borderWidth"] value. Returns null when unspecified. Provides a useable base class that can be used to modify the behavior of ImageBuilder. When registered with an ImageBuilder instance, the ImageBuilder will call the corresponding methods on the extension prior to executing its own methods. Not for external use. Inherit from BuilderExtension instead. Dual-purpose base class for both ImageBuilder and BuilderExtension Extensions can inherit and override certain methods. ImageBuilder inherits this method to utilize its extension invocation code. Each method of AbstractImageProcessor loops through all extensions and executes the same method on each. Provides a sort of multiple-inheritance mechanisim. Creates a new AbstractImageProcessor with no extensions Creates a new AbstractImageProcessor which will run the specified extensions with each method call. Contains the set of extensions that are called for every method. Extend this to allow additional types of source objects to be accepted by transforming them into Bitmap instances. Extend this to allow additional types of source objects to be accepted by transforming them into Stream instances. First plugin to return a Stream wins. Extensions are executed until one extension returns a non-null value. This is taken to mean that the error has been resolved. Extensions should not throw an exception unless they wish to cause subsequent extensions to not execute. If extensions throw an ArgumentException or ExternalException, it will be wrapped in an ImageCorruptedException instance. If the Bitmap class is used for decoding, read gdi-bugs.txt and make sure you set b.Tag to new BitmapTag(optionalPath,stream); Extend this to support alternate image source formats. If the Bitmap class is used for decoding, read gdi-bugs.txt and make sure you set b.Tag to new BitmapTag(optionalPath,stream); Extend this to modify the Bitmap instance after it has been decoded by DecodeStream or DecodeStreamFailed Extend this to allow additional types of *destination* objects to be accepted by transforming them into a stream. The method to override if you want to replace the entire pipeline. All Build() calls call this method first. Does nothing in ImageBuilder Called for Build() calls that want the result encoded. (Not for Bitmap Build(source,settings) calls. Only override this method if you need to replace the behavior of image encoding and image processing together, such as adding support for resizing multi-page TIFF files or animated GIFs. Does NOT dispose of 'source' or 'source's underlying stream. Most calls funnel through here. Default behavior configures an ImageState instance and calls Process(imageState); Shouldn't be overriden for any reason I can think of - use the appropriate virtual method under Process(). If an extension returns a Bitmap instance, it will be used instead of the default behavior. Does NOT dispose of 'source' or 'source's underlying stream. Process.0 First step of the Process() method. Can replace the entire Process method if RequestAction.Cancel is returned. Can be used to add points to translate (for image maps), and also to modify the settings Process.1 Switches the bitmap to the correct frame or page, and applies source flipping commands. Process.2 Extend this to apply any pre-processing to the source bitmap that needs to occur before Layout begins Process.3(Layout).0: This is the last point at which points to translate should be added. Only return RequestedAction.Cancel if you wish to replace the entire Layout sequence logic. Process.3(Layout).1: This is where the points in the layout are flipped the same way the source bitmap was flipped (unless their flags specify otherwise) Process.3(Layout).2: Rings 'image' and 'imageArea' are added to the layout. Process.3(Layout).3: Add rings here to insert them between the image area and the padding Process.3(Layout).4: Ring "padding" is added to the layout Process.3(Layout).5: Add rings here to insert them between the padding and the border Process.3(Layout).6: Ring "border" is added to the layout Process.3(Layout).7: Add rings here to insert them between the border and the effect rings Process.3(Layout).8: Effects such as 'shadow' are added here. Process.3(Layout).9: Add rings here to insert them between the effects and the margin Process.3(Layout).10: Margins are added to the layout Process.3(Layout).11: Add rings here to insert them around the margin. Rings will be outermost Process.3(Layout).anytime: Occurs when the layout is rotated. May be called anytime during Layout() Process.3(Layout).anytime: Occurs after the layout is rotated. May be called anytime during Layout() Process.3(Layout).anytime: Occurs when the layout is normalized to 0,0. May be called anytime during Layout() Process.3(Layout).anytime: Occurs after the layout is normalized. May be called anytime during Layout() Process.3(Layout).anytime: Occurs when the layout point values are rounded to integers. May be called anytime during Layout() Process.3(Layout).anytime: Occurs after the layout point values are rounded to integers. May be called anytime during Layout() Process.3(Layout).12: Occurs once layout has finished. No more changes should occur to points or rings in the layout after this method. destSize is calculated here. Process.4: The destination bitmap is created and sized based destSize. A graphics object is initialized for rendering. Process.5(Render) Rendering. Do not return RequestedAction.Cancel unless you want to replace the entire rendering system. Process.5(Render).1 The background color is rendered Process.5(Render).2 After the background color is rendered Process.5(Render).3 Effects (such as a drop shadow or outer glow) are rendered Process.5(Render).4 After outer effects are rendered Process.5(Render).5 Image padding is drawn Process.5(Render).6 After image padding is drawn Process.5(Render).7: An ImageAttributes instance is created if it doesn't already exist. Process.5(Render).8: The ImageAttributes instance exists and can be modified or replaced. Process.5(Render).9: Plugins have a chance to pre-process the source image before it gets rendered, and save it to s.preRenderBitmap Process.5(Render).10: The image is copied to the destination parallelogram specified by ring 'image'. Process.5(Render).11: After the image is drawn Process.5(Render).12: The border is rendered Process.5(Render).13: After the border is drawn Process.5(Render).14: Any last-minute changes before watermarking or overlays are applied Process.5(Render).15: Watermarks can be rendered here. All image processing should be done Process.5(Render).16: Called before changes are flushed and the graphics object is destroyed. Process.5(Render).17: Changes are flushed to the bitmap here and the graphics object is destroyed. Process.5(Render).18: Changes have been flushed to the bitmap, but the final bitmap has not been flipped yet. Process.6: Non-rendering changes to the bitmap object occur here, such as flipping. The graphics object is unavailable. Process.7: Layout and rendering are both complete. All plugins must implement this. Enables web.config addition and removal. Installs the plugin in the specified Config instance. The plugin must handle all the work of loading settings, registering the plugin etc. Uninstalls the plugin. Should reverse all changes made during Install For plugins that access the query string (important!) If the plugin reads any values from the querystring, the names of the keys should be specified here. This information is required so that the HttpModule knows when to handle an image request. Provides a way to modify settings before they reach the managed API. Does not execute early enough to affect disk caching, although that may change in a later version. Implementations should support being called on their own result multiple times without behavioral differences. Currently only executed in the managed API, too late to affect the disk cache, but that will probably change (it's likely all ISettingsModifiers will get executed twice, once after PostRewrite and once before the managed API executes). We duplicate efforts in PostRewrite to ensure that the DiskCache doesn't block configuration changes. This won't help CloudFront, however. The default scale mode to use when 'width' and/or 'height' are used, and mode is not 'max'. The default scale mode to use when 'maxwidth' and/or 'maxheight' are used (or mode=max). Matches /resize(x,y,f)/ syntax Fixed Bug - will replace both slashes.. make first a lookbehind Parses and removes the resize folder syntax "resize(x,y,f)/" from the specified file path. Places settings into the referenced querystring The collection to place parsed values into Causes IE6 and earlier to use GIF versions of PNG files. By default, only fixes requests with ?iefix=true in the querystring. When catchall is enabled, it will filter all png images, unless iefix=false on those requests. Not compatible with CDNs or proxy servers, as they do not allow varying by user agent reliably. Returns true if the specified querystring and file will cause a PNG file to be returned. Returns true if the user agent string specifies MSIE versions 1 through 6 for Windows. Cached in context.Items after first call. If true, 'iefix=true' will be the default for all PNG images, instead of 'iefix=false'. If true, the requests from IE will be HTTP redirected to new URLs. If false, the GIF will be silently served instead of the PNG, without any redirection. A CDN or caching proxy will mess things up regardless, but using redirection ensures that the CDN/proxy never caches the GIF version instead of the PNG. Adds URL syntax support for legacy projects: http://webimageresizer.codeplex.com/, http://imagehandler.codeplex.com/, http://bbimagehandler.codeplex.com/, DAMP: http://our.umbraco.org/projects/backoffice-extensions/digibiz-advanced-media-picker, Support for http://bip.codeplex.com/ and http://dynamicimageprocess.codeplex.com/ urls is default since w/h are supported. Provides default client-caching behavior. Sends Last-Modified header if present, and Expires header if <clientcache minutes="value" /> is configured. Also defaults Cache-control to Public for anonymous requests (and private for authenticated requests) Allows gradients to be dynamically generated like so: /gradient.png?color1=white&color2=black&angle=40&width=20&height=100 Implement this to allow your class (or VirtualPathProvider subclass) to be used without registering it with the whole ASP.NET system. Returns true if the specified file exists. Returns a virtual file instance for the specified path and querystring. A virtual file to support IVirtualImageProvider Returns an opened stream to the file contents. The virtual path of the file (relative to the domain, like /app/folder/file.ext) For virtual files who want to provide their data in Bitmap form (like a PSD reader or gradient generator). Plugins should never assume this interface will be used, .Open() must also be implemented. Returns a Bitmap instance of the file's contents This interface has nothing to do with output caching. This allows VirtualFile instances to override the default cache key (.VirtualPath) for source caching of VirtualFile instances. See IVirtualFileCache Redirects image 404 errors to a querystring-specified server-local location, while maintaining querystring values (by default) so layout isn't disrupted. The image to use in place of missing images can be specified by the "404" parameter in the querystring. The "404" value can also refer to a named value in the <plugins>/<Image404> setting in Web.config. Using <img src="missingimage.jpg?404=image.jpg&width=200" /> with the default setting (<image404 baseDir="~/" />) will redirect to ~/image.jpg?width=200. You may also configure 'variables', which is the recommended approach. For example, <image404 propertyImageDefault="~/images/nophoto.png" /> in the config file, and <img src="missingimage.jpg?404=propertyImageDefault&width=200" /> will result in a redirect to ~/images/nophoto.png?width=200. Any querystring values in the config variable take precedence over querystring values in the image querystring. For example, <image404 propertyImageDefault="~/images/nophoto.png?format=png" /> in the config file and <img src="missingimage.jpg?format=jpg&404=propertImageDefault&width=200" /> will result in a redirect to ~/images/nophoto.png?format=png&width=200. Implements IHttpHandler, serves content for the NoCache plugin IResponseArgs implementation A collection of data and callbacks that can be passed to a caching object. A string derived from the request, which can contain any kind of data. To get a cache key that varies with the source modified date, it should be combined with the value of GetModifiedDateUTC() and hashed. The rewritten querystring. Can be useful for caching systems that accept querystring arguments. A file extension appropriate for the resulting data. May be different than the extension on the original request. The content-type of the data, among other things. Set ResponseHeaders.ApplyDuringPreSendRequestHeaders to automatically write caching headers based on ResponseHeaders values. Caching systems that use redirects may use this data as hints when configuring caching on the remote server. A delegate that returns the modified date of the source data. True if a modified date is available for verifying cache integrity. A callback method that will resize, encode, and write the data to the given stream. A callback method to return the last modified date of the source file if available, or DateTime.MinValue if not. A callback method that will resize and encode the image into a stream. A value derived from the request. Can be used as a cache key. True if the source file/record has a modified date The content-type of the data, among other things. Set ResponseHeaders.ApplyDuringPreSendRequestHeaders to automatically write caching headers based on ResponseHeaders values. Caching systems that use redirects may use this data as hints when configuring caching on the remote server. The rewritten querystring. Can be useful for caching systems that accept querystring arguments. Provides cache selection logic Selects a caching system for the specified request and response Allows customization of response headers for a processed image, as well as configuration of the caching system. The mime-type of the output data. Defaults to null. The cache setting. Defaults to ServerAndPrivate The UTC time at which the cached data should expire. Browsers generally don't re-request resources until the they have expired (unlike modififeddate). If MinValue, will be ignored. The UTC modified date send with the response. Used by browsers with If-Modified-Since to check a cached value is still valid. If = MinValue, will be ignored. When true: If a client requests a refresh, the response will *still* be served from the server cache. Defaults to false ASP.Net sometimes sends Vary: * which obliterates caching. Vary is to be avoided anyhow. Defaults to true These headers should be applied first, prior to the application of other settings These headers are applied after applying all of the other settings. (and they will overwrite exisiting values). Returns a collection of dependencies used for invalidating the server cache. Note, having items here will disable kernel-mode caching. Perhaps it is better to simply use LastModified A delegate method to apply the values stored in IResponseHeaders to the specified HttpContext. True if the application should automatically execute ApplyToResponse() during the PreSendRequestHeaders event. Default cache when DiskCache isn't installed. Useful for debugging purposes but unsuited for production use, and will use large quanities of RAM. (Scales to fewer than 5 concurrent requests). Serves content directly to the client from memory. Provides caching behavior Returns false if the cache is unable to process the request. If false, the caller should fall back to a different cache Must update the cache if needed, then either rewrite, redirect or serve the cached data. Installs the caching system as the first choice. Removes the plugin. Sends the response directly to the client with no caching logic. The mime-type of the encoded image. Defaults to null Allows subclasses to be used instead of ImageBuilder. Replacements must override the Create method and call their own constructor instead. Shortuct to CurrentImageBuilder.Build (Useful for COM clients). Also creates a destination folder if needed, unlike the normal .Build() call. Returns a deep copy of the specified node Returns a deep copy if the current state of the configuration tree (starting with the 'resizer' element as the root) Replaces the configuration tree with the specified alternative Replaces the configuration tree with the specified alternative Writes a diagnostic page to the specified physical path Returns a string of the diagnostics page Gets the current (app-wide) config instance. Access and modify plugins Access and modify settings related to the HttpModule pipline. Register URL rewriting hooks, etc. Returns a shared instance of ImageManager, (or a subclass if it has been upgraded). Instances change whenever ImageBuilderExtensions change. The ResizeConfigrationSection is not thread safe, and should not be modified Dynamically loads the ResizerSection from web.config when accessed for the first time. If the resizer node doesn't exist, an empty configuration object is created with just the root resizer node. Returns a list of all issues reported by the resizing core, as well as by all the plugins Creates a 'gatherer' that pulls issues from IIssueProviders throughout the Config structure. Even plugins are queried. Security and stability issues. Behavioral issues, such as having no registered image encoders Errors in the module configuration Non-optimal settings Domain-relative path which also includes the path info portion. I.e, '/app/folder/file.aspx/path/info' could be a valid value. Relative to the domain root, not the site or app root. True if the specified extension is one that the pipeline can handle True if the querystring contains any directives that are understood by the pipeline Removes the first fake extension detected at the end of 'path' (like image.jpg.ashx -> image.jpg). Returns an ImageBuilder instance to use for image processing. Returns a ICacheProvider instance that provides caching system selection and creation. Returns an IVirtualFile instance if the specified file exists. Returns true if (a) A registered IVirtualImageProvider says it exists, or (b) if the VirtualPathProvider chain says it exists. The key in Context.Items to store the modified querystring (i.e, post-rewrite). Allows VirtualPathProviders to access the rewritten data. The key in Context.Items to store the IResponseArgs object The key in Context.Items to set if we want to cancel MVC routing for the request The key in Context.Items to access a the path to use instead of Request.path The behavior to use when accessing the file system. Get or sets whether the file extension check should be applied to the current request. Defaults to true. If set to true, will only affect the current request, and will only cause the Resizer to evaluate the rewriting rules on the request. Processing may still not occur if no querystring values are specified. Add 'cache=always' to force caching to occur. True once the InterceptModule has been installed. Returns the value of Context.Items["resizer.newPath"] if present. If not, returns FilePath + PathInfo. Sets Context.Items["resizer.newPath"]. Only useful during the Pipeline.PostAuthorizeRequestStart event. Populates the cache if it is empty. Not thread safe. The specified path must not include a querystring. Slashes, spaces, question marks, ampersands, and colons are not permitted in the extension. If it contains a multipart extension like .txt.zip, only "zip" will be recognized. Must contain a dot - passing in "jpg" will fail. Returns true if any of the querystring keys match any of the directives supported by the pipeline (such as width, height, format, bgcolor, etc) Removes the first fake extensionm detected at the end of 'path' Returns either an IVirtualFile instance or a VirtualFile instance. Returns true if (a) A registered IVirtualImageProvider says it exists, or (b) if the VirtualPathProvider chain says it exists. Cache selection occurs as follows: (1) The first registered CachingSystem that returns true from .CanProcess() is the default (2) The SelectCachingSystem event is fired, allowing handlers to modify the selected cache. This method may return null. Returns a unqiue copy of the image extensions supported by the pipeline. Performs a cached query to all registered IQuerystringPlugin instances. Use IsAcceptedImageType for better performance. Returns a unqiue copy of all querystring keys supported by the pipeline. Performs a cached query to all registered IQuerystringPlugin instances. Use HasPipelineDirective for better performance. (binary search) Cached access to pipeline.fakeExtensions Returns the value of Context.Items["resizer.newPath"] if present. If not, returns FilePath + PathInfo. Sets Context.Items["resizer.newPath"]. Only useful during the Pipeline.PostAuthorizeRequestStart event. Returns the modified query string. If never set, returns a copy of Request.QueryString. Returns the same instance if called multiple times. Copy it if you want to make changes without causing issues. Get or sets whether the file extension check should be applied to the current request. Defaults to true. If set to true, will only affect the current request, and will only cause the Resizer to evaluate the rewriting rules on the request. Processing may still not occur if no querystring values are specified. Add 'cache=always' to force caching to occur. Returns true if the current request is being processed and/or cached by the pipeline. Will return false until *after* the FileExists method is called on the VirtualPathProviders, which is after the AuthorizeImage event fires. This will return a usable value if used from VirtualFile.Open(), or if used inside the PreHandleImage event or later. Fired once, on the first PostAuthorizeRequest event. Fires during the PostAuthorizeRequest phase, prior to any module-specific logic. Executes for every request to the website. Use only as a last resort. Other events occur only for image requests, and thus have lower overhead. Fired during PostAuthorizeRequest, after ResizeExtension has been removed. On fired on requests with extensions that match supported image types. You can add additonal supported image extentions by registering a plugin that implementes IQuerystringPlugin, or you can add an extra extension in the URL and remove it here. Example: .psd.jpg Fired during PostAuthorizeRequest, after Rewrite. Any changes made here (which conflict) will be overwritten by the the current querystring values. I.e, this is a good place to specify default settings. Only fired on accepted image types. (see Rewrite) Fired after all other rewrite events. Only fired on accepted image types. (see Rewrite) Fired after all rewriting is finished. e.AllowAccess defaults to the result of the UrlAuthorization module's verdict. It can be changed. Set e.AllowAccess to true to cause and 403 Access Dened result. Fired when the specified image doesn't exist. Only called for images that would normally be processed. May be called during PostAuthorizeRequest or later - End the request completely with a redirect if you want alternate behavior. Fired immediately before the image request is sent off to the caching system for proccessing. Allows modification of response headers, caching arguments, and callbacks. The number of images processed by this pipeline. True once the InterceptModule has been installed and is intercepting requests. Provides thread-safe access to plugin addition, removal, and querying methods A provider (or selector) of IEncoder instances. Returns an encoder based on the provided settings and the source object Request settings, like format, quality, colors, dither, etc. 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. Creates a new plugin config section, attached to the specified parent Processes the <plugins> section if they are not already loaded. Thread safe. Only executes once. Forces loading of the plugins specified in configuration, even if they have already been loaded. Will add duplicate plugins and throw exceptions if you do not call RemoveAll() first. Not thread safe. Performs actual work. Returns the subset of installed plugins which implement the specified type or interface Returns all registered instances of the specified plugins Returns true if at least one plugin of the specified type is registered. Returns true if 1 or more instances of the type are registered. Returns the first registerd instance of the specified plugin. For IMultiInstancePlugins, use GetAll() Returns the first registered instance of the specified plugin, or creates a new instance if the plugin isn't installed. Returns the first registered instance of the specified plugin, or installs the given instance instead, then re-tries the query Installs the specified plugin, returning the plugin instance. Convenience method, same as plugin.Install(Config.Current). Attempts uninstallation of the specified plugin, returning true if successful. Convenience method, same as plugin.Uninstall(Config.Current). Returns an instance of the first encoder that claims to be able to handle the specified settings. Returns null if no encoders are available. Request settings, like format, quality, colors, dither, etc. 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. This is called to get a sorted list of plugins based on their likelyhood of having the plugin. Searches all loaded assemblies for the specified type, applying rules and prefixes to resolve the namespace and assembly. Returns null if it could not find the type, and logs an issue. For use only by plugins during .Uninstall. Removes the specified plugin from AllPlugins, QuerystringPlugins, CachingSystems, ImageEncoders, and ImageBuiderExtensions, based on which interfaces the instance implements. Plugins may register event handlers and modify settings - thus you should use the plugin's method to uninstall them vs. using this method. Only for use by plugins during IPlugin.Install. Call Plugin.Install instead of this method, since plugins often must perform other initialization actions. Adds the specified plugin to AllPlugins, QuerystringPlugins, CachingSystems, ImageEncoders, and ImageBuiderExtensions, based on which interfaces the instance implements. For ICache and IEncoder, the plugin is inserted at the beginning of CachingSystems and ImageEncoders respectively. To reiterate, plugins may register event handlers and modify settings - thus you should use the plugin's method to uninstall them vs. using this method. Will not register a plugin that is already installed, unless it implementes IMultiInstancePlugin. Removes all plugins, of every kind. Logs any errors encountered. (Not all plugins support uninstallation) Returns true if the <plugins> section has been processed Currently registered ICurrentConfigProviders. Currently registered set of ImageBuilderExtensions. Currently registered IEncoders. Currently registered ICache instances Plugins which accept querystring arguments are registered here. Plugins which accept new file extensions (in the url) are registered here. Plugins which provide virtual files are registered here. Plugins which modify image processing settings. All plugins should be registered here. Used for diagnostic purposes. Returns the most recently registered Logging plugin, or null. No support for namespaces, no intention of eventual serialization. Everything is case-insensitive, but preserves case. Not thread safe. Builds a tree of Nodes from the specified XML subtree. Duplicate attributes are sent to 'ir' Returns the subset of Children with a matching element name. (Case-insensitive) Queryies the subtree for the specified attribute on the specified element. Example selector: element.element.attrname Assumes that the last segment of the selector is an attribute name. Throws an ArgumentException if there is only one segment ( element ). Uses the cache. Sets the specified attribute value, creating parent elements if needed. Clears the query cache. Sets the specified attribute value, creating parent elements if needed. Clears the query cache. Traverses the specified path, creating any missing elements along the way. Uses existing nodes if found. Same as query(), except results are cached until clearQueryCache() is called. Faster, but can be incorrect if existing nodes are renamed, moved, or deleted. Makes a recusive copy of the subtree, keeping no duplicate references to mutable types. Attributes Access attributes by name The concatenated text, significant whitespace, and entity references within this element. Not XML compliant for sure. The name of the element. Child nodes Returns true if the element has neither attributes nor children. Encapsulates a node/attribute selection query, such as "node.node.attribute" Returns a subset of the list starting at the specified index Adds drop shadow capabilities (shadowColor, shadowOffset, and shadowWidth commands) Draws a gradient around the specified polygon. Fades from 'inner' to 'outer' over a distance of 'width' pixels. Returns an new NameValueCollection instance that only includes the "preset" and ("hmac" and "urlb64", if specified) querystring pairs from the specified instance. If true, the plugin will block all commands except those specified in a preset, and the &preset command itself. Only applies to InterceptModule (the URL API). Does not apply to ImageBuilder.Build calls. To replicate the behavior, simply prevent any querystring keys except 'preset' from being passed to ImageBuilder.Build. Allows multi-tenancy support. The 'root' config only needs one plugin, which implements this interface. Returns a Config instance appropriate for the current request. If null is returned, the default/root instance will be used. Implementations MUST return the same instance of Config for two identical requests. Multiple Config instances per tenant/area will cause problems. MUST be thread-safe, concurrent calls WILL ocurr, and WILL occur during initial call. Provides license verification and enforcement services. Do not access directly; use your local embedded static method to verify instance integrity. Notify the license service that the given feature is being used for the given domain. Configure the display name for the given feature id Returns a changing shared secret to make interface hijacking difficult. Returns a plaintext report on licensing status If true, pending verifications will be completed before the method returns Provides a place to cache/store licenses. Only responsible for licenses used by plugins attached to the current Config instance. Returns a collection containing all licenses for the plugin's Config instance, in encrypted binary form. Stores the given licenses (excluding those present in web.config). A collection of 'description' and 'encrypted binary license' pairs. Permits plugins to redact data from the diagnostics page, like passwords Implement this if you are caching files provided by a virtual image provider (For example, remote or s3-hosted images). Returns a cached copy of virtual file if it is cached, and if caching is desired. For plugins that add support for new source file image extensions. If the plugin adds support for new file extensions (such as "psd"), they should be returned by this method. Can be used by plugins to implement 'trial version' functionality. Not currently used. The Trial plugin cannot be removed using this method. Determines when the diagnostics page can be viewed. Diagnostics are disabled Only local requests can access diagnostics All hosts can view diagnostics. Provides the incredibly helpful /resizer.debug page we all love. Mimics the behavior of customErrors by default. Not available if CustomErrors=true or retail=true. Available only to localhost if customErrors=RemoteOnly. Can be overriden by adding in the <resizer> section <diagnostics enableFor="None|AllHosts|LocalHost" /> True if diagnostics can be displayed to the current user. If <diagnostics enableFor="None" />, returns false. If <diagnostics enableFor="Localhost" />, returns false for remote requests If <diagnostics enableFor="AllHosts" />, returns true. If unspecified, uses the same behavior as ASP.NET Custom Errors. Returns the ASP.NET trust level Tag your plugin with this interface if it supports having multiple instances registered at once Wraps a standard ASP.NET VirtualFile instance in an IVirtualFile-compatible wrapper. The VirtualFile instance this class is wrapping Handles reading the <resizer> section from Web.Config Create a ResizerSection instance that wraps the specified node. The node should be a <resizer> element. Parse the specified XML into a Node. The text should include 1 root element, <resizer> Returns the specified subtree, deep copied so it can be used without locking. Called for each child element not specified declaratively SafeList is mutable, but it uses immutable data structures to minimize the need for locking. The provided manipulation Exposes a immutable list. Changes are made by copying the lists. SafeList is Never perform logic on SafeList directly, always use GetList() or GetCollection() first, followed by SetList(). If you need involved list-fu, use ModifyList and specify a callback. It will execute inside a lock, preventing changes on other threads from overwriting each other. Returns an immutable snapshot of the collection Returns a mutable snapshot of the list Replaces the current collection with a new one. (copied to ensure safety) Use ModifyList when modifying the list. Use this only when the previous or current state of the list is irrelevant. Adds the specified item to the end of the list Removes the item from the list Adds the specified item to the beginning of the list Allows a caller to perform logic on the list inside a lock, and return a modified list. Callbacks should be fast, and should reference the IList they are fed, not this SafeList instance. Calling methods on the SafeList instance will cause a deadlock. Returns true if the collection contains the specified item at the moment. Returns the first item in the list. May return null if the list is empty. Returns the first item in the list. May return null if the list is empty. Provides basic encoding functionality for Jpeg, png, and gif output. Allows adjustable Jpeg compression, but doesn't implement indexed PNG files or quantized GIF files. An image encoder. Exposes methods for suitability checking, encoding, transparency compatibility checking, and mime-type/extension calculation. If the encoder can handle the requirements specified by 'settings' and 'source', it should return an encoder instance. If not, it should return null. Request settings, like format, quality, colors, dither, etc. 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. Encodes the image to the specified stream True if the output format will support transparency as it is currently configured. Returns the appropriate mime-time for the output format as currently configured. Returns a file extension appropriate for the output format as currently configured, without a leading dot. Returns true if the this encoder supports the specified image format Writes the specified image to the stream using Quality and OutputFormat Tries to parse an ImageFormat from the settings.Format value. If an unrecogized format is specified, returns null. If an unsupported format is specified, it is returned. If *no* format is specified, returns defaultValue. Attempts to determine the ImageFormat of the source image. First attempts to parse the path, if a string is present in original.Tag. (or if 'original' is a string) Falls back to using original.RawFormat. Returns null if both 'original' is null. RawFormat has a bad reputation, so this may return unexpected values, like MemoryBitmap or something in some situations. The source image that was loaded from a stream, or a string path Returns the ImageFormat enumeration value based on the extension in the specified physical path. Extensions can lie, just a guess. Returns an string instance from the specfied ImageFormat. First matching entry in imageExtensions is used. Returns null if not recognized. Returns a dict of (lowercase invariant) image extensions and ImageFormat values Returns an ImageFormat instance from the specfied file extension. Extensions lie sometimes, just a guess. returns null if not recognized. NOT thread-safe! Supports Png, Jpeg, Gif, Bmp, and Tiff. Throws a ArgumentOutOfRangeException if not png, jpeg, gif, bmp, or tiff Returns the first ImageCodeInfo instance with the specified mime type. Returns null if there are no matches. Saves the specified image to the specified stream using jpeg compression of the specified quality. A number between 0 and 100. Defaults to 90 if passed a negative number. Numbers over 100 are truncated to 100. 90 is a *very* good setting. Saves the image in png form. If Stream 'target' is not seekable, a temporary MemoryStream will be used to buffer the image data into the stream Returns the querystring keys used by DefaultEncoder (quality, format, and thumbnail) Returns signatures for jpeg, bmp, gif, png, wmf, ico, and tif If you set this to anything other than Gif, Png, or Jpeg, it will throw an exception. Defaults to Jpeg 0..100 value. The Jpeg compression quality. 90 is the best setting. Not relevant in Png or Gif compression Returns true if the desired output type supports transparency. Returns the default mime-type for the OutputFormat Returns the default file extesnion for OutputFormat Implements app-wide size Limits on image size The image and total size limits What to do about remaining handlers/methods for the specified section Does nothing Requests that ImageBuilder cancels the default logic of the method, and stop executing plugin calls for the method immediately. Represents the widths of edges of a box. Create a box with all edges the same width. Create a box, specifying individual widths for each size Copies the specified BoxPadding instance Sets the width of all edges, returning a new instance Gets edge offsets as a clockwise array, starting with Top. Returns double.NaN unless all edges are the same width, in which case that width is returned Returns an instance with a width of 0 Returns true if th Output image formats Jpeg - the best format for photographs and thumbnails The best format for transparent images and vector graphics A really poor choice for pretty much everything except animation When to disk cache the image Request no disk caching of the resulting image. Request that the resulting image always be disk cached on the server, even if no modifications are made. Default caching behavior. Modified images are disk cached, unmodified images are not. When to process and re-encode the file. Request no processing of the image or file (generally used with cache=always). The file contents will be used as-is. Require the file or image to be processed. Will cause non-image files to fail with an ImageCorruptedException. Default. Only files with both a supported image extension and resizing settings specified in the querystring will be processed. Controls whether the image is allowed to upscale, downscale, both, or if only the canvas gets to be upscaled. The default. Only downsamples images - never enlarges. If an image is smaller than 'width' and 'height', the image coordinates are used instead. Only upscales (zooms) images - never downsamples except to meet web.config restrictions. If an image is larger than 'width' and 'height', the image coordinates are used instead. Upscales and downscales images according to 'width' and 'height', within web.config restrictions. When the image is smaller than the requested size, padding is added instead of stretching the image [Deprecated (Use FitMode.Stretch)] Previously used to force an image to be 'stretched' to match a different aspect ratio. [Deprecated (Use FitMode)] Maintains aspect ratio. Default. [Deprecated (Use FitMode)] Skews image to fit the new aspect ratio defined by 'width' and 'height' How to resolve aspect ratio differences between the requested size and the original image's size. Fit mode will be determined by other settings, such as &carve=true, &stretch=fill, and &crop=auto. If none are specified and width/height are specified , &mode=pad will be used. If maxwidth/maxheight are used, &mode=max will be used. Width and height are considered maximum values. The resulting image may be smaller to maintain its aspect ratio. The image may also be smaller if the source image is smaller Width and height are considered exact values - padding is used if there is an aspect ratio difference. Use &anchor to override the MiddleCenter default. Width and height are considered exact values - cropping is used if there is an aspect ratio difference. Use &anchor to override the MiddleCenter default. Width and height are considered exact values - seam carving is used if there is an aspect ratio difference. Requires the SeamCarving plugin to be installed, otherwise behaves like 'pad'. Width and height are considered exact values - if there is an aspect ratio difference, the image is stretched. Default. No cropping - uses letterboxing if strecth=proportionally and both width and height are specified. [Deprecated] Use Mode=Crop. Minimally crops to preserve aspect ratio if stretch=proportionally. Crops using the custom crop rectangle. Letterboxes if stretch=proportionally and both widht and height are specified. Indicates the crop units are pixels on the original image. Indicates a custom range is being specified for the values. Base 0. Horizontal and vertical flipping. Convertible to System.Drawing.RotateFlipType by casting. No flipping Flip horizontally Flip vertically (identical to 180 degree rotation) Flip horizontally and vertically Anchor location. Convertible to System.Drawing.ContentAlignment by casting. Content is vertically aligned at the top, and horizontally aligned on the left. Content is vertically aligned at the top, and horizontally aligned at the center. Content is vertically aligned at the top, and horizontally aligned on the right. Content is vertically aligned in the middle, and horizontally aligned onthe left. Content is vertically aligned in the middle, and horizontally aligned at the center. Content is vertically aligned in the middle, and horizontally aligned on the right. Content is vertically aligned at the bottom, and horizontally aligned on the left. Content is vertically aligned at the bottom, and horizontally aligned at the center. Content is vertically aligned at the bottom, and horizontally aligned on the right. Modes of converting the image to Grayscale. GrayscaleMode.Y usually produces the best resuts The reccomended value. Y and NTSC are identical. Red, green, and blue are averaged to get the grayscale image. Usually produces poor results compared to other algorithms. The Jpeg subsampling mode to use. Requires FreeImageEncoder, FreeImageBuilder, WicEncoder, or WicBuilder. The encoder's default subsampling method will be used. 411 Subsampling - Only supported by FreeImageBuilder and FreeImageEncoder. Poor quality. 420 Subsampling - Commonly used in H262 and H264. Low quality compared to 422 and 444. 422 Subsampling - Great balance of quality and file size, commonly used in high-end video formats. 444 subsampling - Highest quality, largest file size. 444 subsampling - Highest quality, largest file size. Provides methods for generating resized images, and for reading and writing them to disk. Use ImageBuilder.Current to get the current instance (as configured in the application configuration), or use ImageBuilder.Current.Create() to control which extensions are used. Shouldn't be used except to make a factory instance. Create a new instance of ImageBuilder using the specified extensions, encoder provider, file provider, and settings filter. Extension methods will be fired in the order they exist in the collection. Creates another instance of the class using the specified extensions. Subclasses should override this and point to their own constructor. Copies the instance along with extensions. Subclasses must override this. Loads a Bitmap from the specified source. If a filename is available, it will be attached to bitmap.Tag in a BitmapTag instance. The Bitmap.Tag.Path value may be a virtual, relative, UNC, windows, or unix path. Does not dispose 'source' if it is a Stream or Image instance - that's the responsibility of the calling code. May be an instance of string, VirtualFile, IVirtualFile IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. If passed an Image instance, the image will be cloned, which will cause metadata, indexed state, and any additional frames to be lost. Accepts physical paths and application relative paths. (C:\... and ~/path) Will ignore ICC profile if ?ignoreicc=true. A Bitmap. The .Tag property will include a BitmapTag instance. If .Tag.Source is not null, remember to dispose it when you dispose the Bitmap. Returns a dictionary of information about the given image. Pass null to get the defaults ("source.width", source.height") Loads a Bitmap from the specified source. If a filename is available, it will be attached to bitmap.Tag in a BitmapTag instance. The Bitmap.Tag.Path value may be a virtual, relative, UNC, windows, or unix path. Does not dispose 'source' if it is a Stream or Image instance - that's the responsibility of the calling code. May be an instance of string, VirtualFile, IVirtualFile IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. If passed an Image instance, the image will be cloned, which will cause metadata, indexed state, and any additional frames to be lost. Accepts physical paths and application relative paths. (C:\... and ~/path) Will ignore ICC profile if ?ignoreicc=true. If true, the position of the source stream will be restored after being read A Bitmap. The .Tag property will include a BitmapTag instance. If .Tag.Source is not null, remember to dispose it when you dispose the Bitmap. Decodes the stream into a System.Drawing.Bitmap instance. As of 3.0.7, now ensures the stream can safely be closed after the method returns. May copy the stream. The copied stream will be in b.Tag.Source. Does not close or dispose any streams. For plugin use only. Returns a stream instance from the specified source object and settings object. To exend this method, override GetStream. The physical or app-relative path, or a VirtualFile, IVirtualFile, Stream, HttpPostedFile, or HttpPostedFileBase instance. Querystring settings to pass to the VirtualFileProvider You should externally initialize this to true, unless the user-provided 'source' is a Stream instance. Will be set to false for HttpPostedFile and HttpPostedFileBase instances, so they can be reused. The physical or virtual path associated with the stream (if present). Otherwise null True if you should save and restore the seek position of the stream. True for HttpPostedFile and HttpPostedFileBase instances. Resizes and processes the specified source image and returns a bitmap of the result. Note! This method assumes that transparency will be supported in the final output format, and therefore does not apply a matte color. Use &bgcolor to specify a background color if you use this method with a non-transparent format such as Jpeg. If passed a source Stream, Bitmap, or Image instance, it will be disposed after use. Use disposeSource=False to disable that behavior. May be an instance of string (a physical path), VirtualFile, IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. Resizing and processing command to apply to the. Resizes and processes the specified source image and returns a bitmap of the result. Note! This method assumes that transparency will be supported in the final output format, and therefore does not apply a matte color. Use &bgcolor to specify a background color if you use this method with a non-transparent format such as Jpeg. If passed a source Stream, Bitmap, or Image instance, it will not be disposed unless disposeSource=true. May be an instance of string (a physical path), VirtualFile, IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. Resizing and processing command to apply to the. If false, 'source' will not be disposed. Resizes and processes the specified source image and stores the encoded result in the specified destination. If passed a source Stream, Bitmap, or Image instance, it will be disposed after use. Use disposeSource=False to disable that behavior. May be an instance of string (a physical path or app-relative virtual path), VirtualFile, IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. App-relative virtual paths will use the VirtualPathProvider system May be a physical path (string), or a Stream instance. Does not have to be seekable. Resizing and processing command to apply to the image. Resizes and processes the specified source image and stores the encoded result in the specified destination. If passed a source Stream, Bitmap, or Image instance, it will be disposed after use. Use disposeSource=False to disable that behavior. May be an instance of string (a physical path or app-relative virtual path), VirtualFile, IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. App-relative virtual paths will use the VirtualPathProvider system May be a physical path (string), or a Stream instance. Does not have to be seekable. Resizing and processing command to apply to the image. Resizes and processes the specified source image and stores the encoded result in the specified destination. If passed a source Stream, Bitmap, or Image instance, it will not be disposed unless disposeSource=true. May be an instance of string (a physical path or app-relative virtual path), VirtualFile, IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. App-relative virtual paths will use the VirtualPathProvider system May be a physical path (string), or a Stream instance. Does not have to be seekable. Resizing and processing command to apply to the image. True to dispose 'source' after use. False to leave intact. Resizes and processes the specified source image and stores the encoded result in the specified destination. If passed a source Stream, Bitmap, or Image instance, it will not be disposed unless disposeSource=true. If passed a path destination, the physical path of the written file will be returned. May be an instance of string (a physical path or app-relative virtual path), VirtualFile, IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. App-relative virtual paths will use the VirtualPathProvider system May be a physical path (string), or a Stream instance. Does not have to be seekable. Resizing and processing command to apply to the image. True to dispose 'source' after use. False to leave intact. If true, will add the correct file extension to 'dest' if it is a string. The most flexible method for processing an image Override this when you need to override the behavior of image encoding and/or Bitmap processing Not for external use. Does NOT dispose of 'source' or 'source's underlying stream. Override this when you need to override the behavior of Bitmap processing. Not for external use. Does NOT dispose of 'source' or 'source's underlying stream. True if the output method will support transparency. If false, the image should be provided a matte color Processes an ImageState instance. Used by Build, GetFinalSize, and TranslatePoint. Can be overriden by a plugin with the OnProcess method Process.3: Handles the layout phase of Processing Handles the rendering phase of processing Process.1 Switches the bitmap to the correct frame or page, and applies source flipping commands Creates a bitmap of s.destSize dimensions, intializes a graphics object for it, and configures all the default settings. Sets the background color if needed or requested Doesn't support flipping. Translate a point on the original bitmap to a point on the new bitmap. If the original point no longer exists, returns Empty Gets the final size of an image Gets the final size of an image Populates copyRect, as well as Rings image and imageArea. Translates and scales any existing rings as if they existed on the original bitmap. Returns a list of the file extensions ImageBuilder can load by default. Plugins can implement IFileExtensionPlugin to add new ones. Returns a list of the querystring commands ImageBuilder can parse by default. Plugins can implement IQuerystringPlugin to add new ones. Handles the encoder selection and provision proccess. May be null. A class to modify or normalize ResizeSettings instances before they are used. Provides a resolution service for app-relative URLs. Returns a shared instance of ImageBuilder or a subclass, equivalent to Config.Current.CurrentImageBuilder Monitors incoming image requests to determine if resizing (or other processing) is being requested. Called when the app is initialized This is where we filter requests and intercept those that want resizing performed. We first strip FakeExtension, then verify the remaining file extension is supported for decoding. We fire URL rewriting events. If the result includes any supported querystring params afterwards, we process the request. Otherwise we let it fall back to IIS/ASP.NET. If the file doesn't exist, we also ignore the request. They're going to cause a 404 anyway. Generates the resized image to disk (if needed), then rewrites the request to that location. Perform 404 checking before calling this method. Assumes file exists. Called during PostAuthorizeRequest We don't actually send the data - but we still want to control the headers on the data. PreSendRequestHeaders allows us to change the content-type and cache headers at excatly the last Current configuration. Same as Config.Current.Pipeline A callback method that will resize, encode, and write the data to the given stream. Callback may throw FileNotFoundException when running on top of an optimistic VPP A callback method to return the last modified date of the source file if available, or DateTime.MinValue if not available. Represents an non-recoverable exception that occured while processing the image. Possible causes are: a corrupted source file, cache resource timeout (such as a locked file in imagecache), unusable configuration (for example, no registered encoders or caches), invalid syntax, or a size limit was exceeded and the request was stopped by the SizeLimiting extension. May also be caused by a missing source file/resource, in the form of the ImageMissingException subclass. This error message is safe to display to the public (should not contain any sensitive information) A source file was corrupted One or more source files was missing Encapsulates the state of an image being resized. Can be used to simulate a resize as well as actually perform one. All code should ignore when Bitmaps and Graphics objects are null, and go about simulating all the mathematical functions as normal. The commands to apply to the bitmap The original size of the source bitmap. Use this instead of accessing the bitmap directly for this information, since the bitmap may not always be available Rendering choices can depend on whether the output format supports transparency. The layout object. Used for calculated and flowing the layout of the various rings around the image (padding, border, effect, margin, etc). The size of the target bitmap image. Set after all sizing operations have completed. The dimensions of the bitmap afer all operations have been applied to it (Calling FlipRotate can change the bitmap dimensions). The rectangular portion of the source image to copy The source bitmap. If null, skip drawing commands, but continue layout logic. An optional intermediate bitmap, created by plugins who need to process the source bitmap it gets rendered to destBitmap. If defined, it should be used instead of sourceBitmap during RenderImage(), and disposed immediately after use. If 'sourceBitmap' is CMYK and `preRenderBitmap` is null, converts `sourceBitmap` to RGB and stores in 'preRenderBitmap' Clones 'sourceBitmap' into 'preRenderBitmap' if null. Applies copyRect (if it will have any effect), placing the result in preRenderBitmap, and resetting copyRect Ensures that the working bitmap is in 32bpp RGBA format - otherwise it is converted. The destination bitmap. If null, skip drawing commands, but continue layout logic. A graphics object to write to the destination bitmap. If null, skip drawing commands, but continue layout logic. Allows color correction/modification during the image copy. Disposes sourceBitmap, destGraphics, destBitmap, and copyAttributes if they are non-null (read-only) Same as copyRect.Size, convenience property. Allows extensions to store data along with the image state An ordered, named collection of polygons. pointsToTranslate, imageOuterEdge, imageAreaOuterEdge. Inflates the last ring using the specified padding options. Returns the resulting ring object Add points this way to see where they will occur on the destination image Gets a bounding box that encloses all rings that don't have ExcludeFromBoundingBox set. Rotates all existing rings (Except those flagged ignore) Normalizes all rings and invisible polygons so that the outermost ring's bounding box starts at the specified orign. Scales all rings and invisible polygons by the specified factor, around the specified point. Translates and scales all rings and invisible polygons as specified. Access and set the Point[] arrays of rings by key. Case-insensitive. Returns the last ring that was added. Only returns PointSets where flags = Ring This polygon participates in the layout phase, and reserves space when added. Affected by all batch operations. Will be returned by LastRing until a new ring is added. Doesn't participate in layout, takes no space, but is affected by batch operations. Will never be returned by LastRing and ignored when calculating bounding boxes. Completely ignored by all operations, left intact. How the pointsToTranslate should be translated if they are cropped out of the destination image. Enforces two kinds of maximum size constraints: a Total size limit, and an Image size limit. Image limits do not include padding, border, or effect widths, and automatically shrink the 'width/height/maxwidth/maxheight' values to fit within the limits. Total limits are absolute and apply to the actual result dimensions, causing an exception if they are exceeded. Limits are checked during the layout phase, prior to resource-intensive bitmap operations. The maximum final size an image generated by ImageBuilder can be. Defaults to 3200x3200 What action to take when the total size of the final image would exceed the TotalSize value. Defaults to ThowException Returns true if ImageSize is specified. The maximum size an un-rotated image can be drawn when creating a resized image. Rotation will increase the total size, as will any borders, paddings, margins, or effects. Not effective at preventing attacks, use totalSize. If larger values are specified in a querystring, they will automatically be scaled to fit within these dimensions. Defaults to 0x0, which means no limits Provides invariant parsing & serialization of primitive types, like Enums, integers, floats, and booleans. Defines a parsing style that permits leading/trailing whitespace, a leading negitve/postiive sign, decimal points, exponential notation, and a thousands separator A set of utility methods for manipulating virtual paths Should be called SetFullExtension. Sets the file extension of the specified path to the specified value, returning the result. If an extension has multiple parts, it will replace all of them. Leading dots will be stripped from 'newExtension' and re-addd as required. The querystring and fragment is maintained as-is. Semicolon syntax not supported. Removes all extension segments from the filename or URL, leaving the querystring intact. I.e, image.jpg.bmp.tiff?hi would be image?hi The querystring and fragment is maintained as-is. Semicolon syntax not supported. Removes the extension from the filename or URL, leaving the querystring intact, where the extension is only the last extension segment. I.e, image.jpg.bmp.tiff?hi would be image.jpg.bmp?hi after this call. The querystring and fragment is maintained as-is. Semicolon syntax not supported. Adds the specified extension to path, returning the result. Multiple calls will result in "path.ext.ext.ext.ext". The querystring and fragment is maintained as-is. Semicolon syntax not supported. Will return the full extension, like ".jpg.ashx", not just the last bit. Excludes extensions containing spaces or slashes. The querystring and fragment is ignored. Semicolon syntax not supported. Grabs the last segment of the filename extension. Returns an empty string if there is no extension, or if the extension contains a space. Includes the leading '.' The querystring and fragment is ignored. Semicolon syntax not supported. Resolves app-relative paths to virtual paths. Does nothing with virtual or relative paths. Turns relative paths into domain-relative paths. Turns app-relative paths into domain relative paths. Joins the path and querystring. If the path already contains a querystring, they are 'append joined' with the correct character. Fragment is maintained as-is. Does not support the semicolon syntax. Removes the query string from the specifed path. If the path is only a querystring, an empty string is returned. Does not support the semicolon syntax. Fragment is maintained as-is. Overwrites exisisting querystring values in 'path' with the values in 'newQuerystring'. Does not support the semicolon syntax. Adds the querystring values in 'newQuerystring' to the querystring in Path, but does not overwrite values. Does not support the semicolon syntax. Returns a string querystring in the form "?key=value&key=value". Keys and values are UrlEncoded as they should be. Returns a string querystring in the form "?key=value&key=value". Keys and values are UrlEncoded if urlEncode=true. Returns a string querystring in the form ";key=value;key=value". Keys and values are UrlEncoded if urlEncode=true. Build a customized querystring from a NameValueCollection True to URL encode all values If true, null-valued keys will be skipped Usually ? or ; Usually & or ; Always = Like ParseQueryString, but permits the leading '?' to be omitted. Does not support the semicolon syntax. Like ParseQueryString, but permits the leading '?' to be omitted, and semicolons can be substituted for '&' Parses the querystring from the given path into a NameValueCollection. accepts "file?key=value" and "?key=value&key2=value2" formats. (no path is required) UrlDecodes keys and values. Parses a querystring into a name/value collection. The given string cannot include path or fragment information - it must be *just* the querystring. Converts aribtrary bytes to a URL-safe version of base64 (no = padding, with - instead of + and _ instead of /) Converts a URL-safe version of base64 to a byte array. (no = padding, with - instead of + and _ instead of /) Converts aribtrary strings to a URL-safe version of base64 (no = padding, with - instead of + and _ instead of /) Converts a URL-safe version of base64 to a string. 64U is (no = padding, with - instead of + and _ instead of /) Returns the physcial mapped path for the specified virtual path if it starts with ~, otherwise retuns the original path. Generates a resized image url for the specified physical or virtual path. Not CloudFront compatible. Does not support remote URLs, use RemoteReader for that. If you're running in IIS classic, add ".ashx" to the 'path' parameter. Attempts to guess the virtual path from physical path. Will be thrwarted if the path is mapped as a virtual folder inside the application. If the path is a non-physical path, it will be returned as is. Returns null if the physical path isn't a subfolder of the application's physical path. Replaces variables in paths with their values. Ex. ~/uploads/thumbs/<guid>.<ext>. Standard variables are <ext> (the default extension for the final file type), <guid>, a randomly generated GUID, <filename>, the original filename without it's extension, <path>, the original path and filename without extension, <settings.width>, (any specified settings value except preset), <width> (final width), and <height> (final height). Allows a string to be filtered using the specified whitelisting expression (regex style). I.e, "hi YOU 3", "a-z3" will produce "hi3". Returns a new collection containing only the specified keys from the old one Returns HostingEnvironment.ApplicationVirtualPath or "/", if asp.net is not running If not running in ASP.NET, returns the folder containing the DLL. A method that resolves variable names to values for the ResolveVariablesInPath method Defines a collection of utility functions for manipulating polygons. These functions may be (re)moved in future releases; be prepared. Rounds the elements of the specified array [not used] Rounds the elements of the specified array [not used] Modifies the specified array by applying the specified function to each element. object delegate(object o){} Rotates the specified polygon (or set of points) around the origin. Rotates the specified polygon (or set of points) around the origin. Returns a clockwise array of points on the rectangle. Point 0 is top-left. Moves the polygon so that the upper-left corner of its bounding box is located at 0,0. Rotates the specified point around the origin. Rotates the specified point around the specified origin. Returns a modified version of the specified vector with the desired length. Returns a bounding box for the specified set of points. Returns a bounding box for the specified set of points. Odd points are Y values, even points are X values Returns a modified version of the array, with each element being offset by the specified amount. Returns true if the member elements of the specified arrays match, and the arrays are of the same length. Moves element 4 to spot 3 and truncates to 3 elements. For compatiblity with Graphics.DrawImage Determines the width and height of the paralellogram. Grabs a single-dimension array from a 2 dimensional array, using the specified primary index. Approximates a radial brush using a high-rez PathGradientBrush. Scales 'inner' to fit inside 'bounding' while maintaining aspect ratio. Upscales and downscales. Scales 'outer' to be equal or larger than 'innerBounds' while maintaining aspect ratio. Upscales and downscales. Scales 'inner' to fit inside 'bounding' while maintaining aspect ratio. Only downscales. Returns true if 'inner' fits inside or equals 'outer' Returns an array of parallelograms. These parallelgrams are the 'corners' outside each vertex in 'poly'. The adjacent edges are perpendicular to 'poly'. Point 1 of each parallelogram will match the respective point in 'poly' Points are clockwise. TODO - some rounding issues going on, not exact numbers here Returns an array of parallelograms. These parallelgrams are the 'corners' outside each vertex in 'poly'. The adjacent edges are perpendicular to 'poly'. Point 1 of each parallelogram will match the respective point in 'poly' Points are clockwise. Each float in widths[] corresponds to the point in poly[]. This is the distance to go perpendicularly from the line beween poly[i] and poly[i +1]. Returns an array of parallelograms. These parallelgrams are the 'sides' bounding the polygon. Points are clockwise. Point 1 is the top-left outer point, point 2 the top-right, point 3 the bottom-right, and point 4 the bottom-left. Expands all sides on the specified polygon by the specified offset. Assumes the polygon is concave. Returns a new polygon Expands all sides on the specified polygon by the specified offsets. Assumes the polygon is concave. Returns a new polygon. An array the same size as poly[], with the distances to expand the edges. Edges are between i and i+1 Moves 'inner' so that the center of its bounding box equals the center of the bounding box of 'outer' Creates a rectangle of size 'size' with a center matching that of bounds. Rounds a floating-point rectangle to an integer rectangle using System.Round Aligns the specified rectangle object with its reference ('container') rectangle using the specified alignment. The container can be smaller than 'obj'. Aligns the specified polygon with its container (reference) polygon using the specified alignment. The container can be smaller than 'obj'. Returns a point equidistant beweteen A and B Verifies that the specified 4 points are not rotated - that each point shares either the x or y coordinate with the previous point Returns the length of the shortest line segment in the given polygon. Returns the distance between two points Normalizes the given angle to a positive multiple of 90 degrees between 0 and 270. Combines the given flipping info and rotation angle into a RotateFlipType value. Rotation angle will snap to nearest 90-degree multiple Used for converting custom crop rectangle coordinates into a valid cropping rectangle. Positive values are relative to 0,0, negative values relative to width, height. X2 and Y2 values of 0 become width and height respectively. An array of 4 elements defining x1, y1, x2, and y2 of the cropping rectangle The width x1 and x2 are relative to The height y1 and y2 are relative to The size of the uncropped image Returns 'box' clipped to be within 'bounds' Expands the given rectangle to be the given size while keeping it centered. Expands the given rectangle using the specified scale multipliers, leaving it centered Always implement this if possible. Allows caching systems to detect changes to source files and invalidate cached data properly. The modified (last write time) of the source file, in UTC form. Represents the settings which will be used to process the image. Extends NameValueCollection to provide friendly property names for commonly used settings. Replaced by the Instructions class. Will be removed in V4.0 Creates an empty settings collection. Copies the specified collection into a new ResizeSettings instance. Parses the specified querystring into name/value pairs. leading ? not required. Discards everything after the first '#' character as a URL fragment. Merges the specified collection with a set of defaults into a new ResizeSettings instance. Parses the specified querystring into name/value pairs and merges it with defaultSettings in a new ResizeSettings instance. Creates a new resize settings object with the specified resizing settings The desired image format, like 'jpg', 'gif', or 'png'. Leave null if you want to preserve the original format. Returns true if any of the specified keys are present in this NameValueCollection If 'thumbnail' and 'format' are not specified, sets 'format' to the specified value. Returns a string containing all the settings in the class, in querystring form. Use ToStringEncoded() to get a URL-safe querystring. This method does not encode commas, spaces, etc. Returns a querystring with all the settings in this class. Querystring keys and values are URL encoded properly. This method will 'normalize' command aliases to the primary key name and resolve duplicates. w->width, h->height, sourceFlip->sFlip, thumbnail->format Normalizes a command that has two possible names. If either of the commands has a null or empty value, those keys are removed. If both the the primary and secondary are present, the secondary is removed. Otherwise, the secondary is renamed to the primary name. ["width"]: Sets the desired width of the image. (minus padding, borders, margins, effects, and rotation). The only instance the resulting image will be smaller is if the original source image is smaller. Set Scale=Both to upscale these images and ensure the output always matches 'width' and 'height'. If both width and height are specified, the image will be 'letterboxed' to match the desired aspect ratio. Change the Mode property to adjust this behavior. ["height"]: Sets the desired height of the image. (minus padding, borders, margins, effects, and rotation) The only instance the resulting image will be smaller is if the original source image is smaller. Set Scale=Both to upscale these images and ensure the output always matches 'width' and 'height'. If both width and height are specified, the image will be 'letterboxed' to match the desired aspect ratio. Change the Mode property to adjust this behavior. ["maxwidth"]: Sets the maximum desired width of the image. (minus padding, borders, margins, effects, and rotation). The image may be smaller than this value to maintain aspect ratio when both maxwidth and maxheight are specified. ["quality"]: The jpeg encoding quality to use. (10..100). 90 is the default and best value, you should leave it. ["maxheight"]: Sets the maximum desired height of the image. (minus padding, borders, margins, effects, and rotation). The image may be smaller than this value to maintain aspect ratio when both maxwidth and maxheight are specified. ["mode"]: Sets the fit mode for the image. max, min, pad, crop, carve, stretch ["rotate"] The degress to rotate the image clockwise. -360 to 360. How to anchor the image when cropping or adding whitespace to meet sizing requirements. Allows you to flip the entire resulting image vertically, horizontally, or both. Rotation is not supported. ["sFlip"] Allows you to flip the source image vertically, horizontally, or both. Rotation is not supported. ["scale"] Whether to downscale, upscale, upscale the canvas, or both upscale or downscale the image as needed. Defaults to DownscaleOnly. See the DefaultSettings plugin to adjust the default. [Deprecated] (Replaced by mode=stretch) Whether to preserve aspect ratio or stretch to fill the bounds. ["cache"]: Server caching mode suggestion for the result ["process"]: Server processing suggestion for the result. Allows you to 'disable' processing of the image (so you can use disk caching with non-image files). Allows you to 'force' processing of the image, for images without a querystring. ["crop"]=none|auto Defaults to None - letterboxing is used if both width and height are supplied, and stretch = proportionally. Set CropTopLeft and CropBottomRight when you need to specify a custom crop rectangle. 4 values specify x1,y1,x2,y2 values for the crop rectangle. Negative values are relative to the bottom right - on a 100x100 picture, (10,10,90,90) is equivalent to (10,10,-10,-10). And (0,0,0,0) is equivalent to (0,0,100,100). ["crop"]=([x1],[y1],x2,y2). Sets x1 and y21, the top-right corner of the crop rectangle. If 0 or greater, the coordinate is relative to the top-left corner of the image. If less than 0, the value is relative to the bottom-right corner. This allows for easy trimming: crop=(10,10,-10,-10). Set ["cropxunits"] and ["cropyunits"] to the width/height of the rectangle your coordinates are relative to, if different from the original image size. ["crop"]=(x1,y1,[x2],[y2]). Sets x2 and y2, the bottom-right corner of the crop rectangle. If 1 or greater, the coordinate is relative to the top-left corner of the image. If 0 or less, the value is relative to the bottom-right corner. This allows for easy trimming: crop=(10,10,-10,-10). Set ["cropxunits"] and ["cropyunits"] to the width/height of the rectangle your coordinates are relative to, if different from the original image size. ["bgcolor"]: Named and hex values are supported. (rgb and rgba, both 3, 6, and 8 digits). Gets/sets ["paddingColor"]. Named and hex values are supported. (rgb and rgba, both 3, 6, and 8 digits). ["paddingWidth"]: Gets/sets the width(s) of padding inside the image border. ["margin"]: Gets/sets the width(s) of the margin outside the image border and effects. Gets/sets ["borderColor"]. Named and hex values are supported. (rgb and rgba, both 3, 6, and 8 digits). Friendly get/set accessor for the ["borderWidth"] value. Returns BoxPadding.Empty when unspecified. Like this["format"]. Gets or sets the output file format to use. "png", "jpg", and "gif" are valid values. Returns null if unspecified. When format is not specified, the original format of the image is used (unless it is not a web safe format - jpeg is the fallback in that scenario). Also checks the 'thumbnail' value for V2 compatibility. When set, 'thumnail' is removed and only 'format' is used. The width which the X and X2 crop values should be applied. For example, a value of '100' makes X and X2 percentages of the original image width. This can be set to any non-negative value. Very useful for performing cropping when the original image size is unknown. 0 indicates that the crop values are relative to the original size of the image. The width which the Y and Y2 crop values should be applied. For example, a value of '100' makes Y and Y2 percentages of the original image height. This can be set to any non-negative value. Very useful for performing cropping when the original image size is unknown. 0 indicates that the crop values are relative to the original size of the image. A Stream utility class that helps to provide seekability to any source stream. Returns a seekable stream for a given source stream. If wrapped, the source stream will be disposed when the returned stream is. The stream to wrap or return. If the source stream is already seekable, it is returned unwrapped. If not, it is wrapped in a SeekableStreamWrapper. Returns a seekable stream for a given source stream. If wrapped, the source stream will be disposed when the returned stream is. The stream to wrap or return. Whether to dispose the source stream when the wrapper is disposed. If a wrapper is created, this parameter will be true on the return to ensure the wrapper gets properly disposed. If the source stream is already seekable, it is returned unwrapped. If not, it is wrapped in a SeekableStreamWrapper. Disposes the seekable stream wrapper, and the wrapped stream if originally requested. Gets whether the stream wrapper can be written to or not. This is only true while the wrapper is being initialized, and otherwise false for all other callers. Copies a read stream to a write stream. Copies the remaining portion of the specified stream to a byte array of exact size. Builds a key for the cached version, using the hashcode of the normalized URL. if subfolders > 1, dirSeparator will be used to separate the subfolder and the key. No extension is appended. I.e, a13514\124211ab132592 or 12412ababc12141 Returns a string for the subfolder name. The bits used are from the end of the hash - this should make the hashes in each directory more unique, and speed up performance (8.3 filename calculations are slow when lots of files share the same first 6 chars. Returns null if not configured. Rounds subfolders up to the nearest power of two. Parses lists in the form "3,4,5,2,5" and "(3,4,40,50)". If a number cannot be parsed (i.e, number 2 in "5,,2,3") defaultValue is used. Copies all remaining data from 'source' to 'dest' Returns RotateNoneFlipNone if not a recognized value. Returns 0 if not a recognized value. Rounds the value to 0, 90, 180, or 270 Throws an exception if the specified value is unsupported. Rotation values are not supported, and should be specified with the Rotate or srcRotate command. Parses padding, allowing syntax (all) and (left, top, right, bottom). Parens are optional. Draws a gradient around the specified polygon. Fades from 'inner' to 'outer' over a distance of 'width' pixels. Functions exactly like an IIS virtual folder, but doesn't require IIS configuration. Registers the VirtualFolder plugin as a virtual path provider. Converts relative and app-relative paths to domain-relative virtual paths. Attempts to convert a phyiscal path into a collapsed rooted physical path. Collapses any .. segments Converts any virtual path in this folder to a physical path. Returns null if the virtual path is outside the folder. Returns true if the specified path is inside this virtual folder Returns true if (a) we have IOPermission, (b) the path is under our prefix, (c) the expected physical file does not exist (because we shouldn't interfere in that case), and (d) the other VPPs don't believe the file exists. Returns the LastWriteTimeUtc value for the specified virtual file in this folder, or DateTime.MinValue if missing. Returns true if the file exists in this virtual folder, and would not be masking an existing file. Returns false if NoIOPermission is true. Unless the path is not within the virtual folder, or IO permissions are missing, will return an IVirtualFile instance for the path. The file may or may not exist. For internal use only by the .NET VPP system. For internal use only by the .NET VPP system. For internal use only by the .NET VPP system. True if the provider attempted to register itself as a VirtualPathProvider and failed due to limited security clearance. False if it did not attempt (say, due to missing IOPermission) , or if it succeeded. If true, the plugin will attempt to register itself as an application-wide VirtualPathProvider instead of a image resizer-specific IVirtualImageProvider. The virtual path served by the VirtualFolder The physical path True if the plugin has detected it doesn't have sufficient IOPermission to operate.