From a79916a009120b5aea9379c203b18960eba13045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Garc=C3=ADa?= Date: Fri, 4 Sep 2020 10:46:51 +0200 Subject: [PATCH] Allow rotation angle with decimals --- src/Intervention/Image/Gd/Commands/RotateCommand.php | 2 +- src/Intervention/Image/Imagick/Commands/RotateCommand.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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));