PHP 클래스 Gregwar\Image\Image

저자: Gregwar ([email protected])
파일 보기 프로젝트 열기: Gregwar/Image 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$types Supported types.

보호된 프로퍼티들

프로퍼티 타입 설명
$adapter Gregwar\Image\Adapter\AdapterInterface Internal adapter.
$cache Gregwar\Cache\CacheInterface Cache system.
$cacheDir Directory to use for file caching.
$cacheMode Directory cache mode.
$fallback Fallback image.
$forceCache Force image caching, even if there is no operation applied.
$hash Transformations hash.
$operations Operations array.
$prettyName Pretty name for the image.
$prettyPrefix
$source The image source.
$useFallbackImage Use fallback image.

공개 메소드들

메소드 설명
__call ( $methodName, $args ) Generic function.
__construct ( $originalFile = null, $width = null, $height = null )
__toString ( ) Tostring defaults to jpeg.
applyOperations ( ) Applies the operations.
cacheData ( string $type = 'jpg', integer $quality = 80 ) Get cache data (to render the image).
cacheFile ( string $type = 'jpg', integer $quality = 80, $actual = false ) Gets the cache file name and generate it if it does not exists.
correct ( ) Tells if the image is correct.
create ( $width, $height ) Creates an instance of a new resource.
fromData ( $data ) Creates an instance of image from its data.
fromFile ( string $originalFile ) Defines the file only after instantiation.
fromResource ( $resource ) Creates an instance of image from resource.
generateHash ( $type = 'guess', $quality = 80 ) Generates the hash.
get ( $type = 'guess', $quality = 80 ) Get the contents of the image.
getAdapter ( ) : Gregwar\Image\Adapter\AdapterInterface
getCacheFallback ( ) Gets the fallback into the cache dir.
getCacheSystem ( ) : Gregwar\Cache\CacheInterface Get the cache system.
getDependencies ( ) : string[] Get all the files that this image depends on.
getFallback ( ) Gets the fallack image path.
getFilePath ( ) : mixed Get the file path.
getHash ( $type = 'guess', $quality = 80 ) Gets the hash.
gif ( ) Generates and output a gif cached file.
guess ( $quality = 80 ) Generates and output an image using the same type as input.
guessType ( ) Guess the file type.
height ( ) Image height.
html ( $title = '', $type = 'jpg', $quality = 80 ) Returning basic html code for this image.
init ( ) Initialize the adapter.
inline ( $type = 'jpg', $quality = 80 ) Returns the Base64 inlinable representation.
jpeg ( $quality = 80 ) Generates and output a jpeg cached file.
open ( $file = '' ) Creates an instance, usefull for one-line chaining.
png ( ) Generates and output a png cached file.
save ( $file, $type = 'guess', $quality = 80 ) Save the file to a given output.
serializeOperations ( ) Serialization of operations.
setActualCacheDir ( $actualCacheDir ) The actual cache dir.
setAdapter ( $adapter )
setCacheDir ( $cacheDir ) Change the caching directory.
setCacheDirMode ( integer $dirMode )
setCacheSystem ( Gregwar\Cache\CacheInterface $cache ) Set the cache system.
setData ( $data ) Sets the image data.
setFallback ( $fallback = null ) Sets the fallback image to use.
setForceCache ( $forceCache = true ) Enable or disable to force cache even if the file is unchanged.
setPrettyName ( $name, $prefix = true ) Sets the pretty name of the image.
setResource ( $resource ) Sets the resource.
useFallback ( $useFallbackImage = true ) Use the fallback image or not.
width ( ) Image width.

보호된 메소드들

메소드 설명
addOperation ( $method, $args ) Adds an operation.
getFilename ( $filename ) Hook to helps to extends and enhance this class.
urlize ( $name ) Urlizes the prettyName.

메소드 상세

__call() 공개 메소드

Generic function.
public __call ( $methodName, $args )

__construct() 공개 메소드

public __construct ( $originalFile = null, $width = null, $height = null )

__toString() 공개 메소드

Tostring defaults to jpeg.
public __toString ( )

addOperation() 보호된 메소드

Adds an operation.
protected addOperation ( $method, $args )

applyOperations() 공개 메소드

Applies the operations.
public applyOperations ( )

cacheData() 공개 메소드

Get cache data (to render the image).
public cacheData ( string $type = 'jpg', integer $quality = 80 )
$type string the image type
$quality integer the quality (for JPEG)

cacheFile() 공개 메소드

Note that if it exists, all the image computation process will not be done.
public cacheFile ( string $type = 'jpg', integer $quality = 80, $actual = false )
$type string the image type
$quality integer the quality (for JPEG)

correct() 공개 메소드

Tells if the image is correct.
public correct ( )

create() 공개 정적인 메소드

Creates an instance of a new resource.
public static create ( $width, $height )

fromData() 공개 정적인 메소드

Creates an instance of image from its data.
public static fromData ( $data )

fromFile() 공개 메소드

Defines the file only after instantiation.
public fromFile ( string $originalFile )
$originalFile string the file path

fromResource() 공개 정적인 메소드

Creates an instance of image from resource.
public static fromResource ( $resource )

generateHash() 공개 메소드

Generates the hash.
public generateHash ( $type = 'guess', $quality = 80 )

get() 공개 메소드

Get the contents of the image.
public get ( $type = 'guess', $quality = 80 )

getAdapter() 공개 메소드

public getAdapter ( ) : Gregwar\Image\Adapter\AdapterInterface
리턴 Gregwar\Image\Adapter\AdapterInterface

getCacheFallback() 공개 메소드

Gets the fallback into the cache dir.
public getCacheFallback ( )

getCacheSystem() 공개 메소드

Get the cache system.
public getCacheSystem ( ) : Gregwar\Cache\CacheInterface
리턴 Gregwar\Cache\CacheInterface

getDependencies() 공개 메소드

Get all the files that this image depends on.
public getDependencies ( ) : string[]
리턴 string[] this is an array of strings containing all the files that the current Image depends on

getFallback() 공개 메소드

Gets the fallack image path.
public getFallback ( )

getFilePath() 공개 메소드

Get the file path.
public getFilePath ( ) : mixed
리턴 mixed a string with the filen name, null if the image does not depends on a file

getFilename() 보호된 메소드

Hook to helps to extends and enhance this class.
protected getFilename ( $filename )

getHash() 공개 메소드

Gets the hash.
public getHash ( $type = 'guess', $quality = 80 )

gif() 공개 메소드

Generates and output a gif cached file.
public gif ( )

guess() 공개 메소드

Generates and output an image using the same type as input.
public guess ( $quality = 80 )

guessType() 공개 메소드

Guess the file type.
public guessType ( )

height() 공개 메소드

Image height.
public height ( )

html() 공개 메소드

Returning basic html code for this image.
public html ( $title = '', $type = 'jpg', $quality = 80 )

init() 공개 메소드

Initialize the adapter.
public init ( )

inline() 공개 메소드

Returns the Base64 inlinable representation.
public inline ( $type = 'jpg', $quality = 80 )

jpeg() 공개 메소드

Generates and output a jpeg cached file.
public jpeg ( $quality = 80 )

open() 공개 정적인 메소드

Creates an instance, usefull for one-line chaining.
public static open ( $file = '' )

png() 공개 메소드

Generates and output a png cached file.
public png ( )

save() 공개 메소드

Save the file to a given output.
public save ( $file, $type = 'guess', $quality = 80 )

serializeOperations() 공개 메소드

Serialization of operations.
public serializeOperations ( )

setActualCacheDir() 공개 메소드

The actual cache dir.
public setActualCacheDir ( $actualCacheDir )

setAdapter() 공개 메소드

public setAdapter ( $adapter )

setCacheDir() 공개 메소드

Change the caching directory.
public setCacheDir ( $cacheDir )

setCacheDirMode() 공개 메소드

public setCacheDirMode ( integer $dirMode )
$dirMode integer

setCacheSystem() 공개 메소드

Set the cache system.
public setCacheSystem ( Gregwar\Cache\CacheInterface $cache )
$cache Gregwar\Cache\CacheInterface

setData() 공개 메소드

Sets the image data.
public setData ( $data )

setFallback() 공개 메소드

Sets the fallback image to use.
public setFallback ( $fallback = null )

setForceCache() 공개 메소드

Enable or disable to force cache even if the file is unchanged.
public setForceCache ( $forceCache = true )

setPrettyName() 공개 메소드

Sets the pretty name of the image.
public setPrettyName ( $name, $prefix = true )

setResource() 공개 메소드

Sets the resource.
public setResource ( $resource )

urlize() 보호된 메소드

Urlizes the prettyName.
protected urlize ( $name )

useFallback() 공개 메소드

Use the fallback image or not.
public useFallback ( $useFallbackImage = true )

width() 공개 메소드

Image width.
public width ( )

프로퍼티 상세

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

Internal adapter.
protected AdapterInterface,Gregwar\Image\Adapter $adapter
리턴 Gregwar\Image\Adapter\AdapterInterface

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

Cache system.
protected CacheInterface,Gregwar\Cache $cache
리턴 Gregwar\Cache\CacheInterface

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

Directory to use for file caching.
protected $cacheDir

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

Directory cache mode.
protected $cacheMode

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

Fallback image.
protected $fallback

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

Force image caching, even if there is no operation applied.
protected $forceCache

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

Transformations hash.
protected $hash

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

Operations array.
protected $operations

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

Pretty name for the image.
protected $prettyName

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

protected $prettyPrefix

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

The image source.
protected $source

$types 공개적으로 정적으로 프로퍼티

Supported types.
public static $types

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

Use fallback image.
protected $useFallbackImage