PHP Класс Bkwld\Croppa\Image

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

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

Метод Описание
__construct ( string $data, array $options = [] ) Constructor
applyFilters ( $options ) Apply filters that have been defined in the config as seperate classes.
autoRotate ( ) Auto rotate the image based on exif data (like from phones) https://github.com/nik-kor/PHPThumb/blob/master/src/thumb_plugins/jpg_rotate.inc.php
crop ( integer $width, integer $height ) Resize and crop
cropQuadrant ( integer $width, integer $height, array $options ) Do a quadrant adaptive resize. Supported quadrant values are: +---+---+---+ | | T | | +---+---+---+ | L | C | R | +---+---+---+ | | B | | +---+---+---+
get ( ) : string Get the image data
pad ( integer $width, integer $height, array $options ) Pad an image to desired dimensions. Moves the image into the center and fills the rest with given color.
process ( integer $width = null, integer $height = null, array $options = [] ) Take the input from the URL and apply transformations on the image
resize ( integer $width, integer $height ) Resize with no cropping
resizeAndOrCrop ( integer $width, integer $height, array $options ) Determine which resize and crop to apply
trim ( array $options ) Determine which trim to apply.
trimPerc ( array $coords ) Trim the source before applying the crop with offset percentages
trimPixels ( array $coords ) Trim the source before applying the crop with as offset pixels

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

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

Constructor
public __construct ( string $data, array $options = [] )
$data string Image data as a string
$options array PHPThumb options

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

Apply filters that have been defined in the config as seperate classes.
public applyFilters ( $options )

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

Auto rotate the image based on exif data (like from phones) https://github.com/nik-kor/PHPThumb/blob/master/src/thumb_plugins/jpg_rotate.inc.php
public autoRotate ( )

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

Resize and crop
public crop ( integer $width, integer $height )
$width integer
$height integer

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

Do a quadrant adaptive resize. Supported quadrant values are: +---+---+---+ | | T | | +---+---+---+ | L | C | R | +---+---+---+ | | B | | +---+---+---+
public cropQuadrant ( integer $width, integer $height, array $options )
$width integer
$height integer
$options array

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

Get the image data
public get ( ) : string
Результат string Image data

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

Pad an image to desired dimensions. Moves the image into the center and fills the rest with given color.
public pad ( integer $width, integer $height, array $options )
$width integer
$height integer
$options array

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

Take the input from the URL and apply transformations on the image
public process ( integer $width = null, integer $height = null, array $options = [] )
$width integer
$height integer
$options array

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

Resize with no cropping
public resize ( integer $width, integer $height )
$width integer
$height integer

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

Determine which resize and crop to apply
public resizeAndOrCrop ( integer $width, integer $height, array $options )
$width integer
$height integer
$options array

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

Determine which trim to apply.
public trim ( array $options )
$options array

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

Trim the source before applying the crop with offset percentages
public trimPerc ( array $coords )
$coords array Cropping instructions as percentages

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

Trim the source before applying the crop with as offset pixels
public trimPixels ( array $coords )
$coords array Cropping instructions as pixels