Image processor using GD.

Includes factory for creating concrete image processors.

package XenForo_Image

 Methods

Determines whether an image can be resized by the server based on dimensions.

canResize(integer $width, integer $height) : boolean
Inherited

inherited_from \XenForo_Image_Abstract::canResize()

Parameters

$width

integer

$height

integer

Returns

boolean

Creates an image from an existing file.

createFromFile(string $fileName, integer $inputType) : \XenForo_Image_Abstract
Inherited

inherited_from \XenForo_Image_Abstract::createFromFile()

Parameters

$fileName

string

$inputType

integer

IMAGETYPE_XYZ constant representing image type

Returns

Creates an image from an existing file.

createFromFileDirect(string $fileName, integer $inputType) : \XenForo_Image_Gd | false

Parameters

$fileName

string

$inputType

integer

IMAGETYPE_XYZ constant representing image type

Returns

Creates a blank image.

createImage(integer $width, integer $height) : \XenForo_Image_Abstract
Inherited

inherited_from \XenForo_Image_Abstract::createImage()

Parameters

$width

integer

$height

integer

Returns

Creates a blank image.

createImageDirect(integer $width, integer $height) : \XenForo_Image_Gd

Parameters

$width

integer

$height

integer

Returns

Crops the image.

crop(\$x $x, \$y $y, \$width $width, \$height $height) 

see \global\XenForo_Image_Abstract::crop()

Parameters

$x

\$x

Crop start x position

$y

\$y

Crop start y position

$width

\$width

Crop width

$height

\$height

Crop height

Gets the height of the image with current manipulations.

getHeight() : integer
Inherited

inherited_from \XenForo_Image_Abstract::getHeight()

Returns

integer

Gets the orientation of the image (landscape, portrait, square)

getOrientation() : string
Inherited

inherited_from \XenForo_Image_Abstract::getOrientation()

Returns

stringOne of the ORIENTATION_ constants

Gets the width of the image with current manipulations.

getWidth() : integer
Inherited

inherited_from \XenForo_Image_Abstract::getWidth()

Returns

integer

Outputs the image.

output(\constant $outputType, string | null $outputFile, integer $quality) : boolean

If no output file is specified, the image is printed to the screen.

see \global\XenForo_Image_Abstract::output()

Parameters

$outputType

\constant

One of the IMAGETYPE_XYZ constants

$outputFile

stringnull

If specified, the file to write to; else, prints to screen

$quality

integer

Quality of outputted file (from 0 to 100)

Returns

booleanTrue on success

Thumbnails the image.

thumbnail(integer $maxWidth, integer $maxHeight) : boolean

see \global\XenForo_Image_Abstract::thumbnail()

Parameters

$maxWidth

integer

The maximum width of the thumb.

$maxHeight

integer

Maximum height of the thumb; if not specified, uses max width.

Returns

booleanTrue if thumbnailing was necessary

Produces a thumbnail of the current image whose shorter side is the specified length

thumbnailFixedShorterSide($shortSideLength) 

see \global\XenForo_Image_Abstract::thumbnailFixedShorterSide

Parameters

$shortSideLength

Constructor.

__construct(resource $image) 

Use static method to create.

Parameters

$image

resource

GD image resource

Gets the name of the default image processing class (this may come from an option).

_getDefaultClassName() : string
Inherited

inherited_from \XenForo_Image_Abstract::_getDefaultClassName()

Returns

string

_preallocateBackground()

_preallocateBackground($image) 

Parameters

$image

Sets the internal GD image resource.

_setImage(resource $image) 

Parameters

$image

resource

 Properties

 

Height of the image.

$_height : integer
Inherited

This must stay current with manipulations.

inherited_from \XenForo_Image_Abstract::$$_height
 

The GD image resource.

$_image : resource

 

Width of the image.

$_width : integer
Inherited

This must stay current with manipulations.

inherited_from \XenForo_Image_Abstract::$$_width

 Constants

 

ORIENTATION_LANDSCAPE

ORIENTATION_LANDSCAPE 
Inherited

inherited_from \XenForo_Image_Abstract::ORIENTATION_LANDSCAPE
 

ORIENTATION_PORTRAIT

ORIENTATION_PORTRAIT 
Inherited

inherited_from \XenForo_Image_Abstract::ORIENTATION_PORTRAIT
 

ORIENTATION_SQUARE

ORIENTATION_SQUARE 
Inherited

inherited_from \XenForo_Image_Abstract::ORIENTATION_SQUARE