MediaWiki  REL1_24
GIFHandler Class Reference

Handler for GIF images. More...

Inheritance diagram for GIFHandler:
Collaboration diagram for GIFHandler:

List of all members.

Public Member Functions

 canAnimateThumbnail ($file)
 We cannot animate thumbnails that are bigger than a particular size.
 formatMetadata ($image)
 getCommonMetaArray (File $image)
 Return the standard metadata elements for #filemetadata parser func.
 getImageArea ($image)
 getLongDesc ($image)
 getMetadata ($image, $filename)
 Get handler-specific metadata which will be saved in the img_metadata field.
 getMetadataType ($image)
 Get a string describing the type of metadata, for display purposes.
 isAnimatedImage ($image)
 isMetadataValid ($image, $metadata)
 Check if the metadata string is valid for this handler.

Public Attributes

const BROKEN_FILE = '0'

Detailed Description

Handler for GIF images.

Definition at line 29 of file GIF.php.


Member Function Documentation

We cannot animate thumbnails that are bigger than a particular size.

Parameters:
File$file
Returns:
bool

Reimplemented from MediaHandler.

Definition at line 116 of file GIF.php.

References $file, getImageArea(), and global.

Parameters:
File$image
Returns:
array|bool

Reimplemented from MediaHandler.

Definition at line 49 of file GIF.php.

References MediaHandler\formatMetadataHelper(), and getCommonMetaArray().

Return the standard metadata elements for #filemetadata parser func.

Parameters:
File$image
Returns:
array|bool

Reimplemented from MediaHandler.

Definition at line 63 of file GIF.php.

References array(), and File\getMetadata().

Referenced by formatMetadata().

Todo:
Add unit tests
Parameters:
File$image
Returns:
bool

Reimplemented from ImageHandler.

Definition at line 84 of file GIF.php.

Referenced by canAnimateThumbnail().

Parameters:
File$image
Returns:
string

Reimplemented from ImageHandler.

Definition at line 158 of file GIF.php.

References $wgLang, array(), global, wfMessage(), wfRestoreWarnings(), and wfSuppressWarnings().

GIFHandler::getMetadata ( image,
path 
)

Get handler-specific metadata which will be saved in the img_metadata field.

Parameters:
File$imageThe image object, or false if there isn't one. Warning, FSFile::getPropsFromPath might pass an (object)array() instead (!)
string$pathThe filename
Returns:
string A string of metadata in php serialized form (Run through serialize())

Reimplemented from MediaHandler.

Definition at line 32 of file GIF.php.

References $e, BROKEN_FILE, BitmapMetadataHandler\GIF(), and wfDebug().

Get a string describing the type of metadata, for display purposes.

Note:
This method is currently unused.
Parameters:
File$image
Returns:
string

Reimplemented from MediaHandler.

Definition at line 123 of file GIF.php.

Parameters:
File$image
Returns:
bool

Reimplemented from MediaHandler.

Definition at line 99 of file GIF.php.

GIFHandler::isMetadataValid ( image,
metadata 
)

Check if the metadata string is valid for this handler.

If it returns MediaHandler::METADATA_BAD (or false), Image will reload the metadata from the file and update the database. MediaHandler::METADATA_GOOD for if the metadata is a-ok, MediaHandler::METADATA_COMPATIBLE if metadata is old but backwards compatible (which may or may not trigger a metadata reload).

Note:
Returning self::METADATA_BAD will trigger a metadata reload from file on page view. Always returning this from a broken file, or suddenly triggering as bad metadata for a large number of files can cause performance problems.
Parameters:
File$image
string$metadataThe metadata in serialized form
Returns:
bool

Reimplemented from MediaHandler.

Definition at line 127 of file GIF.php.

References MediaHandler\METADATA_BAD, MediaHandler\METADATA_COMPATIBLE, MediaHandler\METADATA_GOOD, GIFMetadataExtractor\VERSION, wfDebug(), wfRestoreWarnings(), and wfSuppressWarnings().


Member Data Documentation

Definition at line 30 of file GIF.php.

Referenced by getMetadata(), and GIFHandlerTest\provideIsMetadataValid().


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