ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Namespaces | Classes | Enumerations
Package ImageResizer

Namespaces

package  Caching
 
package  Collections
 
package  Configuration
 
package  Encoding
 
package  ExtensionMethods
 
package  Licensing
 
package  Plugins
 
package  Resizing
 
package  Util
 

Classes

class  BoxEdges
 Represents the widths of edges of a box. More...
 
class  ResizerSection
 Handles reading the <resizer> section from Web.Config More...
 
class  ImageBuilder
 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. More...
 
class  ImageJob
 
class  ImageProcessingException
 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. More...
 
class  ImageCorruptedException
 A source file was corrupted More...
 
class  ImageMissingException
 One or more source files was missing More...
 
class  Instructions
 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. More...
 
class  InterceptModule
 Monitors incoming image requests to determine if resizing (or other processing) is being requested. More...
 
class  ResizeSettings
 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 More...
 
class  ImageUploadHelperS3Extensions
 
class  ImageUploadHelper
 

Enumerations

enum  OutputFormat { OutputFormat.Jpeg = 8, OutputFormat.Png = 16, OutputFormat.Gif = 32 }
 Output image formats More...
 
enum  ServerCacheMode { ServerCacheMode.No, ServerCacheMode.Always, ServerCacheMode.Default }
 When to disk cache the image More...
 
enum  ProcessWhen { ProcessWhen.No, ProcessWhen.Always, ProcessWhen.Default }
 When to process and re-encode the file. More...
 
enum  ScaleMode { ScaleMode.DownscaleOnly, ScaleMode.UpscaleOnly, ScaleMode.Both, ScaleMode.UpscaleCanvas }
 Controls whether the image is allowed to upscale, downscale, both, or if only the canvas gets to be upscaled. More...
 
enum  StretchMode { StretchMode.Proportionally, StretchMode.Fill }
 [Deprecated (Use FitMode.Stretch)] Previously used to force an image to be 'stretched' to match a different aspect ratio. More...
 
enum  FitMode {
  FitMode.None, FitMode.Max, FitMode.Pad, FitMode.Crop,
  FitMode.Carve, FitMode.Stretch
}
 How to resolve aspect ratio differences between the requested size and the original image's size. More...
 
enum  CropMode { CropMode.None, CropMode.Auto, CropMode.Custom }
 
enum  CropUnits { CropUnits.SourcePixels, CropUnits.Custom }
 
enum  FlipMode { FlipMode.None = 0, FlipMode.X = 4, FlipMode.Y = 6, FlipMode.XY = 2 }
 Horizontal and vertical flipping. Convertible to System.Drawing.RotateFlipType by casting. More...
 
enum  AnchorLocation {
  AnchorLocation.TopLeft = 1, AnchorLocation.TopCenter = 2, AnchorLocation.TopRight = 4, AnchorLocation.MiddleLeft = 16,
  AnchorLocation.MiddleCenter = 32, AnchorLocation.MiddleRight = 64, AnchorLocation.BottomLeft = 256, AnchorLocation.BottomCenter = 512,
  AnchorLocation.BottomRight = 1024
}
 Anchor location. Convertible to System.Drawing.ContentAlignment by casting. More...
 
enum  GrayscaleMode {
  None = 0, GrayscaleMode.Y = 1, NTSC = 1, RY = 2,
  BT709 = 3, GrayscaleMode.Flat = 4
}
 Modes of converting the image to Grayscale. GrayscaleMode.Y usually produces the best resuts More...
 
enum  JpegSubsamplingMode {
  JpegSubsamplingMode.Default = 0, JpegSubsamplingMode.Y4Cb1Cr1 = 4, JpegSubsamplingMode.Y4Cb2Cr0 = 8, JpegSubsamplingMode.Y4Cb2Cr2 = 16,
  JpegSubsamplingMode.HighestQuality =32, JpegSubsamplingMode.Y4Cb4Cr4 = 32
}
 The Jpeg subsampling mode to use. Requires FreeImageEncoder, FreeImageBuilder, WicEncoder, or WicBuilder. More...
 

Enumeration Type Documentation

Anchor location. Convertible to System.Drawing.ContentAlignment by casting.

Enumerator
TopLeft 

