Beispiel #1
1
 /**
  * Perform orientation image manipulation.
  * @param  Image $image The source image.
  * @return Image The manipulated image.
  */
 public function run(Image $image)
 {
     $orientation = $this->getOrientation();
     if ($orientation === 'auto') {
         return $image->orientate();
     }
     return $image->rotate($orientation);
 }
Beispiel #2
0
 /**
  * Perform orientation image manipulation.
  * @param  Request $request The request object.
  * @param  Image   $image   The source image.
  * @return Image   The manipulated image.
  */
 public function run(Request $request, Image $image)
 {
     $orientation = $this->getOrientation($request->get('or'));
     if ($orientation === 'auto') {
         return $image->orientate();
     }
     return $image->rotate($orientation);
 }
Beispiel #3
0
 protected function rotation()
 {
     // Auto orientate
     $this->image->orientate();
     if ($this->flip) {
         $this->image->flip($this->flip);
     }
     // Rotate within the existing frame
     if ($this->rotation) {
         $width = $this->image->getWidth();
         $height = $this->image->getHeight();
         $this->image->rotate($this->rotation);
         $this->image->crop($width, $height);
     }
     // Rotate entire image
     if ($this->orientation) {
         $this->image->rotate($this->orientation);
     }
 }
Beispiel #4
0
 /**
  * Handle the image manipulation request
  * @param  \Intervention\Image\Image $image
  * @param  array                     $options
  * @return \Intervention\Image\Image
  */
 public function handle($image, $options)
 {
     return $image->orientate();
 }
 public function applyFilter(Image $image)
 {
     return $image->orientate();
 }