Image
extends Facade
in package
Table of Contents
Properties
Methods
- __callStatic() : mixed
- copyImage() : bool
- createImages() : array{path: string, type: string, name: string, size: string}
- createWebpWithGd() : void
- createWebpWithImagick() : void
- deleteImageAllSize() : void
- detectImageExtenstion() : string
- editImage() : resource
- editImageForImagick() : void
- getImageDimensions() : array<string|int, mixed>|null
- getInstance() : mixed
- get service instance
- isAvailableWebpWithGd() : bool
- isAvailableWebpWithImagick() : bool
- optimize() : void
- optimizeTest() : bool
- resizeImg() : void
- setContainer() : void
- getServiceAlias() : string
- getServiceInstance() : mixed
- isCache() : bool
Properties
$container
protected
static Container
$container
Methods
__callStatic()
public
static __callStatic(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
- $method : string
- $arguments : array<string|int, mixed>
copyImage()
public
static copyImage(string $from, string $to[, int|null $width = = 'null' ][, int|null $height = = 'null' ][, int|null $size = = 'null' ][, int|null $angle = = 'null' ]) : bool
画像をコピー
Parameters
- $from : string
- $to : string
- $width : int|null = = 'null'
- $height : int|null = = 'null'
- $size : int|null = = 'null'
- $angle : int|null = = 'null'
Return values
boolcreateImages()
public
static createImages(array{name: string, type: string, tmp_name: string, error: int, size: int} $File, array{normal?: int, tiny?: int, large?: int, square?: int} $sizes, string $destDir[, bool $isRandomFileName = = 'true' ][, int|null $angle = = 'null' ][, bool $forceLarge = = 'false' ]) : array{path: string, type: string, name: string, size: string}
画サイズ違い(tiny, square, large, normal)の画像を生成
Parameters
- $File : array{name: string, type: string, tmp_name: string, error: int, size: int}
- $sizes : array{normal?: int, tiny?: int, large?: int, square?: int}
- $destDir : string
- $isRandomFileName : bool = = 'true'
- $angle : int|null = = 'null'
- $forceLarge : bool = = 'false'
Return values
array{path: string, type: string, name: string, size: string}createWebpWithGd()
public
static createWebpWithGd(resource $resource, string $distPath[, int $imageQuality = = '75' ]) : void
GDでWebPを生成
Parameters
- $resource : resource
- $distPath : string
- $imageQuality : int = = '75'
createWebpWithImagick()
public
static createWebpWithImagick(string $srcPath, string $distPath[, int $imageQuality = = '75' ]) : void
ImagickでWebPを生成
Parameters
- $srcPath : string
- $distPath : string
- $imageQuality : int = = '75'
deleteImageAllSize()
public
static deleteImageAllSize(string $path) : void
全サイズの画像削除
Parameters
- $path : string
detectImageExtenstion()
public
static detectImageExtenstion(string $mimeType) : string
画像の拡張子を検出
Parameters
- $mimeType : string
Return values
stringeditImage()
public
static editImage(resource $rsrc[, int|null $width = = 'null' ][, int|null $height = = 'null' ][, int|null $size = = 'null' ][, int|null $angle = = 'null' ]) : resource
画像を編集(GD使用)
Parameters
- $rsrc : resource
- $width : int|null = = 'null'
- $height : int|null = = 'null'
- $size : int|null = = 'null'
- $angle : int|null = = 'null'
Return values
resourceeditImageForImagick()
public
static editImageForImagick(string $rsrc, string $file[, int|null $width = = 'null' ][, int|null $height = = 'null' ][, int|null $size = = 'null' ][, int|null $angle = = 'null' ]) : void
画像を編集(Imagick使用)
Parameters
- $rsrc : string
- $file : string
- $width : int|null = = 'null'
- $height : int|null = = 'null'
- $size : int|null = = 'null'
- $angle : int|null = = 'null'
getImageDimensions()
public
static getImageDimensions(string $path) : array<string|int, mixed>|null
画像の幅と高さを取得
Parameters
- $path : string
Return values
array<string|int, mixed>|nullgetInstance()
get service instance
public
static getInstance() : mixed
isAvailableWebpWithGd()
public
static isAvailableWebpWithGd() : bool
GDでWebPを生成可能かどうかを判定
Return values
boolisAvailableWebpWithImagick()
public
static isAvailableWebpWithImagick() : bool
ImagickでWebPを生成可能かどうかを判定
Return values
booloptimize()
public
static optimize(string $path) : void
画像をロスレス圧縮
Parameters
- $path : string
optimizeTest()
public
static optimizeTest(string $path) : bool
画像のロスレス圧縮テスト
Parameters
- $path : string
Return values
boolresizeImg()
public
static resizeImg(string $srcPath, string $destPath, string $ext[, int|null $width = = 'null' ][, int|null $height = = 'null' ][, int|null $size = = 'null' ][, int|null $angle = = 'null' ]) : void
画像をリサイズ
Parameters
- $srcPath : string
- $destPath : string
- $ext : string
- $width : int|null = = 'null'
- $height : int|null = = 'null'
- $size : int|null = = 'null'
- $angle : int|null = = 'null'
setContainer()
public
static setContainer(Container $container) : void
Parameters
- $container : Container
getServiceAlias()
protected
static getServiceAlias() : string
Return values
stringgetServiceInstance()
protected
static getServiceInstance(string $alias) : mixed
Parameters
- $alias : string
isCache()
protected
static isCache() : bool