Properties

$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 image types.

Type

array

Methods

__construct()

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

Constructor

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

Parameters

string $img
integer $w
integer $h

Returns

\Pop\Image\AbstractImage

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

__get()

__get(string  $name) : mixed

Magic get method to return a manipulation object

Parameters

string $name

Returns

mixed

create()

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

Create a new image resource

Parameters

integer $width
integer $height
string $image

Returns

\Pop\Image\AbstractImage

load()

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

Load an existing image as a resource

Parameters

string $image

Throws

\Pop\Image\Exception

Returns

\Pop\Image\AbstractImage

save()

save(string  $to = null) : void

Save the image object to disk.

Parameters

string $to

output()

output(boolean  $download = false) : void

Output the image object directly.

Parameters

boolean $download

destroy()

destroy(boolean  $delete = false) : void

Destroy the image object and the related image file directly.

Parameters

boolean $delete

setImage()

setImage(string  $img) : void

Set the image properties

Parameters

string $img

Throws

\Pop\Image\Exception