diff --git a/src/Intervention/Image/Gd/Commands/RotateCommand.php b/src/Intervention/Image/Gd/Commands/RotateCommand.php index e02b9176..682ec0d4 100644 --- a/src/Intervention/Image/Gd/Commands/RotateCommand.php +++ b/src/Intervention/Image/Gd/Commands/RotateCommand.php @@ -20,7 +20,7 @@ class RotateCommand extends AbstractCommand $color = new Color($color); // restrict rotations beyond 360 degrees, since the end result is the same - $angle %= 360; + $angle = fmod($angle, 360); // rotate image $image->setCore(imagerotate($image->getCore(), $angle, $color->getInt())); diff --git a/src/Intervention/Image/Imagick/Commands/RotateCommand.php b/src/Intervention/Image/Imagick/Commands/RotateCommand.php index edaef0d3..b3e12a53 100644 --- a/src/Intervention/Image/Imagick/Commands/RotateCommand.php +++ b/src/Intervention/Image/Imagick/Commands/RotateCommand.php @@ -20,7 +20,7 @@ class RotateCommand extends AbstractCommand $color = new Color($color); // restrict rotations beyond 360 degrees, since the end result is the same - $angle %= 360; + $angle = fmod($angle, 360); // rotate image $image->getCore()->rotateImage($color->getPixel(), ($angle * -1));