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());
41 if (!$metadata) return parent
::getLongDesc( $image );
44 $info[] = $image->getMimeType();
45 $info[] = $sk->formatSize( $image->getSize() );
47 if ($metadata['looped'])
48 $info[] = wfMsgExt( 'file-info-gif-looped', 'parseinline' );
50 if ($metadata['frameCount'] > 1)
51 $info[] = wfMsgExt( 'file-info-gif-frames', 'parseinline', $metadata['frameCount'] );
53 if ($metadata['duration'])
54 $info[] = $wgLang->formatTimePeriod( $metadata['duration'] );
56 $infoString = $wgLang->commaList( $info );
58 return "($infoString)";