Content is vertically aligned at the top, and horizontally aligned on the left.

TopCenter 

Content is vertically aligned at the top, and horizontally aligned at the center.

TopRight 

Content is vertically aligned at the top, and horizontally aligned on the right.

MiddleLeft 

Content is vertically aligned in the middle, and horizontally aligned onthe left.

MiddleCenter 

Content is vertically aligned in the middle, and horizontally aligned at the center.

MiddleRight 

Content is vertically aligned in the middle, and horizontally aligned on the right.

BottomLeft 

Content is vertically aligned at the bottom, and horizontally aligned on the left.

BottomCenter 

Content is vertically aligned at the bottom, and horizontally aligned at the center.

BottomRight 

Content is vertically aligned at the bottom, and horizontally aligned on the right.

Definition at line 204 of file Enumerations.cs.

204  {
205  /// <summary>
206  /// Content is vertically aligned at the top, and horizontally aligned on the left.
207  /// </summary>
208  TopLeft = 1,
209 
210  /// <summary>
211  /// Content is vertically aligned at the top, and horizontally aligned at the center.
212  /// </summary>
213  TopCenter = 2,
214 
215  /// <summary>
216  /// Content is vertically aligned at the top, and horizontally aligned on the right.
217  /// </summary>
218  TopRight = 4,
219 
220  /// <summary>
221  /// Content is vertically aligned in the middle, and horizontally aligned onthe left.
222  /// </summary>
223  MiddleLeft = 16,
224 
225  /// <summary>
226  /// Content is vertically aligned in the middle, and horizontally aligned at the center.
227  /// </summary>
228  MiddleCenter = 32,
229 
230  /// <summary>
231  /// Content is vertically aligned in the middle, and horizontally aligned on the right.
232  /// </summary>
233  MiddleRight = 64,
234 
235  /// <summary>
236  /// Content is vertically aligned at the bottom, and horizontally aligned on the left.
237  /// </summary>
238  BottomLeft = 256,
239 
240  /// <summary>
241  /// Content is vertically aligned at the bottom, and horizontally aligned at the center.
242  /// </summary>
243  BottomCenter = 512,
244 
245  /// <summary>
246  /// Content is vertically aligned at the bottom, and horizontally aligned on the right.
247  /// </summary>
248  BottomRight = 1024,
249  }
Content is vertically aligned at the bottom, 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 at the bottom, and horizontally aligned at the center.
Content is vertically aligned in the middle, and horizontally aligned at the center.
Content is vertically aligned at the bottom, and horizontally aligned on the right.
Content is vertically aligned at the top, and horizontally aligned on the left.
Content is vertically aligned in the middle, and horizontally aligned on the right.
Enumerator
None 

Default. No cropping - uses letterboxing if strecth=proportionally and both width and height are specified.

Auto 

[Deprecated] Use Mode=Crop. Minimally crops to preserve aspect ratio if stretch=proportionally.

Custom 

Crops using the custom crop rectangle. Letterboxes if stretch=proportionally and both widht and height are specified.

Definition at line 145 of file Enumerations.cs.

