Don't override the default Bitmap.php information in the longDescription() for GIF...
authorDerk-Jan Hartman <hartman@users.mediawiki.org>
Sun, 20 Jun 2010 16:13:24 +0000 (16:13 +0000)
committerDerk-Jan Hartman <hartman@users.mediawiki.org>
Sun, 20 Jun 2010 16:13:24 +0000 (16:13 +0000)
includes/media/GIF.php

index 636ae64..4679963 100644 (file)
@@ -63,16 +63,17 @@ class GIFHandler extends BitmapHandler {
        function getLongDesc( $image ) {
                global $wgUser, $wgLang;
                $sk = $wgUser->getSkin();
+               $original = parent::getLongDesc( $image );
 
                wfSuppressWarnings();
                $metadata = unserialize($image->getMetadata());
                wfRestoreWarnings();
                
-               if (!$metadata) return parent::getLongDesc( $image );
+               if (!$metadata || $metadata['frameCount'] <=  1)
+                       return $original;
                
                $info = array();
-               $info[] = $image->getMimeType();
-               $info[] = $sk->formatSize( $image->getSize() );
+               $info[] = substr( $original, 1, strlen( $original )-2 );
                
                if ($metadata['looped'])
                        $info[] = wfMsgExt( 'file-info-gif-looped', 'parseinline' );