]> granicus.if.org Git - php/commitdiff
Replace md5 image comparision with test_image_equals_file()
authorChristoph M. Becker <cmbecker69@gmx.de>
Sun, 11 Sep 2016 12:56:11 +0000 (14:56 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Sun, 11 Sep 2016 12:56:11 +0000 (14:56 +0200)
ext/gd/tests/bug22544-mb.phpt
ext/gd/tests/bug22544私はガラスを食べられます.png [new file with mode: 0644]

index d4f5929d6d09052c640717281f8879b15945f86a..0847214dc3a94f1a7b751ad37d25cc84f4ffe78c 100644 (file)
@@ -8,16 +8,13 @@ Bug #22544 (TrueColor transparency in PNG images).
 ?>
 --FILE--
 <?php
-       $dest = dirname(realpath(__FILE__)) . '/bug22544私はガラスを食べられます.png';
-       @unlink($dest);
        $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);
-       imagegd($image, $dest);
-       echo md5_file($dest) . "\n";
-       @unlink($dest);
+       include_once __DIR__ . '/func.inc';
+       test_image_equals_file(__DIR__ . '/bug22544私はガラスを食べられます.png', $image);
 ?>
 --EXPECT--
-7643ef115f642a79c2de6e411f485ddd
+The images are equal.
diff --git a/ext/gd/tests/bug22544私はガラスを食べられます.png b/ext/gd/tests/bug22544私はガラスを食べられます.png
new file mode 100644 (file)
index 0000000..5e6251f
Binary files /dev/null and "b/ext/gd/tests/bug22544\347\247\201\343\201\257\343\202\254\343\203\251\343\202\271\343\202\222\351\243\237\343\201\271\343\202\211\343\202\214\343\201\276\343\201\231.png" differ