Documentation

ImageHandler
in package

Class ImageHandler

Table of Contents

$constImageFormat  : array<string|int, mixed>
$imageFormat  : array<string|int, mixed>
convert()  : resource
Do image conversion work
getExtension()  : string
Get image extension from specific $path
getRealExtension()  : mixed
Given specific $path to detect current image extension
loadImage()  : false|resource|null
makeDirectory()  : bool
Try creating the directory
saveImage()  : bool|null

Properties

$constImageFormat

private array<string|int, mixed> $constImageFormat = [IMAGETYPE_GIF => 'gif', IMAGETYPE_JPEG => 'jpeg', IMAGETYPE_PNG => 'png', IMAGETYPE_WEBP => 'webp']

$imageFormat

private array<string|int, mixed> $imageFormat = ['gif', 'jpeg', 'jpg', 'png', 'webp']

Methods

convert()

Do image conversion work

public convert(string $from, string $to[, mixed $quality = null ]) : resource
Parameters
$from : string
$to : string
$quality : mixed = null
Tags
throws
InvalidArgumentException
Return values
resource

getExtension()

Get image extension from specific $path

private getExtension(string $path) : string
Parameters
$path : string
Return values
string

getRealExtension()

Given specific $path to detect current image extension

private getRealExtension(mixed $path) : mixed
Parameters
$path : mixed
Return values
mixed

loadImage()

private loadImage( $from) : false|resource|null
Parameters
$from :
Return values
false|resource|null

makeDirectory()

Try creating the directory

private makeDirectory(mixed $to) : bool
Parameters
$to : mixed
Tags
throws
InvalidArgumentException
Return values
bool

saveImage()

private saveImage( $to,  $image,  $quality) : bool|null
Parameters
$to :
$image :
$quality :
Return values
bool|null

Search results