Validate/File/ImageSize.php
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.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Validate
- Version
- $Id$
\Zend_Validate_File_ImageSize
Package: Zend_ValidateValidator for the image size of a image file
- Parent(s)
- \Zend_Validate_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties



array $_messageTemplates = array(self::WIDTH_TOO_BIG => "Maximum allowed width for image '%value%' should be '%maxwidth%' but '%width%' detected", self::WIDTH_TOO_SMALL => "Minimum expected width for image '%value%' should be '%minwidth%' but '%width%' detected", self::HEIGHT_TOO_BIG => "Maximum allowed height for image '%value%' should be '%maxheight%' but '%height%' detected", self::HEIGHT_TOO_SMALL => "Minimum expected height for image '%value%' should be '%minheight%' but '%height%' detected", self::NOT_DETECTED => "The size of image '%value%' could not be detected", self::NOT_READABLE => "File '%value%' is not readable or does not exist")
Default valuearray(self::WIDTH_TOO_BIG => "Maximum allowed width for image '%value%' should be '%maxwidth%' but '%width%' detected", self::WIDTH_TOO_SMALL => "Minimum expected width for image '%value%' should be '%minwidth%' but '%width%' detected", self::HEIGHT_TOO_BIG => "Maximum allowed height for image '%value%' should be '%maxheight%' but '%height%' detected", self::HEIGHT_TOO_SMALL => "Minimum expected height for image '%value%' should be '%minheight%' but '%height%' detected", self::NOT_DETECTED => "The size of image '%value%' could not be detected", self::NOT_READABLE => "File '%value%' is not readable or does not exist")
Details- Type
- array



array $_messageVariables = array('minwidth' => '_minwidth', 'maxwidth' => '_maxwidth', 'minheight' => '_minheight', 'maxheight' => '_maxheight', 'width' => '_width', 'height' => '_height')
Error message template variables
Default valuearray('minwidth' => '_minwidth', 'maxwidth' => '_maxwidth', 'minheight' => '_minheight', 'maxheight' => '_maxheight', 'width' => '_width', 'height' => '_height')
Details- Type
- array
Methods



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


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
ParametersName | Type | Description |
---|
$value | string | Real file to check for image size |
---|
$file | array | File data from Zend_File_Transfer |
---|
Returns


setImageHeight(array $options) : \Zend_Validate_File_ImageSize
Sets the mimimum and maximum image height
ParametersName | Type | Description |
---|
$options | array | The image height dimensions |
---|
Returns 


setImageMax(array $options) : \Zend_Validate_StringLength
Sets the maximum image size
ParametersName | Type | Description |
---|
$options | array | The maximum image dimensions |
---|
ReturnsThrows 


setImageMin(array $options) : \Zend_Validate_File_ImageSize
Sets the minimum image size
ParametersName | Type | Description |
---|
$options | array | The minimum image dimensions |
---|
ReturnsThrows 


setImageWidth(array $options) : \Zend_Validate_File_ImageSize
Sets the mimimum and maximum image width
ParametersName | Type | Description |
---|
$options | array | The image width dimensions |
---|
Returns