API Documentation

Validate/File/ImageSize.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Validate
version
$Id: ImageSize.php 22697 2010-07-26 21:14:47Z alexander $
Classes
Zend_Validate_File_ImageSize

Description

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.

Zend_Validate_File_ImageSize

Extends from
Zend_Validate_Abstract
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Validate
Constants
WIDTH_TOO_BIG
WIDTH_TOO_SMALL
HEIGHT_TOO_BIG
HEIGHT_TOO_SMALL
NOT_DETECTED
NOT_READABLE
Properties
$_messageTemplates
$_messageVariables
$_minwidth
$_maxwidth
$_minheight
$_maxheight
$_width
$_height
Methods
__construct
getImageMin
getImageMax
getImageWidth
getImageHeight
setImageMin
setImageMax
setImageWidth
setImageHeight
isValid
_throw

Description

Validator for the image size of a image file

Constants

WIDTH_TOO_BIG

 WIDTH_TOO_BIG = 'fileImageSizeWidthTooBig'

Details

value
fileImageSizeWidthTooBig
const
string Error constants

WIDTH_TOO_SMALL

 WIDTH_TOO_SMALL = 'fileImageSizeWidthTooSmall'

Details

value
fileImageSizeWidthTooSmall

HEIGHT_TOO_BIG

 HEIGHT_TOO_BIG = 'fileImageSizeHeightTooBig'

Details

value
fileImageSizeHeightTooBig

HEIGHT_TOO_SMALL

 HEIGHT_TOO_SMALL = 'fileImageSizeHeightTooSmall'

Details

value
fileImageSizeHeightTooSmall

NOT_DETECTED

 NOT_DETECTED = 'fileImageSizeNotDetected'

Details

value
fileImageSizeNotDetected

NOT_READABLE

 NOT_READABLE = 'fileImageSizeNotReadable'

Details

value
fileImageSizeNotReadable

Properties

$_height

integer $_height = ''

Detected height

Details

$_height
integer
visibility
protected
default
final
false
static
false

$_maxheight

integer $_maxheight = ''

Maximum image height

Details

$_maxheight
integer
visibility
protected
default
final
false
static
false

$_maxwidth

integer $_maxwidth = ''

Maximum image width

Details

$_maxwidth
integer
visibility
protected
default
final
false
static
false

$_messageTemplates

array $_messageTemplates = 'array'

Details

$_messageTemplates
array
Error message template
visibility
protected
default
array
final
false
static
false

$_messageVariables

array $_messageVariables = 'array'

Details

$_messageVariables
array
Error message template variables
visibility
protected
default
array
final
false
static
false

$_minheight

integer $_minheight = ''

Minimum image height

Details

$_minheight
integer
visibility
protected
default
final
false
static
false

$_minwidth

integer $_minwidth = ''

Minimum image width

Details

$_minwidth
integer
visibility
protected
default
final
false
static
false

$_width

integer $_width = ''

Detected width

Details

$_width
integer
visibility
protected
default
final
false
static
false

Methods

__construct

__construct( Zend_Config|array $options ) : void

Sets validator options

Accepts the following option keys: - minheight - minwidth - maxheight - maxwidth

Arguments
$options
Zend_Configarray
Details
visibility
public
final
false
static
false

_throw

_throw( string $file, string $errorType ) : false

Throws an error of the given type

Arguments
$file
string
$errorType
string
Output
false
Details
visibility
protected
final
false
static
false

getImageHeight

getImageHeight( ) : array

Returns the set image height sizes

Output
array
Details
visibility
public
final
false
static
false

getImageMax

getImageMax( ) : array

Returns the set maximum image sizes

Output
array
Details
visibility
public
final
false
static
false

getImageMin

getImageMin( ) : array

Returns the set minimum image sizes

Output
array
Details
visibility
public
final
false
static
false

getImageWidth

getImageWidth( ) : array

Returns the set image width sizes

Output
array
Details
visibility
public
final
false
static
false

isValid

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

Arguments
$value
string
Real file to check for image size
$file
array
File data from Zend_File_Transfer
Output
boolean
Details
visibility
public
final
false
static
false

setImageHeight

setImageHeight( array $options ) : Zend_Validate_File_ImageSize

Sets the mimimum and maximum image height

Arguments
$options
array
The image height dimensions
Output
Zend_Validate_File_ImageSize
Provides a fluent interface
Details
visibility
public
final
false
static
false

setImageMax

setImageMax( array $options ) : Zend_Validate_StringLength

Sets the maximum image size

Arguments
$options
array
The maximum image dimensions
Output
Zend_Validate_StringLength
Provides a fluent interface
Details
visibility
public
final
false
static
false
throws
When maxwidth is smaller than minwidth
throws
When maxheight is smaller than minheight

setImageMin

setImageMin( array $options ) : Zend_Validate_File_ImageSize

Sets the minimum image size

Arguments
$options
array
The minimum image dimensions
Output
Zend_Validate_File_ImageSize
Provides a fluent interface
Details
visibility
public
final
false
static
false
throws
When minwidth is greater than maxwidth
throws
When minheight is greater than maxheight

setImageWidth

setImageWidth( array $options ) : Zend_Validate_File_ImageSize

Sets the mimimum and maximum image width

Arguments
$options
array
The image width dimensions
Output
Zend_Validate_File_ImageSize
Provides a fluent interface
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.