ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Classes | Public Types | Public Member Functions | Protected Attributes | Properties | List of all members
ImageResizer.Plugins.Basic.SizeLimits Class Reference

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

Inheritance diagram for ImageResizer.Plugins.Basic.SizeLimits:
Inheritance graph
[legend]
Collaboration diagram for ImageResizer.Plugins.Basic.SizeLimits:
Collaboration graph
[legend]

Classes

class  SizeLimitException
 

Public Types

enum  TotalSizeBehavior { ThrowException, IgnoreLimits }
 

Public Member Functions

 SizeLimits (Config c)
 
void ValidateTotalSize (Size total)
 
bool FitsInsideTotalSize (Size s)
 
- Public Member Functions inherited from ImageResizer.Configuration.Issues.IssueSink
 IssueSink (string defaultSource)
 
virtual IEnumerable< IIssueGetIssues ()
 Returns a copy of the list of reported issues. More...
 
virtual void AcceptIssue (IIssue i)
 Adds the specified issue to the list unless it is an exact duplicate of another instance. More...
 

Protected Attributes

Size totalSize = new Size(3200,3200)
 
TotalSizeBehavior totalBehavior = TotalSizeBehavior.ThrowException
 
Size imageSize = new Size(0,0)
 
- Protected Attributes inherited from ImageResizer.Configuration.Issues.IssueSink
string defaultSource = null
 

Properties

Size TotalSize [get, set]
 The maximum final size an image generated by ImageBuilder can be. Defaults to 3200x3200 More...
 
TotalSizeBehavior TotalBehavior [get, set]
 What action to take when the total size of the final image would exceed the TotalSize value. Defaults to ThowException More...
 
bool HasImageSize [get]
 Returns true if ImageSize is specified. More...
 
Size ImageSize [get, set]
 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 More...
 

Detailed Description

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.

Definition at line 18 of file SizeLimits.cs.

Property Documentation

bool ImageResizer.Plugins.Basic.SizeLimits.HasImageSize
get

Returns true if ImageSize is specified.

Definition at line 81 of file SizeLimits.cs.

Size ImageResizer.Plugins.Basic.SizeLimits.ImageSize
getset

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

Definition at line 92 of file SizeLimits.cs.

TotalSizeBehavior ImageResizer.Plugins.Basic.SizeLimits.TotalBehavior
getset

What action to take when the total size of the final image would exceed the TotalSize value. Defaults to ThowException

Definition at line 73 of file SizeLimits.cs.

Size ImageResizer.Plugins.Basic.SizeLimits.TotalSize
getset

The maximum final size an image generated by ImageBuilder can be. Defaults to 3200x3200

Definition at line 64 of file SizeLimits.cs.


The documentation for this class was generated from the following file: