PHP Class Instafilter\Image

This image class allows for the basic manipulation of images and the addition of any number of instagram-style filters Based on the FuelPHP 1.x Image class http://fuelphp.com
Show file Open project: fbf/instafilter

Public Properties

Property Type Description
$image
$image_temp

Protected Properties

Property Type Description
$accepted_extensions
$configuration
$im_path
$imagick
$queued_actions

Public Methods

Method Description
__construct ( array $configuration = [] )
__destruct ( )
_apply_filter ( $filter )
apply_filter ( $filter )
exec ( string $program, string $params, boolean $passthru = false ) : mixed Executes the specified imagemagick executable and returns the output.
image ( )
imagick ( $set = null )
load ( $filename, $configuration = [] )
resize ( $width, $height = null, $keepar = true, $pad = false )
run_queue ( boolean $clear = null ) Runs all queued actions on the loaded image.
save ( $output )
sizes ( )

Protected Methods

Method Description
_queue ( string $function ) Queues a function to run at a later time.
_resize ( $width, $height = null, $keepar = true, $pad = true )
check_extension ( string $filename, boolean $writevar = true ) : boolean Checks if the extension is accepted by this library, and if its valid sets the $this->image_extension variable.
convert_number ( string $input, boolean $x = null ) : integer Converts percentages, negatives, and other values to absolute integers.
debug ( ) Used for debugging image output.

Method Details

__construct() public method

public __construct ( array $configuration = [] )
$configuration array

__destruct() public method

public __destruct ( )

_apply_filter() public method

public _apply_filter ( $filter )

_queue() protected method

Queues a function to run at a later time.
protected _queue ( string $function )
$function string The name of the function to be ran, without the leading _

_resize() protected method

protected _resize ( $width, $height = null, $keepar = true, $pad = true )

apply_filter() public method

public apply_filter ( $filter )

check_extension() protected method

Checks if the extension is accepted by this library, and if its valid sets the $this->image_extension variable.
protected check_extension ( string $filename, boolean $writevar = true ) : boolean
$filename string
$writevar boolean Decides if the extension should be written to $this->image_extension
return boolean

convert_number() protected method

Converts percentages, negatives, and other values to absolute integers.
protected convert_number ( string $input, boolean $x = null ) : integer
$input string
$x boolean Determines if the number relates to the x-axis or y-axis.
return integer The converted number, usable with the image being edited.

debug() protected method

Used for debugging image output.
protected debug ( )

exec() public method

Executes the specified imagemagick executable and returns the output.
public exec ( string $program, string $params, boolean $passthru = false ) : mixed
$program string The name of the executable.
$params string The parameters of the executable.
$passthru boolean Returns the output if false or pass it to browser.
return mixed Either returns the output or returns nothing.

image() public method

public image ( )

imagick() public method

public imagick ( $set = null )

load() public static method

public static load ( $filename, $configuration = [] )

resize() public method

public resize ( $width, $height = null, $keepar = true, $pad = false )

run_queue() public method

Runs all queued actions on the loaded image.
public run_queue ( boolean $clear = null )
$clear boolean Decides if the queue should be cleared once completed.

save() public method

public save ( $output )

sizes() public method

public sizes ( )

Property Details

$accepted_extensions protected property

protected $accepted_extensions

$configuration protected property

protected $configuration

$im_path protected property

protected $im_path

$image public property

public $image

$image_temp public property

public $image_temp

$imagick protected property

protected $imagick

$queued_actions protected property

protected $queued_actions