Rundiz\Image

WebP
in package

WebP file information class.

Tags
since
3.1.0

Table of Contents

Properties

$file  : string|null

Methods

__construct()  : mixed
WebP file information class.
checkWebPConstant()  : mixed
Check that WEBP constants are already define, if not then define it.
isAnimated()  : bool
Check if WEBP file that was specified is animated or not.
isGDSupported()  : bool
Check if GD supported current WEBP file.
isImagickSupportedAnimated()  : bool
Check if Imagick (and ImageMagick) supported animated WEBP.
webPInfo()  : array<string|int, mixed>|false
Get WebP file info.

Properties

$file

protected string|null $file

File path.

Tags
since
3.1.4

Methods

__construct()

WebP file information class.

public __construct([string $file = '' ]) : mixed
Parameters
$file : string = ''

Path to WEBP file.

Tags
since
3.1.4

checkWebPConstant()

Check that WEBP constants are already define, if not then define it.

public checkWebPConstant() : mixed

isAnimated()

Check if WEBP file that was specified is animated or not.

public isAnimated() : bool
Tags
since
3.1.4
Return values
bool

Return true if yes, false if something else.

isGDSupported()

Check if GD supported current WEBP file.

public isGDSupported() : bool
Tags
since
3.1.4
Return values
bool

Return true if yes, false if no.

isImagickSupportedAnimated()

Check if Imagick (and ImageMagick) supported animated WEBP.

public isImagickSupportedAnimated() : bool

This test is not depend on WEBP file specified.

Tags
since
3.1.4
Return values
bool

Return true if it is already supported. Return false for otherwise.

webPInfo()

Get WebP file info.

public webPInfo([string $file = '' ]) : array<string|int, mixed>|false
Parameters
$file : string = ''

Full path to image file. You can omit this argument and use one in class constructor instead.

Tags
link

unpack format reference.

link

WebP document.

link

Original question.

link

Original source code for get WEBP width and height (in case getimagesize() did not work on old PHP). By WordPress.

Return values
array<string|int, mixed>|false

Return associative array if success, return false for otherwise.


        
On this page

Search results