summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-02-03 22:52:20 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-02-03 22:52:20 +0100
commitf8d795820e780a6322e054c26c581570613c14f0 (patch)
tree99d3ae01ce564752807341c5743863b4c92513f8 /ext/gd
parentd2cb200e10ada6fa44c54a29292bb4665728fff0 (diff)
downloadphp-git-f8d795820e780a6322e054c26c581570613c14f0.tar.gz
Reindent phpt files
Diffstat (limited to 'ext/gd')
-rw-r--r--ext/gd/tests/bug22544-mb.phpt14
-rw-r--r--ext/gd/tests/bug22544.phpt14
-rw-r--r--ext/gd/tests/bug24155.phpt24
-rw-r--r--ext/gd/tests/bug24594.phpt116
-rw-r--r--ext/gd/tests/bug42434.phpt4
-rw-r--r--ext/gd/tests/bug43073.phpt42
-rw-r--r--ext/gd/tests/bug43475.phpt32
-rw-r--r--ext/gd/tests/bug44849.phpt2
-rw-r--r--ext/gd/tests/bug49600.phpt2
-rw-r--r--ext/gd/tests/bug53504.phpt20
-rw-r--r--ext/gd/tests/bug64641.phpt16
-rw-r--r--ext/gd/tests/bug67248.phpt2
-rw-r--r--ext/gd/tests/bug72339.phpt2
-rw-r--r--ext/gd/tests/bug72709.phpt2
-rw-r--r--ext/gd/tests/colorat.phpt6
-rw-r--r--ext/gd/tests/colorclosest.phpt20
-rw-r--r--ext/gd/tests/colorresolve.phpt20
-rw-r--r--ext/gd/tests/copy.phpt8
-rw-r--r--ext/gd/tests/copypalette.phpt14
-rw-r--r--ext/gd/tests/copyresized.phpt44
-rw-r--r--ext/gd/tests/createfromstring.phpt8
-rw-r--r--ext/gd/tests/createfromwbmp2.phpt4
-rw-r--r--ext/gd/tests/createfromwbmp2_extern.phpt4
-rw-r--r--ext/gd/tests/dashedlines.phpt6
-rw-r--r--ext/gd/tests/func.inc142
-rw-r--r--ext/gd/tests/gd_info_basic.phpt6
-rw-r--r--ext/gd/tests/gdimage_prevent_serialization.phpt2
-rw-r--r--ext/gd/tests/gif.phpt84
-rw-r--r--ext/gd/tests/gif2gd.phpt18
-rw-r--r--ext/gd/tests/gif2jpg.phpt10
-rw-r--r--ext/gd/tests/gif2png.phpt10
-rw-r--r--ext/gd/tests/imagefilter.phpt130
-rw-r--r--ext/gd/tests/imagefttext.phpt54
-rw-r--r--ext/gd/tests/imageinterpolation_basic.phpt46
-rw-r--r--ext/gd/tests/imagewbmp-mb.phpt6
-rw-r--r--ext/gd/tests/imagewbmp.phpt6
-rw-r--r--ext/gd/tests/jpeg2png.phpt34
-rw-r--r--ext/gd/tests/jpg2gd-mb.phpt34
-rw-r--r--ext/gd/tests/jpg2gd.phpt34
-rw-r--r--ext/gd/tests/libgd00106.phpt4
-rw-r--r--ext/gd/tests/libgd00191.phpt4
-rw-r--r--ext/gd/tests/lines.phpt38
-rw-r--r--ext/gd/tests/png2gd.phpt34
-rw-r--r--ext/gd/tests/pngcomp.phpt6
-rw-r--r--ext/gd/tests/types.phpt10
-rw-r--r--ext/gd/tests/xbm2png.phpt10
-rw-r--r--ext/gd/tests/xpm2gd.phpt18
-rw-r--r--ext/gd/tests/xpm2jpg.phpt10
-rw-r--r--ext/gd/tests/xpm2png.phpt10
49 files changed, 593 insertions, 593 deletions
diff --git a/ext/gd/tests/bug22544-mb.phpt b/ext/gd/tests/bug22544-mb.phpt
index 0847214dc3..ae347edd70 100644
--- a/ext/gd/tests/bug22544-mb.phpt
+++ b/ext/gd/tests/bug22544-mb.phpt
@@ -8,13 +8,13 @@ Bug #22544 (TrueColor transparency in PNG images).
?>
--FILE--
<?php
- $image = imageCreateTruecolor(640, 100);
- $transparent = imageColorAllocate($image, 0, 0, 0);
- $red = imageColorAllocate($image, 255, 50, 50);
- imageColorTransparent($image, $transparent);
- imageFilledRectangle($image, 0, 0, 640-1, 100-1, $transparent);
- include_once __DIR__ . '/func.inc';
- test_image_equals_file(__DIR__ . '/bug22544私はガラスを食べられます.png', $image);
+ $image = imageCreateTruecolor(640, 100);
+ $transparent = imageColorAllocate($image, 0, 0, 0);
+ $red = imageColorAllocate($image, 255, 50, 50);
+ imageColorTransparent($image, $transparent);
+ imageFilledRectangle($image, 0, 0, 640-1, 100-1, $transparent);
+ include_once __DIR__ . '/func.inc';
+ test_image_equals_file(__DIR__ . '/bug22544私はガラスを食べられます.png', $image);
?>
--EXPECT--
The images are equal.
diff --git a/ext/gd/tests/bug22544.phpt b/ext/gd/tests/bug22544.phpt
index 3d4335d461..c7b1e91966 100644
--- a/ext/gd/tests/bug22544.phpt
+++ b/ext/gd/tests/bug22544.phpt
@@ -8,13 +8,13 @@ Bug #22544 (TrueColor transparency in PNG images).
?>
--FILE--
<?php
- $image = imageCreateTruecolor(640, 100);
- $transparent = imageColorAllocate($image, 0, 0, 0);
- $red = imageColorAllocate($image, 255, 50, 50);
- imageColorTransparent($image, $transparent);
- imageFilledRectangle($image, 0, 0, 640-1, 100-1, $transparent);
- include_once __DIR__ . '/func.inc';
- test_image_equals_file(__DIR__ . '/bug22544.png', $image);
+ $image = imageCreateTruecolor(640, 100);
+ $transparent = imageColorAllocate($image, 0, 0, 0);
+ $red = imageColorAllocate($image, 255, 50, 50);
+ imageColorTransparent($image, $transparent);
+ imageFilledRectangle($image, 0, 0, 640-1, 100-1, $transparent);
+ include_once __DIR__ . '/func.inc';
+ test_image_equals_file(__DIR__ . '/bug22544.png', $image);
?>
--EXPECT--
The images are equal.
diff --git a/ext/gd/tests/bug24155.phpt b/ext/gd/tests/bug24155.phpt
index 43d34b7177..ff4f40fdec 100644
--- a/ext/gd/tests/bug24155.phpt
+++ b/ext/gd/tests/bug24155.phpt
@@ -9,22 +9,22 @@ Bug #24155 (gdImageRotate270 rotation problem).
?>
--FILE--
<?php
- $dest = dirname(realpath(__FILE__)) . '/bug24155.png';
- @unlink($dest);
+ $dest = dirname(realpath(__FILE__)) . '/bug24155.png';
+ @unlink($dest);
- $im = imagecreatetruecolor(30, 50);
- imagefill($im, 0, 0, (16777215 - 255));
- $im = imagerotate($im, 270, 255);
- imagepng($im, $dest);
+ $im = imagecreatetruecolor(30, 50);
+ imagefill($im, 0, 0, (16777215 - 255));
+ $im = imagerotate($im, 270, 255);
+ imagepng($im, $dest);
- $im2 = imagecreatefrompng($dest);
+ $im2 = imagecreatefrompng($dest);
- // Uniform fill + n x 90degrees rotation , the color value does not change
- $col = imagecolorat($im2, 20, 20);
- // 16777215 - 255 = 16776960
- echo "$col\n";
+ // Uniform fill + n x 90degrees rotation , the color value does not change
+ $col = imagecolorat($im2, 20, 20);
+ // 16777215 - 255 = 16776960
+ echo "$col\n";
- @unlink($dest);
+ @unlink($dest);
?>
--EXPECT--
16776960
diff --git a/ext/gd/tests/bug24594.phpt b/ext/gd/tests/bug24594.phpt
index f4006497c6..138258cbbc 100644
--- a/ext/gd/tests/bug24594.phpt
+++ b/ext/gd/tests/bug24594.phpt
@@ -8,74 +8,74 @@ Bug #24594 (Filling an area using tiles).
?>
--FILE--
<?php
- $tile = imagecreate(36,36);
- $base = imagecreate(150,150);
- $white = imagecolorallocate($tile,255,255,255);
- $black = imagecolorallocate($tile,0,0,0);
- $white = imagecolorallocate($base,255,255,255);
- $black = imagecolorallocate($base,0,0,0);
+ $tile = imagecreate(36,36);
+ $base = imagecreate(150,150);
+ $white = imagecolorallocate($tile,255,255,255);
+ $black = imagecolorallocate($tile,0,0,0);
+ $white = imagecolorallocate($base,255,255,255);
+ $black = imagecolorallocate($base,0,0,0);
- /* create the dots pattern */
- for ($x=0;$x<36;$x+=2) {
- for ($y=0;$y<36;$y+=2) {
- imagesetpixel($tile,$x,$y,$black);
- }
- }
+ /* create the dots pattern */
+ for ($x=0;$x<36;$x+=2) {
+ for ($y=0;$y<36;$y+=2) {
+ imagesetpixel($tile,$x,$y,$black);
+ }
+ }
- imagesettile($base,$tile);
- imagerectangle($base, 9,9,139,139,$black);
- imageline($base, 9,9,139,139,$black);
- imagefill($base,11,12,IMG_COLOR_TILED);
+ imagesettile($base,$tile);
+ imagerectangle($base, 9,9,139,139,$black);
+ imageline($base, 9,9,139,139,$black);
+ imagefill($base,11,12,IMG_COLOR_TILED);
- $res = imagecolorat($base,0,10)==$black?'1':'0';
- $res .= imagecolorat($base,0,20)==$black?'1':'0';
- $res .= imagecolorat($base,0,30)==$black?'1':'0';
- $res .= imagecolorat($base,0,40)==$black?'1':'0';
- $res .= imagecolorat($base,0,50)==$black?'1':'0';
- $res .= imagecolorat($base,0,60)==$black?'1':'0';
+ $res = imagecolorat($base,0,10)==$black?'1':'0';
+ $res .= imagecolorat($base,0,20)==$black?'1':'0';
+ $res .= imagecolorat($base,0,30)==$black?'1':'0';
+ $res .= imagecolorat($base,0,40)==$black?'1':'0';
+ $res .= imagecolorat($base,0,50)==$black?'1':'0';
+ $res .= imagecolorat($base,0,60)==$black?'1':'0';
- $res .= imagecolorat($base,11,12)==$white?'1':'0';
- $res .= imagecolorat($base,12,13)==$white?'1':'0';
- $res .= imagecolorat($base,13,14)==$white?'1':'0';
- $res .= imagecolorat($base,14,15)==$white?'1':'0';
- $res .= imagecolorat($base,15,16)==$white?'1':'0';
- $res .= imagecolorat($base,16,17)==$white?'1':'0';
+ $res .= imagecolorat($base,11,12)==$white?'1':'0';
+ $res .= imagecolorat($base,12,13)==$white?'1':'0';
+ $res .= imagecolorat($base,13,14)==$white?'1':'0';
+ $res .= imagecolorat($base,14,15)==$white?'1':'0';
+ $res .= imagecolorat($base,15,16)==$white?'1':'0';
+ $res .= imagecolorat($base,16,17)==$white?'1':'0';
- $res .= imagecolorat($base,10,12)==$black?'1':'0';
- $res .= imagecolorat($base,11,13)==$black?'1':'0';
- $res .= imagecolorat($base,12,14)==$black?'1':'0';
- $res .= imagecolorat($base,13,15)==$black?'1':'0';
- $res .= imagecolorat($base,14,16)==$black?'1':'0';
- $res .= imagecolorat($base,15,17)==$black?'1':'0';
- echo "$res\n";
+ $res .= imagecolorat($base,10,12)==$black?'1':'0';
+ $res .= imagecolorat($base,11,13)==$black?'1':'0';
+ $res .= imagecolorat($base,12,14)==$black?'1':'0';
+ $res .= imagecolorat($base,13,15)==$black?'1':'0';
+ $res .= imagecolorat($base,14,16)==$black?'1':'0';
+ $res .= imagecolorat($base,15,17)==$black?'1':'0';
+ echo "$res\n";
- imagefilledrectangle($base,0,0,149,149,$white);
- imagerectangle($base, 9,9,139,139,$black);
- imageline($base, 9,9,139,139,$black);
- imagefill($base,0,0,IMG_COLOR_TILED);
+ imagefilledrectangle($base,0,0,149,149,$white);
+ imagerectangle($base, 9,9,139,139,$black);
+ imageline($base, 9,9,139,139,$black);
+ imagefill($base,0,0,IMG_COLOR_TILED);
- $res = imagecolorat($base,0,10)==$black?'1':'0';
- $res .= imagecolorat($base,0,20)==$black?'1':'0';
- $res .= imagecolorat($base,0,30)==$black?'1':'0';
- $res .= imagecolorat($base,0,40)==$black?'1':'0';
- $res .= imagecolorat($base,0,50)==$black?'1':'0';
- $res .= imagecolorat($base,0,60)==$black?'1':'0';
+ $res = imagecolorat($base,0,10)==$black?'1':'0';
+ $res .= imagecolorat($base,0,20)==$black?'1':'0';
+ $res .= imagecolorat($base,0,30)==$black?'1':'0';
+ $res .= imagecolorat($base,0,40)==$black?'1':'0';
+ $res .= imagecolorat($base,0,50)==$black?'1':'0';
+ $res .= imagecolorat($base,0,60)==$black?'1':'0';
- $res .= imagecolorat($base,11,12)==$white?'1':'0';
- $res .= imagecolorat($base,12,13)==$white?'1':'0';
- $res .= imagecolorat($base,13,14)==$white?'1':'0';
- $res .= imagecolorat($base,14,15)==$white?'1':'0';
- $res .= imagecolorat($base,15,16)==$white?'1':'0';
- $res .= imagecolorat($base,16,17)==$white?'1':'0';
+ $res .= imagecolorat($base,11,12)==$white?'1':'0';
+ $res .= imagecolorat($base,12,13)==$white?'1':'0';
+ $res .= imagecolorat($base,13,14)==$white?'1':'0';
+ $res .= imagecolorat($base,14,15)==$white?'1':'0';
+ $res .= imagecolorat($base,15,16)==$white?'1':'0';
+ $res .= imagecolorat($base,16,17)==$white?'1':'0';
- $res .= imagecolorat($base,0,16)==$black?'1':'0';
- $res .= imagecolorat($base,2,42)==$black?'1':'0';
- $res .= imagecolorat($base,4,44)==$black?'1':'0';
- $res .= imagecolorat($base,146,146)==$black?'1':'0';
- $res .= imagecolorat($base,148,146)==$black?'1':'0';
- $res .= imagecolorat($base,0,0)==$black?'1':'0';
+ $res .= imagecolorat($base,0,16)==$black?'1':'0';
+ $res .= imagecolorat($base,2,42)==$black?'1':'0';
+ $res .= imagecolorat($base,4,44)==$black?'1':'0';
+ $res .= imagecolorat($base,146,146)==$black?'1':'0';
+ $res .= imagecolorat($base,148,146)==$black?'1':'0';
+ $res .= imagecolorat($base,0,0)==$black?'1':'0';
- echo "$res\n";
+ echo "$res\n";
?>
--EXPECT--
000000111111101010
diff --git a/ext/gd/tests/bug42434.phpt b/ext/gd/tests/bug42434.phpt
index 8f5205d936..3db42a228e 100644
--- a/ext/gd/tests/bug42434.phpt
+++ b/ext/gd/tests/bug42434.phpt
@@ -15,9 +15,9 @@ imageantialias($im, true);
imageline($im, 0, 0, 10, 0, 0x000000);
if (imagecolorat($im, 9, 0) == 0x000000) {
- echo 'DONE';
+ echo 'DONE';
} else {
- echo 'Bugged';
+ echo 'Bugged';
}
imagedestroy($im);
diff --git a/ext/gd/tests/bug43073.phpt b/ext/gd/tests/bug43073.phpt
index c52bdad5be..74641496de 100644
--- a/ext/gd/tests/bug43073.phpt
+++ b/ext/gd/tests/bug43073.phpt
@@ -8,22 +8,22 @@ Bug #43073 (TrueType bounding box is wrong for angle<>0)
--FILE--
<?php
$exp = [
- [501,400, 611,400, 611,376, 501,376],
- [492,361, 595,319, 586,296, 483,338],
- [470,329, 549,251, 531,233, 453,312],
- [439,307, 481,204, 458,195, 416,297],
- [400,299, 400,189, 376,189, 376,299],
- [361,307, 319,204, 296,213, 338,316],
- [329,329, 251,250, 233,267, 311,346],
- [307,360, 204,318, 195,341, 297,383],
- [299,400, 189,400, 189,424, 299,424],
- [307,438, 204,480, 213,503, 316,461],
- [329,470, 250,548, 267,566, 346,488],
- [360,492, 318,595, 341,604, 383,502],
- [400,501, 400,611, 424,611, 424,501],
- [438,492, 480,595, 503,586, 461,483],
- [470,470, 548,549, 566,532, 488,453],
- [492,439, 595,481, 604,458, 502,416]
+ [501,400, 611,400, 611,376, 501,376],
+ [492,361, 595,319, 586,296, 483,338],
+ [470,329, 549,251, 531,233, 453,312],
+ [439,307, 481,204, 458,195, 416,297],
+ [400,299, 400,189, 376,189, 376,299],
+ [361,307, 319,204, 296,213, 338,316],
+ [329,329, 251,250, 233,267, 311,346],
+ [307,360, 204,318, 195,341, 297,383],
+ [299,400, 189,400, 189,424, 299,424],
+ [307,438, 204,480, 213,503, 316,461],
+ [329,470, 250,548, 267,566, 346,488],
+ [360,492, 318,595, 341,604, 383,502],
+ [400,501, 400,611, 424,611, 424,501],
+ [438,492, 480,595, 503,586, 461,483],
+ [470,470, 548,549, 566,532, 488,453],
+ [492,439, 595,481, 604,458, 502,416]
];
$cwd = __DIR__;
$font = "$cwd/Tuffy.ttf";
@@ -41,11 +41,11 @@ for ($angle = 0.0, $i = 0; $angle < 360.0; $angle += $delta_t, $i++) {
imagepolygon($g, $bbox, $red);
printf("%2d: ", $i);
for ($j = 0; $j < 8; $j++) {
- if ($bbox[$j] >= $exp[$i][$j] - 1 && $bbox[$j] <= $exp[$i][$j] + 1) {
- echo '.';
- } else {
- echo "(expected $exp[$i][$j], got $bbox[$j])";
- }
+ if ($bbox[$j] >= $exp[$i][$j] - 1 && $bbox[$j] <= $exp[$i][$j] + 1) {
+ echo '.';
+ } else {
+ echo "(expected $exp[$i][$j], got $bbox[$j])";
+ }
}
echo "\n";
$temp = $cos_t * $x + $sin_t * $y;
diff --git a/ext/gd/tests/bug43475.phpt b/ext/gd/tests/bug43475.phpt
index f0302d45ef..9264299181 100644
--- a/ext/gd/tests/bug43475.phpt
+++ b/ext/gd/tests/bug43475.phpt
@@ -13,22 +13,22 @@ require_once __DIR__ . '/similarity.inc';
function setStyleAndThickness($im, $color, $thickness)
{
- $style = array();
- $i = 0;
- while ($i < 16 * $thickness) {
- $style[$i++] = $color;
- }
- while ($i < 20 * $thickness) {
- $style[$i++] = IMG_COLOR_TRANSPARENT;
- }
- while ($i < 28 * $thickness) {
- $style[$i++] = $color;
- }
- while ($i < 32 * $thickness) {
- $style[$i++] = IMG_COLOR_TRANSPARENT;
- }
- imagesetstyle($im, $style);
- imagesetthickness($im, $thickness);
+ $style = array();
+ $i = 0;
+ while ($i < 16 * $thickness) {
+ $style[$i++] = $color;
+ }
+ while ($i < 20 * $thickness) {
+ $style[$i++] = IMG_COLOR_TRANSPARENT;
+ }
+ while ($i < 28 * $thickness) {
+ $style[$i++] = $color;
+ }
+ while ($i < 32 * $thickness) {
+ $style[$i++] = IMG_COLOR_TRANSPARENT;
+ }
+ imagesetstyle($im, $style);
+ imagesetthickness($im, $thickness);
}
$im = imagecreate(800, 800);
diff --git a/ext/gd/tests/bug44849.phpt b/ext/gd/tests/bug44849.phpt
index 368a08a242..22e8a65ec4 100644
--- a/ext/gd/tests/bug44849.phpt
+++ b/ext/gd/tests/bug44849.phpt
@@ -6,7 +6,7 @@ Bug #44849 (imagecolorclosesthwb is not available on Windows)
?>
--FILE--
<?php
- var_dump(function_exists('imagecolorclosesthwb'));
+ var_dump(function_exists('imagecolorclosesthwb'));
?>
--EXPECT--
bool(true)
diff --git a/ext/gd/tests/bug49600.phpt b/ext/gd/tests/bug49600.phpt
index 25fae3ca37..79830be71f 100644
--- a/ext/gd/tests/bug49600.phpt
+++ b/ext/gd/tests/bug49600.phpt
@@ -15,7 +15,7 @@ $color = imagecolorallocate($image, 255, 255, 255);
foreach (array("E", "I", "P", "g", "i", "q") as $c)
{
$x = imagettftext($image, 32, 0, 0, 0, $color, $font, $c);
- $y = imagettfbbox(32, 0, "$cwd/Tuffy.ttf", $c);
+ $y = imagettfbbox(32, 0, "$cwd/Tuffy.ttf", $c);
if ( abs($x[0] - $y[0]) > 1
|| abs($x[2] - $y[2]) > 1
|| abs($x[4] - $y[4]) > 1
diff --git a/ext/gd/tests/bug53504.phpt b/ext/gd/tests/bug53504.phpt
index c44e4ef0f8..11e7a8af57 100644
--- a/ext/gd/tests/bug53504.phpt
+++ b/ext/gd/tests/bug53504.phpt
@@ -51,16 +51,16 @@ $tests = [
foreach ($tests as $testnum => $test) {
$bbox = imageftbbox($test['fontSize'], $test['angle'], $font, $test['text']);
- printf('%2d: ', $testnum);
- for ($i = 0; $i < 8; $i++) {
- $exp = $test['exp'][$i];
- if ($bbox[$i] >= $exp - 2 && $bbox[$i] <= $exp + 2) {
- echo '.';
- } else {
- echo "(expected $exp, got $bbox[$i])";
- }
- }
- echo "\n";
+ printf('%2d: ', $testnum);
+ for ($i = 0; $i < 8; $i++) {
+ $exp = $test['exp'][$i];
+ if ($bbox[$i] >= $exp - 2 && $bbox[$i] <= $exp + 2) {
+ echo '.';
+ } else {
+ echo "(expected $exp, got $bbox[$i])";
+ }
+ }
+ echo "\n";
$bboxDrawn = imagefttext($g, $test['fontSize'], $test['angle'],
$test['x'], $test['y'], $black, $font, $test['text']);
diff --git a/ext/gd/tests/bug64641.phpt b/ext/gd/tests/bug64641.phpt
index 2d5768eece..4eb2e28730 100644
--- a/ext/gd/tests/bug64641.phpt
+++ b/ext/gd/tests/bug64641.phpt
@@ -14,24 +14,24 @@ require_once __DIR__ . '/similarity.inc';
$im = imagecreatetruecolor(640, 480);
$points = array(
- 100, 100,
- 100, 200,
- 100, 300
+ 100, 100,
+ 100, 200,
+ 100, 300
);
imagefilledpolygon($im, $points, 0xFFFF00);
$points = array(
- 300, 200,
- 400, 200,
- 500, 200
+ 300, 200,
+ 400, 200,
+ 500, 200
);
imagefilledpolygon($im, $points, 0xFFFF00);
$ex = imagecreatefrompng(__DIR__ . '/bug64641.png');
if (($diss = calc_image_dissimilarity($ex, $im)) < 1e-5) {
- echo "IDENTICAL";
+ echo "IDENTICAL";
} else {
- echo "DISSIMILARITY: $diss";
+ echo "DISSIMILARITY: $diss";
}
imagedestroy($ex);
diff --git a/ext/gd/tests/bug67248.phpt b/ext/gd/tests/bug67248.phpt
index c9a9588343..c5b54354f1 100644
--- a/ext/gd/tests/bug67248.phpt
+++ b/ext/gd/tests/bug67248.phpt
@@ -10,7 +10,7 @@ Bug #67248 (imageaffinematrixget missing check of parameters)
require __DIR__ . '/func.inc';
for($i=0;$i<7;$i++) {
- trycatch_dump(
+ trycatch_dump(
fn() => imageaffinematrixget($i)
);
}
diff --git a/ext/gd/tests/bug72339.phpt b/ext/gd/tests/bug72339.phpt
index 5b5fdb6ee6..bd8054cced 100644
--- a/ext/gd/tests/bug72339.phpt
+++ b/ext/gd/tests/bug72339.phpt
@@ -26,7 +26,7 @@ fclose($fh);
$im = imagecreatefromgd2($fname);
if ($im) {
- imagedestroy($im);
+ imagedestroy($im);
}
unlink($fname);
diff --git a/ext/gd/tests/bug72709.phpt b/ext/gd/tests/bug72709.phpt
index 2963f1c104..a5b0463f62 100644
--- a/ext/gd/tests/bug72709.phpt
+++ b/ext/gd/tests/bug72709.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded('gd')) die('skip ext/gd not available');
<?php
$im = imagecreatetruecolor(1, 1);
-try {
+try {
var_dump(imagesetstyle($im, array()));
}
catch (\Error $ex) {
diff --git a/ext/gd/tests/colorat.phpt b/ext/gd/tests/colorat.phpt
index e8c1a5fb46..9be5d431da 100644
--- a/ext/gd/tests/colorat.phpt
+++ b/ext/gd/tests/colorat.phpt
@@ -30,9 +30,9 @@ echo 'test colorat palette: ';
$c = imagecolorsforindex($im, imagecolorat($im, 3,3));
$failed = false;
foreach ($c as $v) {
- if ($v != 0) {
- $failed = true;
- }
+ if ($v != 0) {
+ $failed = true;
+ }
}
echo !$failed ? 'ok' : 'failed';
echo "\n";
diff --git a/ext/gd/tests/colorclosest.phpt b/ext/gd/tests/colorclosest.phpt
index 7ade09478e..3f588fbd59 100644
--- a/ext/gd/tests/colorclosest.phpt
+++ b/ext/gd/tests/colorclosest.phpt
@@ -31,11 +31,11 @@ print_r(imagecolorsforindex($im, $c));
$im = imagecreate(5,5);
for ($i=0; $i<256; $i++) {
- if ($i == 246) {
- imagecolorallocate($im, $i,10,10);
- } else {
- imagecolorallocate($im, $i,0,0);
- }
+ if ($i == 246) {
+ imagecolorallocate($im, $i,10,10);
+ } else {
+ imagecolorallocate($im, $i,0,0);
+ }
}
$c = imagecolorclosest($im, 255,10,10);
print_r(imagecolorsforindex($im, $c));
@@ -65,11 +65,11 @@ print_r(imagecolorsforindex($im, $c));
$im = imagecreate(5,5);
for ($i=0; $i<256; $i++) {
- if ($i == 246) {
- imagecolorallocatealpha($im, $i,10,10,1);
- } else {
- imagecolorallocatealpha($im, $i,0,0,100);
- }
+ if ($i == 246) {
+ imagecolorallocatealpha($im, $i,10,10,1);
+ } else {
+ imagecolorallocatealpha($im, $i,0,0,100);
+ }
}
$c = imagecolorclosestalpha($im, 255,10,10,1);
print_r(imagecolorsforindex($im, $c));
diff --git a/ext/gd/tests/colorresolve.phpt b/ext/gd/tests/colorresolve.phpt
index 0a939bd85f..6df57ef75d 100644
--- a/ext/gd/tests/colorresolve.phpt
+++ b/ext/gd/tests/colorresolve.phpt
@@ -25,11 +25,11 @@ print_r(imagecolorsforindex($im, $c));
$im = imagecreate(5,5);
for ($i=0; $i<256; $i++) {
- if ($i == 246) {
- imagecolorresolve($im, $i,10,10);
- } else {
- imagecolorresolve($im, $i,0,0);
- }
+ if ($i == 246) {
+ imagecolorresolve($im, $i,10,10);
+ } else {
+ imagecolorresolve($im, $i,0,0);
+ }
}
$c = imagecolorresolve($im, 255,10,10);
print_r(imagecolorsforindex($im, $c));
@@ -55,11 +55,11 @@ print_r(imagecolorsforindex($im, $c));
$im = imagecreate(5,5);
for ($i=0; $i<256; $i++) {
- if ($i == 246) {
- imagecolorresolvealpha($im, $i,10,10,1);
- } else {
- imagecolorresolvealpha($im, $i,0,0,100);
- }
+ if ($i == 246) {
+ imagecolorresolvealpha($im, $i,10,10,1);
+ } else {
+ imagecolorresolvealpha($im, $i,0,0,100);
+ }
}
$c = imagecolorresolvealpha($im, 255,10,10,0);
print_r(imagecolorsforindex($im, $c));
diff --git a/ext/gd/tests/copy.phpt b/ext/gd/tests/copy.phpt
index 28bb3ed173..046567e3ef 100644
--- a/ext/gd/tests/copy.phpt
+++ b/ext/gd/tests/copy.phpt
@@ -21,7 +21,7 @@ $p2 = imagecolorat($dst_tc, 0,0) == 0x0000ff;
$p3 = imagecolorat($dst_tc, 4,4) == 0x00ff00;
if ($p1 && $p2 && $p3) {
- echo "TC/TC: ok\n";
+ echo "TC/TC: ok\n";
}
imagedestroy($src_tc); imagedestroy($dst_tc);
@@ -46,7 +46,7 @@ $p2 = $c2['red'] == 0x00 && $c2['blue']==0xff && $c2['green']==0x00;
$p3 = $c3['red'] == 0x00 && $c3['blue']==0x00 && $c3['green']==0xff;
if ($p1 && $p2 && $p3) {
- echo "TC/P: ok\n";
+ echo "TC/P: ok\n";
}
imagedestroy($src_tc); imagedestroy($dst_tc);
@@ -76,7 +76,7 @@ $p3 = $c3['red'] == 0x00 && $c3['blue']==0x00 && $c3['green']==0xff;
if ($p1 && $p2 && $p3) {
- echo "P/P: ok\n";
+ echo "P/P: ok\n";
}
@@ -99,7 +99,7 @@ $p2 = imagecolorat($dst_tc, 0,0) == 0x0000ff;
$p3 = imagecolorat($dst_tc, 4,4) == 0x00ff00;
if ($p1 && $p2 && $p3) {
- echo "P/TC: ok\n";
+ echo "P/TC: ok\n";
}
?>
--EXPECT--
diff --git a/ext/gd/tests/copypalette.phpt b/ext/gd/tests/copypalette.phpt
index 3e29b42a43..747011e69a 100644
--- a/ext/gd/tests/copypalette.phpt
+++ b/ext/gd/tests/copypalette.phpt
@@ -9,18 +9,18 @@ imagepalettecopy
$failed = false;
$im = imagecreate(1,1);
for ($i=0; $i<256; $i++) {
- imagecolorallocate($im, $i, $i, $i);
+ imagecolorallocate($im, $i, $i, $i);
}
$im2 = imagecreate(1,1);
imagepalettecopy($im2, $im);
for ($i=0; $i<256; $i++) {
- $c = imagecolorsforindex($im2, $i);
- if ($c['red']!=$i || $c['green']!=$i || $c['blue']!=$i) {
- $failed = true;
- break;
- }
+ $c = imagecolorsforindex($im2, $i);
+ if ($c['red']!=$i || $c['green']!=$i || $c['blue']!=$i) {
+ $failed = true;
+ break;
+ }
}
echo "copy palette 255 colors: ";
echo $failed ? 'failed' : 'ok';
@@ -33,7 +33,7 @@ imagecolorallocatealpha($im, 0,0,0,100);
imagepalettecopy($im2, $im);
$c = imagecolorsforindex($im2, 0);
if ($c['red']!=0 || $c['green']!=0 || $c['blue']!=0 || $c['alpha']!=100) {
- $failed = true;
+ $failed = true;
}
echo 'copy palette 1 color and alpha: ';
echo $failed ? 'failed' : 'ok';
diff --git a/ext/gd/tests/copyresized.phpt b/ext/gd/tests/copyresized.phpt
index df4996332d..2af9cc9682 100644
--- a/ext/gd/tests/copyresized.phpt
+++ b/ext/gd/tests/copyresized.phpt
@@ -8,32 +8,32 @@ imagecopyresized
<?php
function get_hexcolor($im, $c) {
- if (imageistruecolor($im)) {
- return $c;
- }
- $colors = imagecolorsforindex($im, $c);
- return ($colors['red'] << 16) + ($colors['green'] << 8) + ($colors['blue']);
+ if (imageistruecolor($im)) {
+ return $c;
+ }
+ $colors = imagecolorsforindex($im, $c);
+ return ($colors['red'] << 16) + ($colors['green'] << 8) + ($colors['blue']);
}
function check_doublesize($dst) {
- $im = imagecreatetruecolor(38,38);
- imagefill($im,0,0, 0xffffff);
- imagefilledrectangle($im, 0,0,9,9, 0xff0000);
- imagefilledrectangle($im, 0,28,9,37, 0xff0000);
- imagefilledrectangle($im, 28,0,37,9, 0xff0000);
- imagefilledrectangle($im, 28,28,37,37, 0xff0000);
- imagefilledrectangle($im, 14,14,23,23, 0xff0000);
+ $im = imagecreatetruecolor(38,38);
+ imagefill($im,0,0, 0xffffff);
+ imagefilledrectangle($im, 0,0,9,9, 0xff0000);
+ imagefilledrectangle($im, 0,28,9,37, 0xff0000);
+ imagefilledrectangle($im, 28,0,37,9, 0xff0000);
+ imagefilledrectangle($im, 28,28,37,37, 0xff0000);
+ imagefilledrectangle($im, 14,14,23,23, 0xff0000);
- for ($x = 0; $x < 38; $x++) {
- for ($y = 0; $y < 38; $y++) {
- $p1 = imagecolorat($im, $x, $y);
- $p2 = imagecolorat($dst, $x, $y);
- if (get_hexcolor($im, $p1) != get_hexcolor($dst, $p2)) {
- return false;
- }
- }
- }
- return true;
+ for ($x = 0; $x < 38; $x++) {
+ for ($y = 0; $y < 38; $y++) {
+ $p1 = imagecolorat($im, $x, $y);
+ $p2 = imagecolorat($dst, $x, $y);
+ if (get_hexcolor($im, $p1) != get_hexcolor($dst, $p2)) {
+ return false;
+ }
+ }
+ }
+ return true;
}
$src_tc = imagecreatetruecolor(19,19);
diff --git a/ext/gd/tests/createfromstring.phpt b/ext/gd/tests/createfromstring.phpt
index 6a4b1a7e11..5d14708a2e 100644
--- a/ext/gd/tests/createfromstring.phpt
+++ b/ext/gd/tests/createfromstring.phpt
@@ -18,9 +18,9 @@ $im_string = file_get_contents(__DIR__ . '/tc.png');
$im = imagecreatefromstring($im_string);
echo 'createfromstring truecolor png: ';
if (imagecolorat($im, 3,3) != 0x0) {
- echo 'failed';
+ echo 'failed';
} else {
- echo 'ok';
+ echo 'ok';
}
echo "\n";
unlink($dir . '/tc.png');
@@ -42,9 +42,9 @@ echo'createfromstring palette png: ';
$c = imagecolorsforindex($im, imagecolorat($im, 3,3));
$failed = false;
if ($c['red'] != 255 || $c['green'] != 0 || $c['blue'] != 0) {
- echo 'failed';
+ echo 'failed';
} else {
- echo 'ok';
+ echo 'ok';
}
echo "\n";
unlink($dir . '/p.png');
diff --git a/ext/gd/tests/createfromwbmp2.phpt b/ext/gd/tests/createfromwbmp2.phpt
index 819795181a..f75d02613d 100644
--- a/ext/gd/tests/createfromwbmp2.phpt
+++ b/ext/gd/tests/createfromwbmp2.phpt
@@ -10,7 +10,7 @@ imagecreatefromwbmp with invalid wbmp
$filename = __DIR__ . '/_tmp.wbmp';
$fp = fopen($filename,"wb");
if (!$fp) {
- exit("Failed to create <$filename>");
+ exit("Failed to create <$filename>");
}
//write header
@@ -34,7 +34,7 @@ fputs($fp, chr($c), 1);
/*write some data to cause overflow*/
for ($i=0; $i<10000; $i++) {
- fwrite($fp, chr($c), 1);
+ fwrite($fp, chr($c), 1);
}
fclose($fp);
diff --git a/ext/gd/tests/createfromwbmp2_extern.phpt b/ext/gd/tests/createfromwbmp2_extern.phpt
index 0aff8d8b93..ad7a130c18 100644
--- a/ext/gd/tests/createfromwbmp2_extern.phpt
+++ b/ext/gd/tests/createfromwbmp2_extern.phpt
@@ -10,7 +10,7 @@ imagecreatefromwbmp with invalid wbmp
$filename = __DIR__ . '/_tmp.wbmp';
$fp = fopen($filename,"wb");
if (!$fp) {
- exit("Failed to create <$filename>");
+ exit("Failed to create <$filename>");
}
//write header
@@ -34,7 +34,7 @@ fputs($fp, chr($c), 1);
/*write some data to cause overflow*/
for ($i=0; $i<10000; $i++) {
- fwrite($fp, chr($c), 1);
+ fwrite($fp, chr($c), 1);
}
fclose($fp);
diff --git a/ext/gd/tests/dashedlines.phpt b/ext/gd/tests/dashedlines.phpt
index b6d4892c88..bcf17174cc 100644
--- a/ext/gd/tests/dashedlines.phpt
+++ b/ext/gd/tests/dashedlines.phpt
@@ -26,7 +26,7 @@ $p5 = imagecolorat($im, 5,5) == $b;
if ($p1 && $p2 && $p3 && $p4 && $p5) {
- echo "Horizontal: ok\n";
+ echo "Horizontal: ok\n";
}
imagedestroy($im);
@@ -46,7 +46,7 @@ $p5 = imagecolorat($im, 2,4) == $r;
$p6 = imagecolorat($im, 2,5) == $b;
if ($p1 && $p2 && $p3 && $p4 && $p5 && $p6) {
- echo "Vertical: ok\n";
+ echo "Vertical: ok\n";
}
imagedestroy($im);
@@ -66,7 +66,7 @@ $p5 = imagecolorat($im, 4,4) == $r;
$p6 = imagecolorat($im, 5,5) == $b;
if ($p1 && $p2 && $p3 && $p4 && $p5 && $p6) {
- echo "Diagonal: ok\n";
+ echo "Diagonal: ok\n";
}
imagedestroy($im);
diff --git a/ext/gd/tests/func.inc b/ext/gd/tests/func.inc
index faa0b06816..5273f99830 100644
--- a/ext/gd/tests/func.inc
+++ b/ext/gd/tests/func.inc
@@ -2,61 +2,61 @@
function get_gd_version()
{
- return GD_VERSION;
+ return GD_VERSION;
}
function get_php_info()
{
- ob_start();
- phpinfo();
- $info = ob_get_contents();
- ob_end_clean();
+ ob_start();
+ phpinfo();
+ $info = ob_get_contents();
+ ob_end_clean();
- return $info;
+ return $info;
}
function get_freetype_version()
{
- $version = 0;
+ $version = 0;
- if (preg_match(',FreeType Version => (\d+\.\d+\.\d+),s', get_php_info(), $match)) {
- $version = $match[1];
- }
+ if (preg_match(',FreeType Version => (\d+\.\d+\.\d+),s', get_php_info(), $match)) {
+ $version = $match[1];
+ }
- return $version;
+ return $version;
}
function get_libjpeg_version()
{
- $version = 0;
+ $version = 0;
- if (preg_match(',libJPEG Version => ([a-z0-9]+),s', get_php_info(), $match)) {
- $version = $match[1];
- }
+ if (preg_match(',libJPEG Version => ([a-z0-9]+),s', get_php_info(), $match)) {
+ $version = $match[1];
+ }
- return $version;
+ return $version;
}
function get_libpng_version()
{
- $version = 0;
+ $version = 0;
- if (preg_match(',libPNG Version => (\d+\.\d+\.\d+),s', get_php_info(), $match)) {
- $version = $match[1];
- }
+ if (preg_match(',libPNG Version => (\d+\.\d+\.\d+),s', get_php_info(), $match)) {
+ $version = $match[1];
+ }
- return $version;
+ return $version;
}
function get_libxpm_version()
{
- $version = 0;
+ $version = 0;
- if (preg_match(',libXpm Version => (\d+),s', get_php_info(), $match)) {
- $version = $match[1];
- }
+ if (preg_match(',libXpm Version => (\d+),s', get_php_info(), $match)) {
+ $version = $match[1];
+ }
- return $version;
+ return $version;
}
/**
@@ -77,39 +77,39 @@ function get_libxpm_version()
*/
function test_image_equals_file($filename, $actual)
{
- if (!file_exists($filename)) {
- echo "The expected image does not exist.\n";
- save_actual_image($actual);
- return;
- }
- $actual = test_to_truecolor($actual);
- $expected = imagecreatefrompng($filename);
- $expected = test_to_truecolor($expected);
- $exp_x = imagesx($expected);
- $exp_y = imagesy($expected);
- $act_x = imagesx($actual);
- $act_y = imagesy($actual);
- if ($exp_x != $act_x || $exp_y != $act_y) {
- echo "The image size differs: expected {$exp_x}x{$exp_y}, got {$act_x}x{$act_y}.\n";
- save_actual_image($actual);
- return;
- }
- $pixels_changed = 0;
- for ($y = 0; $y < $exp_y; $y++) {
- for ($x = 0; $x < $exp_x; $x ++) {
- $exp_c = imagecolorat($expected, $x, $y);
- $act_c = imagecolorat($actual, $x, $y);
- if ($exp_c != $act_c) {
- $pixels_changed++;
- }
- }
- }
- if (!$pixels_changed) {
- echo "The images are equal.\n";
- } else {
- echo "The images differ in {$pixels_changed} pixels.\n";
- save_actual_image($actual);
- }
+ if (!file_exists($filename)) {
+ echo "The expected image does not exist.\n";
+ save_actual_image($actual);
+ return;
+ }
+ $actual = test_to_truecolor($actual);
+ $expected = imagecreatefrompng($filename);
+ $expected = test_to_truecolor($expected);
+ $exp_x = imagesx($expected);
+ $exp_y = imagesy($expected);
+ $act_x = imagesx($actual);
+ $act_y = imagesy($actual);
+ if ($exp_x != $act_x || $exp_y != $act_y) {
+ echo "The image size differs: expected {$exp_x}x{$exp_y}, got {$act_x}x{$act_y}.\n";
+ save_actual_image($actual);
+ return;
+ }
+ $pixels_changed = 0;
+ for ($y = 0; $y < $exp_y; $y++) {
+ for ($x = 0; $x < $exp_x; $x ++) {
+ $exp_c = imagecolorat($expected, $x, $y);
+ $act_c = imagecolorat($actual, $x, $y);
+ if ($exp_c != $act_c) {
+ $pixels_changed++;
+ }
+ }
+ }
+ if (!$pixels_changed) {
+ echo "The images are equal.\n";
+ } else {
+ echo "The images differ in {$pixels_changed} pixels.\n";
+ save_actual_image($actual);
+ }
}
/**
@@ -120,15 +120,15 @@ function test_image_equals_file($filename, $actual)
*/
function test_to_truecolor($image)
{
- if (imageistruecolor($image)) {
- return $image;
- } else {
- $width = imagesx($image);
- $height = imagesy($image);
- $result = imagecreatetruecolor($width, $height);
- imagecopy($result, $image, 0,0, 0,0, $width, $height);
- return $result;
- }
+ if (imageistruecolor($image)) {
+ return $image;
+ } else {
+ $width = imagesx($image);
+ $height = imagesy($image);
+ $result = imagecreatetruecolor($width, $height);
+ imagecopy($result, $image, 0,0, 0,0, $width, $height);
+ return $result;
+ }
}
/**
@@ -142,9 +142,9 @@ function test_to_truecolor($image)
*/
function save_actual_image($image)
{
- $pathinfo = pathinfo($_SERVER['SCRIPT_FILENAME']);
- $filename = "{$pathinfo['dirname']}/{$pathinfo['filename']}.out.png";
- imagepng($image, $filename);
+ $pathinfo = pathinfo($_SERVER['SCRIPT_FILENAME']);
+ $filename = "{$pathinfo['dirname']}/{$pathinfo['filename']}.out.png";
+ imagepng($image, $filename);
}
/**
diff --git a/ext/gd/tests/gd_info_basic.phpt b/ext/gd/tests/gd_info_basic.phpt
index b027462a41..99102168f1 100644
--- a/ext/gd/tests/gd_info_basic.phpt
+++ b/ext/gd/tests/gd_info_basic.phpt
@@ -14,11 +14,11 @@ gd_info()
* Source code: ext/standard/image.c
* Alias to functions:
*/
- echo "basic test of gd_info() function\n";
+ echo "basic test of gd_info() function\n";
- var_dump(gd_info());
+ var_dump(gd_info());
- echo "\nDone\n";
+ echo "\nDone\n";
?>
--EXPECTF--
basic test of gd_info() function
diff --git a/ext/gd/tests/gdimage_prevent_serialization.phpt b/ext/gd/tests/gdimage_prevent_serialization.phpt
index ef08444d37..e1e33127d1 100644
--- a/ext/gd/tests/gdimage_prevent_serialization.phpt
+++ b/ext/gd/tests/gdimage_prevent_serialization.phpt
@@ -11,7 +11,7 @@ if(!extension_loaded('gd')) {
$img_src = imagecreatetruecolor(32, 32);
var_dump(serialize($img_src));
-
+
?>
--EXPECTF--
Fatal error: Uncaught Exception: Serialization of 'GdImage' is not allowed in %s:%d
diff --git a/ext/gd/tests/gif.phpt b/ext/gd/tests/gif.phpt
index 39ade092c2..8315fb0dbc 100644
--- a/ext/gd/tests/gif.phpt
+++ b/ext/gd/tests/gif.phpt
@@ -13,34 +13,34 @@ gif in/out
<?php
function check_box($r,$g,$b, $error=0) {
- $cwd = __DIR__;
- $im2 = imagecreatefromgif($cwd . '/test_gif.gif');
-
- $c = imagecolorsforindex($im2, imagecolorat($im2, 8,8));
-
- if ($error>0) {
- $r_min = $r - $error; $r_max = $r + $error;
- $g_min = $g - $error; $g_max = $g + $error;
- $b_min = $b - $error; $b_max = $b + $error;
-
- if (
- ($c['red'] >= $r_min || $c['red'] <= $r_max)
- &&
- ($c['green'] >= $g_min || $c['green'] <= $g_max)
- &&
- ($c['blue'] >= $b_min || $c['blue'] <= $b_max)
- ) {
- return true;
- } else {
- return false;
- }
- } else {
- if ($c['red']==$r && $c['green']==$g && $c['blue']==$b) {
- return true;
- } else {
- return false;
- }
- }
+ $cwd = __DIR__;
+ $im2 = imagecreatefromgif($cwd . '/test_gif.gif');
+
+ $c = imagecolorsforindex($im2, imagecolorat($im2, 8,8));
+
+ if ($error>0) {
+ $r_min = $r - $error; $r_max = $r + $error;
+ $g_min = $g - $error; $g_max = $g + $error;
+ $b_min = $b - $error; $b_max = $b + $error;
+
+ if (
+ ($c['red'] >= $r_min || $c['red'] <= $r_max)
+ &&
+ ($c['green'] >= $g_min || $c['green'] <= $g_max)
+ &&
+ ($c['blue'] >= $b_min || $c['blue'] <= $b_max)
+ ) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ if ($c['red']==$r && $c['green']==$g && $c['blue']==$b) {
+ return true;
+ } else {
+ return false;
+ }
+ }
}
$cwd = __DIR__;
@@ -49,76 +49,76 @@ $c = imagecolorallocate($im, 255,255,255);
imagefilledrectangle($im, 5,5, 10,10, $c);
imagegif($im, $cwd . '/test_gif.gif');
if (check_box(255,255,255)) {
- echo "<4 cols: ok\n";
+ echo "<4 cols: ok\n";
}
$im = imagecreate(10,10);
for ($i=0; $i<7; $i++) {
- $c = imagecolorallocate($im, $i,$i,$i);
+ $c = imagecolorallocate($im, $i,$i,$i);
}
imagefilledrectangle($im, 5,5, 10,10, $c);
imagegif($im, $cwd . '/test_gif.gif');
$i--;
if (check_box($i,$i,$i)) {
- echo "<8 cols: ok\n";
+ echo "<8 cols: ok\n";
}
$im = imagecreate(10,10);
for ($i=0; $i<15; $i++) {
- $c = imagecolorallocate($im, $i,$i,$i);
+ $c = imagecolorallocate($im, $i,$i,$i);
}
imagefilledrectangle($im, 5,5, 10,10, $c);
imagegif($im, $cwd . '/test_gif.gif');
$i--;
if (check_box($i,$i,$i)) {
- echo "<16 cols: ok\n";
+ echo "<16 cols: ok\n";
}
$im = imagecreate(10,10);
for ($i=0; $i<31; $i++) {
- $c = imagecolorallocate($im, $i,$i,$i);
+ $c = imagecolorallocate($im, $i,$i,$i);
}
imagefilledrectangle($im, 5,5, 10,10, $c);
imagegif($im, $cwd . '/test_gif.gif');
$i--;
if (check_box($i,$i,$i)) {
- echo "<32 cols: ok\n";
+ echo "<32 cols: ok\n";
}
$im = imagecreate(10,10);
for ($i=0; $i<63; $i++) {
- $c = imagecolorallocate($im, $i,$i,$i);
+ $c = imagecolorallocate($im, $i,$i,$i);
}
imagefilledrectangle($im, 5,5, 10,10, $c);
imagegif($im, $cwd . '/test_gif.gif');
$i--;
if (check_box($i,$i,$i)) {
- echo "<64 cols: ok\n";
+ echo "<64 cols: ok\n";
}
$im = imagecreate(10,10);
for ($i=0; $i<127; $i++) {
- $c = imagecolorallocate($im, $i,$i,$i);
+ $c = imagecolorallocate($im, $i,$i,$i);
}
imagefilledrectangle($im, 5,5, 10,10, $c);
imagegif($im, $cwd . '/test_gif.gif');
$i--;
if (check_box($i,$i,$i)) {
- echo "<128 cols: ok\n";
+ echo "<128 cols: ok\n";
}
$im = imagecreate(10,10);
for ($i=0; $i<255; $i++) {
- $c = imagecolorallocate($im, $i,$i,$i);
+ $c = imagecolorallocate($im, $i,$i,$i);
}
imagefilledrectangle($im, 5,5, 10,10, $c);
imagegif($im, $cwd . '/test_gif.gif');
$i--;
if (check_box($i,$i,$i)) {
- echo "<256 cols: ok\n";
+ echo "<256 cols: ok\n";
}
@@ -128,7 +128,7 @@ imagegif($im, $cwd . '/test_gif.gif');
imagegif($im, $cwd . '/test_gif_2.gif');
if (check_box(255,255,255, 10)) {
- echo ">256 cols: ok\n";
+ echo ">256 cols: ok\n";
}
@unlink($cwd . "/test_gif.gif");
diff --git a/ext/gd/tests/gif2gd.phpt b/ext/gd/tests/gif2gd.phpt
index 3fe9397fb6..a741cadb26 100644
--- a/ext/gd/tests/gif2gd.phpt
+++ b/ext/gd/tests/gif2gd.phpt
@@ -12,18 +12,18 @@ gif --> gd1/gd2 conversion test
?>
--FILE--
<?php
- $cwd = __DIR__;
+ $cwd = __DIR__;
- echo "GIF to GD1 conversion: ";
- echo imagegd(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.gd1") ? 'ok' : 'failed';
- echo "\n";
+ echo "GIF to GD1 conversion: ";
+ echo imagegd(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.gd1") ? 'ok' : 'failed';
+ echo "\n";
- echo "GIF to GD2 conversion: ";
- echo imagegd2(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.gd2") ? 'ok' : 'failed';
- echo "\n";
+ echo "GIF to GD2 conversion: ";
+ echo imagegd2(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.gd2") ? 'ok' : 'failed';
+ echo "\n";
- @unlink($cwd . "/test_gif.gd1");
- @unlink($cwd . "/test_gif.gd2");
+ @unlink($cwd . "/test_gif.gd1");
+ @unlink($cwd . "/test_gif.gd2");
?>
--EXPECT--
GIF to GD1 conversion: ok
diff --git a/ext/gd/tests/gif2jpg.phpt b/ext/gd/tests/gif2jpg.phpt
index 38d8963271..b0ce474886 100644
--- a/ext/gd/tests/gif2jpg.phpt
+++ b/ext/gd/tests/gif2jpg.phpt
@@ -15,13 +15,13 @@ gif --> jpeg conversion test
?>
--FILE--
<?php
- $cwd = __DIR__;
+ $cwd = __DIR__;
- echo "GIF to JPEG conversion: ";
- echo imagejpeg(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.jpeg") ? 'ok' : 'failed';
- echo "\n";
+ echo "GIF to JPEG conversion: ";
+ echo imagejpeg(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.jpeg") ? 'ok' : 'failed';
+ echo "\n";
- @unlink($cwd . "/test_gif.jpeg");
+ @unlink($cwd . "/test_gif.jpeg");
?>
--EXPECT--
GIF to JPEG conversion: ok
diff --git a/ext/gd/tests/gif2png.phpt b/ext/gd/tests/gif2png.phpt
index 27aac9cdd8..295a80944c 100644
--- a/ext/gd/tests/gif2png.phpt
+++ b/ext/gd/tests/gif2png.phpt
@@ -15,13 +15,13 @@ gif --> png conversion test
?>
--FILE--
<?php
- $cwd = __DIR__;
+ $cwd = __DIR__;
- echo "GIF to PNG conversion: ";
- echo imagepng(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.png") ? 'ok' : 'failed';
- echo "\n";
+ echo "GIF to PNG conversion: ";
+ echo imagepng(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.png") ? 'ok' : 'failed';
+ echo "\n";
- @unlink($cwd . "/test_gif.png");
+ @unlink($cwd . "/test_gif.png");
?>
--EXPECT--
GIF to PNG conversion: ok
diff --git a/ext/gd/tests/imagefilter.phpt b/ext/gd/tests/imagefilter.phpt
index a46cc1476e..f040c5cac4 100644
--- a/ext/gd/tests/imagefilter.phpt
+++ b/ext/gd/tests/imagefilter.phpt
@@ -10,88 +10,88 @@ imagefilter() function test
--FILE--
<?php
$no_arg_filters = array(
- "IMG_FILTER_NEGATE",
- "IMG_FILTER_GRAYSCALE",
- "IMG_FILTER_EDGEDETECT",
- "IMG_FILTER_GAUSSIAN_BLUR",
- "IMG_FILTER_SELECTIVE_BLUR",
- "IMG_FILTER_EMBOSS",
- "IMG_FILTER_MEAN_REMOVAL"
+ "IMG_FILTER_NEGATE",
+ "IMG_FILTER_GRAYSCALE",
+ "IMG_FILTER_EDGEDETECT",
+ "IMG_FILTER_GAUSSIAN_BLUR",
+ "IMG_FILTER_SELECTIVE_BLUR",
+ "IMG_FILTER_EMBOSS",
+ "IMG_FILTER_MEAN_REMOVAL"
);
$SAVE_DIR = __DIR__;
$SOURCE_IMG = $SAVE_DIR . "/test.png";
- foreach ($no_arg_filters as $filt) {
- $im = imagecreatefrompng($SOURCE_IMG);
- if (imagefilter($im, constant($filt))) {
- imagepng($im, $SAVE_DIR."/".$filt. ".png");
- echo "$filt success\n";
- @unlink($SAVE_DIR."/".$filt. ".png");
- } else {
- echo "$filt failed\n";
- }
- }
+ foreach ($no_arg_filters as $filt) {
+ $im = imagecreatefrompng($SOURCE_IMG);
+ if (imagefilter($im, constant($filt))) {
+ imagepng($im, $SAVE_DIR."/".$filt. ".png");
+ echo "$filt success\n";
+ @unlink($SAVE_DIR."/".$filt. ".png");
+ } else {
+ echo "$filt failed\n";
+ }
+ }
- $im = imagecreatefrompng($SOURCE_IMG);
+ $im = imagecreatefrompng($SOURCE_IMG);
- if (imagefilter($im, IMG_FILTER_SMOOTH, -1924.124)) {
- imagepng($im, $SAVE_DIR . "/IMG_FILTER_SMOOTH.png");
- echo "IMG_FILTER_SMOOTH success\n";
- @unlink($SAVE_DIR . "/IMG_FILTER_SMOOTH.png");
- } else {
- echo "IMG_FILTER_SMOOTH failed\n";
- }
+ if (imagefilter($im, IMG_FILTER_SMOOTH, -1924.124)) {
+ imagepng($im, $SAVE_DIR . "/IMG_FILTER_SMOOTH.png");
+ echo "IMG_FILTER_SMOOTH success\n";
+ @unlink($SAVE_DIR . "/IMG_FILTER_SMOOTH.png");
+ } else {
+ echo "IMG_FILTER_SMOOTH failed\n";
+ }
- $im = imagecreatefrompng($SOURCE_IMG);
+ $im = imagecreatefrompng($SOURCE_IMG);
- if (imagefilter($im, IMG_FILTER_COLORIZE, -127.12, -127.98, 127)) {
- imagepng($im, $SAVE_DIR . "/IMG_FILTER_COLORIZE.png");
- echo "IMG_FILTER_COLORIZE success\n";
- unlink($SAVE_DIR . "/IMG_FILTER_COLORIZE.png");
- } else {
- echo "IMG_FILTER_COLORIZE failed\n";
- }
+ if (imagefilter($im, IMG_FILTER_COLORIZE, -127.12, -127.98, 127)) {
+ imagepng($im, $SAVE_DIR . "/IMG_FILTER_COLORIZE.png");
+ echo "IMG_FILTER_COLORIZE success\n";
+ unlink($SAVE_DIR . "/IMG_FILTER_COLORIZE.png");
+ } else {
+ echo "IMG_FILTER_COLORIZE failed\n";
+ }
- $im = imagecreatefrompng($SOURCE_IMG);
+ $im = imagecreatefrompng($SOURCE_IMG);
- if (imagefilter($im, IMG_FILTER_CONTRAST, -90)) {
- imagepng($im, $SAVE_DIR . "/IMG_FILTER_CONTRAST.png");
- echo "IMG_FILTER_CONTRAST success\n";
- unlink($SAVE_DIR . "/IMG_FILTER_CONTRAST.png");
- } else {
- echo "IMG_FILTER_CONTRAST failed\n";
- }
+ if (imagefilter($im, IMG_FILTER_CONTRAST, -90)) {
+ imagepng($im, $SAVE_DIR . "/IMG_FILTER_CONTRAST.png");
+ echo "IMG_FILTER_CONTRAST success\n";
+ unlink($SAVE_DIR . "/IMG_FILTER_CONTRAST.png");
+ } else {
+ echo "IMG_FILTER_CONTRAST failed\n";
+ }
- $im = imagecreatefrompng($SOURCE_IMG);
+ $im = imagecreatefrompng($SOURCE_IMG);
- if (imagefilter($im, IMG_FILTER_BRIGHTNESS, 98)) {
- imagepng($im, $SAVE_DIR . "/IMG_FILTER_BRIGHTNESS.png");
- echo "IMG_FILTER_BRIGHTNESS success\n";
- unlink($SAVE_DIR . "/IMG_FILTER_BRIGHTNESS.png");
- } else {
- echo "IMG_FILTER_BRIGHTNESS failed\n";
- }
+ if (imagefilter($im, IMG_FILTER_BRIGHTNESS, 98)) {
+ imagepng($im, $SAVE_DIR . "/IMG_FILTER_BRIGHTNESS.png");
+ echo "IMG_FILTER_BRIGHTNESS success\n";
+ unlink($SAVE_DIR . "/IMG_FILTER_BRIGHTNESS.png");
+ } else {
+ echo "IMG_FILTER_BRIGHTNESS failed\n";
+ }
- $im = imagecreatefrompng($SOURCE_IMG);
+ $im = imagecreatefrompng($SOURCE_IMG);
- if (imagefilter($im, IMG_FILTER_PIXELATE, 5, true)) {
- imagepng($im, $SAVE_DIR . "/IMG_FILTER_PIXELATE.png");
- echo "IMG_FILTER_PIXELATE success\n";
- unlink($SAVE_DIR . "/IMG_FILTER_PIXELATE.png");
- } else {
- echo "IMG_FILTER_PIXELATE failed\n";
- }
+ if (imagefilter($im, IMG_FILTER_PIXELATE, 5, true)) {
+ imagepng($im, $SAVE_DIR . "/IMG_FILTER_PIXELATE.png");
+ echo "IMG_FILTER_PIXELATE success\n";
+ unlink($SAVE_DIR . "/IMG_FILTER_PIXELATE.png");
+ } else {
+ echo "IMG_FILTER_PIXELATE failed\n";
+ }
- $im = imagecreatefrompng($SOURCE_IMG);
+ $im = imagecreatefrompng($SOURCE_IMG);
- if (imagefilter($im, IMG_FILTER_SCATTER, 3, 5)) {
- imagepng($im, $SAVE_DIR . "/IMG_FILTER_SCATTER.png");
- echo "IMG_FILTER_SCATTER success\n";
- unlink($SAVE_DIR . "/IMG_FILTER_SCATTER.png");
- } else {
- echo "IMG_FILTER_SCATTER failed\n";
- }
+ if (imagefilter($im, IMG_FILTER_SCATTER, 3, 5)) {
+ imagepng($im, $SAVE_DIR . "/IMG_FILTER_SCATTER.png");
+ echo "IMG_FILTER_SCATTER success\n";
+ unlink($SAVE_DIR . "/IMG_FILTER_SCATTER.png");
+ } else {
+ echo "IMG_FILTER_SCATTER failed\n";
+ }
?>
--EXPECT--
IMG_FILTER_NEGATE success
diff --git a/ext/gd/tests/imagefttext.phpt b/ext/gd/tests/imagefttext.phpt
index 85bca4d545..d140af858e 100644
--- a/ext/gd/tests/imagefttext.phpt
+++ b/ext/gd/tests/imagefttext.phpt
@@ -11,41 +11,41 @@ imagefttext() function test
?>
--FILE--
<?php
- $cwd = __DIR__;
- $fontfile_8859 = "$cwd/test8859.ttf";
+ $cwd = __DIR__;
+ $fontfile_8859 = "$cwd/test8859.ttf";
- function testrun($im, $fontfile) {
- $sx = imagesx($im);
- $sy = imagesy($im);
+ function testrun($im, $fontfile) {
+ $sx = imagesx($im);
+ $sy = imagesy($im);
- $colour_w = imagecolorallocate($im, 255, 255, 255);
- $colour_b = imagecolorallocate($im, 0, 0, 0);
+ $colour_w = imagecolorallocate($im, 255, 255, 255);
+ $colour_b = imagecolorallocate($im, 0, 0, 0);
- imagefilledrectangle($im, 0, 0, $sx - 1, $sy - 1, $colour_b);
- imagefttext($im, $sy * 0.75, 0, 0, $sy - 1, $colour_w, $fontfile, "A", array());
+ imagefilledrectangle($im, 0, 0, $sx - 1, $sy - 1, $colour_b);
+ imagefttext($im, $sy * 0.75, 0, 0, $sy - 1, $colour_w, $fontfile, "A", array());
- $cnt = 0;
- for ($y = 0; $y < $sy; ++$y) {
- for ($x = 0; $x < $sx; ++$x) {
- if (imagecolorat($im, $x, $y) == $colour_b) {
- ++$cnt;
- }
- }
- }
+ $cnt = 0;
+ for ($y = 0; $y < $sy; ++$y) {
+ for ($x = 0; $x < $sx; ++$x) {
+ if (imagecolorat($im, $x, $y) == $colour_b) {
+ ++$cnt;
+ }
+ }
+ }
- // imagecolordeallocate($im, $colour_w);
- // imagecolordeallocate($im, $colour_b);
+ // imagecolordeallocate($im, $colour_w);
+ // imagecolordeallocate($im, $colour_b);
- return ($cnt < ($sx * $sy));
- }
+ return ($cnt < ($sx * $sy));
+ }
- $im = imagecreate(256, 256);
- var_dump(testrun($im, $fontfile_8859));
- imagedestroy($im);
+ $im = imagecreate(256, 256);
+ var_dump(testrun($im, $fontfile_8859));
+ imagedestroy($im);
- $im = imagecreatetruecolor(256, 256);
- var_dump(testrun($im, $fontfile_8859));
- imagedestroy($im);
+ $im = imagecreatetruecolor(256, 256);
+ var_dump(testrun($im, $fontfile_8859));
+ imagedestroy($im);
?>
--EXPECT--
bool(true)
diff --git a/ext/gd/tests/imageinterpolation_basic.phpt b/ext/gd/tests/imageinterpolation_basic.phpt
index 80e88647d8..4f01f9b0f2 100644
--- a/ext/gd/tests/imageinterpolation_basic.phpt
+++ b/ext/gd/tests/imageinterpolation_basic.phpt
@@ -7,32 +7,32 @@ if (!extension_loaded('gd')) die('skip gd extension not available');
--FILE--
<?php
$methods = array(
- IMG_BELL,
- IMG_BESSEL,
- IMG_BILINEAR_FIXED,
- IMG_BICUBIC,
- IMG_BICUBIC_FIXED,
- IMG_BLACKMAN,
- IMG_BOX,
- IMG_BSPLINE,
- IMG_CATMULLROM,
- IMG_GAUSSIAN,
- IMG_GENERALIZED_CUBIC,
- IMG_HERMITE,
- IMG_HAMMING,
- IMG_HANNING,
- IMG_MITCHELL,
- IMG_NEAREST_NEIGHBOUR,
- IMG_POWER,
- IMG_QUADRATIC,
- IMG_SINC,
- IMG_TRIANGLE,
- IMG_WEIGHTED4,
+ IMG_BELL,
+ IMG_BESSEL,
+ IMG_BILINEAR_FIXED,
+ IMG_BICUBIC,
+ IMG_BICUBIC_FIXED,
+ IMG_BLACKMAN,
+ IMG_BOX,
+ IMG_BSPLINE,
+ IMG_CATMULLROM,
+ IMG_GAUSSIAN,
+ IMG_GENERALIZED_CUBIC,
+ IMG_HERMITE,
+ IMG_HAMMING,
+ IMG_HANNING,
+ IMG_MITCHELL,
+ IMG_NEAREST_NEIGHBOUR,
+ IMG_POWER,
+ IMG_QUADRATIC,
+ IMG_SINC,
+ IMG_TRIANGLE,
+ IMG_WEIGHTED4,
);
$im = imagecreate(8, 8);
foreach ($methods as $method) {
- imagesetinterpolation($im, $method);
- var_dump(imagegetinterpolation($im) === $method);
+ imagesetinterpolation($im, $method);
+ var_dump(imagegetinterpolation($im) === $method);
}
?>
--EXPECT--
diff --git a/ext/gd/tests/imagewbmp-mb.phpt b/ext/gd/tests/imagewbmp-mb.phpt
index fefbb066c7..664f42c4e3 100644
--- a/ext/gd/tests/imagewbmp-mb.phpt
+++ b/ext/gd/tests/imagewbmp-mb.phpt
@@ -18,9 +18,9 @@ echo 'test create wbmp: ';
$c = imagecolorsforindex($im2, imagecolorat($im2, 3,3));
$failed = false;
foreach ($c as $v) {
- if ($v != 0) {
- $failed = true;
- }
+ if ($v != 0) {
+ $failed = true;
+ }
}
echo !$failed ? 'ok' : 'failed';
echo "\n";
diff --git a/ext/gd/tests/imagewbmp.phpt b/ext/gd/tests/imagewbmp.phpt
index 27491bb42e..ee5dd5c6e2 100644
--- a/ext/gd/tests/imagewbmp.phpt
+++ b/ext/gd/tests/imagewbmp.phpt
@@ -18,9 +18,9 @@ echo 'test create wbmp: ';
$c = imagecolorsforindex($im2, imagecolorat($im2, 3,3));
$failed = false;
foreach ($c as $v) {
- if ($v != 0) {
- $failed = true;
- }
+ if ($v != 0) {
+ $failed = true;
+ }
}
echo !$failed ? 'ok' : 'failed';
echo "\n";
diff --git a/ext/gd/tests/jpeg2png.phpt b/ext/gd/tests/jpeg2png.phpt
index 8d14b33e3a..dfcd1ef1a2 100644
--- a/ext/gd/tests/jpeg2png.phpt
+++ b/ext/gd/tests/jpeg2png.phpt
@@ -15,28 +15,28 @@ jpeg <--> png conversion test
?>
--FILE--
<?php
- $cwd = __DIR__;
+ $cwd = __DIR__;
- echo "PNG to JPEG conversion: ";
- echo imagejpeg(imagecreatefrompng($cwd . "/conv_test.png"), $cwd . "/test_jpeg.jpeg") ? 'ok' : 'failed';
- echo "\n";
+ echo "PNG to JPEG conversion: ";
+ echo imagejpeg(imagecreatefrompng($cwd . "/conv_test.png"), $cwd . "/test_jpeg.jpeg") ? 'ok' : 'failed';
+ echo "\n";
- echo "Generated JPEG to PNG conversion: ";
- echo imagepng(imagecreatefromjpeg($cwd . "/test_jpeg.jpeg"), $cwd . "/test_jpng.png") ? 'ok' : 'failed';
- echo "\n";
+ echo "Generated JPEG to PNG conversion: ";
+ echo imagepng(imagecreatefromjpeg($cwd . "/test_jpeg.jpeg"), $cwd . "/test_jpng.png") ? 'ok' : 'failed';
+ echo "\n";
- echo "JPEG to PNG conversion: ";
- echo imagepng(imagecreatefromjpeg($cwd . "/conv_test.jpg"), $cwd . "/test_png.png") ? 'ok' : 'failed';
- echo "\n";
+ echo "JPEG to PNG conversion: ";
+ echo imagepng(imagecreatefromjpeg($cwd . "/conv_test.jpg"), $cwd . "/test_png.png") ? 'ok' : 'failed';
+ echo "\n";
- echo "Generated PNG to JPEG conversion: ";
- echo imagejpeg(imagecreatefrompng($cwd . "/test_png.png"), $cwd . "/test_pjpeg.jpeg") ? 'ok' : 'failed';
- echo "\n";
+ echo "Generated PNG to JPEG conversion: ";
+ echo imagejpeg(imagecreatefrompng($cwd . "/test_png.png"), $cwd . "/test_pjpeg.jpeg") ? 'ok' : 'failed';
+ echo "\n";
- @unlink($cwd . "/test_jpeg.jpeg");
- @unlink($cwd . "/test_jpng.png");
- @unlink($cwd . "/test_png.png");
- @unlink($cwd . "/test_pjpeg.jpeg");
+ @unlink($cwd . "/test_jpeg.jpeg");
+ @unlink($cwd . "/test_jpng.png");
+ @unlink($cwd . "/test_png.png");
+ @unlink($cwd . "/test_pjpeg.jpeg");
?>
--EXPECT--
PNG to JPEG conversion: ok
diff --git a/ext/gd/tests/jpg2gd-mb.phpt b/ext/gd/tests/jpg2gd-mb.phpt
index b7c0b98ab4..8cf4ffd283 100644
--- a/ext/gd/tests/jpg2gd-mb.phpt
+++ b/ext/gd/tests/jpg2gd-mb.phpt
@@ -12,28 +12,28 @@ jpeg <--> gd1/gd2 conversion test
?>
--FILE--
<?php
- $cwd = __DIR__;
+ $cwd = __DIR__;
- echo "JPEG to GD1 conversion: ";
- echo imagegd(imagecreatefromjpeg($cwd . "/conv_test私はガラスを食べられます.jpg"), $cwd . "/test私はガラスを食べられます.gd1") ? 'ok' : 'failed';
- echo "\n";
+ echo "JPEG to GD1 conversion: ";
+ echo imagegd(imagecreatefromjpeg($cwd . "/conv_test私はガラスを食べられます.jpg"), $cwd . "/test私はガラスを食べられます.gd1") ? 'ok' : 'failed';
+ echo "\n";
- echo "JPEG to GD2 conversion: ";
- echo imagegd2(imagecreatefromjpeg($cwd . "/conv_test私はガラスを食べられます.jpg"), $cwd . "/test私はガラスを食べられます.gd2") ? 'ok' : 'failed';
- echo "\n";
+ echo "JPEG to GD2 conversion: ";
+ echo imagegd2(imagecreatefromjpeg($cwd . "/conv_test私はガラスを食べられます.jpg"), $cwd . "/test私はガラスを食べられます.gd2") ? 'ok' : 'failed';
+ echo "\n";
- echo "GD1 to JPEG conversion: ";
- echo imagejpeg(imagecreatefromgd($cwd . "/test私はガラスを食べられます.gd1"), $cwd . "/test_gd1.jpeg") ? 'ok' : 'failed';
- echo "\n";
+ echo "GD1 to JPEG conversion: ";
+ echo imagejpeg(imagecreatefromgd($cwd . "/test私はガラスを食べられます.gd1"), $cwd . "/test_gd1.jpeg") ? 'ok' : 'failed';
+ echo "\n";
- echo "GD2 to JPEG conversion: ";
- echo imagejpeg(imagecreatefromgd2($cwd . "/test私はガラスを食べられます.gd2"), $cwd . "/test_gd2.jpeg") ? 'ok' : 'failed';
- echo "\n";
+ echo "GD2 to JPEG conversion: ";
+ echo imagejpeg(imagecreatefromgd2($cwd . "/test私はガラスを食べられます.gd2"), $cwd . "/test_gd2.jpeg") ? 'ok' : 'failed';
+ echo "\n";
- @unlink($cwd . "/test私はガラスを食べられます.gd1");
- @unlink($cwd . "/test私はガラスを食べられます.gd2");
- @unlink($cwd . "/test_gd1.jpeg");
- @unlink($cwd . "/test_gd2.jpeg");
+ @unlink($cwd . "/test私はガラスを食べられます.gd1");
+ @unlink($cwd . "/test私はガラスを食べられます.gd2");
+ @unlink($cwd . "/test_gd1.jpeg");
+ @unlink($cwd . "/test_gd2.jpeg");
?>
--EXPECT--
JPEG to GD1 conversion: ok
diff --git a/ext/gd/tests/jpg2gd.phpt b/ext/gd/tests/jpg2gd.phpt
index 6ec714ef27..da671e01ac 100644
--- a/ext/gd/tests/jpg2gd.phpt
+++ b/ext/gd/tests/jpg2gd.phpt
@@ -12,28 +12,28 @@ jpeg <--> gd1/gd2 conversion test
?>
--FILE--
<?php
- $cwd = __DIR__;
+ $cwd = __DIR__;
- echo "JPEG to GD1 conversion: ";
- echo imagegd(imagecreatefromjpeg($cwd . "/conv_test.jpg"), $cwd . "/test_jpeg.gd1") ? 'ok' : 'failed';
- echo "\n";
+ echo "JPEG to GD1 conversion: ";
+ echo imagegd(imagecreatefromjpeg($cwd . "/conv_test.jpg"), $cwd . "/test_jpeg.gd1") ? 'ok' : 'failed';
+ echo "\n";
- echo "JPEG to GD2 conversion: ";
- echo imagegd2(imagecreatefromjpeg($cwd . "/conv_test.jpg"), $cwd . "/test_jpeg.gd2") ? 'ok' : 'failed';
- echo "\n";
+ echo "JPEG to GD2 conversion: ";
+ echo imagegd2(imagecreatefromjpeg($cwd . "/conv_test.jpg"), $cwd . "/test_jpeg.gd2") ? 'ok' : 'failed';
+ echo "\n";
- echo "GD1 to JPEG conversion: ";
- echo imagejpeg(imagecreatefromgd($cwd . "/test_jpeg.gd1"), $cwd . "/test_gd1.jpeg") ? 'ok' : 'failed';
- echo "\n";
+ echo "GD1 to JPEG conversion: ";
+ echo imagejpeg(imagecreatefromgd($cwd . "/test_jpeg.gd1"), $cwd . "/test_gd1.jpeg") ? 'ok' : 'failed';
+ echo "\n";
- echo "GD2 to JPEG conversion: ";
- echo imagejpeg(imagecreatefromgd2($cwd . "/test_jpeg.gd2"), $cwd . "/test_gd2.jpeg") ? 'ok' : 'failed';
- echo "\n";
+ echo "GD2 to JPEG conversion: ";
+ echo imagejpeg(imagecreatefromgd2($cwd . "/test_jpeg.gd2"), $cwd . "/test_gd2.jpeg") ? 'ok' : 'failed';
+ echo "\n";
- @unlink($cwd . "/test_jpeg.gd1");
- @unlink($cwd . "/test_jpeg.gd2");
- @unlink($cwd . "/test_gd1.jpeg");
- @unlink($cwd . "/test_gd2.jpeg");
+ @unlink($cwd . "/test_jpeg.gd1");
+ @unlink($cwd . "/test_jpeg.gd2");
+ @unlink($cwd . "/test_gd1.jpeg");
+ @unlink($cwd . "/test_gd2.jpeg");
?>
--EXPECT--
JPEG to GD1 conversion: ok
diff --git a/ext/gd/tests/libgd00106.phpt b/ext/gd/tests/libgd00106.phpt
index 65e4692ea3..d651b0bb1f 100644
--- a/ext/gd/tests/libgd00106.phpt
+++ b/ext/gd/tests/libgd00106.phpt
@@ -13,9 +13,9 @@ $c2 = imagecolorat($im, 1,2);
$c3 = imagecolorat($im, 2,1);
$c4 = imagecolorat($im, 2,2);
if ($c1 == 0xFFFFFF && $c2 == 0 && $c3 == 0 && $c4 == 0) {
- echo "Ok";
+ echo "Ok";
} else {
- echo "failed";
+ echo "failed";
}
?>
--EXPECT--
diff --git a/ext/gd/tests/libgd00191.phpt b/ext/gd/tests/libgd00191.phpt
index 6e3ffd51b1..983b93e180 100644
--- a/ext/gd/tests/libgd00191.phpt
+++ b/ext/gd/tests/libgd00191.phpt
@@ -14,9 +14,9 @@ imagefilledellipse($im, 30, 50, 20, 20, imagecolorallocate($im, 0, 0, 0));
$index = imagecolorat($im, 12, 28);
$arr = imagecolorsforindex($im, $index);
if ($arr['red'] == 255 && $arr['green'] == 255 && $arr['blue'] == 255) {
- echo "Ok";
+ echo "Ok";
} else {
- echo "failed";
+ echo "failed";
}
?>
--EXPECT--
diff --git a/ext/gd/tests/lines.phpt b/ext/gd/tests/lines.phpt
index 9401b6c82d..34e8304dcd 100644
--- a/ext/gd/tests/lines.phpt
+++ b/ext/gd/tests/lines.phpt
@@ -16,10 +16,10 @@ $p1 = imagecolorat($im, 0,5)==0x00ff00;
$p2 = imagecolorat($im, 5,5)==0x00ff00;
$p3 = true;
for ($x=1; $x<5; $x++) {
- $p3 = $p3 && (imagecolorat($im, $x,5)==0x00ff00);
+ $p3 = $p3 && (imagecolorat($im, $x,5)==0x00ff00);
}
if ($p1 && $p2 && $p3) {
- echo "Horizontal: ok\n";
+ echo "Horizontal: ok\n";
}
$im = imagecreatetruecolor(6,6);
@@ -30,11 +30,11 @@ $p1 = imagecolorat($im, 0,0)==0x00ff00;
$p2 = imagecolorat($im, 0,5)==0x00ff00;
$p3 = true;
for ($y=1; $y<5; $y++) {
- $p3 = $p3 && (imagecolorat($im, 0,$y)==0x00ff00);
+ $p3 = $p3 && (imagecolorat($im, 0,$y)==0x00ff00);
}
if ($p1 && $p2 && $p3) {
- echo "Vertical: ok\n";
+ echo "Vertical: ok\n";
}
@@ -50,12 +50,12 @@ $x=1;
$p3 = true;
for ($y=1; $y<5; $y++) {
- $p3 = $p3 && (imagecolorat($im, $x,$y)==0x00ff00);
- $x++;
+ $p3 = $p3 && (imagecolorat($im, $x,$y)==0x00ff00);
+ $x++;
}
if ($p1 && $p2 && $p3) {
- echo "Diagonal: ok\n";
+ echo "Diagonal: ok\n";
}
// Outside
@@ -64,12 +64,12 @@ imagefill($im, 0,0, 0xffffff);
imageline($im, 12, 12, 23,23, 0x00ff00);
$p3 = true;
for ($x=0; $x<6; $x++) {
- for ($y=0; $y<6; $y++) {
- $p3 = $p3 && (imagecolorat($im, $x,$y)!=0x00ff00);
- }
+ for ($y=0; $y<6; $y++) {
+ $p3 = $p3 && (imagecolorat($im, $x,$y)!=0x00ff00);
+ }
}
if ($p3) {
- echo "Outside 1: ok\n";
+ echo "Outside 1: ok\n";
}
$im = imagecreatetruecolor(6,6);
@@ -77,12 +77,12 @@ imagefill($im, 0,0, 0xffffff);
imageline($im, -12, -12, -23,-23, 0x00ff00);
$p3 = true;
for ($x=0; $x<6; $x++) {
- for ($y=0; $y<6; $y++) {
- $p3 = $p3 && (imagecolorat($im, $x,$y)!=0x00ff00);
- }
+ for ($y=0; $y<6; $y++) {
+ $p3 = $p3 && (imagecolorat($im, $x,$y)!=0x00ff00);
+ }
}
if ($p3) {
- echo "Outside 2: ok\n";
+ echo "Outside 2: ok\n";
}
$im = imagecreatetruecolor(6,6);
@@ -90,12 +90,12 @@ imagefill($im, 0,0, 0xffffff);
imageline($im, -1, -1, 4,4, 0x00ff00);
$p3 = true;
for ($x=0; $x<5; $x++) {
- for ($y=0; $y<5; $y++) {
- $p3 = $p3 && (imagecolorat($im, $x,$y)==0x00ff00);
- }
+ for ($y=0; $y<5; $y++) {
+ $p3 = $p3 && (imagecolorat($im, $x,$y)==0x00ff00);
+ }
}
if ($p3) {
- echo "Outside 2: ok\n";
+ echo "Outside 2: ok\n";
}
diff --git a/ext/gd/tests/png2gd.phpt b/ext/gd/tests/png2gd.phpt
index ea70298292..850cdd0be2 100644
--- a/ext/gd/tests/png2gd.phpt
+++ b/ext/gd/tests/png2gd.phpt
@@ -12,28 +12,28 @@ png <--> gd1/gd2 conversion test
?>
--FILE--
<?php
- $cwd = __DIR__;
+ $cwd = __DIR__;
- echo "PNG to GD1 conversion: ";
- echo imagegd(imagecreatefrompng($cwd . "/conv_test.png"), $cwd . "/test_png.gd1") ? 'ok' : 'failed';
- echo "\n";
+ echo "PNG to GD1 conversion: ";
+ echo imagegd(imagecreatefrompng($cwd . "/conv_test.png"), $cwd . "/test_png.gd1") ? 'ok' : 'failed';
+ echo "\n";
- echo "PNG to GD2 conversion: ";
- echo imagegd2(imagecreatefrompng($cwd . "/conv_test.png"), $cwd . "/test_png.gd2") ? 'ok' : 'failed';
- echo "\n";
+ echo "PNG to GD2 conversion: ";
+ echo imagegd2(imagecreatefrompng($cwd . "/conv_test.png"), $cwd . "/test_png.gd2") ? 'ok' : 'failed';
+ echo "\n";
- echo "GD1 to PNG conversion: ";
- echo imagepng(imagecreatefromgd($cwd . "/test_png.gd1"), $cwd . "/test_gd1.png") ? 'ok' : 'failed';
- echo "\n";
+ echo "GD1 to PNG conversion: ";
+ echo imagepng(imagecreatefromgd($cwd . "/test_png.gd1"), $cwd . "/test_gd1.png") ? 'ok' : 'failed';
+ echo "\n";
- echo "GD2 to PNG conversion: ";
- echo imagepng(imagecreatefromgd2($cwd . "/test_png.gd2"), $cwd . "/test_gd2.png") ? 'ok' : 'failed';
- echo "\n";
+ echo "GD2 to PNG conversion: ";
+ echo imagepng(imagecreatefromgd2($cwd . "/test_png.gd2"), $cwd . "/test_gd2.png") ? 'ok' : 'failed';
+ echo "\n";
- @unlink($cwd . "/test_png.gd1");
- @unlink($cwd . "/test_png.gd2");
- @unlink($cwd . "/test_gd1.png");
- @unlink($cwd . "/test_gd2.png");
+ @unlink($cwd . "/test_png.gd1");
+ @unlink($cwd . "/test_png.gd2");
+ @unlink($cwd . "/test_gd1.png");
+ @unlink($cwd . "/test_gd2.png");
?>
--EXPECT--
PNG to GD1 conversion: ok
diff --git a/ext/gd/tests/pngcomp.phpt b/ext/gd/tests/pngcomp.phpt
index aa663a6dd2..f9065ea82a 100644
--- a/ext/gd/tests/pngcomp.phpt
+++ b/ext/gd/tests/pngcomp.phpt
@@ -12,9 +12,9 @@ png compression test
?>
--FILE--
<?php
- $cwd = __DIR__;
+ $cwd = __DIR__;
- echo "PNG compression test: ";
+ echo "PNG compression test: ";
$im = imagecreatetruecolor(20,20);
imagefilledrectangle($im, 5,5, 10,10, 0xffffff);
@@ -26,7 +26,7 @@ png compression test
echo "ok\n";
}
- @unlink($cwd . "/test_pngcomp.png");
+ @unlink($cwd . "/test_pngcomp.png");
?>
--EXPECT--
PNG compression test: ok
diff --git a/ext/gd/tests/types.phpt b/ext/gd/tests/types.phpt
index 246e3ba7d2..7510ba17c6 100644
--- a/ext/gd/tests/types.phpt
+++ b/ext/gd/tests/types.phpt
@@ -9,23 +9,23 @@ imagetypes
$flags = imagetypes();
if ($flags&0x1 && !function_exists("imagegif")) {
- echo "gif failed\n";
+ echo "gif failed\n";
}
if ($flags&0x2 && !function_exists("imagejpeg")) {
- echo "jpeg failed\n";
+ echo "jpeg failed\n";
}
if ($flags&0x4 && !function_exists("imagepng")) {
- echo "png failed\n";
+ echo "png failed\n";
}
if ($flags&0x8 && !function_exists("imagewbmp")) {
- echo "wbmp failed\n";
+ echo "wbmp failed\n";
}
if ($flags&16 && !function_exists("imagecreatefromxpm")) {
- echo "xom failed\n";
+ echo "xom failed\n";
}
echo "ok\n";
?>
diff --git a/ext/gd/tests/xbm2png.phpt b/ext/gd/tests/xbm2png.phpt
index 8dcd07bc4a..9b1b4013c8 100644
--- a/ext/gd/tests/xbm2png.phpt
+++ b/ext/gd/tests/xbm2png.phpt
@@ -14,13 +14,13 @@ xbm --> png conversion test
?>
--FILE--
<?php
- $cwd = __DIR__;
+ $cwd = __DIR__;
- echo "XBM to PNG conversion: ";
- echo imagepng(imagecreatefromxbm($cwd . "/conv_test.xbm"), $cwd . "/test_xbm.png") ? 'ok' : 'failed';
- echo "\n";
+ echo "XBM to PNG conversion: ";
+ echo imagepng(imagecreatefromxbm($cwd . "/conv_test.xbm"), $cwd . "/test_xbm.png") ? 'ok' : 'failed';
+ echo "\n";
- @unlink($cwd . "/test_xbm.png");
+ @unlink($cwd . "/test_xbm.png");
?>
--EXPECT--
XBM to PNG conversion: ok
diff --git a/ext/gd/tests/xpm2gd.phpt b/ext/gd/tests/xpm2gd.phpt
index f48dcb2b3b..dba9f03ec8 100644
--- a/ext/gd/tests/xpm2gd.phpt
+++ b/ext/gd/tests/xpm2gd.phpt
@@ -12,18 +12,18 @@ xpm --> gd1/gd2 conversion test
?>
--FILE--
<?php
- $cwd = __DIR__;
+ $cwd = __DIR__;
- echo "XPM to GD1 conversion: ";
- echo imagegd(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.gd1") ? 'ok' : 'failed';
- echo "\n";
+ echo "XPM to GD1 conversion: ";
+ echo imagegd(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.gd1") ? 'ok' : 'failed';
+ echo "\n";
- echo "XPM to GD2 conversion: ";
- echo imagegd2(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.gd2") ? 'ok' : 'failed';
- echo "\n";
+ echo "XPM to GD2 conversion: ";
+ echo imagegd2(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.gd2") ? 'ok' : 'failed';
+ echo "\n";
- @unlink($cwd . "/test_xpm.gd1");
- @unlink($cwd . "/test_xpm.gd2");
+ @unlink($cwd . "/test_xpm.gd1");
+ @unlink($cwd . "/test_xpm.gd2");
?>
--EXPECT--
XPM to GD1 conversion: ok
diff --git a/ext/gd/tests/xpm2jpg.phpt b/ext/gd/tests/xpm2jpg.phpt
index 92cab3e5fa..6491b85646 100644
--- a/ext/gd/tests/xpm2jpg.phpt
+++ b/ext/gd/tests/xpm2jpg.phpt
@@ -15,13 +15,13 @@ xpm --> jpeg conversion test
?>
--FILE--
<?php
- $cwd = __DIR__;
+ $cwd = __DIR__;
- echo "XPM to JPEG conversion: ";
- echo imagejpeg(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.jpeg") ? 'ok' : 'failed';
- echo "\n";
+ echo "XPM to JPEG conversion: ";
+ echo imagejpeg(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.jpeg") ? 'ok' : 'failed';
+ echo "\n";
- @unlink($cwd . "/test_xpm.jpeg");
+ @unlink($cwd . "/test_xpm.jpeg");
?>
--EXPECT--
XPM to JPEG conversion: ok
diff --git a/ext/gd/tests/xpm2png.phpt b/ext/gd/tests/xpm2png.phpt
index e473cfb31c..602fc72a7c 100644
--- a/ext/gd/tests/xpm2png.phpt
+++ b/ext/gd/tests/xpm2png.phpt
@@ -15,13 +15,13 @@ xpm --> png conversion test
?>
--FILE--
<?php
- $cwd = __DIR__;
+ $cwd = __DIR__;
- echo "XPM to PNG conversion: ";
- echo imagepng(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.png") ? 'ok' : 'failed';
- echo "\n";
+ echo "XPM to PNG conversion: ";
+ echo imagepng(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.png") ? 'ok' : 'failed';
+ echo "\n";
- @unlink($cwd . "/test_xpm.png");
+ @unlink($cwd . "/test_xpm.png");
?>
--EXPECT--
XPM to PNG conversion: ok