Example #1
0
 /**
  * Generate the thumbnail based on the local file system. This step is necessary
  * to simplify things and ensure the correct file permissions are given
  * to the local files.
  * @param $thumbFile
  * @param $thumbPath
  * @param $width
  * @param $height
  * @param $options
  * @throws \Exception
  */
 protected function makeThumbLocal($thumbFile, $thumbPath, $width, $height, $options)
 {
     $rootPath = $this->getLocalRootPath();
     $filePath = $rootPath . '/' . $this->getDiskPath();
     $thumbPath = $rootPath . '/' . $thumbPath;
     /*
      * Handle a broken source image
      */
     if (!$this->hasFile($this->disk_name)) {
         BrokenImage::copyTo($thumbPath);
     } else {
         $resizer = Resizer::open($filePath);
         $resizer->resize($width, $height, $options['mode'], $options['offset']);
         $resizer->save($thumbPath, $options['quality']);
     }
     FileHelper::chmod($thumbPath);
 }