PHP Class Image_GD, yii-easyimage

Author: Kohana Team
Inheritance: extends Image
Afficher le fichier Open project: zhdanovartur/yii-easyimage Class Usage Examples

Protected Properties

Свойство Type Description
$_create_function Function name to open Image
$_image Temporary image resource
$_isProgressiveJpeg

Méthodes publiques

Méthode Description
__construct ( string $file, boolean $useProgressiveJpeg = false ) : void Runs [Image_GD::check] and loads the image.
__destruct ( ) : void Destroys the loaded image to free up resources.
check ( ) : boolean Checks if GD is enabled and bundled. Bundled GD is required for some methods to work. Exceptions will be thrown from those methods when GD is not bundled.

Méthodes protégées

Méthode Description
_create ( integer $width, integer $height ) : resource Create an empty image with the given width and height.
_do_background ( integer $r, integer $g, integer $b, integer $opacity ) : void Execute a background.
_do_crop ( integer $width, integer $height, integer $offset_x, integer $offset_y ) : void Execute a crop.
_do_flip ( integer $direction ) : void Execute a flip.
_do_reflection ( integer $height, integer $opacity, boolean $fade_in ) : void Execute a reflection.
_do_render ( string $type, integer $quality ) : string Execute a render.
_do_resize ( integer $width, integer $height ) : void Execute a resize.
_do_rotate ( integer $degrees ) : void Execute a rotation.
_do_save ( string $file, integer $quality ) : boolean Execute a save.
_do_sharpen ( integer $amount ) : void Execute a sharpen.
_do_watermark ( $watermark, integer $offset_x, integer $offset_y, integer $opacity ) : void Execute a watermarking.
_load_image ( ) : void Loads an image into GD.
_save_function ( string $extension, integer &$quality ) : array Get the GD saving function and image type for this extension.
_set_interlacing ( resource $image ) Sets an interlace mode.

Method Details

__construct() public méthode

Runs [Image_GD::check] and loads the image.
public __construct ( string $file, boolean $useProgressiveJpeg = false ) : void
$file string image file path
$useProgressiveJpeg boolean use progressive JPEG format
Résultat void

__destruct() public méthode

Destroys the loaded image to free up resources.
public __destruct ( ) : void
Résultat void

_create() protected méthode

Create an empty image with the given width and height.
protected _create ( integer $width, integer $height ) : resource
$width integer image width
$height integer image height
Résultat resource

_do_background() protected méthode

Execute a background.
protected _do_background ( integer $r, integer $g, integer $b, integer $opacity ) : void
$r integer red
$g integer green
$b integer blue
$opacity integer opacity
Résultat void

_do_crop() protected méthode

Execute a crop.
protected _do_crop ( integer $width, integer $height, integer $offset_x, integer $offset_y ) : void
$width integer new width
$height integer new height
$offset_x integer offset from the left
$offset_y integer offset from the top
Résultat void

_do_flip() protected méthode

Execute a flip.
protected _do_flip ( integer $direction ) : void
$direction integer direction to flip
Résultat void

_do_reflection() protected méthode

Execute a reflection.
protected _do_reflection ( integer $height, integer $opacity, boolean $fade_in ) : void
$height integer reflection height
$opacity integer reflection opacity
$fade_in boolean TRUE to fade out, FALSE to fade in
Résultat void

_do_render() protected méthode

Execute a render.
protected _do_render ( string $type, integer $quality ) : string
$type string image type: png, jpg, gif, etc
$quality integer quality
Résultat string

_do_resize() protected méthode

Execute a resize.
protected _do_resize ( integer $width, integer $height ) : void
$width integer new width
$height integer new height
Résultat void

_do_rotate() protected méthode

Execute a rotation.
protected _do_rotate ( integer $degrees ) : void
$degrees integer degrees to rotate
Résultat void

_do_save() protected méthode

Execute a save.
protected _do_save ( string $file, integer $quality ) : boolean
$file string new image filename
$quality integer quality
Résultat boolean

_do_sharpen() protected méthode

Execute a sharpen.
protected _do_sharpen ( integer $amount ) : void
$amount integer amount to sharpen
Résultat void

_do_watermark() protected méthode

Execute a watermarking.
protected _do_watermark ( $watermark, integer $offset_x, integer $offset_y, integer $opacity ) : void
$offset_x integer offset from the left
$offset_y integer offset from the top
$opacity integer opacity of watermark
Résultat void

_load_image() protected méthode

Loads an image into GD.
protected _load_image ( ) : void
Résultat void

_save_function() protected méthode

Also normalizes the quality setting
protected _save_function ( string $extension, integer &$quality ) : array
$extension string image type: png, jpg, etc
$quality integer image quality
Résultat array save function, IMAGETYPE_* constant

_set_interlacing() protected méthode

Sets an interlace mode.
protected _set_interlacing ( resource $image )
$image resource Image to apply interlacing. This is useful for creating progressive jpeg images.

check() public static méthode

Checks if GD is enabled and bundled. Bundled GD is required for some methods to work. Exceptions will be thrown from those methods when GD is not bundled.
public static check ( ) : boolean
Résultat boolean

Property Details

$_create_function protected_oe property

Function name to open Image
protected $_create_function

$_image protected_oe property

Temporary image resource
protected $_image

$_isProgressiveJpeg protected_oe property

protected $_isProgressiveJpeg