/**
  * Returns the filepath. Used for finding image in filesystem.
  *
  * @return string
  */
 public function getFilePath()
 {
     if ($this->srcImage !== null) {
         return $this->srcImage->getPath();
     }
     return $this->filePath;
 }
 public static function castImage(Image $image, array $a, Stub $stub, $isNested, $filter = 0)
 {
     try {
         $a[Caster::PREFIX_PROTECTED . 'info'] = $image->getInfo();
     } catch (IOException $e) {
     }
     return $a;
 }
Exemple #3
0
 /**
  * {@inheritdoc}
  */
 public function getType()
 {
     try {
         return parent::getType();
     } catch (IOException $e) {
         return null;
     }
 }
Exemple #4
0
 /**
  * {@inheritdoc}
  */
 public function listContents($directory = '', $recursive = false)
 {
     $directory = $this->normalizePath($directory);
     try {
         $contents = $this->getAdapter()->listContents($directory, $recursive);
     } catch (Exception $e) {
         throw $this->handleEx($e, $directory);
     }
     $formatter = new Flysystem\Util\ContentListingFormatter($directory, $recursive);
     $contents = $formatter->formatListing($contents);
     $contents = array_map(function ($entry) {
         $type = $this->getTypeFromMetadata($entry);
         $entry['type'] = $type;
         if ($type === 'dir') {
             $handler = new Handler\Directory($this, $entry['path']);
         } elseif ($type === 'image') {
             $handler = Handler\Image::createFromListingEntry($this, $entry);
         } else {
             $handler = Handler\File::createFromListingEntry($this, $entry);
         }
         $handler->setMountPoint($this->mountPoint);
         return $handler;
     }, $contents);
     return $contents;
 }