Documentation

Image
in package

FinalYes

Legacy image conversion, resizing, thumbnail, and optimization facade.

Included for historical compatibility only. This API is out of support and should not be used in new code.

Tags
author

Daniel Schulz

since
2017-12-28

Table of Contents

Constants

FFMPEG_QUERY_CONVERT  : mixed = '-i %1$s %2$s -y'
IRFANVIEW_QUERY_CONVERT  : mixed = '%1$s /silent /convert=%2$s'
IRFANVIEW_QUERY_SCALE  : mixed = '%1$s /silent /resize=(%3$d,%4$d) /convert=%2$s'
IRFANVIEW_QUERY_SIZE  : mixed = '%1$s /resize=(%3$d,%4$d) /aspectratio /silent...
OPTIPNG_QUERY_MINIFY  : mixed = '-silent %1$s'

Properties

$FFMPEG_ACTIVE  : bool
$FFMPEG_PATH  : string
$IRFANVIEW_ACTIVE  : bool
$IRFANVIEW_PATH  : string
$OPTIPNG_ACTIVE  : bool
$OPTIPNG_PATH  : string
$THUMBNAIL_HEIGHT  : int
$THUMBNAIL_WIDTH  : int

Methods

addSprite()  : bool
convertFile()  : bool
createFromFile()  : mixed
createSprite()  : bool
cropFile()  : void
imageInfo()  : array<string|int, mixed>
mergeFile()  : bool
scaleFile()  : bool
setTransparency()  : void
splitImage()  : mixed
getTempFile()  : string

Constants

FFMPEG_QUERY_CONVERT

public mixed FFMPEG_QUERY_CONVERT = '-i %1$s %2$s -y'

IRFANVIEW_QUERY_CONVERT

public mixed IRFANVIEW_QUERY_CONVERT = '%1$s /silent /convert=%2$s'

IRFANVIEW_QUERY_SCALE

public mixed IRFANVIEW_QUERY_SCALE = '%1$s /silent /resize=(%3$d,%4$d) /convert=%2$s'

IRFANVIEW_QUERY_SIZE

public mixed IRFANVIEW_QUERY_SIZE = '%1$s /resize=(%3$d,%4$d) /aspectratio /silent /convert=%2$s'

OPTIPNG_QUERY_MINIFY

public mixed OPTIPNG_QUERY_MINIFY = '-silent %1$s'

Properties

$FFMPEG_ACTIVE

public static bool $FFMPEG_ACTIVE = true

$FFMPEG_PATH

public static string $FFMPEG_PATH = 'ffmpeg'

$IRFANVIEW_ACTIVE

public static bool $IRFANVIEW_ACTIVE = true

$IRFANVIEW_PATH

public static string $IRFANVIEW_PATH = 'i_view32'

$OPTIPNG_ACTIVE

public static bool $OPTIPNG_ACTIVE = true

$OPTIPNG_PATH

public static string $OPTIPNG_PATH = 'optipng'

$THUMBNAIL_HEIGHT

public static int $THUMBNAIL_HEIGHT = 240

$THUMBNAIL_WIDTH

public static int $THUMBNAIL_WIDTH = 320

Methods

addSprite()

public static addSprite(mixed $destFile, array<string|int, mixed> $sourceFileList[, mixed $spriteWidth = null ][, mixed $spriteHeigh = null ]) : bool
Parameters
$destFile : mixed
$sourceFileList : array<string|int, mixed>
$spriteWidth : mixed = null
$spriteHeigh : mixed = null
Return values
bool

convertFile()

public static convertFile(mixed $sourceFile, mixed $destFile) : bool
Parameters
$sourceFile : mixed
$destFile : mixed
Return values
bool

createFromFile()

public static createFromFile(mixed $file) : mixed
Parameters
$file : mixed
Tags
throws
DomainException
Return values
mixed —

A GD resource on PHP 7.4, GdImage on PHP 8+, or false on load failure.

createSprite()

public static createSprite(mixed $destFile, mixed $spriteWidth, mixed $spriteHeight[, mixed $cols = 1 ][, mixed $rows = 1 ][, array<string|int, mixed> $imageList = [] ]) : bool
Parameters
$destFile : mixed
$spriteWidth : mixed
$spriteHeight : mixed
$cols : mixed = 1
$rows : mixed = 1
$imageList : array<string|int, mixed> = []
Return values
bool

cropFile()

public static cropFile(mixed $sourceFile, mixed $destFile, mixed $width, mixed $height) : void
Parameters
$sourceFile : mixed
$destFile : mixed
$width : mixed
$height : mixed

imageInfo()

public static imageInfo(mixed $file) : array<string|int, mixed>
Parameters
$file : mixed
Tags
throws
DomainException
Return values
array<string|int, mixed>

mergeFile()

public static mergeFile(mixed $sourceFile, mixed $appendFile[, mixed $targetFile = null ]) : bool
Parameters
$sourceFile : mixed
$appendFile : mixed
$targetFile : mixed = null
Return values
bool

scaleFile()

public static scaleFile(mixed $sourceFile, mixed $destFile, mixed $width, mixed $height) : bool
Parameters
$sourceFile : mixed
$destFile : mixed
$width : mixed
$height : mixed
Return values
bool

setTransparency()

public static setTransparency(mixed $image_source, mixed $new_image) : void
Parameters
$image_source : mixed

GD resource on PHP 7.4 or GdImage on PHP 8+.

$new_image : mixed

GD resource on PHP 7.4 or GdImage on PHP 8+.

Tags
throws
DomainException

splitImage()

public static splitImage(mixed $file, mixed $x, mixed $y, mixed $new_width, mixed $new_height) : mixed
Parameters
$file : mixed
$x : mixed
$y : mixed
$new_width : mixed
$new_height : mixed
Tags
throws
DomainException
Return values
mixed —

A GD resource on PHP 7.4, GdImage on PHP 8+, or false on load failure.

getTempFile()

protected static getTempFile() : string
Return values
string
On this page

Search results