Properties

$info

$info : \ArrayObject

Image extension info

Type

\ArrayObject

$quality

$quality : integer

Image quality

Type

integer

$resource

$resource : mixed

Image resource

Type

mixed

$fullpath

$fullpath : string

Full path of image file, i.e. '/path/to/image.ext'

Type

string

$dir

$dir : string

Full, absolute directory of the image file, i.e. '/some/dir/'

Type

string

$basename

$basename : string

Full basename of image file, i.e. 'image.ext'

Type

string

$filename

$filename : string

Full filename of image file, i.e. 'image'

Type

string

$extension

$extension : string

Image file extension, i.e. 'ext'

Type

string

$size

$size : integer

Image file size in bytes

Type

integer

$mime

$mime : string

Image file mime type

Type

string

$output

$output : mixed

Image file output buffer

Type

mixed

$width

$width : integer

Image width

Type

integer

$height

$height : integer

Image height

Type

integer

$allowed

$allowed : array

Array of allowed file types.

Type

array

$compression

$compression : integer

Image compression

Type

integer

$imageFilter

$imageFilter : integer

Image filter

Type

integer

$imageBlur

$imageBlur : float

Image blur

Type

float

Methods

getAvailableAdapters()

getAvailableAdapters() : array

Get the available image library adapters

Returns

array

isAvailable()

isAvailable(string  $adapter) : boolean

Get the available image library adapters

Parameters

string $adapter

Returns

boolean

getAllowedTypes()

getAllowedTypes() : array

Get the allowed image types

Returns

array

info()

info() : \ArrayObject

Get the image extension info

Returns

\ArrayObject

version()

version() : string

Get the image extension version

Returns

string

getQuality()

getQuality() : integer

Get the image quality.

Returns

integer

setBackgroundColor()

setBackgroundColor(integer  $r, integer  $g, integer  $b) : \Pop\Image\AbstractImage

Set the image adjust object

Parameters

integer $r
integer $g
integer $b

Returns

\Pop\Image\AbstractImage

__get()

__get(string  $name) : mixed

Magic get method to return a manipulation object

Parameters

string $name

Returns

mixed

setQuality()

setQuality(integer  $quality) : \Pop\Image\Gmagick

Set the image quality.

Parameters

integer $quality

Returns

\Pop\Image\Gmagick

resizeToWidth()

resizeToWidth(integer  $w) : \Pop\Image\Gmagick

Resize the image object to the width parameter passed.

Parameters

integer $w

Returns

\Pop\Image\Gmagick

resizeToHeight()

resizeToHeight(integer  $h) : \Pop\Image\Gmagick

Resize the image object to the height parameter passed.

Parameters

integer $h

Returns

\Pop\Image\Gmagick

resize()

resize(integer  $px) : \Pop\Image\Gmagick

Resize the image object, allowing for the largest dimension to be scaled to the value of the $px argument.

Parameters

integer $px

Returns

\Pop\Image\Gmagick

scale()

scale(float  $scale) : \Pop\Image\Gmagick

Scale the image object, allowing for the dimensions to be scaled proportionally to the value of the $scl argument.

Parameters

float $scale

Returns

\Pop\Image\Gmagick

crop()

crop(integer  $w, integer  $h, integer  $x, integer  $y) : \Pop\Image\Gmagick

Crop the image object to a image whose dimensions are based on the value of the $wid and $hgt argument. The optional $x and $y arguments allow for the adjustment of the crop to select a certain area of the image to be cropped.

Parameters

integer $w
integer $h
integer $x
integer $y

Returns

\Pop\Image\Gmagick

cropThumb()

cropThumb(integer  $px, integer  $offset = null) : \Pop\Image\Gmagick

Crop the image object to a square image whose dimensions are based on the value of the $px argument. The optional $offset argument allows for the adjustment of the crop to select a certain area of the image to be cropped.

Parameters

integer $px
integer $offset

Returns

\Pop\Image\Gmagick

rotate()

