/** * @param \Imagine\Image\AbstractImage $oImage * @param int $iOrientation */ private function rotateImageByOrientation(&$oImage, $iOrientation) { if (0 < $iOrientation) { switch ($iOrientation) { default: case 1: break; case 2: // horizontal flip $oImage->flipHorizontally(); break; case 3: // 180 rotate left $oImage->rotate(180); break; case 4: // vertical flip $oImage->flipVertically(); break; case 5: // vertical flip + 90 rotate right $oImage->flipVertically(); $oImage->rotate(-90); break; case 6: // 90 rotate right $oImage->rotate(-90); break; case 7: // horizontal flip + 90 rotate right $oImage->flipHorizontally(); $oImage->rotate(-90); break; case 8: // 90 rotate left $oImage->rotate(90); break; } } }
/** * Wrapper for rotate * * @param array Array of options for processing the image. * @return $this */ public function rotate(array $options = []) { $this->_image->rotate($options['degree']); return $this; }