Merge "Add login error browser test"
[lhc/web/wiklou.git] / includes / media / PNG.php
index 7b3ddb5..c3f0832 100644 (file)
@@ -49,15 +49,16 @@ class PNGHandler extends BitmapHandler {
 
        /**
         * @param File $image
+        * @param bool|IContextSource $context Context to use (optional)
         * @return array|bool
         */
-       function formatMetadata( $image ) {
+       function formatMetadata( $image, $context = false ) {
                $meta = $this->getCommonMetaArray( $image );
                if ( count( $meta ) === 0 ) {
                        return false;
                }
 
-               return $this->formatMetadataHelper( $meta );
+               return $this->formatMetadataHelper( $meta, $context );
        }
 
        /**
@@ -117,9 +118,9 @@ class PNGHandler extends BitmapHandler {
                        return self::METADATA_GOOD;
                }
 
-               wfSuppressWarnings();
+               MediaWiki\suppressWarnings();
                $data = unserialize( $metadata );
-               wfRestoreWarnings();
+               MediaWiki\restoreWarnings();
 
                if ( !$data || !is_array( $data ) ) {
                        wfDebug( __METHOD__ . " invalid png metadata\n" );
@@ -146,9 +147,9 @@ class PNGHandler extends BitmapHandler {
                global $wgLang;
                $original = parent::getLongDesc( $image );
 
-               wfSuppressWarnings();
+               MediaWiki\suppressWarnings();
                $metadata = unserialize( $image->getMetadata() );
-               wfRestoreWarnings();
+               MediaWiki\restoreWarnings();
 
                if ( !$metadata || $metadata['frameCount'] <= 0 ) {
                        return $original;
@@ -174,7 +175,10 @@ class PNGHandler extends BitmapHandler {
                return $wgLang->commaList( $info );
        }
 
+       // PNGs should be easy to support, but it will need some sharpening applied
+       // and another user test to check if the perceived quality change is noticeable
+
        public function supportsBucketing() {
-               return true;
+               return false;
        }
 }