MediaWiki  master
GIFMetadataExtractor Class Reference

GIF frame counter. More...

Static Public Member Functions

static getMetadata ( $filename)
 

Public Attributes

const VERSION = 1
 

Static Private Member Functions

static decodeBPP ( $data)
 
static readBlock ( $fh, $includeLengths=false)
 Read a block. More...
 
static readGCT ( $fh, $bpp)
 
static skipBlock ( $fh)
 

Private Attributes

const MAX_SUBBLOCKS = 262144
 

Static Private Attributes

static string $gifExtensionSep
 
static string $gifFrameSep
 
static string $gifTerm
 

Detailed Description

GIF frame counter.

Definition at line 34 of file GIFMetadataExtractor.php.

Member Function Documentation

◆ decodeBPP()

static GIFMetadataExtractor::decodeBPP (   $data)
staticprivate
Parameters
string$data
Exceptions
Exception
Returns
int

Definition at line 280 of file GIFMetadataExtractor.php.

Referenced by getMetadata().

◆ getMetadata()

static GIFMetadataExtractor::getMetadata (   $filename)
static
Exceptions
Exception
Parameters
string$filename
Returns
array

Definition at line 56 of file GIFMetadataExtractor.php.

References decodeBPP(), readBlock(), readGCT(), skipBlock(), and wfDebug().

Referenced by BitmapMetadataHandler\GIF().

◆ readBlock()

static GIFMetadataExtractor::readBlock (   $fh,
  $includeLengths = false 
)
staticprivate

Read a block.

In the GIF format, a block is made up of several sub-blocks. Each sub block starts with one byte saying how long the sub-block is, followed by the sub-block. The entire block is terminated by a sub-block of length 0.

Parameters
resource$fhFile handle
bool$includeLengthsInclude the length bytes of the sub-blocks in the returned value. Normally this is false, except XMP is weird and does a hack where you need to keep these length bytes.
Exceptions
Exception
Returns
string The data.

Definition at line 326 of file GIFMetadataExtractor.php.

Referenced by getMetadata().

◆ readGCT()

static GIFMetadataExtractor::readGCT (   $fh,
  $bpp 
)
staticprivate
Parameters
resource$fh
int$bpp
Returns
void

Definition at line 266 of file GIFMetadataExtractor.php.

Referenced by getMetadata().

◆ skipBlock()

static GIFMetadataExtractor::skipBlock (   $fh)
staticprivate
Parameters
resource$fh
Exceptions
Exception

Definition at line 298 of file GIFMetadataExtractor.php.

Referenced by getMetadata().

Member Data Documentation

◆ $gifExtensionSep

string GIFMetadataExtractor::$gifExtensionSep
staticprivate

Definition at line 39 of file GIFMetadataExtractor.php.

◆ $gifFrameSep

string GIFMetadataExtractor::$gifFrameSep
staticprivate

Definition at line 36 of file GIFMetadataExtractor.php.

◆ $gifTerm

string GIFMetadataExtractor::$gifTerm
staticprivate

Definition at line 42 of file GIFMetadataExtractor.php.

◆ MAX_SUBBLOCKS

const GIFMetadataExtractor::MAX_SUBBLOCKS = 262144
private

Definition at line 49 of file GIFMetadataExtractor.php.

◆ VERSION

const GIFMetadataExtractor::VERSION = 1

The documentation for this class was generated from the following file: