Methods
Constructor. Parameter $image should be:
1. An instance of image driver class (copy instance).
__construct(mixed $image,array $options = array())
inherited
- An image represented by the type of the $image property
(resource or object).
- An array with two elements. First - width, second - height.
Creates a blank image.
- A filename string. Get image form file.
Second paramaeter is used by pass some specific image driver options
Arguments
Magic method which allows read-only access to all protected or private
class properties
__get(string $property): mixed
inheritedfinal
Checks if PHP needs some extra extensions to use the image driver. This
static method should be implemented into driver classes like abstract
methods
available(): boolean
inheritedstatic
Returns an array. Element 0 - image resource. Element 1 - width. Element 2 - height.
buildImage(mixed $image): array
inheritedfinal
Returns FALSE on failure.
Arguments
Response
array
Checks if file is an image. This static method should be implemented into
driver classes like abstract methods
checkImage(string $file): boolean
inheritedstatic
Arguments
Response
boolean
Factory pattern to load selected driver. $image and $options are passed
to the constructor of the image driver
factory(string $driver,mixed $image,array $options = array()): object
inheritedstaticfinal
Arguments
Response
object
flipHorizontal
flipHorizontal()
inheritedabstract
flipVertical
flipVertical()
inheritedabstract
This method should create a blank image with selected size. Should returns
resource or object related to the created image, which will be passed to
$image property
getBlankImage(integer $width,integer $height): mixed
inheritedabstract
Checks if the drivers in the array parameter could be used. Returns first
found one
getDriver(array $drivers = array('gd')): string
inheritedstaticfinal
Arguments
Response
string
This method should create an image from source image. Only first parameter
($image) is input. Its type should be filename string or a type of the
$image property. See the constructor reference for details. The
parametters $width and $height are output only. Should returns resource or
object related to the created image, which will be passed to $image
property
getImage(mixed $image,integer &$width,integer &$height): mixed
inheritedabstract
Returns calculated proportional height from the given width
getPropHeight(integer $resizedWidth): integer
inheritedfinal
Arguments
Response
integer
Returns calculated proportional width from the given height
getPropWidth(integer $resizedHeight): integer
inheritedfinal
Arguments
Response
integer
imageCopyResampled
imageCopyResampled( $src, $dstX, $dstY, $srcX, $srcY, $dstW = null, $dstH = null, $srcW = null, $srcH = null)
imageFilledRectangle
imageFilledRectangle( $x1, $y1, $x2, $y2, $color)
Should output the image. Second parameter is used to pass some options like
'file' - if is set, the output will be written to a file
'quality' - compression quality
It's possible to use extra specific options required by image type ($type)
output(string $type = 'jpeg',array $options = array()): boolean
inheritedabstract
Arguments
Response
boolean
output_gif
output_gif(array $options = array())
output_jpeg
output_jpeg(array $options = array())
output_png
output_png(array $options = array())
Resize image. Should return TRUE on success or FALSE on failure
resize(integer $width,integer $height): boolean
inheritedabstract
Arguments
Response
boolean
Resize and crop the image to fit in given resolution. Returns TRUE on
success or FALSE on failure
resizeCrop( $width, $height,integer $offset = false): boolean
inheritedabstract
Arguments
Response
boolean
Resize image to fit in given resolution. Should returns TRUE on success
or FALSE on failure. If $background is set, the image size will be
$width x $height and the empty spaces (if any) will be filled with defined
color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255)
resizeFit(integer $width,integer $height,mixed $background = false): boolean
inheritedabstract
Arguments
Response
boolean
Rotate image
rotate(integer $angle,string $background = "#000000"): boolean
inheritedabstract
Arguments
Response
boolean
Apply a PNG or GIF watermark to the image. $top and $left parameters sets
the offset of the watermark in pixels. Boolean and NULL values are possible
too. In default case (FALSE, FALSE) the watermark should be applyed to
the bottom right corner. NULL values means center aligning. If the
watermark is bigger than the image or it's partialy or fully outside the
image, it shoudn't be applied
watermark(string $file,mixed $left = false,mixed $top = false): boolean
inheritedabstract
Arguments
Response
boolean
Constants
DEFAULT_JPEG_QUALITY
DEFAULT_JPEG_QUALITY
inherited
Properties
Image resource or object
image :mixed
inherited
Image width in pixels
width :integer
inherited
Image height in pixels
height :integer
inherited
Init error
initError :boolean
inherited
Driver specific options
options :array
inherited