Rundiz\Image

AvifInfo.php

Important note!

This file is from https://aomedia.googlesource.com/libavifinfo/+/refs/heads/main/avifinfo.php PHP is already supported AVIF since v8.2, this class is for use with older version of PHP. #php8.2

Tags
todo

Remove usage of this class when minimum requirement is PHP >= 8.2.0

Namespace must be modified from Avifinfo to be Rundiz\Avifinfo to prevent re-declare functions errors when other vendor using it.

Copied from commit: f50948793d6ae181d82c1255a40fb1becce6ee57

Table of Contents

Classes

Tile
Prop
Dim_Prop
Chan_Prop
Features
Box
Parser

Constants

ABORTED  = 3
FOUND  = 0
INVALID  = 4
MAX_FEATURES  = 8
MAX_NUM_BOXES  = 4096
MAX_PROPS  = 32
MAX_SIZE  = 4294967295
MAX_TILES  = 16
MAX_VALUE  = 255
NOT_FOUND  = 1
TRUNCATED  = 2
UNDEFINED  = 0

Functions

read_big_endian()  : int
Reads an unsigned integer with most significant bits first.
read()  : binary
Reads bytes and advances the stream position by the same count.
skip()  : bool
Advances the stream position by the given offset.

Constants

MAX_FEATURES

public mixed MAX_FEATURES = 8

MAX_NUM_BOXES

public mixed MAX_NUM_BOXES = 4096

MAX_SIZE

public mixed MAX_SIZE = 4294967295

Functions

read_big_endian()

Reads an unsigned integer with most significant bits first.

read_big_endian(mixed $input, int $num_bytes) : int
Parameters
$input : mixed
$num_bytes : int

Number of parsed bytes.

Return values
int

Value.

read()

Reads bytes and advances the stream position by the same count.

read(stream $handle, int $num_bytes) : binary
Parameters
$handle : stream

Bytes will be read from this resource.

$num_bytes : int

Number of bytes read. Must be greater than 0.

Return values
binary

string|false The raw bytes or false on failure.

skip()

Advances the stream position by the given offset.

skip(stream $handle, int $num_bytes) : bool
Parameters
$handle : stream

Bytes will be skipped from this resource.

$num_bytes : int

Number of skipped bytes. Can be 0.

Return values
bool

True on success or false on failure.


        
On this page

Search results