PHP Класс EasyImage, yii-easyimage

Наследование: extends CApplicationComponent
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
__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 )

Приватные методы

Метод Описание
_doThumbOf ( string $file, string $newFile, array $params ) : boolean Performance of image manipulation and save result.

Описание методов

__construct() публичный Метод

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

__toString() публичный Метод

Must be rendered with the appropriate Content-Type header or it will not be displayed correctly.
public __toString ( ) : string
Результат string as binary

background() публичный Метод

public background ( $color, $opacity = 100 )

crop() публичный Метод

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

detectPath() публичный Метод

This method detects which (absolute or relative) path is used.
public detectPath ( array $file ) : string
$file array path
Результат string path

flip() публичный Метод

public flip ( $direction )

image() публичный Метод

This method returns the current Image instance.
public image ( ) : Image
Результат Image

init() публичный Метод

public init ( )

reflection() публичный Метод

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

render() публичный Метод

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

resize() публичный Метод

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 rotate ( $degrees )

save() публичный Метод

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

scaleAndCrop() публичный Метод

public scaleAndCrop ( $width, $height )

sharpen() публичный Метод

public sharpen ( $amount )

thumbOf() публичный Метод

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
Результат string HTML

thumbSrcOf() публичный Метод

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
Результат string URL path

watermark() публичный Метод

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

Описание свойств

$cachePath публичное свойство

relative path where the cache files are kept
public $cachePath

$cacheTime публичное свойство

cache lifetime in seconds
public $cacheTime

$driver публичное свойство

driver type: GD, Imagick
public $driver

$isProgressiveJpeg публичное свойство

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

$newDirMode публичное свойство

Permissions for main cache directory and subdirectories.
public $newDirMode

$newFileMode публичное свойство

Permissions for cached files.
public $newFileMode

$quality публичное свойство

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

$retinaSupport публичное свойство

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