Rotates image specified number of degrees

@param int $degrees
@return GdThumb
428476
public function rotateImageNDegrees ($degrees)
	{
		if (!is_numeric($degrees))
		{
			throw new InvalidArgumentException('$degrees must be numeric');
		}
		
		if (!function_exists('imagerotate'))
		{
			throw new RuntimeException('Your version of GD does not support image rotation.');
		}
		
		$this->workingImage = imagerotate($this->oldImage, $degrees, 0);
    	
		$newWidth 							= $this->currentDimensions['height'];
    	$newHeight 							= $this->currentDimensions['width'];
		$this->oldImage 					= $this->workingImage;
		$this->currentDimensions['width'] 	= $newWidth;
		$this->currentDimensions['height'] 	= $newHeight;
		
		return $this;
	}
169647
public function setAngleDegrees($degree)
	{
		if ( ! is_numeric($degree))
		{
			throw new \InvalidArgumentException('Angle degrees must be a numeric.');
		}
		
		$this->setAngle($degree * pi() / 180);
		
		return $this;
	}
916390
public function trimPerc($coords) {
        list($x1, $y1, $x2, $y2) = $coords;
        $size = (object) $this->thumb->getCurrentDimensions();

        // Convert percentage values to what GdThumb expects
        $x = round($x1 * $size->width);
        $y = round($y1 * $size->height);
        $width = round($x2 * $size->width - $x);
        $height = round($y2 * $size->height - $y);
        $this->thumb->crop($x, $y, $width, $height);
        return $this;
    }
375975
public function arc(Array $settings = []) : GD
    {
        $x      = $settings['x']       ?? $this->x      ?? 0;
        $y      = $settings['y']       ?? $this->y      ?? 0;
        $width  = $settings['width']   ?? $this->width  ?? 100;
        $height = $settings['height']  ?? $this->height ?? 100;
        $start  = $settings['start']   ?? $this->start  ?? 0;
        $end    = $settings['end']     ?? $this->end    ?? 360;
        $color  = $settings['color']   ?? $this->color  ?? '0|0|0';
        $style  = $settings['type']    ?? $this->type   ?? NULL;

        if( $style === NULL )
        {
            imagearc($this->canvas, $x, $y, $width, $height, $start, $end, $this->allocate($color));
        }
        else
        {
            imagefilledarc
            (
                $this->canvas, $x, $y, $width, $height, $start, $end,
                $this->allocate($color),
                Helper::toConstant($style, 'IMG_ARC_')
            );
        }
        
        $this->defaultRevolvingVariables();

        return $this;
    }
930297
public function rotate($value = 90, $bgColor = 'transparent')
		# Author:     Jarrod Oberto
		# Date:       07-05-2011
		# Purpose:    Rotate image
		# Param in:   (mixed) $degrees: (int) number of degress to rotate image
		#               (str) param "left": rotate left
		#               (str) param "right": rotate right
		#               (str) param "upside": upside-down image
		# Param out:
		# Reference:
		# Notes:    The default direction of imageRotate() is counter clockwise.
		#
	{
		if ($this->imageResized)
		{

			if (is_integer($value))
			{
				$degrees = $value;
			}

			// *** Convert color
			$rgbArray = $this->formatColor($bgColor);
			$r = $rgbArray['r'];
			$g = $rgbArray['g'];
			$b = $rgbArray['b'];
			if (isset($rgbArray['a']))
			{
				$a = $rgbArray['a'];
			}

			if (is_string($value))
			{

				$value = fix_strtolower($value);

				switch ($value)
				{
					case 'left':
						$degrees = 90;
						break;
					case 'right':
						$degrees = 270;
						break;
					case 'upside':
						$degrees = 180;
						break;
					default:
						break;
				}

			}

			// *** The default direction of imageRotate() is counter clockwise
			//   * This makes it clockwise
			$degrees = 360 - $degrees;

			// *** Create background color
			$bg = ImageColorAllocateAlpha($this->imageResized, $r, $g, $b, $a);

			// *** Fill with background
			ImageFill($this->imageResized, 0, 0, $bg);

			// *** Rotate
			$this->imageResized = imagerotate($this->imageResized, $degrees, $bg); // Rotate 45 degrees and allocated the transparent colour as the one to make transparent (obviously)

			// Ensure alpha transparency
			ImageSaveAlpha($this->imageResized, true);

		}
	}
1301949
public function rotate($rotation = 0, $background = 0)
	{
		if (empty($this->resource))
		{
			return false;
		}
		$resource = imagerotate($this->resource, $rotation, $background);
		imagedestroy($this->resource);
		$this->resource = $resource;
	}
