MediaWiki  REL1_24
PNGHandler Class Reference

Handler for PNG images. More...

Inheritance diagram for PNGHandler:
Collaboration diagram for PNGHandler:

List of all members.

Public Member Functions

 canAnimateThumbnail ($image)
 We do not support making APNG thumbnails, so always false.
 formatMetadata ($image)
 getCommonMetaArray (File $image)
 Get a file type independent array of metadata.
 getLongDesc ($image)
 getMetadata ($image, $filename)
 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.
 supportsBucketing ()
 Returns whether or not this handler supports the chained generation of thumbnails according to buckets.

Public Attributes

const BROKEN_FILE = '0'

Detailed Description

Handler for PNG images.

Definition at line 29 of file PNG.php.


Member Function Documentation

We do not support making APNG thumbnails, so always false.

Parameters:
File$image
Returns:
bool False

Reimplemented from MediaHandler.

Definition at line 105 of file PNG.php.

Parameters:
File$image
Returns:
array|bool

Reimplemented from MediaHandler.

Definition at line 54 of file PNG.php.

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

Get a file type independent array of metadata.

Parameters:
File$image
Returns:
array The metadata array

Reimplemented from MediaHandler.

Definition at line 69 of file PNG.php.

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

Referenced by formatMetadata().

Parameters:
File$image
Returns:
string

Reimplemented from ImageHandler.

Definition at line 145 of file PNG.php.

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

PNGHandler::getMetadata ( image,
filename 
)
Parameters:
File$image
string$filename
Returns:
string

Reimplemented from MediaHandler.

Definition at line 37 of file PNG.php.

References $e, BROKEN_FILE, BitmapMetadataHandler\PNG(), 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 109 of file PNG.php.

Parameters:
File$image
Returns:
bool

Reimplemented from MediaHandler.

Definition at line 88 of file PNG.php.

PNGHandler::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 113 of file PNG.php.

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

Returns whether or not this handler supports the chained generation of thumbnails according to buckets.

Returns:
bool
Since:
1.24

Reimplemented from MediaHandler.

Definition at line 177 of file PNG.php.


Member Data Documentation

Definition at line 30 of file PNG.php.

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


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