summaryrefslogtreecommitdiff
path: root/ext/gd/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/tests')
-rw-r--r--ext/gd/tests/bug42434.phpt1
-rw-r--r--ext/gd/tests/bug51263.phpt32
-rw-r--r--ext/gd/tests/bug51671.phpt24
-rwxr-xr-xext/gd/tests/imageantialias_error1.phpt1
-rwxr-xr-xext/gd/tests/imageantialias_error2.phpt1
-rw-r--r--ext/gd/tests/imagelayereffect_basic.phpt2
-rw-r--r--ext/gd/tests/imagelayereffect_error1.phpt2
-rw-r--r--ext/gd/tests/imagelayereffect_error2.phpt2
-rw-r--r--ext/gd/tests/imagelayereffect_error3.phpt2
9 files changed, 63 insertions, 4 deletions
diff --git a/ext/gd/tests/bug42434.phpt b/ext/gd/tests/bug42434.phpt
index cede1ac17..bc0790ede 100644
--- a/ext/gd/tests/bug42434.phpt
+++ b/ext/gd/tests/bug42434.phpt
@@ -5,6 +5,7 @@ Bug #42434 (ImageLine w/ antialias = 1px shorter)
if (!extension_loaded('gd')) {
die('skip gd extension not available');
}
+if (!GD_BUNDLED) die("skip requires bundled GD library\n");
?>
--FILE--
<?php
diff --git a/ext/gd/tests/bug51263.phpt b/ext/gd/tests/bug51263.phpt
new file mode 100644
index 000000000..8e86f4176
--- /dev/null
+++ b/ext/gd/tests/bug51263.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Bug #51263 (imagettftext and rotated text uses wrong baseline)
+--SKIPIF--
+<?php
+ if(!extension_loaded('gd')){ die('skip gd extension not available'); }
+ if(!function_exists('imagettftext')) die('skip imagettftext() not available');
+?>
+--FILE--
+<?php
+$cwd = dirname(__FILE__);
+$ttf = "$cwd/Tuffy.ttf";
+$w = 23;
+$h = 70;
+$img = imagecreatetruecolor($w, $h);
+$blk = imagecolorallocate($img, 0, 0, 0);
+imagefilledrectangle($img, 0, 0, $w-1, $h-1, $blk);
+$col = imagecolorallocate($img, 255, 255, 255);
+imagettftext($img, 8, 90, 10, 60, $col, $ttf, "foo bar qux");
+$x = array(0, 1, 2, 3, 13);
+for ($j=0; $j<30; $j++) {
+ foreach ($x as $i) {
+ $c = imagecolorat($img, $i, $j);
+ if ($c != 0) {
+ echo "KO: ($i, $j)\n";
+ exit;
+ }
+ }
+}
+echo "OK\n";
+?>
+--EXPECTF--
+OK
diff --git a/ext/gd/tests/bug51671.phpt b/ext/gd/tests/bug51671.phpt
new file mode 100644
index 000000000..5dd77fe67
--- /dev/null
+++ b/ext/gd/tests/bug51671.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #51671 (imagefill does not work correctly for small images)
+--SKIPIF--
+<?php
+ if(!extension_loaded('gd')){ die('skip gd extension not available'); }
+?>
+--FILE--
+<?php
+$w = 1;
+$h = 50;
+$im = imagecreatetruecolor($w, $h);
+$white = imagecolorallocate($im, 255, 255, 255);
+imagefill($im, 0, 0, $white);
+
+for ($iy = 0; $iy < $h; $iy++) {
+ if (($c = imagecolorat($im, 0, $iy)) != $white) {
+ printf("Failed, (0, $iy) is %X\n", $c);
+ }
+}
+
+echo "OK\n";
+?>
+--EXPECTF--
+OK
diff --git a/ext/gd/tests/imageantialias_error1.phpt b/ext/gd/tests/imageantialias_error1.phpt
index 53fe0cc66..e9475e957 100755
--- a/ext/gd/tests/imageantialias_error1.phpt
+++ b/ext/gd/tests/imageantialias_error1.phpt
@@ -6,6 +6,7 @@ Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
+if (!GD_BUNDLED) die("skip requires bundled GD library\n");
?>
--FILE--
<?php
diff --git a/ext/gd/tests/imageantialias_error2.phpt b/ext/gd/tests/imageantialias_error2.phpt
index 8dad8bd11..64b0a60eb 100755
--- a/ext/gd/tests/imageantialias_error2.phpt
+++ b/ext/gd/tests/imageantialias_error2.phpt
@@ -6,6 +6,7 @@ Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
+if (!GD_BUNDLED) die("skip requires bundled GD library\n");
?>
--FILE--
<?php
diff --git a/ext/gd/tests/imagelayereffect_basic.phpt b/ext/gd/tests/imagelayereffect_basic.phpt
index 6dbc8600c..a34e05e02 100644
--- a/ext/gd/tests/imagelayereffect_basic.phpt
+++ b/ext/gd/tests/imagelayereffect_basic.phpt
@@ -6,7 +6,7 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
- if (!GD_BUNDLED) die('function only available in bundled, external GD detected');
+ if (!GD_BUNDLED) die('skip function only available in bundled, external GD detected');
?>
--FILE--
<?php
diff --git a/ext/gd/tests/imagelayereffect_error1.phpt b/ext/gd/tests/imagelayereffect_error1.phpt
index ad457103c..21f37a8a1 100644
--- a/ext/gd/tests/imagelayereffect_error1.phpt
+++ b/ext/gd/tests/imagelayereffect_error1.phpt
@@ -6,7 +6,7 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
- if (!GD_BUNDLED) die('function only available in bundled, external GD detected');
+ if (!GD_BUNDLED) die('skip function only available in bundled, external GD detected');
?>
--FILE--
<?php
diff --git a/ext/gd/tests/imagelayereffect_error2.phpt b/ext/gd/tests/imagelayereffect_error2.phpt
index 7fb993969..d8d331bfd 100644
--- a/ext/gd/tests/imagelayereffect_error2.phpt
+++ b/ext/gd/tests/imagelayereffect_error2.phpt
@@ -6,7 +6,7 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
- if (!GD_BUNDLED) die('function only available in bundled, external GD detected');
+ if (!GD_BUNDLED) die('skip function only available in bundled, external GD detected');
?>
--FILE--
<?php
diff --git a/ext/gd/tests/imagelayereffect_error3.phpt b/ext/gd/tests/imagelayereffect_error3.phpt
index 9f9918633..d4deff107 100644
--- a/ext/gd/tests/imagelayereffect_error3.phpt
+++ b/ext/gd/tests/imagelayereffect_error3.phpt
@@ -6,7 +6,7 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
- if (!GD_BUNDLED) die('function only available in bundled, external GD detected');
+ if (!GD_BUNDLED) die('skip function only available in bundled, external GD detected');
?>
--FILE--
<?php