PHP Класс Thumbor\Url\CommandSet

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

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

Метод Описание
addFilter ( ) Append a filter, e.g. ->addFilter('brightness', 42)
crop ( $topLeftX, $topLeftY, $bottomRightX, $bottomRightY ) Manually specify crop window.
fitIn ( $width, $height ) Resize the image to fit in a box of the specified dimensions. Overrides any previous call to fullFitIn, fitIn or resize.
fullFitIn ( $width, $height ) Resize the image to fit by smallest side in a box of the specified dimensions.
halign ( string $halign ) Specify horizontal alignment used if width is altered due to cropping
metadataOnly ( boolean $metadataOnly ) Specify that JSON metadata should be returned instead of the thumbnailed image.
resize ( $width, $height ) Resize the image to the specified dimensions. Overrides any previous call to fullFitIn, fitIn or resize.
smartCrop ( boolean $smartCrop ) Specify that smart cropping should be used (overrides halign/valign).
toArray ( ) Stringify and return commands as an array.
trim ( $colourSource = null, $tolerance = null ) Trim surrounding space from the thumbnail. The top-left corner of the image is assumed to contain the background colour. To specify otherwise, pass either 'top-left' or 'bottom-right' as the $colourSource argument.
valign ( string $valign ) Specify vertical alignment used if height is altered due to cropping

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

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

Append a filter, e.g. ->addFilter('brightness', 42)
public addFilter ( )

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

Manually specify crop window.
public crop ( $topLeftX, $topLeftY, $bottomRightX, $bottomRightY )

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

Resize the image to fit in a box of the specified dimensions. Overrides any previous call to fullFitIn, fitIn or resize.
public fitIn ( $width, $height )

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

Overrides any previous call to fullFitIn, fitIn or resize.
public fullFitIn ( $width, $height )

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

Specify horizontal alignment used if width is altered due to cropping
public halign ( string $halign )
$halign string one of {'left', 'center', 'right'}

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

Specify that JSON metadata should be returned instead of the thumbnailed image.
public metadataOnly ( boolean $metadataOnly )
$metadataOnly boolean

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

Use a value of 0 for proportional resizing. E.g. for a 640 x 480 image, ->size(320, 0) yields a 320 x 240 thumbnail. Use a value of 'orig' to use an original image dimension. E.g. for a 640 x 480 image, ->resize(320, 'orig') yields a 320 x 480 thumbnail.
public resize ( $width, $height )

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

Specify that smart cropping should be used (overrides halign/valign).
public smartCrop ( boolean $smartCrop )
$smartCrop boolean

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

Stringify and return commands as an array.
public toArray ( )

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

For tolerance the euclidian distance between the colors of the reference pixel and the surrounding pixels is used. If the distance is within the tolerance they'll get trimmed. For a RGB image the tolerance would be within the range 0-442
public trim ( $colourSource = null, $tolerance = null )

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

Specify vertical alignment used if height is altered due to cropping
public valign ( string $valign )
$valign string one of {'top', 'middle', 'bottom'}