Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Validator for the image size of a image file

array
$_messageTemplates= 'array(
self::WIDTH_TOO_BIG => "Maximum allowed width for image '%value%' should be '%maxwidth%' but '%width%' detected"'
array(
self::WIDTH_TOO_BIG => "Maximum allowed width for image '%value%' should be '%maxwidth%' but '%width%' detected"
Details
array
$_messageVariables= 'array(
'minwidth' => '_minwidth''
array(
'minwidth' => '_minwidth'
Details
__construct(
\Zend_Config|array $options
)
:
void
Sets validator options
Accepts the following option keys: - minheight - minwidth - maxheight - maxwidth
Name | Type | Description |
---|---|---|
$options | \Zend_Config|array |

_throw(
string $file, string $errorType
)
:
false
Throws an error of the given type
Name | Type | Description |
---|---|---|
$file | string | |
$errorType | string |
Type | Description |
---|---|
false |

isValid(
string $value, array $file
=
null
)
:
boolean
Defined by Zend_Validate_Interface
Returns true if and only if the imagesize of $value is at least min and not bigger than max
Name | Type | Description |
---|---|---|
$value | string | Real file to check for image size |
$file | array | File data from Zend_File_Transfer |
Type | Description |
---|---|
boolean |

setImageHeight(
array $options
)
:
\Zend_Validate_File_ImageSize
Sets the mimimum and maximum image height
Name | Type | Description |
---|---|---|
$options | array | The image height dimensions |
Type | Description |
---|---|
\Zend_Validate_File_ImageSize | Provides a fluent interface |

setImageMax(
array $options
)
:
\Zend_Validate_StringLength
Sets the maximum image size
Name | Type | Description |
---|---|---|
$options | array | The maximum image dimensions |
Type | Description |
---|---|
\Zend_Validate_StringLength | Provides a fluent interface |
Exception | Description |
---|---|
\Zend_Validate_Exception | When maxwidth is smaller than minwidth |
\Zend_Validate_Exception | When maxheight is smaller than minheight |

setImageMin(
array $options
)
:
\Zend_Validate_File_ImageSize
Sets the minimum image size
Name | Type | Description |
---|---|---|
$options | array | The minimum image dimensions |
Type | Description |
---|---|
\Zend_Validate_File_ImageSize | Provides a fluent interface |
Exception | Description |
---|---|
\Zend_Validate_Exception | When minwidth is greater than maxwidth |
\Zend_Validate_Exception | When minheight is greater than maxheight |

setImageWidth(
array $options
)
:
\Zend_Validate_File_ImageSize
Sets the mimimum and maximum image width
Name | Type | Description |
---|---|---|
$options | array | The image width dimensions |
Type | Description |
---|---|
\Zend_Validate_File_ImageSize | Provides a fluent interface |