Returns the Exif metadata of this file,
or of its specified revision.

@param   mixed  $revision  The index or timestamp of the revision (optional)
@return  mixed             The metadata of this file (array),
or null if revision not found
772216
public function getMetadata($revision = null)
	{
		// Without revision, use current info
		if (!isset($revision)) {
			return $this->info['metadata'];
		}

		// Obtain the properties of the revision
		if (($info = $this->getRevision($revision)) === null) {
			return null;
		}

		return $info['metadata'];
	}
206087
public function getUrl($revision = null)
	{
		// Without revision, use current info
		if (!isset($revision)) {
			return $this->info['url'];
		}

		// Obtain the properties of the revision
		if (($info = $this->getRevision($revision)) === null) {
			return null;
		}

		return $info['url'];
	}
147562
public function getMetadata($key)
    {
        if (!is_array($this->metadata)) {
            $this->metadata = json_decode(json_encode($this->metadata), true);
        }
        return (isset($this->metadata[$key])) ? $this->metadata[$key] : null;
    }
1023106
public function findVersionOfFile($file, $version)
    {
        if($file == null || ($f2 = $this->findOriginalFileToVersion($file)) == null ||
            $file->getAbsoluteFilePath() != $f2->getAbsoluteFilePath()){
            return null;
        }
        $name = $this->versionFileName($file, $version);
        $f = new FileImpl($file->getParentFolder()->getAbsolutePath()."/".$name);
        return $this->containsFile($f)?$f:null;
    }
350293
public function getTimestamp($revision = null)
	{
		// Without revision, use current info
		if (!isset($revision)) {
			return $this->info['timestamp'];
		}

		// Obtain the properties of the revision
		if (($info = $this->getRevision($revision)) === null) {
			return null;
		}

		return $info['timestamp'];
	}
1224401
private function getRevision($document)
    {
        $revision = null;

        if ($document instanceof Document) {
            $revision = $document->getRevision();
        }

        return $revision;
    }
745511
public function getComment($revision = null)
	{
		// Without revision, use current info
		if (!isset($revision)) {
			return $this->info['comment'];
		}

		// Obtain the properties of the revision
		if (($info = $this->getRevision($revision)) === null) {
			return null;
		}

		return $info['comment'];
	}
1269602
public final function getMetadata($key = null)
   {
       return isset($key)
            ? (array_key_exists($key, $this->meta) ? $this->meta[$key] : null)
            : $this->meta;
   }
68
public function getChangedFiles($rev)
    {
        $raw_changes = $this->execute('hg status --change ' . $rev);
        $this->repository_type = 'hg';

        $changes = [];
        foreach ($raw_changes as $key => $change) {
            $exploded_change = explode(' ', $change);
            $changes[$key]['type'] = $exploded_change[0];
            $changes[$key]['path'] = $exploded_change[1];
        }

        return $changes;
    }
1041276
public function getMetadata($key = null, $default = null)
    {
        if (null === $key) {
            return $this->metadata;
        }

        if (!is_scalar($key)) {
            throw new Exception\InvalidArgumentException('Non-scalar argument provided for key');
        }

        if (array_key_exists($key, $this->metadata)) {
            return $this->metadata[$key];
        }

        return $default;
    }
177096
public function getFormattedImage($format)
    {
        $formatName = $format instanceof FormatInterface
            ? $format->getName()
            : $format
        ;

        return $this->formattedImages
            ->filter(function (FormattedImageInterface $formattedImage) use ($formatName) {
                return ($format = $formattedImage->getFormat())
                    && $format->getName() == $formatName
                ;
            })
            ->first() ?: null // first() returns "false" if collection empty
        ;
    }
699251
private function getMessage($revision)
    {
        switch ($revision->key) {
            case 'created_at':
                return $this->getResponsibleInfo($revision) . ' created user '
                    . $this->getAffectedResourceName($revision) . ' (' . $revision->revisionable_id . ')';
            case 'deleted_at':
                return $this->getResponsibleInfo($revision) . ' deleted user '
                    . $this->getAffectedResourceName($revision) . ' (' . $revision->revisionable_id . ')';
            default:
                return $this->getResponsibleInfo($revision) . ' changed user '
                    . $this->getAffectedResourceName($revision) . ' (' . $revision->revisionable_id . ')'
                    . ' field ' .  $revision->fieldName() . ' from ' .$revision->oldValue() . ' to ' .
                    $revision->newValue();
        }
    }
537922
public function viewRevisionAction($rev)
    {
        $revision = $this->getAuditReader()->findRevision($rev);
        if (!$revision) {
            throw $this->createNotFoundException(sprintf('Revision %s not found', $rev));
        }

        $changedEntities = $this->getAuditReader()->findEntitiesChangedAtRevision($rev);

        return $this->render('SimpleThingsEntityAuditBundle:Audit:view_revision.html.twig', array(
            'revision' => $revision,
            'changedEntities' => $changedEntities,
        ));
    }
1172087
private function getAffectedResourceName($revision)
    {
        if ($revision->historyOf()) {
            return $revision->historyOf()->name;
        }
        if ($revision->key == 'deleted_at') {
            $oldUser = json_decode($revision->old_value);
            if($oldUser) {
                return $oldUser->name;
            }
        }
        return 'Non existing user';
    }
1244474
private function getRollbackParams( Revision $revision, $title ) {
		$params = [];
		if ( !is_null( $title ) ) {
			// This is needed prior to https://gerrit.wikimedia.org/r/#/c/133063/
			$params['title'] = $title->getTitle();
		} else {
			// This will work after https://gerrit.wikimedia.org/r/#/c/133063/
			$params['pageid'] = $revision->getPageId();
		}
		$params['user'] = $revision->getUser();
		$params['token'] = $this->getTokenForRevision( $revision );

		return $params;
	}
1269245
public function modified($file, $rev=NULL, $type='sandbox')
	{
		$result = $this->metadata($file, false, false, true, $rev, $type);
		return strtotime($result['modified']);
	}
358767
public function shouldProcess(Version $version)
    {
        $result = false;
        if (ExifMetadataReader::isSupported()) {
            if ($version->getTypeObject()->getName() == 'JPEG') {
                try {
                    $metadata = $version->hasImagineImage() ? $version->getImagineImage()->metadata() : null;
                    if ($metadata === null) {
                        $fr = $version->getFileResource();
                        $medatadaReader = new ExifMetadataReader();
                        $metadata = $medatadaReader->readData($fr->read());
                    }
                    switch ($metadata->get('ifd0.Orientation', null)) {
                        case 2: // top-right
                        case 3: // bottom-right
                        case 4: // bottom-left
                        case 5: // left-top
                        case 6: // right-top
                        case 7: // right-bottom
                        case 8: // left-bottom
                            $result = true;
                            break;
                    }
                } catch (Exception $x) {
                } catch (Throwable $x) {
                }
            }
        }

        return $result;
    }