Methods

Initialize by loading config

_init() : void

Adds a border to the image.

border(integer $size, string $color) : \Fuel\Core\Image_Driver

Parameters

$size

integer

The side of the border, in pixels.

$color

string

A hexadecimal color.

Returns

Used to set configuration options.

config(array $index, mixed $value) : \Fuel\Core\Image_Driver

Sending the config options through the static reference initializes the instance. If you need to send a driver config through the static reference, make sure its the first one sent! If errors arise, create a new instance using forge().

Parameters

$index

array

An array of configuration settings.

$value

mixed

Returns

Crops the image using coordinates or percentages.

crop(integer $x1, integer $y1, integer $x2, integer $y2) : \Fuel\Core\Image_Driver

Absolute integer or percentages accepted for all 4.

Parameters

$x1

integer

X-Coordinate based from the top-left corner.

$y1

integer

Y-Coordinate based from the top-left corner.

$x2

integer

X-Coordinate based from the bottom-right corner.

$y2

integer

Y-Coordinate based from the bottom-right corner.

Returns

Resize the image.

crop_resize(integer $width, integer $height) : \Fuel\Core\Image_Driver

If the width or height is null, it will resize retaining the original aspect ratio.

Parameters

$width

integer

The new width of the image.

$height

integer

The new height of the image.

Returns

Creates a vertical / horizontal or both mirror image.

flip(string $direction) : \Fuel\Core\Image_Driver

Parameters

$direction

string

'vertical', 'horizontal', 'both'

Returns

Creates a new instance of the image driver

forge(array $config, string $filename) : \Fuel\Core\Image_Driver

Parameters

$config

array

$filename

string

The file to load

Exceptions

\FuelException

Returns

Turns the image into a grayscale version

grayscale() : \Fuel\Core\Image_Driver

Loads the image and checks if its compatible.

load(string $filename, string $return_data, mixed $force_extension) : \Fuel\Core\Image_Driver

Parameters

$filename

string

The file to load

$return_data

string

Decides if it should return the images data, or just "$this".

$force_extension

mixed

Whether or not to force the image extension

Returns

Masks the image using the alpha channel of the image input.

mask(string $maskimage) : \Fuel\Core\Image_Driver

Parameters

$maskimage

string

The location of the image to use as the mask

Returns

Outputs the file directly to the user.

output(string $filetype) : \Fuel\Core\Image_Driver

Parameters

$filetype

string

The extension type to use. Ex: png, jpg, bmp, gif

Returns

Reloads the image.

reload() : \Fuel\Core\Image_Driver

Resize the image.

resize(integer $width, integer $height, boolean $keepar, boolean $pad) : \Fuel\Core\Image_Driver

If the width or height is null, it will resize retaining the original aspect ratio.

Parameters

$width

integer

The new width of the image.

$height

integer

The new height of the image.

$keepar

boolean

Defaults to true. If false, allows resizing without keeping AR.

$pad

boolean

If set to true and $keepar is true, it will pad the image with the configured bgcolor

Returns

Rotates the image

rotate(integer $degrees) : \Fuel\Core\Image_Driver

Parameters

$degrees

integer

The degrees to rotate, negatives integers allowed.

Returns

Adds rounded corners to the image.

rounded(integer $radius, integer $sides, integer $antialias) : \Fuel\Core\Image_Driver

Parameters

$radius

integer

$sides

integer

Accepts any combination of "tl tr bl br" separated by spaces, or null for all sides

$antialias

integer

Sets the anti-alias range.

Returns

Saves the image, and optionally attempts to set permissions

save(string $filename, string $permissions) : \Fuel\Core\Image_Driver

Parameters

$filename

string

The location where to save the image.

$permissions

string

Allows unix style permissions

Returns

Saves the image, and optionally attempts to set permissions

save_pa(string $prepend, string $append, string $permissions) : \Fuel\Core\Image_Driver

Parameters

$prepend

string

The text to add to the beginning of the filename.

$append

string

The text to add to the end of the filename.

$permissions

string

Allows unix style permissions

Returns

Returns sizes for the currently loaded image, or the image given in the $filename.

sizes(string $filename) : object

Parameters

$filename

string

The location of the file to get sizes for.

Returns

objectAn object containing width and height variables.

Adds a watermark to the image.

watermark(string $filename, string $position, integer | array $padding) : \Fuel\Core\Image_Driver

Parameters

$filename

string

The filename of the watermark file to use.

$position

string

The position of the watermark, ex: "bottom right", "center center", "top left"

$padding

integerarray

The spacing between the edge of the image, or an array with seperate horizontal and vertical padding

Returns

Creates a new instance for static use of the class.

instance() : \Fuel\Core\Image_Driver

 Properties

 

Holds the config until an instance is initiated.

$_config : array

 

$_instance

$_instance