Documentation

GraphicsMagick extends ImageDriver
in package

GraphicsMagick Image Driver.

Table of Contents

Properties

$dir  : string
$errors  : array<string|int, string>
$ext  : string
$tmp_image  : string

Methods

__construct()  : void
Attempts to detect the GraphicsMagick installation directory.
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
Creates a temporary image and executes the given actions. By creating a temporary copy of the image before manipulating it, this process is atomic.
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.
convert()  : string|false
Execute gm convert.
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.

Properties

$dir

protected string $dir = ''

Directory that GM is installed in

$errors

protected array<string|int, string> $errors = array()

Processing errors

$ext

protected string $ext = ''

Command extension (exe for windows)

Methods

__construct()

Attempts to detect the GraphicsMagick installation directory.

public __construct(array<string|int, mixed> $config) : void
Parameters
$config : array<string|int, mixed>

Configuration

Tags
throws
Kohana_Exception

crop()

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

public crop(mixed $prop) : bool
Parameters
$prop : mixed
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 flip(mixed $dir) : bool
Parameters
$dir : mixed
Return values
bool

process()

Creates a temporary image and executes the given actions. By creating a temporary copy of the image before manipulating it, this process is atomic.

public 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>
$actions : array<string|int, mixed>
$dir : string
$file : string
$render : bool = false
Return values
bool

resize()

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

public resize(mixed $prop) : bool
Parameters
$prop : mixed
Return values
bool

rotate()

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

public rotate(mixed $amt) : bool
Parameters
$amt : mixed
Return values
bool

sharpen()

Sharpen and image. Valid amounts are 1 to 100.

public sharpen(mixed $amount) : bool
Parameters
$amount : mixed

Amount to sharpen

Return values
bool

convert()

Execute gm convert.

protected convert(string $cmd[, array<string|int, mixed> $args = [] ]) : string|false
Parameters
$cmd : string

convert command args

$args : array<string|int, mixed> = []

args to interpolate into the command

Return values
string|false

properties()

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

protected 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