SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class Image

Manipulate images using standard methods such as resize, crop, rotate, etc.
This class must be re-initialized for every image you wish to manipulate.

Variables

NameVisibilityDescription
$actions 
$allowed_types (static) 
$driver 
$image 

Functions

NameVisibilityDescription
__constructpublicCreates a new image editor instance.
__getpublicHandles retrieval of pre-save image properties
addTextpublicAdds text to the base of an image, e.g. for copyright credit
base64public (static)Generate a base64-encoded PNG image, e.g. for an <img src="data:image/png;base64,..."> tag
calcResizeDimspublicCalculates dimensions to be generated by a resize
croppublicCrop an image to a specific width and height. You may also set the top
factorypublic (static)Creates a new Image instance and returns it.
flippublicFlip an image horizontally or vertically.
qualitypublicChange the quality of an image.
renderpublicOutput the image to the browser.
resizepublicResize an image to a specific width and height. By default, Kohana will
rotatepublicAllows rotation of an image by 180 degrees clockwise or counter clockwise.
savepublicSave the image to a new image or overwrite this image.
sharpenpublicSharpen an image.
validSizeprotectedSanitize a given value type.

public __construct

void $Image->__construct ( string $image [, array $config ] );

Creates a new image editor instance.

public __get

mixed $Image->__get ( string $property );

Handles retrieval of pre-save image properties

public addText

Image $Image->addText ( string $text );

Adds text to the base of an image, e.g. for copyright credit

public base64

unknown Image::base64 ( Path $file_path [, ImageTransform $transform ] );

Generate a base64-encoded PNG image, e.g. for an <img src="data:image/png;base64,..."> tag

public calcResizeDims

array $Image->calcResizeDims ( int $width , int $height , int $master );

Calculates dimensions to be generated by a resize

public crop

object $Image->crop ( integer $width , integer $height [, integer $top [, integer $left ]] );

Crop an image to a specific width and height. You may also set the top
and left offset.
This method is chainable.

public factory

object Image::factory ( string $image [, array $config ] );

Creates a new Image instance and returns it.

public flip

object $Image->flip ( integer $direction );

Flip an image horizontally or vertically.

public quality

object $Image->quality ( integer $amount );

Change the quality of an image.

public render

object $Image->render ( [ boolean $keep_actions ] );

Output the image to the browser.

public resize

object $Image->resize ( integer $width , integer $height [, integer $master ] );

Resize an image to a specific width and height. By default, Kohana will
maintain the aspect ratio using the width as the master dimension. If you
wish to use height as master dim, set $image->master_dim = Image::HEIGHT
This method is chainable.

public rotate

object $Image->rotate ( integer $degrees );

Allows rotation of an image by 180 degrees clockwise or counter clockwise.

public save

object $Image->save ( [ string $new_image [, integer $chmod [, boolean $keep_actions ]]] );

Save the image to a new image or overwrite this image.

public sharpen

object $Image->sharpen ( integer $amount );

Sharpen an image.

protected validSize

boolean $Image->validSize ( string $type , mixed &$value );

Sanitize a given value type.