cvs: php-src /ext/gd/tests bug24155.phpt bug27582_1.phpt
| From: | Pierre-Alain Joye | Date: | Mon, 25 Apr 2005 11:36:25 +0000 |
| Subject: | cvs: php-src /ext/gd/tests bug24155.phpt bug27582_1.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-31584@lists.php.net to get a copy of this message | ||
pajoye Mon Apr 25 07:36:25 2005 EDT
Modified files:
/php-src/ext/gd/tests bug24155.phpt bug27582_1.phpt
Log:
- do not use md5, png signature can change between libpng version
some floating points issue can end to different colors (+/- 1/255)
tests should work again now.
http://cvs.php.net/diff.php/php-src/ext/gd/tests/bug24155.phpt?r1=1.2&r2=1.3&ty=u
Index: php-src/ext/gd/tests/bug24155.phpt
diff -u php-src/ext/gd/tests/bug24155.phpt:1.2 php-src/ext/gd/tests/bug24155.phpt:1.3
--- php-src/ext/gd/tests/bug24155.phpt:1.2 Thu Apr 8 04:39:41 2004
+++ php-src/ext/gd/tests/bug24155.phpt Mon Apr 25 07:36:24 2005
@@ -19,8 +19,14 @@
$im = imagerotate($im, 270, 255);
imagepng($im, $dest);
- echo md5_file($dest) . "\n";
+ $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";
+
@unlink($dest);
?>
--EXPECT--
-cc867fd65c30883463ce58d0341f0997
+16776960
http://cvs.php.net/diff.php/php-src/ext/gd/tests/bug27582_1.phpt?r1=1.4&r2=1.5&ty=u
Index: php-src/ext/gd/tests/bug27582_1.phpt
diff -u php-src/ext/gd/tests/bug27582_1.phpt:1.4 php-src/ext/gd/tests/bug27582_1.phpt:1.5
--- php-src/ext/gd/tests/bug27582_1.phpt:1.4 Sun Apr 3 07:15:39 2005
+++ php-src/ext/gd/tests/bug27582_1.phpt Mon Apr 25 07:36:24 2005
@@ -12,13 +12,17 @@
@unlink($dest);
$im = ImageCreateTrueColor(10, 10);
imagealphablending($im, true);
-imagesavealpha($im, false);
+imagesavealpha($im, true);
$bordercolor=ImageColorAllocateAlpha($im, 0, 0, 0, 2);
$color = ImageColorAllocateAlpha($im, 0, 0, 0, 1);
ImageFillToBorder($im, 5, 5, $bordercolor, $color);
imagepng($im, $dest);
-echo md5_file($dest) . "\n";
+
+$im2 = imagecreatefrompng($dest);
+$col = imagecolorat($im2, 5, 5);
+$color = imagecolorsforindex($im2, $col);
+echo $color['alpha'];
@unlink($dest);
?>
--EXPECT--
-08287f8f5d406946009df5f04ca83dc0
+1