diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-08-12 09:28:15 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-08-12 09:28:15 +0200 |
commit | 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch) | |
tree | 577a29fb579188d16003a209ce2a2e9c5b0aa2bd /includes/media/GIF.php | |
parent | cacc939b34e315b85e2d72997811eb6677996cc1 (diff) |
Update to MediaWiki 1.21.1
Diffstat (limited to 'includes/media/GIF.php')
-rw-r--r-- | includes/media/GIF.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/includes/media/GIF.php b/includes/media/GIF.php index 84b9b8ca..2e532feb 100644 --- a/includes/media/GIF.php +++ b/includes/media/GIF.php @@ -29,7 +29,7 @@ class GIFHandler extends BitmapHandler { const BROKEN_FILE = '0'; // value to store in img_metadata if error extracting metadata. - + function getMetadata( $image, $filename ) { try { $parsedGIFMetadata = BitmapMetadataHandler::GIF( $filename ); @@ -39,7 +39,7 @@ class GIFHandler extends BitmapHandler { return self::BROKEN_FILE; } - return serialize($parsedGIFMetadata); + return serialize( $parsedGIFMetadata ); } /** @@ -53,7 +53,7 @@ class GIFHandler extends BitmapHandler { return false; } $meta = unserialize( $meta ); - if ( !isset( $meta['metadata'] ) || count( $meta['metadata'] ) <= 1 ) { + if ( !isset( $meta['metadata'] ) || count( $meta['metadata'] ) <= 1 ) { return false; } @@ -85,7 +85,7 @@ class GIFHandler extends BitmapHandler { function isAnimatedImage( $image ) { $ser = $image->getMetadata(); if ( $ser ) { - $metadata = unserialize($ser); + $metadata = unserialize( $ser ); if( $metadata['frameCount'] > 1 ) { return true; } @@ -119,13 +119,13 @@ class GIFHandler extends BitmapHandler { wfRestoreWarnings(); if ( !$data || !is_array( $data ) ) { - wfDebug(__METHOD__ . ' invalid GIF metadata' ); + wfDebug( __METHOD__ . ' invalid GIF metadata' ); return self::METADATA_BAD; } if ( !isset( $data['metadata']['_MW_GIF_VERSION'] ) || $data['metadata']['_MW_GIF_VERSION'] != GIFMetadataExtractor::VERSION ) { - wfDebug(__METHOD__ . ' old but compatible GIF metadata' ); + wfDebug( __METHOD__ . ' old but compatible GIF metadata' ); return self::METADATA_COMPATIBLE; } return self::METADATA_GOOD; @@ -141,29 +141,29 @@ class GIFHandler extends BitmapHandler { $original = parent::getLongDesc( $image ); wfSuppressWarnings(); - $metadata = unserialize($image->getMetadata()); + $metadata = unserialize( $image->getMetadata() ); wfRestoreWarnings(); - - if (!$metadata || $metadata['frameCount'] <= 1) { + + if ( !$metadata || $metadata['frameCount'] <= 1 ) { return $original; } /* Preserve original image info string, but strip the last char ')' so we can add even more */ $info = array(); $info[] = $original; - + if ( $metadata['looped'] ) { $info[] = wfMessage( 'file-info-gif-looped' )->parse(); } - + if ( $metadata['frameCount'] > 1 ) { $info[] = wfMessage( 'file-info-gif-frames' )->numParams( $metadata['frameCount'] )->parse(); } - + if ( $metadata['duration'] ) { $info[] = $wgLang->formatTimePeriod( $metadata['duration'] ); } - + return $wgLang->commaList( $info ); } } |