Documentation

ImageDriver
in package

AbstractYes

Image API driver.

Table of Contents

Methods

crop()  : bool
Crop an image. Valid properties are: width, height, top, left.
execute()  : bool
Executes a set of actions, defined in pairs.
flip()  : bool
Flip an image. Valid directions are horizontal and vertical.
process()  : bool
Process an image with a set of actions.
resize()  : bool
Resize an image. Valid properties are: width, height, and master.
rotate()  : bool
Rotate an image. Valid amounts are -180 to 180.
sharpen()  : bool
Sharpen and image. Valid amounts are 1 to 100.
properties()  : array<string|int, mixed>
Return the current width and height of the temporary image. This is mainly needed for sanitizing the geometry.
sanitizeGeometry()  : void
Sanitize and normalize a geometry array based on the temporary image width and height. Valid properties are: width, height, top, left.

Methods

crop()

Crop an image. Valid properties are: width, height, top, left.

public abstract crop(array<string|int, mixed> $properties) : bool
Parameters
$properties : array<string|int, mixed>

New properties

Return values
bool

execute()

Executes a set of actions, defined in pairs.

public execute(array<string|int, mixed> $actions) : bool
Parameters
$actions : array<string|int, mixed>

Actions

Return values
bool

flip()

Flip an image. Valid directions are horizontal and vertical.

public abstract flip(int $direction) : bool
Parameters
$direction : int

Direction to flip

Return values
bool

process()

Process an image with a set of actions.

public abstract process(array<string|int, mixed> $image, array<string|int, mixed> $actions, string $dir, string $file[, bool $render = false ]) : bool
Parameters
$image : array<string|int, mixed>

Image filename

$actions : array<string|int, mixed>

Actions to execute

$dir : string

Destination directory path

$file : string

Destination filename

$render : bool = false

Whether to render the image immediately

Return values
bool

resize()

Resize an image. Valid properties are: width, height, and master.

public abstract resize(array<string|int, mixed> $properties) : bool
Parameters
$properties : array<string|int, mixed>

New properties

Return values
bool

rotate()

Rotate an image. Valid amounts are -180 to 180.

public abstract rotate(int $amount) : bool
Parameters
$amount : int

Amount to rotate

Return values
bool

sharpen()

Sharpen and image. Valid amounts are 1 to 100.

public abstract sharpen(int $amount) : bool
Parameters
$amount : int

Amount to sharpen

Return values
bool

properties()

Return the current width and height of the temporary image. This is mainly needed for sanitizing the geometry.

protected abstract properties() : array<string|int, mixed>
Return values
array<string|int, mixed> —

width, height

sanitizeGeometry()

Sanitize and normalize a geometry array based on the temporary image width and height. Valid properties are: width, height, top, left.

protected sanitizeGeometry(array<string|int, mixed> &$geometry) : void
Parameters
$geometry : array<string|int, mixed>

Geometry properties

On this page

Search results