145  {
146  /// <summary>
147  /// Default. No cropping - uses letterboxing if strecth=proportionally and both width and height are specified.
148  /// </summary>
149  None,
150  /// <summary>
151  /// [Deprecated] Use Mode=Crop. Minimally crops to preserve aspect ratio if stretch=proportionally.
152  /// </summary>
153  [Obsolete("Use Mode=Crop instead.")]
154  Auto,
155  /// <summary>
156  /// Crops using the custom crop rectangle. Letterboxes if stretch=proportionally and both widht and height are specified.
157  /// </summary>
158  Custom
159  }
Fit mode will be determined by other settings, such as &amp;carve=true, &amp;stretch=fill, and &amp;crop=auto. If none are specified and width/height are specified , &amp;mode=pad will be used. If maxwidth/maxheight are used, &amp;mode=max will be used.
[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 heigh...
Enumerator
SourcePixels 

Indicates the crop units are pixels on the original image.

Custom 

Indicates a custom range is being specified for the values. Base 0.

Definition at line 162 of file Enumerations.cs.

162  {
163  /// <summary>
164  /// Indicates the crop units are pixels on the original image.
165  /// </summary>
166  SourcePixels,
167  /// <summary>
168  /// Indicates a custom range is being specified for the values. Base 0.
169  /// </summary>
170  Custom
171 
172 
173  }
Crops using the custom crop rectangle. Letterboxes if stretch=proportionally and both widht and heigh...
Indicates the crop units are pixels on the original image.

How to resolve aspect ratio differences between the requested size and the original image's size.

Enumerator
None 

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.

Max 

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

Pad 

Width and height are considered exact values - padding is used if there is an aspect ratio difference. Use &anchor to override the MiddleCenter default.

Crop 

Width and height are considered exact values - cropping is used if there is an aspect ratio difference. Use &anchor to override the MiddleCenter default.

Carve 

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'.

Stretch 

Width and height are considered exact values - if there is an aspect ratio difference, the image is stretched.

Definition at line 114 of file Enumerations.cs.

114  {
115  /// <summary>
116  /// Fit mode will be determined by other settings, such as &amp;carve=true, &amp;stretch=fill, and &amp;crop=auto. If none are specified and width/height are specified , &amp;mode=pad will be used. If maxwidth/maxheight are used, &amp;mode=max will be used.
117  /// </summary>
118  None,
119 
120  /// <summary>
121  /// 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
122  /// </summary>
123  Max,
124  /// <summary>
125  /// Width and height are considered exact values - padding is used if there is an aspect ratio difference. Use &amp;anchor to override the MiddleCenter default.
126  /// </summary>
127  Pad,
128  /// <summary>
129  /// Width and height are considered exact values - cropping is used if there is an aspect ratio difference. Use &amp;anchor to override the MiddleCenter default.
130  /// </summary>
131  Crop,
132  /// <summary>
133  /// 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'.
134  /// </summary>
135  Carve,
136  /// <summary>
137  /// Width and height are considered exact values - if there is an aspect ratio difference, the image is stretched.
138  /// </summary>
139  Stretch,
140 
141 
142  }
Fit mode will be determined by other settings, such as &amp;carve=true, &amp;stretch=fill, and &amp;crop=auto. If none are specified and width/height are specified , &amp;mode=pad will be used. If maxwidth/maxheight are used, &amp;mode=max will be used.
Width and height are considered exact values - padding is used if there is an aspect ratio difference...
Width and height are considered exact values - seam carving is used if there is an aspect ratio diffe...
Width and height are considered exact values - cropping is used if there is an aspect ratio differenc...
Width and height are considered maximum values. The resulting image may be smaller to maintain its as...
Width and height are considered exact values - if there is an aspect ratio difference, the image is stretched.

Horizontal and vertical flipping. Convertible to System.Drawing.RotateFlipType by casting.

Enumerator
None 

No flipping

X 

Flip horizontally

Y 

Flip vertically (identical to 180 degree rotation)

XY 

Flip horizontally and vertically

Definition at line 177 of file Enumerations.cs.

177  {
178  /// <summary>
179  /// No flipping
180  /// </summary>
181  None = 0,
182  /// <summary>
183  /// Flip horizontally
184  /// </summary>
185  [EnumString("h")]
186  X = 4,
187  /// <summary>
188  /// Flip vertically (identical to 180 degree rotation)
189  /// </summary>
190  [EnumString("v")]
191  Y = 6,
192  /// <summary>
193  /// Flip horizontally and vertically
194  /// </summary>
195  [EnumString("both")]
196  XY = 2
197  }
Fit mode will be determined by other settings, such as &amp;carve=true, &amp;stretch=fill, and &amp;crop=auto. If none are specified and width/height are specified , &amp;mode=pad will be used. If maxwidth/maxheight are used, &amp;mode=max will be used.
Flip vertically (identical to 180 degree rotation)
Flip horizontally and vertically
Flip horizontally

Modes of converting the image to Grayscale. GrayscaleMode.Y usually produces the best resuts

Enumerator
Y 

The reccomended value. Y and NTSC are identical.

Flat 

Red, green, and blue are averaged to get the grayscale image. Usually produces poor results compared to other algorithms.

Definition at line 254 of file Enumerations.cs.

254  {
255  [EnumString("false")]
256  None = 0,
257  /// <summary>
258  /// The reccomended value. Y and NTSC are identical.
259  /// </summary>
260  [EnumString("true")]
261  Y = 1,
262 
263  NTSC = 1,
264  RY = 2,
265  BT709= 3,
266 
267  /// <summary>
268  /// Red, green, and blue are averaged to get the grayscale image. Usually produces poor results compared to other algorithms.
269  /// </summary>
270  Flat = 4
271  }
Fit mode will be determined by other settings, such as &amp;carve=true, &amp;stretch=fill, and &amp;crop=auto. If none are specified and width/height are specified , &amp;mode=pad will be used. If maxwidth/maxheight are used, &amp;mode=max will be used.
Flip vertically (identical to 180 degree rotation)
Red, green, and blue are averaged to get the grayscale image. Usually produces poor results compared ...

The Jpeg subsampling mode to use. Requires FreeImageEncoder, FreeImageBuilder, WicEncoder, or WicBuilder.

Enumerator
Default 

The encoder's default subsampling method will be used.

Y4Cb1Cr1 

411 Subsampling - Only supported by FreeImageBuilder and FreeImageEncoder. Poor quality.

Y4Cb2Cr0 

420 Subsampling - Commonly used in H262 and H264. Low quality compared to 422 and 444.

Y4Cb2Cr2 

422 Subsampling - Great balance of quality and file size, commonly used in high-end video formats.

HighestQuality 

444 subsampling - Highest quality, largest file size.

Y4Cb4Cr4 

444 subsampling - Highest quality, largest file size.

Definition at line 275 of file Enumerations.cs.

275  {
276  /// <summary>
277  /// The encoder's default subsampling method will be used.
278  /// </summary>
279  Default = 0,
280  /// <summary>
281  /// 411 Subsampling - Only supported by FreeImageBuilder and FreeImageEncoder. Poor quality.
282  /// </summary>
283  [EnumString("411",true)]
284  Y4Cb1Cr1 = 4,
285  /// <summary>
286  /// 420 Subsampling - Commonly used in H262 and H264. Low quality compared to 422 and 444.
287  /// </summary>
288  [EnumString("420",true)]
289  Y4Cb2Cr0 = 8,
290  /// <summary>
291  /// 422 Subsampling - Great balance of quality and file size, commonly used in high-end video formats.
292  /// </summary>
293  [EnumString("422",true)]
294  Y4Cb2Cr2 = 16,
295  /// <summary>
296  /// 444 subsampling - Highest quality, largest file size.
297  /// </summary>
298  [EnumString("444",true)]
299  HighestQuality =32,
300  /// <summary>
301  /// 444 subsampling - Highest quality, largest file size.
302  /// </summary>
303  [EnumString("444",true)]
304  Y4Cb4Cr4 = 32
305  }
444 subsampling - Highest quality, largest file size.
Default caching behavior. Modified images are disk cached, unmodified images are not.
411 Subsampling - Only supported by FreeImageBuilder and FreeImageEncoder. Poor quality.
444 subsampling - Highest quality, largest file size.
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...

Output image formats

Enumerator
Jpeg 

Jpeg - the best format for photographs and thumbnails

Png 

The best format for transparent images and vector graphics

Gif 

A really poor choice for pretty much everything except animation

Definition at line 10 of file Enumerations.cs.

10  {
11  /// <summary>
12  /// Jpeg - the best format for photographs and thumbnails
13  /// </summary>
14  [EnumString("jpg",true)]
15  [EnumString("jpe")]
16  [EnumString("jif")]
17  [EnumString("jfif")]
18  [EnumString("jfi")]
19  [EnumString("exif")]
20  Jpeg = 8,
21  /// <summary>
22  /// The best format for transparent images and vector graphics
23  /// </summary>
24  Png = 16,
25  /// <summary>
26  /// A really poor choice for pretty much everything except animation
27  /// </summary>
28  Gif = 32
29  }
A really poor choice for pretty much everything except animation
Jpeg - the best format for photographs and thumbnails
The best format for transparent images and vector graphics

When to process and re-encode the file.

Enumerator
No 

Request no processing of the image or file (generally used with cache=always). The file contents will be used as-is.

Always 

Require the file or image to be processed. Will cause non-image files to fail with an ImageCorruptedException.

Default 

Default. Only files with both a supported image extension and resizing settings specified in the querystring will be processed.

Definition at line 54 of file Enumerations.cs.

54  {
55  /// <summary>
56  /// Request no processing of the image or file (generally used with cache=always).
57  /// The file contents will be used as-is.
58  /// </summary>
59  No,
60  /// <summary>
61  /// Require the file or image to be processed. Will cause non-image files to fail with an ImageCorruptedException.
62  /// </summary>
63  Always,
64  /// <summary>
65  /// Default. Only files with both a supported image extension and resizing settings specified in the querystring will be processed.
66  /// </summary>
67  Default
68  }
Default caching behavior. Modified images are disk cached, unmodified images are not.
Request no disk caching of the resulting image.

Controls whether the image is allowed to upscale, downscale, both, or if only the canvas gets to be upscaled.

Enumerator
DownscaleOnly 

The default. Only downsamples images - never enlarges. If an image is smaller than 'width' and 'height', the image coordinates are used instead.

UpscaleOnly 

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.

Both 

Upscales and downscales images according to 'width' and 'height', within web.config restrictions.

UpscaleCanvas 

When the image is smaller than the requested size, padding is added instead of stretching the image

Definition at line 75 of file Enumerations.cs.

75  {
76  /// <summary>
77  /// The default. Only downsamples images - never enlarges. If an image is smaller than 'width' and 'height', the image coordinates are used instead.
78  /// </summary>
79  [EnumString("down")]
81  /// <summary>
82  /// 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.
83  /// </summary>
84  [EnumString("up")]
86  /// <summary>
87  /// Upscales and downscales images according to 'width' and 'height', within web.config restrictions.
88  /// </summary>
89  Both,
90  /// <summary>
91  /// When the image is smaller than the requested size, padding is added instead of stretching the image
92  /// </summary>
93  [EnumString("canvas")]
95  }
When the image is smaller than the requested size, padding is added instead of stretching the image ...
Upscales and downscales images according to &#39;width&#39; and &#39;height&#39;, within web.config restrictions...
Only upscales (zooms) images - never downsamples except to meet web.config restrictions. If an image is larger than &#39;width&#39; and &#39;height&#39;, the image coordinates are used instead.
The default. Only downsamples images - never enlarges. If an image is smaller than &#39;width&#39; and &#39;heigh...

When to disk cache the image

Enumerator
No 

Request no disk caching of the resulting image.

Always 

Request that the resulting image always be disk cached on the server, even if no modifications are made.

Default 

Default caching behavior. Modified images are disk cached, unmodified images are not.

Definition at line 36 of file Enumerations.cs.

36  {
37  /// <summary>
38  /// Request no disk caching of the resulting image.
39  /// </summary>
40  No,
41  /// <summary>
42  /// Request that the resulting image always be disk cached on the server, even if no modifications are made.
43  /// </summary>
44  Always,
45  /// <summary>
46  /// Default caching behavior. Modified images are disk cached, unmodified images are not.
47  /// </summary>
48  Default
49 
50  }
Default caching behavior. Modified images are disk cached, unmodified images are not.
Request no disk caching of the resulting image.

[Deprecated (Use FitMode.Stretch)] Previously used to force an image to be 'stretched' to match a different aspect ratio.

Enumerator
Proportionally 

[Deprecated (Use FitMode)] Maintains aspect ratio. Default.

Fill 

[Deprecated (Use FitMode)] Skews image to fit the new aspect ratio defined by 'width' and 'height'

Definition at line 101 of file Enumerations.cs.

101  {
102  /// <summary>
103  /// [Deprecated (Use FitMode)] Maintains aspect ratio. Default.
104  /// </summary>
106  /// <summary>
107  /// [Deprecated (Use FitMode)] Skews image to fit the new aspect ratio defined by 'width' and 'height'
108  /// </summary>
109  Fill
110  }
[Deprecated (Use FitMode)] Maintains aspect ratio. Default.
[Deprecated (Use FitMode)] Skews image to fit the new aspect ratio defined by &#39;width&#39; and &#39;height&#39; ...