Rotates an image the number of degrees specified by $rotation

@param int $rotation
9774
public function rotate($rotation)
    {
        if(isset($this->edited)){
            $this->getInfo();
            $this->edited =  imagerotate($this->edited, $rotation, 0);
        } else {
            $this->edited =  imagerotate($this->original, $rotation, 0);
        }

    }
87580
public function apply(ImageInterface $image)
    {

        //        1        2       3      4         5            6           7          8
        //
        //        888888  888888      88  88      8888888888  88                  88  8888888888
        //        88          88      88  88      88  88      88  88          88  88      88  88
        //        8888      8888    8888  8888    88          8888888888  8888888888          88
        //        88          88      88  88
        //        88          88  888888  888888


        switch ($this->orientation) {
            case 2:
                $image->flipHorizontally();
                break;
            case 3:
                $image->rotate(180);
                break;
            case 4:
                $image->flipVertically();
                break;
            case 5:
                $image->rotate(90)->flipHorizontally();
                break;
            case 6:
                $image->rotate(90);
                break;
            case 7:
                $image->rotate(-90)->flipHorizontally();
                break;
            case 8:
                $image->rotate(-90);
                break;
            default:
                break;
        }

        // after rotating the image, we need to reset orientation in Exif data to 1
        if ($image instanceof \Imagine\Imagick\Image) {
            $image->getImagick()->setImageOrientation(1);
        } else {
            // TODO: how can this be done in GD and Gmagick?
            // Workaround: delete all metadata
            $image->strip();
        }
        return $image;
    }
376426
public function rotate($angle, $backgroundColor = -1) {
		if($backgroundColor === -1) {
			$backgroundColor = hexdec($this->getBackgroundColor()->getHexValue());
		}
		$this->image = imagerotate($this->image, $angle, (int) $backgroundColor);
		$this->getSize();
		return $this;
	}
650226
public function rotateImage180(Image $file, $quality = 95)
	{
		$this->rotateImage($file, ImageProcessor\ImageRotator::ROTATE_180, $quality);
	}
394512
private function getOrientation($filename) {
        $exif = @exif_read_data($filename);
        if($exif === null)
            return 0;
        $rotation = 0;
        if (!empty($exif['Orientation'])) {
            switch ($exif['Orientation']) {
                case 3:
                    $rotation = 180;
                    break;
                case 6:
                    $rotation = 90;
                    break;
                case 8:
                    $rotation = -90;
                    break;
            }
        }
        return $rotation;
    }
1229119
private function fixImageOrientation($image)
    {
        $orientation = $image->getImageOrientation();
        switch ($orientation) {
            case \Imagick::ORIENTATION_UNDEFINED:
                break;
            case \Imagick::ORIENTATION_TOPLEFT:
                break;
            case \Imagick::ORIENTATION_TOPRIGHT:
                $image->flopImage();
                $image->setimageorientation(\Imagick::ORIENTATION_TOPLEFT);
                break;
            case \Imagick::ORIENTATION_BOTTOMRIGHT:
                $image->rotateImage(new \ImagickPixel(), 180);
                $image->setimageorientation(\Imagick::ORIENTATION_TOPLEFT);
                break;
            case \Imagick::ORIENTATION_BOTTOMLEFT:
                $image->rotateImage(new \ImagickPixel(), 180);
                $image->flopImage();
                $image->setimageorientation(\Imagick::ORIENTATION_TOPLEFT);
                break;
            case \Imagick::ORIENTATION_LEFTTOP:
                $image->rotateImage(new \ImagickPixel(), 90);
                $image->flopImage();
                $image->setimageorientation(\Imagick::ORIENTATION_TOPLEFT);
                break;
            case \Imagick::ORIENTATION_RIGHTTOP:
                $image->rotateImage(new \ImagickPixel(), 90);
                $image->setimageorientation(\Imagick::ORIENTATION_TOPLEFT);
                break;
            case \Imagick::ORIENTATION_RIGHTBOTTOM:
                $image->rotateImage(new \ImagickPixel(), 270);
                $image->flopImage();
                $image->setimageorientation(\Imagick::ORIENTATION_TOPLEFT);
                break;
            case \Imagick::ORIENTATION_LEFTBOTTOM:
                $image->rotateImage(new \ImagickPixel(), 270);
                $image->setimageorientation(\Imagick::ORIENTATION_TOPLEFT);
                break;
        }

        return $image;
    }
