PHP 클래스 Gc\Media\Image

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

보호된 프로퍼티들

프로퍼티 타입 설명
$availableOptions array Available options
$height integer Original image height
$image resource Original image
$imageResized resource Image resized
$width integer Original image width

공개 메소드들

메소드 설명
__construct ( string $filename = null ) Initialize object
hex2rgb ( string $hexString ) : resource Convert hexa string to rbg
open ( string $file ) : Image Open image
resize ( integer $newWidth, integer $newHeight, string $option = 'auto', string $backgroundColor = '#000000', integer $sourceX, integer $sourceY ) : Image Resize image
save ( string $savePath, integer $imageQuality = 90 ) : boolean Save image

보호된 메소드들

메소드 설명
crop ( integer $newWidth, integer $newHeight, integer $sourceX, integer $sourceY ) : Image Crop image
getSizeByFixedHeight ( integer $newHeight ) : double Get fixed height
getSizeByFixedWidth ( integer $newWidth ) : double Get fixed width

메소드 상세

__construct() 공개 메소드

Initialize object
public __construct ( string $filename = null )
$filename string filename

crop() 보호된 메소드

Crop image
protected crop ( integer $newWidth, integer $newHeight, integer $sourceX, integer $sourceY ) : Image
$newWidth integer New width
$newHeight integer New height
$sourceX integer Source x
$sourceY integer Source y
리턴 Image

getSizeByFixedHeight() 보호된 메소드

Get fixed height
protected getSizeByFixedHeight ( integer $newHeight ) : double
$newHeight integer New height
리턴 double

getSizeByFixedWidth() 보호된 메소드

Get fixed width
protected getSizeByFixedWidth ( integer $newWidth ) : double
$newWidth integer New width
리턴 double

hex2rgb() 공개 메소드

Convert hexa string to rbg
public hex2rgb ( string $hexString ) : resource
$hexString string Hexadecimal string
리턴 resource

open() 공개 메소드

Open image
public open ( string $file ) : Image
$file string File
리턴 Image

resize() 공개 메소드

Resize image
public resize ( integer $newWidth, integer $newHeight, string $option = 'auto', string $backgroundColor = '#000000', integer $sourceX, integer $sourceY ) : Image
$newWidth integer New width
$newHeight integer New height
$option string Option can be (auto|crop)
$backgroundColor string Background color
$sourceX integer Source x
$sourceY integer Source y
리턴 Image

save() 공개 메소드

Save image
public save ( string $savePath, integer $imageQuality = 90 ) : boolean
$savePath string Save path
$imageQuality integer Image quality default is 90
리턴 boolean

프로퍼티 상세

$availableOptions 보호되어 있는 프로퍼티

Available options
protected array $availableOptions
리턴 array

$height 보호되어 있는 프로퍼티

Original image height
protected int $height
리턴 integer

$image 보호되어 있는 프로퍼티

Original image
protected resource $image
리턴 resource

$imageResized 보호되어 있는 프로퍼티

Image resized
protected resource $imageResized
리턴 resource

$width 보호되어 있는 프로퍼티

Original image width
protected int $width
리턴 integer