]> granicus.if.org Git - php/commit
Fix test_image_equals_file() wrt. palette images
authorChristoph M. Becker <cmbecker69@gmx.de>
Sun, 25 Sep 2016 08:30:48 +0000 (10:30 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Sun, 25 Sep 2016 08:34:03 +0000 (10:34 +0200)
commitc696bc8cfac64a66bb69dffe96d312a621fcdab7
tree5cf87334b08fb64434e003aa83e68fde288f4ed6
parentc596b02a5b451ad95987f7a8c86b0ba313efa5a8
Fix test_image_equals_file() wrt. palette images

The recently introduced test_image_equals_file() doesn't properly work for
palette images, because in this case only the palette indexes are compared,
what can lead to false positives and negatives as shown in the added test.

To fix that we convert palette images to truecolor, what is supposed to be
faster than calling imagecolorsforindex() for each pixel.

We furthermore rely on PHP's refcounting to free unused images; after all,
this is not C.
ext/gd/tests/func.inc
ext/gd/tests/test_image_equals_file_palette.phpt [new file with mode: 0644]