a-blog cms PHP API Reference

Helper
in package

Table of Contents

Properties

$engine  : ImageEngine

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

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
bool

createImages()

サイズ違い(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
string

getImageDimensions()

画像の幅と高さを取得

public getImageDimensions(string $path) : array<string|int, mixed>|null
Parameters
$path : string
Return values
array<string|int, mixed>|null

parseSvgLength()

SVGの長さをパースして、ピクセル値を返す

public parseSvgLength(string $value) : float|null
Parameters
$value : string
Return values
float|null

resizeImg()

画像のリサイズ

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}
Return values
array{path: string, type: string, name: string, size: string}

        
On this page

Search results