Fixed more terse arrays for PHP5.3 . Added debugging for deconstructGif as it takes less than a second locally, but times out in Travis.

This commit is contained in:
Danack
2015-02-09 19:10:30 +00:00
parent bc038800a0
commit f5aca2879f
4 changed files with 16 additions and 9 deletions
+3 -3
View File
@@ -62,9 +62,9 @@ function createGradientImage($width, $height, $colorPoints, $sparseMethod, $abso
function renderImageBarycentric() {
$points = array(
[0, 0, 'skyblue'],
[-1, 1, 'skyblue'],
[1, 1, 'black'],
array(0, 0, 'skyblue'),
array(-1, 1, 'skyblue'),
array(1, 1, 'black'),
);
$imagick = createGradientImage(600, 200, $points, \Imagick::SPARSECOLORMETHOD_BARYCENTRIC);
$bytes = $imagick->getImageBlob();
@@ -16,7 +16,7 @@ function setStrokeDashOffset($strokeColor, $fillColor, $backgroundColor) {
$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);
$draw->setStrokeWidth(4);
$draw->setStrokeDashArray([20, 20]);
$draw->setStrokeDashArray(array(20, 20));
$draw->setStrokeDashOffset(0);
$draw->rectangle(100, 50, 225, 175);
@@ -17,16 +17,16 @@ function setStrokeDashArray($strokeColor, $fillColor, $backgroundColor) {
$draw->setFillColor($fillColor);
$draw->setStrokeWidth(4);
$draw->setStrokeDashArray([10, 10]);
$draw->setStrokeDashArray(array(10, 10));
$draw->rectangle(100, 50, 225, 175);
$draw->setStrokeDashArray([20, 5, 20, 5, 5, 5,]);
$draw->setStrokeDashArray(array(20, 5, 20, 5, 5, 5,));
$draw->rectangle(275, 50, 400, 175);
$draw->setStrokeDashArray([20, 5, 20, 5, 5]);
$draw->setStrokeDashArray(array(20, 5, 20, 5, 5));
$draw->rectangle(100, 200, 225, 350);
$draw->setStrokeDashArray([1, 1, 1, 1, 2, 2, 3, 3, 5, 5, 8, 8, 13, 13, 21, 21, 34, 34, 55, 55, 89, 89, 144, 144, 233, 233, 377, 377, 610, 610, 987, 987, 1597, 1597, 2584, 2584, 4181, 4181,]);
$draw->setStrokeDashArray(array(1, 1, 1, 1, 2, 2, 3, 3, 5, 5, 8, 8, 13, 13, 21, 21, 34, 34, 55, 55, 89, 89, 144, 144, 233, 233, 377, 377, 610, 610, 987, 987, 1597, 1597, 2584, 2584, 4181, 4181,));
$draw->rectangle(275, 200, 400, 350);
+8 -1
View File
@@ -29,7 +29,8 @@ function makeSimpleGif($deconstruct) {
$backgroundPalette->addimage($blackWhitePalette);
for($count=0 ; $count<$imageFrames ; $count++){
for($count=0 ; $count<$imageFrames ; $count++) {
echo "Frame: ".$imageFrames."\n";
$drawing = new \ImagickDraw();
$drawing->setFillColor('white');
$drawing->setStrokeColor('rgba(64, 64, 64, 0.8)');
@@ -60,4 +61,10 @@ makeSimpleGif($deconstruct) ;
echo "Ok";
?>
--EXPECTF--
Frame: 1
Frame: 2
Frame: 3
Frame: 4
Frame: 5
Frame: 6
Ok