* @see http://exif.org/Exif2-2.PDF The Exif 2.2 specification
* @file
*/
+use MediaWiki\MediaWikiServices;
+use Wikimedia\Timestamp\TimestampException;
/**
* Format Image metadata values into a human readable form.
unset( $tags['ResolutionUnit'] );
foreach ( $tags as $tag => &$vals ) {
-
// This seems ugly to wrap non-array's in an array just to unwrap again,
// especially when most of the time it is not an array
if ( !is_array( $tags[$tag] ) ) {
}
foreach ( $vals as &$val ) {
-
switch ( $tag ) {
case 'Compression':
switch ( $val ) {
* @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,
protected function getExtendedMetadataFromHook( File $file, array $extendedMetadata,
&$maxCacheTime
) {
-
Hooks::run( 'GetExtendedMetadata', [
&$extendedMetadata,
$file,
$field['value'] = $this->resolveMultivalueValue( $field['value'] );
}
}
-
}
/**