* Moving wfGetSVGSize() and wfScaleSVGUnit() into a seperate SVGMetadataExtractor.
[lhc/web/wiklou.git] / includes / media / PNG.php
index babadde..0a7fc32 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 /**
+ * Handler for PNG images.
+ *
  * @file
  * @ingroup Media
  */
@@ -50,23 +52,23 @@ class PNGHandler extends BitmapHandler {
                return (boolean) $data;
        }
        function getLongDesc( $image ) {
-               global $wgUser, $wgLang;
-               $sk = $wgUser->getSkin();
+               global $wgLang;
                $original = parent::getLongDesc( $image );
 
                wfSuppressWarnings();
                $metadata = unserialize($image->getMetadata());
                wfRestoreWarnings();
 
-               if( !metadata || $metadata['frameCount'] == 0 )
+               if( !$metadata || $metadata['frameCount'] <= 0 )
                        return $original;
 
+               $info = array();
                $info[] = substr( $original, 1, strlen( $original )-2 );
                
                if ($metadata['loopCount'] == 0)
                        $info[] = wfMsgExt( 'file-info-png-looped', 'parseinline' );
                elseif ($metadata['loopCount'] > 1)
-                       $info[] = wfMsgExt( 'file-info-png-repeat', 'parseinline', $metadata['loopCount'] );;
+                       $info[] = wfMsgExt( 'file-info-png-repeat', 'parseinline', $metadata['loopCount'] );
                
                if ($metadata['frameCount'] > 0)
                        $info[] = wfMsgExt( 'file-info-png-frames', 'parseinline', $metadata['frameCount'] );