149803
private function writeDegrees(float $degrees, string $positive, string $negative): string
    {
        if ($degrees < 0.0) {
            return sprintf(self::DEGREE_FORMAT, $degrees, $negative);
        }

        return sprintf(self::DEGREE_FORMAT, $degrees, $positive);
    }
426419
public function rotate($angle = 90, $background = '#fff', $ignore = 0) {
		$this->image = imagerotate($this->image, $angle, $this->getColorWithRGB($background), $ignore);
		return $this->image !== false;
	}
598231
public Img rotate(int degree) {
		final BufferedImage image = getValidSrcImg();
		int width = image.getWidth(null);
		int height = image.getHeight(null);
		final Rectangle rectangle = calcRotatedSize(width, height, degree);
		final BufferedImage targetImg = new BufferedImage(rectangle.width, rectangle.height, getTypeInt());
		Graphics2D graphics2d = targetImg.createGraphics();
		// 抗锯齿
		graphics2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
		// 从中心旋转
		graphics2d.translate((rectangle.width - width) / 2, (rectangle.height - height) / 2);
		graphics2d.rotate(Math.toRadians(degree), width / 2, height / 2);
		graphics2d.drawImage(image, 0, 0, null);
		graphics2d.dispose();
		this.targetImage = targetImg;
		return this;
	}
441011
public function rotate($degrees)
    {
        $supportedRotations = [
            0,
            90,
            180,
            270,
        ];

        $this->assertInArray($degrees, $supportedRotations);

        $this->valueArguments['rotation'] = $degrees;

        return $this;
    }
97600
public function rotate($angle = 0)
    {
        if ($this->resource) {
            $this->resource = imagerotate($this->resource, $angle, 0);
        }

        return $this;
    }
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;
    }
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;
    }
185516
public function rotate($angle)
    {
        $this->setResource(imagerotate($this->resource, $angle , $this->BackgroundColor));
    }
1349146
public function flip($horizontal = true) {
		if (function_exists('imageflip')) {
			imageflip($this->_image, $horizontal ? IMG_FLIP_HORIZONTAL : IMG_FLIP_VERTICAL);
		} else {
			$image = imagecreatetruecolor($this->width, $this->height);
			imagealphablending($image, false);
			imagesavealpha($image, true);
			if ($horizontal) {
				$dst_y = 0;
				$src_y = 0;
				$coordinate = ($this->width - 1);
				foreach (range($this->width, 0) as $range) {
					$src_x = $range;
					$dst_x = $coordinate - $range;
					imagecopy($image, $this->_image, $dst_x, $dst_y, $src_x, $src_y, 1, $this->height);
				}
			} else {
				$dst_x = 0;
				$src_x = 0;
				$coordinate = ($this->height - 1);
				foreach (range($this->height, 0) as $range) {
					$src_y = $range;
					$dst_y = $coordinate - $range;
					imagecopy($image, $this->_image, $dst_x, $dst_y, $src_x, $src_y, $this->width, 1);
				}
			}
			imagedestroy($this->_image);
			$this->_image = $image;
		}
		return $this;
	}
448575
public function flip($direction)
    {

        $new = imagecreatetruecolor($this->width, $this->height);
        imagealphablending($new, false);
        imagesavealpha($new, true);

        switch (strtolower($direction)) {

            case 'y':
                for ($y = 0; $y < $this->height; $y++) {
                    imagecopy($new, $this->image, 0, $y, 0, $this->height - $y - 1, $this->width, 1);
                }
                break;

            default:
                for ($x = 0; $x < $this->width; $x++) {
                    imagecopy($new, $this->image, $x, 0, $this->width - $x - 1, 0, 1, $this->height);
                }
                break;

        }

        $this->image = $new;

        return $this;

    }
1136595
def rotate(self, deg, **kwargs):
        
        opts = Image._normalize_options(kwargs)

        if deg == "auto":
            if self._orig_format == "JPEG":
                try:
                    exif = self.img._getexif() or dict()
                    deg = _orientation_to_rotation.get(exif.get(274, 0), 0)
                except Exception:
                    logger.warn('unable to parse exif')
                    deg = 0
            else:
                deg = 0

        deg = 360 - (int(deg) % 360)
        if deg % 90 == 0:
            if deg == 90:
                self.img = self.img.transpose(PIL.Image.ROTATE_90)
            elif deg == 180:
                self.img = self.img.transpose(PIL.Image.ROTATE_180)
            elif deg == 270:
                self.img = self.img.transpose(PIL.Image.ROTATE_270)
        else:
            self.img = self.img.rotate(deg, expand=bool(int(opts["expand"])))

        return self