PHP 클래스 Thumbor\Url\CommandSet

파일 보기 프로젝트 열기: 99designs/phumbor 1 사용 예제들

공개 메소드들

메소드 설명
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'}