rotate(integer  $degrees, array  $bgColor = array(255, 255, 255)) : \Pop\Image\Gmagick

Rotate the image object

Parameters

integer $degrees
array $bgColor

Throws

\Pop\Image\Exception

Returns

\Pop\Image\Gmagick

flip()

flip() : \Pop\Image\Gmagick

Method to flip the image over the x-axis.

Returns

\Pop\Image\Gmagick

flop()

flop() : \Pop\Image\Gmagick

Method to flip the image over the y-axis.

Returns

\Pop\Image\Gmagick

convert()

convert(string  $type) : \Pop\Image\Gmagick

Convert the image object to another format.

Parameters

string $type

Throws

\Pop\Image\Exception

Returns

\Pop\Image\Gmagick

getColor()

getColor(array  $color, integer  $opacity = 100) : mixed

Create and return a color.

Parameters

array $color
integer $opacity

Throws

\Pop\Image\Exception

Returns

mixed

__construct()

__construct(string  $img = null, integer  $w = null, integer  $h = null) : \Pop\Image\Gmagick

Constructor

Instantiate an image file object based on either a pre-existing image file on disk, or a new image file using the Gmagick extension.

Parameters

string $img
integer $w
integer $h

Throws

\Pop\Image\Exception

Returns

\Pop\Image\Gmagick

resource()

resource() : resource

Get the image resource

Returns

resource

getFullpath()

getFullpath() : string

Get the image full path

Returns

string

getDir()

getDir() : string

Get the image directory

Returns

string

getBasename()

getBasename() : string

Get the image basename

Returns

string

getFilename()

getFilename() : string

Get the image filename

Returns

string

getExtension()

getExtension() : string

Get the image extension

Returns

string

getSize()

getSize() : integer

Get the image size

Returns

integer

getMime()

getMime() : string

Get the image mime type

Returns

string

getWidth()

getWidth() : integer

Get the image width.

Returns

integer

getHeight()

getHeight() : integer

Get the image height.

Returns

integer

create()

create(integer  $width, integer  $height, string  $image = null) : \Pop\Image\Gmagick

Create a new image resource

Parameters

integer $width
integer $height
string $image

Returns

\Pop\Image\Gmagick

load()

load(string  $image) : \Pop\Image\Gmagick

Load an existing image as a resource

Parameters

string $image

Throws

\Pop\Image\Exception

Returns

\Pop\Image\Gmagick

save()

save(string  $to = null) : void

Save the image object to disk.

Parameters

string $to

output()

output(boolean  $download = false, boolean  $sendHeaders = true) : void

Output the image object directly.

Parameters

boolean $download
boolean $sendHeaders

Throws

\Pop\Image\Exception

destroy()

destroy(boolean  $delete = false) : void

Destroy the image object and the related image file directly.

Parameters

boolean $delete

isInstalled()

isInstalled() : boolean

Check if Gmagick is installed.

Returns

boolean

getFormats()

getFormats() : array

Get the allowed image formats

Returns

array

getCompression()

getCompression() : integer

Get the image compression.

Returns

integer

getImageFilter()

getImageFilter() : integer

Get the image filter.

Returns

integer

getImageBlur()

getImageBlur() : float

Get the image blur.

Returns

float

setCompression()

setCompression(integer  $compression) : \Pop\Image\Gmagick

Set the image compression

Parameters

integer $compression

Returns

\Pop\Image\Gmagick

setImageFilter()

setImageFilter(integer  $filter) : \Pop\Image\Gmagick

Set the image filter.

Parameters

integer $filter

Returns

\Pop\Image\Gmagick

setImageBlur()

setImageBlur(float  $blur) : \Pop\Image\Gmagick

Set the image blur.

Parameters

float $blur

Returns

\Pop\Image\Gmagick

__toString()

__toString() : string

Output the image

Returns

string

setImage()

setImage(string  $img) : void

Set the image properties

Parameters

string $img

Throws

\Pop\Image\Exception

setFormats()

setFormats() : void

Set the image formats based on what's supported by Gmagick