408330
function photos_transform_rotate($photo_id, $degrees)
    {
        /** http://www.flickr.com/services/api/flickr.photos.transform.rotate.html */
        $this->request("flickr.photos.transform.rotate", array("photo_id" => $photo_id, "degrees" => $degrees), TRUE);
        return $this->parsed_response ? true : false;
    }
521037
public function rotate($degree, $background = 0)
    {
        //rotate the image
        $rotate = imagerotate($this->resource, $degree, $background);

        //destroy the original resource
        imagedestroy($this->resource);

        //assign the new resource
        $this->resource = $rotate;

        return $this;
    }
915330
public function rotate(float $degrees)
    {
        $degrees = 360 - $degrees; // match imagick
        $this->data = imagerotate($this->data, $degrees, 0);
    }
1360129
public function rotate($x = 90)
    {
        $this->gdExtensionCheck();

        $file = $this->getFilePath();
        switch ($this->getExt()) {
            case 'png':
                $kaynak = imagecreatefrompng($file);
                unlink($file);
                $rotated = imagerotate($kaynak, $x, 0);
                imagepng($rotated, $file, 10);
                break;
            case 'jpg':
                $kaynak = imagecreatefromjpeg($file);
                unlink($file);

                $rotated = imagerotate($kaynak, $x, 0);
                imagejpeg($rotated, $file, 100);
                break;
            case 'gif':
                $kaynak = imagecreatefromgif($file);
                unlink($file);

                $rotated = imagerotate($kaynak, $x, 0);
                imagegif($rotated, $file);
                break;
        }
        imagedestroy($kaynak);

        return $this;
    }
1168901
public void rotate(Quaternion rotation, Point3D pivot1) {
		if (pivot1==null) {
			rotate(rotation);
		} else {
			Transform3D m = new Transform3D();
			m.setRotation(rotation);

			// Translate to the pivot
			this.getP1().setX(this.getP1().getX() - pivot1.getX());
			this.getP1().setY(this.getP1().getY() - pivot1.getY());
			this.getP1().setZ(this.getP1().getZ() - pivot1.getZ());

			m.transform(this.getP1());

			this.getP1().setX(this.getP1().getX() + pivot1.getX());
			this.getP1().setY(this.getP1().getY() + pivot1.getY());
			this.getP1().setZ(this.getP1().getZ() + pivot1.getZ());

			// Rotate the direction
			m.transform(this.getSegmentVector());
			this.getSegmentVector().normalize();
		}
	}
493525
public static void rotate(Image image, int degree, ImageOutputStream out) throws IORuntimeException {
		writeJpg(rotate(image, degree), out);
	}
326126
public function setRotationAngle($rotationAngle) {
        $this->rotationAngle = intval($rotationAngle);
        $this->font->setRotationAngle($this->rotationAngle);
    }
1274105
public void rotate(double cos, double sin) {
		Transformation2D temp = new Transformation2D();
		temp.setRotate(cos, sin);
		multiply(temp);
	}
396785
public function rotate($angle, $bgColor)
    {
        $this->log("Rotate image " . $angle . " degrees with filler color.");

        $color = $this->getBackgroundColor();
        $this->image = imagerotate($this->image, $angle, $color);

        $this->width  = imagesx($this->image);
        $this->height = imagesy($this->image);

        $this->log("New image dimension width x height: " . $this->width . " x " . $this->height);

        return $this;
    }
772117
public function rotate($degrees, $bgcolor = 0, $transparent = 0) {

		if(false === ('-' . intval($degrees) == '-' . $degrees)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($degrees)), E_USER_ERROR);
		}

		if(false === ('-' . intval($bgcolor) == '-' . $bgcolor)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($bgcolor)), E_USER_ERROR);
		}

		if(false === ('-' . intval($transparent) == '-' . $transparent)) {
			return trigger_error(sprintf('Argument 3 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($transparent)), E_USER_ERROR);
		}

		$this -> add(__FUNCTION__, func_get_args());
		return $this;
	}
1185678
public function rotate($degrees)
    {
        $resampleImageResource =& $this->getResampleImageResource();

        try {

            $resampleImageResource->rotateimage('#000000', $degrees);

            return true;

        } catch (\GmagickException $e) {

            $this->errors[ $e->getCode() ] = $e->getMessage();

        }

        return false;
    }