PHP Class EasyImage, yii-easyimage

Inheritance: extends CApplicationComponent
Datei anzeigen Open project: zhdanovartur/yii-easyimage Class Usage Examples

Public Properties

Property Type Description
$cachePath relative path where the cache files are kept
$cacheTime cache lifetime in seconds
$driver driver type: GD, Imagick
$isProgressiveJpeg use progressive jpeg instread of baseline. This is used in GD only.
$newDirMode Permissions for main cache directory and subdirectories.
$newFileMode Permissions for cached files.
$quality value of quality: 0-100 (only for JPEG)
$retinaSupport use retina-resolutions This setting increases the load on the server.

Public Methods

Method Description
__construct ( string $file = null, string $driver = null, boolean $useProgressiveJpeg = false ) Constructor.
__toString ( ) : string Convert object to binary data of current image.
background ( $color, $opacity = 100 )
crop ( $width, $height, $offset_x = null, $offset_y = null )
detectPath ( array $file ) : string This method detects which (absolute or relative) path is used.
flip ( $direction )
image ( ) : Image This method returns the current Image instance.
init ( )
reflection ( $height = null, $opacity = 100, $fade_in = false )
render ( $type = null, $quality = 100 )
resize ( $width = null, $height = null, $master = null ) Description of the methods for the AutoComplete feature in a IDE because it uses a design pattern "factory".
rotate ( $degrees )
save ( $file = null, $quality = 100 )
scaleAndCrop ( $width, $height )
sharpen ( $amount )
thumbOf ( string $file, array $params = [], array $htmlOptions = [], mixed $hash = null ) : string This method returns prepared HTML code for cached thumbnail.
thumbSrcOf ( string $file, array $params = [], mixed $hash = null ) : string This method returns the URL to the cached thumbnail.
watermark ( $watermark, $offset_x = null, $offset_y = null, $opacity = 100 )

Private Methods

Method Description
_doThumbOf ( string $file, string $newFile, array $params ) : boolean Performance of image manipulation and save result.

Method Details

__construct() public method

Constructor.
public __construct ( string $file = null, string $driver = null, boolean $useProgressiveJpeg = false )
$file string
$driver string
$useProgressiveJpeg boolean

__toString() public method

Must be rendered with the appropriate Content-Type header or it will not be displayed correctly.
public __toString ( ) : string
return string as binary

background() public method

public background ( $color, $opacity = 100 )

crop() public method

public crop ( $width, $height, $offset_x = null, $offset_y = null )

detectPath() public method

This method detects which (absolute or relative) path is used.
public detectPath ( array $file ) : string
$file array path
return string path

flip() public method

public flip ( $direction )

image() public method

This method returns the current Image instance.
public image ( ) : Image
return Image

init() public method

public init ( )

reflection() public method

public reflection ( $height = null, $opacity = 100, $fade_in = false )

render() public method

public render ( $type = null, $quality = 100 )

resize() public method

Description of the methods for the AutoComplete feature in a IDE because it uses a design pattern "factory".
public resize ( $width = null, $height = null, $master = null )

rotate() public method

public rotate ( $degrees )

save() public method

public save ( $file = null, $quality = 100 )

scaleAndCrop() public method

public scaleAndCrop ( $width, $height )

sharpen() public method

public sharpen ( $amount )

thumbOf() public method

Use standard yii-component CHtml::image().
public thumbOf ( string $file, array $params = [], array $htmlOptions = [], mixed $hash = null ) : string
$file string path
$params array
$htmlOptions array
$hash mixed cache version modifier
return string HTML

thumbSrcOf() public method

This method returns the URL to the cached thumbnail.
public thumbSrcOf ( string $file, array $params = [], mixed $hash = null ) : string
$file string path
$params array
$hash mixed cache version modifier
return string URL path

watermark() public method

public watermark ( $watermark, $offset_x = null, $offset_y = null, $opacity = 100 )

Property Details

$cachePath public_oe property

relative path where the cache files are kept
public $cachePath

$cacheTime public_oe property

cache lifetime in seconds
public $cacheTime

$driver public_oe property

driver type: GD, Imagick
public $driver

$isProgressiveJpeg public_oe property

use progressive jpeg instread of baseline. This is used in GD only.
public $isProgressiveJpeg

$newDirMode public_oe property

Permissions for main cache directory and subdirectories.
public $newDirMode

$newFileMode public_oe property

Permissions for cached files.
public $newFileMode

$quality public_oe property

value of quality: 0-100 (only for JPEG)
public $quality

$retinaSupport public_oe property

use retina-resolutions This setting increases the load on the server.
public $retinaSupport