Helper
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- コンストラクター
- copyImage() : bool
- 画像の複製
- createImages() : array{path: string, type: string, name: string, size: string}
- サイズ違い(tiny, square, large, normal)の画像を生成
- deleteImageAllSize() : void
- 全サイズの画像削除
- detectImageExtenstion() : string
- 画像パスから画像タイプを取得
- getImageDimensions() : array<string|int, mixed>|null
- 画像の幅と高さを取得
- parseSvgLength() : float|null
- SVGの長さをパースして、ピクセル値を返す
- resizeImg() : void
- 画像のリサイズ
- createCreateImagesConfig() : array{edit: array{tiny: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}, square?: array{size: int, angle?: int|null}, normal: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}, large?: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}}, srcPath: string, destPath: string, path: string, ext: "gif"|"png"|"bmp"|"xbm"|"jpg", fileName: string}
- createResizedImages() : array{path: string, type: string, name: string, size: string}
Properties
$engine
private
ImageEngine
$engine
Methods
__construct()
コンストラクター
public
__construct() : mixed
copyImage()
画像の複製
public
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()
サイズ違い(tiny, square, large, normal)の画像を生成
public
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}
Parameters
- $File : array{name: string, type: string, tmp_name: string, error: int, size: int}
-
$_FILES[$name] で取得したファイル情報
- $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}deleteImageAllSize()
全サイズの画像削除
public
deleteImageAllSize(string $path) : void
Parameters
- $path : string
detectImageExtenstion()
画像パスから画像タイプを取得
public
detectImageExtenstion(string $mimeType) : string
Parameters
- $mimeType : string
Return values
stringgetImageDimensions()
画像の幅と高さを取得
public
getImageDimensions(string $path) : array<string|int, mixed>|null
Parameters
- $path : string
Return values
array<string|int, mixed>|nullparseSvgLength()
SVGの長さをパースして、ピクセル値を返す
public
parseSvgLength(string $value) : float|null
Parameters
- $value : string
Return values
float|nullresizeImg()
画像のリサイズ
public
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
createCreateImagesConfig()
protected
createCreateImagesConfig(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{edit: array{tiny: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}, square?: array{size: int, angle?: int|null}, normal: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}, large?: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}}, srcPath: string, destPath: string, path: string, ext: "gif"|"png"|"bmp"|"xbm"|"jpg", fileName: string}
Parameters
- $File : array{name: string, type: string, tmp_name: string, error: int, size: int}
-
$_FILES[$name] で取得したファイル情報
- $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{edit: array{tiny: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}, square?: array{size: int, angle?: int|null}, normal: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}, large?: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}}, srcPath: string, destPath: string, path: string, ext: "gif"|"png"|"bmp"|"xbm"|"jpg", fileName: string}createResizedImages()
protected
createResizedImages(array{edit: array{tiny: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}, square?: array{size: int, angle?: int|null}, normal: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}, large?: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}}, srcPath: string, destPath: string, path: string, ext: "gif"|"png"|"bmp"|"xbm"|"jpg", fileName: string} $config) : array{path: string, type: string, name: string, size: string}
Parameters
- $config : array{edit: array{tiny: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}, square?: array{size: int, angle?: int|null}, normal: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}, large?: array{size: int, angle?: int, side?: "w"|"h"|"width"|"height"}}, srcPath: string, destPath: string, path: string, ext: "gif"|"png"|"bmp"|"xbm"|"jpg", fileName: string}