class Grafika

Contains factory methods for detecting editors, creating editors and images.

Constants

DIR

Grafika root directory

Methods

static string
fontsDir()

Return path to directory containing fonts used in text operations.

static 
setEditorList(array $editorList)

Change the editor list order of evaluation globally.

static string
detectAvailableEditor(array $editorList = null)

Detects and return the name of the first supported editor which can either be "Imagick" or "Gd".

static EditorInterface
createEditor(array $editorList = array('Imagick', 'Gd'))

Creates the first available editor.

static ImageInterface
createImage(string $imageFile)

Create an image.

static ImageInterface
createBlankImage(int $width = 1, int $height = 1)

Create a blank image.

static FilterInterface
createFilter(string $filterName)

Create a filter. Detects available editor to use.

createDrawingObject(string $drawingObjectName)

Draws an object. Detects available editor to use.

Details

at line line 66
static string fontsDir()

Return path to directory containing fonts used in text operations.

Return Value

string

at line line 80
static setEditorList(array $editorList)

Change the editor list order of evaluation globally.

Parameters

array $editorList

Exceptions

Exception

at line line 95
static string detectAvailableEditor(array $editorList = null)

Detects and return the name of the first supported editor which can either be "Imagick" or "Gd".

Parameters

array $editorList Array of editor list names. Use this to change the order of evaluation for editors for this function call only. Default order of evaluation is Imagick then GD.

Return Value

string Name of available editor.

Exceptions

Exception Throws exception if there are no supported editors.

at line line 126
static EditorInterface createEditor(array $editorList = array('Imagick', 'Gd'))

Creates the first available editor.

Parameters

array $editorList Array of editor list names. Use this to change the order of evaluation for editors. Default order of evaluation is Imagick then GD.

Return Value

EditorInterface

Exceptions

Exception

at line line 143
static ImageInterface createImage(string $imageFile)

Create an image.

Parameters

string $imageFile Path to image file.

Return Value

ImageInterface

Exceptions

Exception

at line line 163
static ImageInterface createBlankImage(int $width = 1, int $height = 1)

Create a blank image.

Parameters

int $width Width of image in pixels.
int $height Height of image in pixels.

Return Value

ImageInterface

Exceptions

Exception

at line line 182
static FilterInterface createFilter(string $filterName)

Create a filter. Detects available editor to use.

Parameters

string $filterName The name of the filter.

Return Value

FilterInterface

Exceptions

Exception

at line line 283
static DrawingObjectInterface createDrawingObject(string $drawingObjectName)

Draws an object. Detects available editor to use.

Parameters

string $drawingObjectName The name of the DrawingObject.

Return Value

DrawingObjectInterface

Exceptions

Exception We use arraykeyexist() instead of isset() to be able to detect a parameter with a NULL value.