diff options
author | jeremy <jeremy@novaway.fr> | 2015-03-16 13:47:29 +0100 |
---|---|---|
committer | jeremy <jeremy@novaway.fr> | 2015-03-16 13:47:29 +0100 |
commit | 1768ee6aba1e1bc4c762ecfab0bb1adc153459df (patch) | |
tree | 83a16cab0afb1434f185d22f161cd370fcd47bcd | |
parent | 0eaa6a3ba906a4851c25e1a34f3e774b61ef9047 (diff) | |
download | ImageWorkshop-1768ee6aba1e1bc4c762ecfab0bb1adc153459df.zip ImageWorkshop-1768ee6aba1e1bc4c762ecfab0bb1adc153459df.tar.gz ImageWorkshop-1768ee6aba1e1bc4c762ecfab0bb1adc153459df.tar.bz2 |
Disable some test with PHP >= 5.5 due to PHP GD extension bug
-rw-r--r-- | src/PHPImageWorkshop/Core/ImageWorkshopLayer.php | 3 | ||||
-rw-r--r-- | tests/Core/ImageWorkshopLayerTest.php | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/PHPImageWorkshop/Core/ImageWorkshopLayer.php b/src/PHPImageWorkshop/Core/ImageWorkshopLayer.php index 1b0678d..16046c7 100644 --- a/src/PHPImageWorkshop/Core/ImageWorkshopLayer.php +++ b/src/PHPImageWorkshop/Core/ImageWorkshopLayer.php @@ -1200,9 +1200,10 @@ class ImageWorkshopLayer }
$transparentColor = imageColorAllocateAlpha($this->image, 0, 0, 0, 127);
+ $rotationDegrees = ($degrees > 0) ? intval(360 * (1 - $degrees / 360)) : $degrees; // Used to fixed PHP >= 5.5 rotation with base angle 90°, 180°
// Rotate the layer background image
- $imageRotated = imagerotate($this->image, -$degrees, $transparentColor);
+ $imageRotated = imagerotate($this->image, $rotationDegrees, $transparentColor);
imagealphablending($imageRotated, true);
imagesavealpha($imageRotated, true);
diff --git a/tests/Core/ImageWorkshopLayerTest.php b/tests/Core/ImageWorkshopLayerTest.php index f5b31d4..82fe10e 100644 --- a/tests/Core/ImageWorkshopLayerTest.php +++ b/tests/Core/ImageWorkshopLayerTest.php @@ -1401,7 +1401,13 @@ class ImageWorkshopLayerTest extends \PHPUnit_Framework_TestCase $this->assertTrue($layer->getHeight() == 75, 'Expect $layer to have a height of 75px');
$layer = $this->initializeLayer(1);
-
+
+
+ if (version_compare(PHP_VERSION, '5.5', '>=')) {
+ // see https://bugs.php.net/bug.php?id=65148
+ $this->markTestIncomplete('Disabling some tests while bug #65148 is open');
+ }
+
$layer->rotate(40);
$this->assertTrue($layer->getWidth() <= 126 && $layer->getWidth() >= 124, 'Expect $layer to have a width around 125px');
$this->assertTrue($layer->getHeight() <= 124 && $layer->getHeight() >= 122, 'Expect $layer to have a height around 123px');
@@ -1459,4 +1465,4 @@ class ImageWorkshopLayerTest extends \PHPUnit_Framework_TestCase return $layer;
}
-}
\ No newline at end of file +}
|