PHP 클래스 Eventviva\ImageResize

파일 보기 프로젝트 열기: eventviva/php-image-resize 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$interlace
$quality_jpg
$quality_png
$source_type

보호된 프로퍼티들

프로퍼티 타입 설명
$dest_h
$dest_w
$dest_x
$dest_y
$original_h
$original_w
$source_h
$source_image
$source_w
$source_x
$source_y

공개 메소드들

메소드 설명
__construct ( string $filename ) : ImageResize Loads image source and its properties to the instanciated object
__toString ( ) : string Convert the image to string with the current settings
createFromString ( string $image_data ) : ImageResize Create instance from a strng
crop ( integer $width, integer $height, boolean $allow_enlarge = false, integer $position = self::CROPCENTER ) : static Crops image according to the given width, height and crop position
freecrop ( integer $width, integer $height, integer $x = false, integer $y = false ) : static Crops image according to the given width, height, x and y
getDestHeight ( ) : integer Gets height of the destination image
getDestWidth ( ) : integer Gets width of the destination image
getImageAsString ( integer $image_type = null, integer $quality = null ) : string Convert the image to string
getSourceHeight ( ) : integer Gets source height
getSourceWidth ( ) : integer Gets source width
imageCreateJpegfromExif ( $filename ) http://stackoverflow.com/a/28819866
output ( string $image_type = null, integer $quality = null ) Outputs image to browser
resize ( integer $width, integer $height, boolean $allow_enlarge = false ) : static Resizes image according to the given width and height
resizeToBestFit ( integer $max_width, integer $max_height, boolean $allow_enlarge = false ) : static Resizes image to best fit inside the given dimensions
resizeToHeight ( integer $height, boolean $allow_enlarge = false ) : static Resizes image according to the given height (width proportional)
resizeToWidth ( integer $width, boolean $allow_enlarge = false ) : static Resizes image according to the given width (height proportional)
save ( string $filename, string $image_type = null, integer $quality = null, integer $permissions = null ) : static Saves new image
scale ( integer | float $scale ) : static Resizes image according to given scale (proportionally)

보호된 메소드들

메소드 설명
getCropPosition ( integer $expectedSize, integer $position = self::CROPCENTER ) : integer Gets crop position (X or Y) according to the given position

메소드 상세

__construct() 공개 메소드

Loads image source and its properties to the instanciated object
public __construct ( string $filename ) : ImageResize
$filename string
리턴 ImageResize

__toString() 공개 메소드

Convert the image to string with the current settings
public __toString ( ) : string
리턴 string

createFromString() 공개 정적인 메소드

Create instance from a strng
public static createFromString ( string $image_data ) : ImageResize
$image_data string
리턴 ImageResize

crop() 공개 메소드

Crops image according to the given width, height and crop position
public crop ( integer $width, integer $height, boolean $allow_enlarge = false, integer $position = self::CROPCENTER ) : static
$width integer
$height integer
$allow_enlarge boolean
$position integer
리턴 static

freecrop() 공개 메소드

Crops image according to the given width, height, x and y
public freecrop ( integer $width, integer $height, integer $x = false, integer $y = false ) : static
$width integer
$height integer
$x integer
$y integer
리턴 static

getCropPosition() 보호된 메소드

Gets crop position (X or Y) according to the given position
protected getCropPosition ( integer $expectedSize, integer $position = self::CROPCENTER ) : integer
$expectedSize integer
$position integer
리턴 integer

getDestHeight() 공개 메소드

Gets height of the destination image
public getDestHeight ( ) : integer
리턴 integer

getDestWidth() 공개 메소드

Gets width of the destination image
public getDestWidth ( ) : integer
리턴 integer

getImageAsString() 공개 메소드

Convert the image to string
public getImageAsString ( integer $image_type = null, integer $quality = null ) : string
$image_type integer
$quality integer
리턴 string

getSourceHeight() 공개 메소드

Gets source height
public getSourceHeight ( ) : integer
리턴 integer

getSourceWidth() 공개 메소드

Gets source width
public getSourceWidth ( ) : integer
리턴 integer

imageCreateJpegfromExif() 공개 메소드

http://stackoverflow.com/a/28819866
public imageCreateJpegfromExif ( $filename )

output() 공개 메소드

Outputs image to browser
public output ( string $image_type = null, integer $quality = null )
$image_type string
$quality integer

resize() 공개 메소드

Resizes image according to the given width and height
public resize ( integer $width, integer $height, boolean $allow_enlarge = false ) : static
$width integer
$height integer
$allow_enlarge boolean
리턴 static

resizeToBestFit() 공개 메소드

Resizes image to best fit inside the given dimensions
public resizeToBestFit ( integer $max_width, integer $max_height, boolean $allow_enlarge = false ) : static
$max_width integer
$max_height integer
$allow_enlarge boolean
리턴 static

resizeToHeight() 공개 메소드

Resizes image according to the given height (width proportional)
public resizeToHeight ( integer $height, boolean $allow_enlarge = false ) : static
$height integer
$allow_enlarge boolean
리턴 static

resizeToWidth() 공개 메소드

Resizes image according to the given width (height proportional)
public resizeToWidth ( integer $width, boolean $allow_enlarge = false ) : static
$width integer
$allow_enlarge boolean
리턴 static

save() 공개 메소드

Saves new image
public save ( string $filename, string $image_type = null, integer $quality = null, integer $permissions = null ) : static
$filename string
$image_type string
$quality integer
$permissions integer
리턴 static

scale() 공개 메소드

Resizes image according to given scale (proportionally)
public scale ( integer | float $scale ) : static
$scale integer | float
리턴 static

프로퍼티 상세

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

protected $dest_h

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

protected $dest_w

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

protected $dest_x

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

protected $dest_y

$interlace 공개적으로 프로퍼티

public $interlace

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

protected $original_h

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

protected $original_w

$quality_jpg 공개적으로 프로퍼티

public $quality_jpg

$quality_png 공개적으로 프로퍼티

public $quality_png

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

protected $source_h

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

protected $source_image

$source_type 공개적으로 프로퍼티

public $source_type

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

protected $source_w

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

protected $source_x

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

protected $source_y