Merge "Use file width/height instead of metadata for getContentHeaders"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 24 May 2017 06:44:54 +0000 (06:44 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 24 May 2017 06:44:54 +0000 (06:44 +0000)
1  2 
includes/media/FormatMetadata.php

@@@ -24,7 -24,6 +24,7 @@@
   * @see http://exif.org/Exif2-2.PDF The Exif 2.2 specification
   * @file
   */
 +use MediaWiki\MediaWikiServices;
  use Wikimedia\Timestamp\TimestampException;
  
  /**
@@@ -102,9 -101,6 +102,6 @@@ class FormatMetadata extends ContextSou
        public function makeFormattedData( $tags ) {
                $resolutionunit = !isset( $tags['ResolutionUnit'] ) || $tags['ResolutionUnit'] == 2 ? 2 : 3;
                unset( $tags['ResolutionUnit'] );
-               // Width and height are for internal use and already available & displayed outside of metadata
-               unset( $tags['Width'] );
-               unset( $tags['Height'] );
  
                foreach ( $tags as $tag => &$vals ) {
                        // This seems ugly to wrap non-array's in an array just to unwrap again,
         * @since 1.23
         */
        public function fetchExtendedMetadata( File $file ) {
 -              $cache = ObjectCache::getMainWANInstance();
 +              $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
  
                // If revision deleted, exit immediately
                if ( $file->isDeleted( File::DELETED_FILE ) ) {
                        return [];
                }
  
 -              $cacheKey = wfMemcKey(
 +              $cacheKey = $cache->makeKey(
                        'getExtendedMetadata',
                        $this->getLanguage()->getCode(),
                        (int)$this->singleLang,