+
+ public function getDisplayedFile() {
+ $this->loadFile();
+ return $this->displayImg;
+ }
+
+ public function getDuplicates() {
+ $this->loadFile();
+ if ( !is_null($this->dupes) ) {
+ return $this->dupes;
+ }
+ if ( !( $hash = $this->img->getSha1() ) ) {
+ return $this->dupes = array();
+ }
+ $dupes = RepoGroup::singleton()->findBySha1( $hash );
+ // Remove duplicates with self and non matching file sizes
+ $self = $this->img->getRepoName().':'.$this->img->getName();
+ $size = $this->img->getSize();
+ foreach ( $dupes as $index => $file ) {
+ $key = $file->getRepoName().':'.$file->getName();
+ if ( $key == $self )
+ unset( $dupes[$index] );
+ if ( $file->getSize() != $size )
+ unset( $dupes[$index] );
+ }
+ return $this->dupes = $dupes;
+
+ }
+