Abstract image processor.

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
Static

Parameters

$width

integer

$height

integer

Returns

boolean

Creates an image from an existing file.

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

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_Abstract | false
Static

Parameters

$fileName

string

$inputType

integer

IMAGETYPE_XYZ constant representing image type

Returns

Creates a blank image.

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

Parameters

$width

integer

$height

integer

Returns

Creates a blank image.

createImageDirect(integer $width, integer $height) : \XenForo_Image_Abstract
Static

Parameters

$width

integer

$height

integer

Returns

Crops the current image.

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

Parameters

$x

Crop start x position

$y

Crop start y position

$width

Crop width

$height

Crop height

Gets the height of the image with current manipulations.

getHeight() : integer

Returns

integer

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

getOrientation() : string

Returns

stringOne of the ORIENTATION_ constants

Gets the width of the image with current manipulations.

getWidth() : integer

Returns

integer

Outputs the processed image.

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

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

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 current image.

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

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(integer $shortSideWidth) 

Parameters

$shortSideWidth

integer

Protected constructor.

__construct() 

Use static method to create.

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

_getDefaultClassName() : string
Static

Returns

string

 Properties

 

$_height : integer

This must stay current with manipulations.

 

$_width : integer

This must stay current with manipulations.

 Constants

 

ORIENTATION_LANDSCAPE

ORIENTATION_LANDSCAPE 
 

ORIENTATION_PORTRAIT

ORIENTATION_PORTRAIT 
 

ORIENTATION_SQUARE

ORIENTATION_SQUARE