Methods

getResource()

getResource() : resource

Get the image resource

Returns

resource

hasResource()

hasResource() : boolean

Determine if there is an image resource

Returns

boolean

getName()

getName() : string

Get the image name

Returns

string

getWidth()

getWidth() : integer

Get the image width

Returns

integer

getHeight()

getHeight() : integer

Get the image height

Returns

integer

getColorspace()

getColorspace() : integer

Get the colorspace

Returns

integer

isIndexed()

isIndexed() : boolean

Determine if the image is index color

Returns

boolean

getType()

getType() : string

Get the image type

Returns

string

getExif()

getExif() : array

Get the image EXIF data

Returns

array

isGray()

isGray() : boolean

Determine if the image is grayscale

Returns

boolean

isRgb()

isRgb() : boolean

Determine if the image is RGB

Returns

boolean

isCmyk()

isCmyk() : boolean

Determine if the image is CMYK

Returns

boolean

load()

load(string  $name = null) : \Pop\Image\Adapter\AdapterInterface

Load the image resource from the existing image file

Parameters

string $name

Returns

\Pop\Image\Adapter\AdapterInterface

loadFromString()

loadFromString(string  $data, string  $name = null) : \Pop\Image\Adapter\AdapterInterface

Load the image resource from data

Parameters

string $data
string $name

Returns

\Pop\Image\Adapter\AdapterInterface

create()

create(integer  $width = null, integer  $height = null, string  $name = null) : \Pop\Image\Adapter\AdapterInterface

Create a new image resource

Parameters

integer $width
integer $height
string $name

Returns

\Pop\Image\Adapter\AdapterInterface

createIndex()

createIndex(integer  $width = null, integer  $height = null, string  $name = null) : \Pop\Image\Adapter\AdapterInterface

Create a new indexed image resource

Parameters

integer $width
integer $height
string $name

Returns

\Pop\Image\Adapter\AdapterInterface

resizeToWidth()

resizeToWidth(integer  $w) : \Pop\Image\Adapter\AdapterInterface

Resize the image object to the width parameter passed

Parameters

integer $w

Returns

\Pop\Image\Adapter\AdapterInterface

resizeToHeight()

resizeToHeight(integer  $h) : \Pop\Image\Adapter\AdapterInterface

Resize the image object to the height parameter passed

Parameters

integer $h

Returns

\Pop\Image\Adapter\AdapterInterface

resize()

resize(integer  $px) : \Pop\Image\Adapter\AdapterInterface

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\Adapter\AdapterInterface

scale()

scale(float  $scale) : \Pop\Image\Adapter\AdapterInterface

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\Adapter\AdapterInterface

crop()

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

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\Adapter\AdapterInterface

cropThumb()

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

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\Adapter\AdapterInterface

rotate()

rotate(integer  $degrees, \Pop\Image\Color\ColorInterface  $bgColor = null) : \Pop\Image\Adapter\Gd

Rotate the image object

Parameters

integer $degrees
\Pop\Image\Color\ColorInterface $bgColor

Throws

\Pop\Image\Adapter\Exception

Returns

\Pop\Image\Adapter\Gd

convert()

convert(string  $type) : \Pop\Image\Adapter\AdapterInterface

Convert the image object to another format

Parameters

string $type

Throws

\Pop\Image\Adapter\Exception

Returns

\Pop\Image\Adapter\AdapterInterface

writeToFile()

writeToFile(string  $to = null, integer  $quality = 100) : void

Write the image object to a file on disk

Parameters

string $to
integer $quality

Throws

\Pop\Image\Adapter\Exception

outputToHttp()

outputToHttp(integer  $quality = 100, string  $to = null, boolean  $download = false, boolean  $sendHeaders = true) : void

Output the image object directly to HTTP

Parameters

integer $quality
string $to
boolean $download
boolean $sendHeaders

Throws

\Pop\Image\Adapter\Exception

destroy()

destroy(boolean  $delete = false) : void

Destroy the image object and the related image file directly

Parameters

boolean $delete

createColor()

createColor(\Pop\Image\Color\ColorInterface  $color = null, integer  $alpha = 100) : mixed

Create and return a color.

Parameters

\Pop\Image\Color\ColorInterface $color
integer $alpha

Throws

\Pop\Image\Adapter\Exception

Returns

mixed

sendHeaders()

sendHeaders(string  $to = null, boolean  $download = false) : void

Send image headers the image

Parameters

string $to
boolean $download

__toString()

__toString() : string

Output the image

Returns

string