示例#1
0
文件: image.php 项目: ZyXelP/oxwall
 public function rotate($angle, $bgColor = null, $ignoreTransparent = true)
 {
     if ((int) $angle !== 0) {
         $this->image = $this->image->rotate($angle, $bgColor, $ignoreTransparent);
     }
     return $this;
 }
示例#2
0
 /**
  * Rotates and mirrors and image properly based on current orientation value
  *
  * @param WideImage_Image $img
  * @param int $orientation
  * @return WideImage_Image
  */
 function execute($img, $orientation)
 {
     switch ($orientation) {
         case 2:
             return $img->mirror();
             break;
         case 3:
             return $img->rotate(180);
             break;
         case 4:
             return $img->rotate(180)->mirror();
             break;
         case 5:
             return $img->rotate(90)->mirror();
             break;
         case 6:
             return $img->rotate(90);
             break;
         case 7:
             return $img->rotate(-90)->mirror();
             break;
         case 8:
             return $img->rotate(-90);
             break;
         default:
             return $img->copy();
     }
 }
示例#3
0
文件: image.php 项目: vazahat/dudex
 public function orientateImage()
 {
     if (!function_exists('exif_read_data')) {
         return $this;
     }
     $exif = exif_read_data($this->sourcePath);
     if (!empty($exif['Orientation'])) {
         switch ($exif['Orientation']) {
             case 8:
                 $this->image = $this->image->rotate(-90);
                 break;
             case 3:
                 $this->image = $this->image->rotate(180);
                 break;
             case 6:
                 $this->image = $this->image->rotate(90);
                 break;
         }
     }
     return $this;
 }