class Imagine extends AbstractImagine

Imagine implementation using the Imagick PHP extension.

Methods

$this
setMetadataReader(MetadataReaderInterface $metadataReader)

Set the object to be used to read image metadata.

getMetadataReader()

Get the object to be used to read image metadata.

$this
setClassFactory(ClassFactoryInterface $classFactory)

Set the class factory instance to be used.

getClassFactory()

Get the class factory instance to be used.

string
checkPath(string|object $path)

Checks a path that could be used with ImagineInterface::open and returns a proper string.

__construct()

No description

open(string|LoaderInterface|mixed $path)

Opens an existing image from $path.

create(BoxInterface $size, ColorInterface $color = null)

Creates a new empty image with an optional background color.

load(string $string)

Loads an image from a binary $string.

read(resource $resource)

Loads an image from a resource $resource.

font(string $file, int $size, ColorInterface $color)

Constructs a font with specified $file, $size and $color.

Details

in AbstractImagine at line 36
$this setMetadataReader(MetadataReaderInterface $metadataReader)

Set the object to be used to read image metadata.

Parameters

MetadataReaderInterface $metadataReader

Return Value

$this

See also

ImagineInterface::setMetadataReader

in AbstractImagine at line 48
MetadataReaderInterface getMetadataReader()

Get the object to be used to read image metadata.

in AbstractImagine at line 62
$this setClassFactory(ClassFactoryInterface $classFactory)

Set the class factory instance to be used.

Parameters

ClassFactoryInterface $classFactory

Return Value

$this

See also

ClassFactoryAwareInterface::setClassFactory

in AbstractImagine at line 74
ClassFactoryInterface getClassFactory()

Get the class factory instance to be used.

in AbstractImagine at line 93
protected string checkPath(string|object $path)

Checks a path that could be used with ImagineInterface::open and returns a proper string.

Parameters

string|object $path

Return Value

string

Exceptions

InvalidArgumentException in case the given path is invalid

at line 36
__construct()

Exceptions

RuntimeException

at line 57
ImageInterface open(string|LoaderInterface|mixed $path)

Opens an existing image from $path.

Parameters

string|LoaderInterface|mixed $path the file path, a LoaderInterface instance, or an object whose string representation is the image path

Return Value

ImageInterface

Exceptions

RuntimeException

See also

ImagineInterface::open

at line 88
ImageInterface create(BoxInterface $size, ColorInterface $color = null)

Creates a new empty image with an optional background color.

at line 130
ImageInterface load(string $string)

Loads an image from a binary $string.

Parameters

string $string

Return Value

ImageInterface

Exceptions

RuntimeException

See also

ImagineInterface::load

at line 149
ImageInterface read(resource $resource)

Loads an image from a resource $resource.

Parameters

resource $resource

Return Value

ImageInterface

Exceptions

RuntimeException

See also

ImagineInterface::read

at line 172
FontInterface font(string $file, int $size, ColorInterface $color)

Constructs a font with specified $file, $size and $color.

The font size is to be specified in points (e.g. 10pt means 10)

Parameters

string $file
int $size
ColorInterface $color

Return Value

FontInterface

See also

ImagineInterface::font