From b120be82c2c8896d4226628635ed9bd1dc28effa Mon Sep 17 00:00:00 2001 From: Baptiste DUCATEL Date: Fri, 10 Feb 2017 16:13:02 +0100 Subject: [PATCH] Fix rgba string with non-localized number --- src/Intervention/Image/Gd/Color.php | 2 +- src/Intervention/Image/Gd/Commands/OpacityCommand.php | 2 +- src/Intervention/Image/Imagick/Color.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Intervention/Image/Gd/Color.php b/src/Intervention/Image/Gd/Color.php index 51ba1606..5238831f 100644 --- a/src/Intervention/Image/Gd/Color.php +++ b/src/Intervention/Image/Gd/Color.php @@ -177,7 +177,7 @@ class Color extends AbstractColor */ public function getRgba() { - return sprintf('rgba(%d, %d, %d, %.2f)', $this->r, $this->g, $this->b, round(1 - $this->a / 127, 2)); + return sprintf('rgba(%d, %d, %d, %.2F)', $this->r, $this->g, $this->b, round(1 - $this->a / 127, 2)); } /** diff --git a/src/Intervention/Image/Gd/Commands/OpacityCommand.php b/src/Intervention/Image/Gd/Commands/OpacityCommand.php index 201fcabc..081e68a4 100644 --- a/src/Intervention/Image/Gd/Commands/OpacityCommand.php +++ b/src/Intervention/Image/Gd/Commands/OpacityCommand.php @@ -18,7 +18,7 @@ class OpacityCommand extends \Intervention\Image\Commands\AbstractCommand $size = $image->getSize(); // build temp alpha mask - $mask_color = sprintf('rgba(0, 0, 0, %.1f)', $transparency / 100); + $mask_color = sprintf('rgba(0, 0, 0, %.1F)', $transparency / 100); $mask = $image->getDriver()->newImage($size->width, $size->height, $mask_color); // mask image diff --git a/src/Intervention/Image/Imagick/Color.php b/src/Intervention/Image/Imagick/Color.php index a914feea..3940993e 100644 --- a/src/Intervention/Image/Imagick/Color.php +++ b/src/Intervention/Image/Imagick/Color.php @@ -163,7 +163,7 @@ class Color extends \Intervention\Image\AbstractColor */ public function getRgba() { - return sprintf('rgba(%d, %d, %d, %.2f)', + return sprintf('rgba(%d, %d, %d, %.2F)', $this->getRedValue(), $this->getGreenValue(), $this->getBlueValue(), @@ -248,7 +248,7 @@ class Color extends \Intervention\Image\AbstractColor $a = is_null($a) ? 1 : $a; return $this->pixel = new \ImagickPixel( - sprintf('rgba(%d, %d, %d, %.2f)', $r, $g, $b, $a) + sprintf('rgba(%d, %d, %d, %.2F)', $r, $g, $b, $a) ); }