Beispiel #1
0
 /**
  * Make a new image
  * @param MediaPath      $path
  * @param string      $filename
  * @param string null $thumbnail
  */
 private function makeNew(MediaPath $path, $filename, $thumbnail)
 {
     $image = $this->image->make($path->getUrl());
     foreach ($this->manager->find($thumbnail) as $manipulation => $options) {
         $image = $this->imageFactory->make($manipulation)->handle($image, $options);
     }
     $image = $image->stream(pathinfo($path, PATHINFO_EXTENSION));
     $this->writeImage($filename, $image);
 }
Beispiel #2
0
 /**
  * Make a new image
  * @param string      $path
  * @param string      $filename
  * @param string null $thumbnail
  */
 private function makeNew($path, $filename, $thumbnail)
 {
     $image = $this->image->make(public_path() . $path);
     foreach ($this->manager->find($thumbnail) as $manipulation => $options) {
         $image = $this->imageFactory->make($manipulation)->handle($image, $options);
     }
     $image = $image->encode(pathinfo($path, PATHINFO_EXTENSION));
     $this->writeImage($filename, $image);
 }