PHP Class EasyImage, yii-easyimage

Inheritance: extends CApplicationComponent
Afficher le fichier Open project: zhdanovartur/yii-easyimage Class Usage Examples

Méthodes publiques

Свойство 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.

Méthodes publiques

Méthode 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

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

Method Details

__construct() public méthode

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

__toString() public méthode

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

background() public méthode

public background ( $color, $opacity = 100 )

crop() public méthode

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

detectPath() public méthode

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

flip() public méthode

public flip ( $direction )

image() public méthode

This method returns the current Image instance.
public image ( ) : Image
Résultat Image

init() public méthode

public init ( )

reflection() public méthode

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

render() public méthode

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

resize() public méthode

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 méthode

public rotate ( $degrees )

save() public méthode

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

scaleAndCrop() public méthode

public scaleAndCrop ( $width, $height )

sharpen() public méthode

public sharpen ( $amount )

thumbOf() public méthode

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
Résultat string HTML

thumbSrcOf() public méthode

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
Résultat string URL path

watermark() public méthode

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