C# Class Serenity.Web.ImageChecker

checks stream data if valid image file and validate required conditions.
Mostra file Open project: volkanceylan/Serenity Class Usage Examples

Public Methods

Method Description
CheckSizeConstraints ( int width, int height ) : ImageCheckResult

Checks an image width and height against size constraints

CheckStream ( Stream inputStream ) : ImageCheckResult

Use this overload to check an image from a stream.

CheckStream ( Stream inputStream, bool returnImage, Image &image ) : ImageCheckResult

Checks if the given image if it is a valid or not. If so, controls its compliance to constraints

FormatErrorMessage ( ImageCheckResult result ) : string

Method Details

CheckSizeConstraints() public method

Checks an image width and height against size constraints
public CheckSizeConstraints ( int width, int height ) : ImageCheckResult
width int /// Image width.
height int /// Image height.
return ImageCheckResult

CheckStream() public method

Use this overload to check an image from a stream.
public CheckStream ( Stream inputStream ) : ImageCheckResult
inputStream Stream /// Stream with image data
return ImageCheckResult

CheckStream() public method

Checks if the given image if it is a valid or not. If so, controls its compliance to constraints
public CheckStream ( Stream inputStream, bool returnImage, Image &image ) : ImageCheckResult
inputStream Stream /// Stream which contains image data
returnImage bool /// Does image required to be returned? If not requested, it will be disposed at the end of processing
image Image /// When method returns contains the image object. If returnImage false it will contain null
return ImageCheckResult

FormatErrorMessage() public method

public FormatErrorMessage ( ImageCheckResult result ) : string
result ImageCheckResult
return string