Class Zend_Validate_File_ImageSize

Description

Validator for the image size of a image file

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Validate/File/ImageSize.php (line 35)

Zend_Validate_Abstract
   |
   --Zend_Validate_File_ImageSize
Class Constant Summary
 HEIGHT_TOO_BIG = 'fileImageSizeHeightTooBig'
 HEIGHT_TOO_SMALL = 'fileImageSizeHeightTooSmall'
 NOT_DETECTED = 'fileImageSizeNotDetected'
 NOT_READABLE = 'fileImageSizeNotReadable'
 WIDTH_TOO_BIG = 'fileImageSizeWidthTooBig'
 WIDTH_TOO_SMALL = 'fileImageSizeWidthTooSmall'
Variable Summary
 integer $_height
 integer $_maxheight
 integer $_maxwidth
 integer $_minheight
 integer $_minwidth
 integer $_width
Method Summary
 void __construct (Zend_Config|array $options)
 array getImageHeight ()
 array getImageMax ()
 array getImageMin ()
 array getImageWidth ()
 boolean isValid (string $value, [array $file = null])
 false _throw (string $file, string $errorType)
Variables
integer $_height (line 111)

Detected height

  • access: protected
integer $_maxheight (line 97)

Maximum image height

  • access: protected
integer $_maxwidth (line 83)

Maximum image width

  • access: protected
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%' can not be read",
)
(line 50)
  • var: Error message template
  • access: protected

Redefinition of:
Zend_Validate_Abstract::$_messageTemplates
Validation failure message template definitions
array $_messageVariables = array(
'minwidth' => '_minwidth',
'maxwidth' => '_maxwidth',
'minheight' => '_minheight',
'maxheight' => '_maxheight',
'width' => '_width',
'height' => '_height'
)
(line 62)
  • var: Error message template variables
  • access: protected

Redefinition of:
Zend_Validate_Abstract::$_messageVariables
Additional variables available for validation failure messages
integer $_minheight (line 90)

Minimum image height

  • access: protected
integer $_minwidth (line 76)

Minimum image width

  • access: protected
integer $_width (line 104)

Detected width

  • access: protected

Inherited Variables

Inherited from Zend_Validate_Abstract

Zend_Validate_Abstract::$_defaultTranslator
Zend_Validate_Abstract::$_errors
Zend_Validate_Abstract::$_messageLength
Zend_Validate_Abstract::$_messages
Zend_Validate_Abstract::$_obscureValue
Zend_Validate_Abstract::$_translator
Zend_Validate_Abstract::$_translatorDisabled
Zend_Validate_Abstract::$_value
Methods
Constructor __construct (line 125)

Sets validator options

Accepts the following option keys:

  • minheight
  • minwidth
  • maxheight
  • maxwidth

  • access: public
void __construct (Zend_Config|array $options)
getImageHeight (line 191)

Returns the set image height sizes

  • access: public
array getImageHeight ()
getImageMax (line 171)

Returns the set maximum image sizes

  • access: public
array getImageMax ()
getImageMin (line 161)

Returns the set minimum image sizes

  • access: public
array getImageMin ()
getImageWidth (line 181)

Returns the set image width sizes

  • access: public
array getImageWidth ()
isValid (line 308)

Defined by Zend_Validate_Interface

Returns true if and only if the imagesize of $value is at least min and not bigger than max

  • access: public
boolean isValid (string $value, [array $file = null])
  • string $value: Real file to check for image size
  • array $file: File data from Zend_File_Transfer
setImageHeight (line 290)

Sets the mimimum and maximum image height

  • return: Provides a fluent interface
  • access: public
Zend_Validate_File_ImageSize setImageHeight (array $options)
  • array $options: The image height dimensions
setImageMax (line 241)

Sets the maximum image size

  • return: Provides a fluent interface
  • throws: Zend_Validate_Exception When maxheight is smaller than minheight
  • throws: Zend_Validate_Exception When maxwidth is smaller than minwidth
  • access: public
Zend_Validate_StringLength setImageMax (array $options)
  • array $options: The maximum image dimensions
setImageMin (line 204)

Sets the minimum image size

  • return: Provides a fluent interface
  • throws: Zend_Validate_Exception When minheight is greater than maxheight
  • throws: Zend_Validate_Exception When minwidth is greater than maxwidth
  • access: public
Zend_Validate_File_ImageSize setImageMin (array $options)
  • array $options: The minimum image dimensions
setImageWidth (line 276)

Sets the mimimum and maximum image width

  • return: Provides a fluent interface
  • access: public
Zend_Validate_File_ImageSize setImageWidth (array $options)
  • array $options: The image width dimensions
_throw (line 355)

Throws an error of the given type

  • access: protected
false _throw (string $file, string $errorType)
  • string $file
  • string $errorType

Inherited Methods

Inherited From Zend_Validate_Abstract

 Zend_Validate_Abstract::getDefaultTranslator()
 Zend_Validate_Abstract::getErrors()
 Zend_Validate_Abstract::getMessageLength()
 Zend_Validate_Abstract::getMessages()
 Zend_Validate_Abstract::getMessageTemplates()
 Zend_Validate_Abstract::getMessageVariables()
 Zend_Validate_Abstract::getObscureValue()
 Zend_Validate_Abstract::getTranslator()
 Zend_Validate_Abstract::hasDefaultTranslator()
 Zend_Validate_Abstract::hasTranslator()
 Zend_Validate_Abstract::setDefaultTranslator()
 Zend_Validate_Abstract::setDisableTranslator()
 Zend_Validate_Abstract::setMessage()
 Zend_Validate_Abstract::setMessageLength()
 Zend_Validate_Abstract::setMessages()
 Zend_Validate_Abstract::setObscureValue()
 Zend_Validate_Abstract::setTranslator()
 Zend_Validate_Abstract::translatorIsDisabled()
 Zend_Validate_Abstract::_createMessage()
 Zend_Validate_Abstract::_error()
 Zend_Validate_Abstract::_setValue()
 Zend_Validate_Abstract::__get()
Class Constants
HEIGHT_TOO_BIG = 'fileImageSizeHeightTooBig' (line 42)
HEIGHT_TOO_SMALL = 'fileImageSizeHeightTooSmall' (line 43)
NOT_DETECTED = 'fileImageSizeNotDetected' (line 44)
NOT_READABLE = 'fileImageSizeNotReadable' (line 45)
WIDTH_TOO_BIG = 'fileImageSizeWidthTooBig' (line 40)
WIDTH_TOO_SMALL = 'fileImageSizeWidthTooSmall' (line 41)

Documentation generated on Mon, 21 Jun 2010 15:28:34 -0400 by phpDocumentor 1.4.3