8 * Handler for GIF images.
12 class GIFHandler
extends BitmapHandler
{
14 function getMetadata( $image, $filename ) {
15 if ( !isset($image->parsedGIFMetadata
) )
16 $image->parsedGIFMetadata
= GIFMetadataExtractor
::getMetadata( $filename );
18 return serialize($image->parsedGIFMetadata
);
22 function formatMetadata( $image ) {
26 function getImageArea( $image, $width, $height ) {
27 $metadata = unserialize($image->getMetadata());
28 return $width * $height * $metadata['frameCount'];
31 function getMetadataType( $image ) {
35 function getLongDesc( $image ) {
36 global $wgUser, $wgLang;
37 $sk = $wgUser->getSkin();
39 $metadata = unserialize($image->getMetadata());
42 $info[] = $image->getMimeType();
43 $info[] = $sk->formatSize( $image->getSize() );
45 if ($metadata['looped'])
46 $info[] = wfMsgExt( 'file-info-gif-looped', 'parseinline' );
48 if ($metadata['frameCount'] > 1)
49 $info[] = wfMsgExt( 'file-info-gif-frames', 'parseinline', $metadata['frameCount'] );
51 if ($metadata['duration'])
52 $info[] = $wgLang->formatTimePeriod( $metadata['duration'] );
54 $infoString = $wgLang->commaList( $info );
56 return "($infoString)";