summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
authorPeter Kokot <peterkokot@gmail.com>2018-10-13 11:22:30 +0200
committerPeter Kokot <peterkokot@gmail.com>2018-10-13 11:22:30 +0200
commit2aa897476fd584c037d2414e18382a7e9531e6db (patch)
tree90e54e2e231e4536f1a97862ea985491d04a9b0b /ext/gd
parent5a0610d8ccf28c318a16786024a711bce5633019 (diff)
downloadphp-git-2aa897476fd584c037d2414e18382a7e9531e6db.tar.gz
Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and syncs them to all include the LF style instead of the CRLF files. Newline characters: - LF (\n) (*nix and Mac) - CRLF (\r\n) (Windows) - CR (\r) (old Mac, obsolete) To see which line endings are in the index and in the working copy the following command can be used: `git ls-files --eol` Git additionally provides `.gitattributes` file to specify if some files need to have specific line endings on all platforms (either CRLF or LF). Changed files shouldn't cause issues on modern Windows platforms because also Git can do output conversion is core.autocrlf=true is set on Windows and use CRLF newlines in all files in the working tree. Unless CRLF files are tracked specifically, Git by default tracks all files in the index using LF newlines.
Diffstat (limited to 'ext/gd')
-rw-r--r--ext/gd/tests/bug47946.phpt102
-rw-r--r--ext/gd/tests/bug52070.phpt50
-rw-r--r--ext/gd/tests/bug73968.phpt30
3 files changed, 91 insertions, 91 deletions
diff --git a/ext/gd/tests/bug47946.phpt b/ext/gd/tests/bug47946.phpt
index c84508509c..aeea7fb324 100644
--- a/ext/gd/tests/bug47946.phpt
+++ b/ext/gd/tests/bug47946.phpt
@@ -1,51 +1,51 @@
---TEST--
-Bug #47946 (ImageConvolution overwrites background)
---DESCRIPTION--
-The expected image has black pixel artifacts, what is another issue, though
-(perhaps #40158).
---SKIPIF--
-<?php
-if (!extension_loaded('gd')) die('skip gd extension not available');
-?>
---FILE--
-<?php
-function array_flatten($array)
-{
- $tempArray = array();
-
- foreach ($array as $value) {
- if (is_array($value)) {
- $tempArray = array_merge($tempArray, array_flatten($value));
- } else {
- $tempArray[] = $value;
- }
- }
-
- return $tempArray;
-}
-
-function makeFilter($resource, $matrix, $offset = 1.0)
-{
- $divisor = array_sum(array_flatten($matrix));
- if ($divisor == 0) {
- $divisor = .01;
- }
- return imageconvolution($resource, $matrix, $divisor, $offset);
-}
-
-$edgeMatrix = array(array(1, 0, 1), array(0, 5, 0), array(1, 0, 1));
-
-$im = imagecreatetruecolor(40, 40);
-imagealphablending($im, false);
-imagefilledrectangle($im, 0, 0, 39, 39, 0x7fffffff);
-imagefilledellipse($im, 19, 19, 20, 20, 0x00ff00);
-imagesavealpha($im, true);
-makeFilter($im, $edgeMatrix);
-
-require_once __DIR__ . '/func.inc';
-test_image_equals_file(__DIR__ . '/bug47946_exp.png', $im);
-?>
-===DONE===
---EXPECT--
-The images are equal.
-===DONE===
+--TEST--
+Bug #47946 (ImageConvolution overwrites background)
+--DESCRIPTION--
+The expected image has black pixel artifacts, what is another issue, though
+(perhaps #40158).
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip gd extension not available');
+?>
+--FILE--
+<?php
+function array_flatten($array)
+{
+ $tempArray = array();
+
+ foreach ($array as $value) {
+ if (is_array($value)) {
+ $tempArray = array_merge($tempArray, array_flatten($value));
+ } else {
+ $tempArray[] = $value;
+ }
+ }
+
+ return $tempArray;
+}
+
+function makeFilter($resource, $matrix, $offset = 1.0)
+{
+ $divisor = array_sum(array_flatten($matrix));
+ if ($divisor == 0) {
+ $divisor = .01;
+ }
+ return imageconvolution($resource, $matrix, $divisor, $offset);
+}
+
+$edgeMatrix = array(array(1, 0, 1), array(0, 5, 0), array(1, 0, 1));
+
+$im = imagecreatetruecolor(40, 40);
+imagealphablending($im, false);
+imagefilledrectangle($im, 0, 0, 39, 39, 0x7fffffff);
+imagefilledellipse($im, 19, 19, 20, 20, 0x00ff00);
+imagesavealpha($im, true);
+makeFilter($im, $edgeMatrix);
+
+require_once __DIR__ . '/func.inc';
+test_image_equals_file(__DIR__ . '/bug47946_exp.png', $im);
+?>
+===DONE===
+--EXPECT--
+The images are equal.
+===DONE===
diff --git a/ext/gd/tests/bug52070.phpt b/ext/gd/tests/bug52070.phpt
index acf56e6b5b..d44a527479 100644
--- a/ext/gd/tests/bug52070.phpt
+++ b/ext/gd/tests/bug52070.phpt
@@ -1,25 +1,25 @@
---TEST--
-Bug #52070 (imagedashedline() - dashed line sometimes is not visible)
---SKIPIF--
-<?php
-if (!extension_loaded('gd')) die('skip gd extension not available');
-?>
---FILE--
-<?php
-$im = imagecreate(1200, 800);
-$background_color = imagecolorallocate($im, 40, 40, 40);
-$color = imagecolorallocate($im, 255, 255, 255);
-imagedashedline($im, 800, 400, 300, 400, $color);
-imagedashedline($im, 800, 400, 300, 800, $color);
-imagedashedline($im, 800, 400, 400, 800, $color);
-imagedashedline($im, 800, 400, 500, 800, $color);
-imagedashedline($im, 800, 400, 600, 800, $color);
-imagedashedline($im, 800, 400, 700, 800, $color);
-imagedashedline($im, 800, 400, 800, 800, $color);
-include_once __DIR__ . '/func.inc';
-test_image_equals_file(__DIR__ . '/bug52070.png', $im);
-?>
-===DONE===
---EXPECT--
-The images are equal.
-===DONE===
+--TEST--
+Bug #52070 (imagedashedline() - dashed line sometimes is not visible)
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip gd extension not available');
+?>
+--FILE--
+<?php
+$im = imagecreate(1200, 800);
+$background_color = imagecolorallocate($im, 40, 40, 40);
+$color = imagecolorallocate($im, 255, 255, 255);
+imagedashedline($im, 800, 400, 300, 400, $color);
+imagedashedline($im, 800, 400, 300, 800, $color);
+imagedashedline($im, 800, 400, 400, 800, $color);
+imagedashedline($im, 800, 400, 500, 800, $color);
+imagedashedline($im, 800, 400, 600, 800, $color);
+imagedashedline($im, 800, 400, 700, 800, $color);
+imagedashedline($im, 800, 400, 800, 800, $color);
+include_once __DIR__ . '/func.inc';
+test_image_equals_file(__DIR__ . '/bug52070.png', $im);
+?>
+===DONE===
+--EXPECT--
+The images are equal.
+===DONE===
diff --git a/ext/gd/tests/bug73968.phpt b/ext/gd/tests/bug73968.phpt
index fd17fe26ba..2211840f58 100644
--- a/ext/gd/tests/bug73968.phpt
+++ b/ext/gd/tests/bug73968.phpt
@@ -1,15 +1,15 @@
---TEST--
-Bug #73968 (Premature failing of XBM reading)
---SKIPIF--
-<?php
-if (!extension_loaded('gd')) die('skip gd extension not available');
-?>
---FILE--
-<?php
-$im = imagecreatefromxbm(__DIR__ . DIRECTORY_SEPARATOR . 'bug73968.xbm');
-var_dump($im);
-?>
-===DONE===
---EXPECTF--
-resource(%d) of type (gd)
-===DONE===
+--TEST--
+Bug #73968 (Premature failing of XBM reading)
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip gd extension not available');
+?>
+--FILE--
+<?php
+$im = imagecreatefromxbm(__DIR__ . DIRECTORY_SEPARATOR . 'bug73968.xbm');
+var_dump($im);
+?>
+===DONE===
+--EXPECTF--
+resource(%d) of type (gd)
+===DONE===