Esempio n. 1
0
 /**
  * Get all thumb details
  *
  * @param File $file
  * @return array
  * @throws \Crip\FileManager\Exceptions\FileManagerException
  */
 public function details(File $file)
 {
     $thumbs = collect([]);
     if ($file->isImage()) {
         collect(array_keys($this->sizes))->each(function ($size) use($thumbs, $file) {
             list($width, $height) = getimagesize($this->getPath()->thumbPath($size, $file));
             $thumbs->put($size, ['url' => $this->url->forName($this->getPath(), $file->fullName(), $size), 'size' => [$width, $height]]);
         });
     }
     return $thumbs->all();
 }
Esempio n. 2
0
 /**
  * Update file url
  * @throws FileManagerException
  */
 private function updateUrl()
 {
     $this->file->url = $this->url->forName($this->getPath(), $this->fullName());
 }