Re: cvs: php4 /ext/gd/tests conv_test.gif conv_test.jpeg conv_test.png conv_test.xpm gif2gd.phpt gif2jpg.phpt gif2png.phpt jpeg2png.phpt
jpg2gd.phpt png2gd.phpt xpm2gd.phpt xpm2jpg.phpt xpm2png.phpt
| From: | (Marcus Börger) | Date: | Thu, 05 Dec 2002 15:37:04 +0000 |
| Subject: | Re: cvs: php4 /ext/gd/tests conv_test.gif conv_test.jpeg conv_test.png conv_test.xpm gif2gd.phpt gif2jpg.phpt gif2png.phpt jpeg2png.phpt jpg2gd.phpt png2gd.phpt xpm2gd.phpt xpm2jpg.phpt xpm2png.phpt |
||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-16927@lists.php.net to get a copy of this message | ||
At 16:20 05.12.2002, Ilia A. wrote:
My tests have a if (!GD_BUNDLED) {}, which as I understand should cause the test to be skipped in the event non-bundled GD is being used. The bundled gdyou meant "non bundeled gd" here
will always fail and that is NOT an assumption, the external gd has bugs that were fixed in bundled gd these are known so it is pointless to make the tests work with bundled gd, we'd just get pointless bug reports about something that we do not have control over. MD5 hashes may be unreliable because float calculations tend to give slightly different results depending on a platform due to rounding issues.In most cases they should work becuase of little resolution required during internal operations (calculations). Most problematic in this manner are lossy file formats such as jpeg. For loss less file formats floating point differences in the different platforms shouldn't result in different images anyway. Maybe we must create a special test images that allows such hash comparisons.
I'll will try to test this on a SunOS box later on and see if that is indeed the case. Perhaps a filesize check would be appropriate, something that would compare the generated image size and see if it is within the reasonable bounds (+- 10 bytes) of the expected image.If we cannot work with md5 hashes i think that's the way to go.
Ilia On December 5, 2002 06:05 am, Marcus Börger wrote: Hi Ilia, when testing conversion to gd2 you do not test for gd2 existance (imagegd2() function) instead you assume that the tests fail if one uses an external gd lib (what makes the function check needless of cause). But why is that so? And why not print out an error then? Maybe we direct the users to use the internal lib then and receive less bug reports. What i really didlike with your tests is that you simply verify that there is an output by checking that there is no error. I miss a check for the output here. For example yesturday i experimented with rle gifs and was glad when i got no more errors and warnings. But then when looking at the generated images i saw they contained bullshit. Therefore i suggest you generate an md5 hash from the output and verify that, too. Why is there 'jpegxxx' and jpgxxx'? What about png2jpg, png2xpm and jpeg2xpm? Last but not least it would have liked it more if the names were different: 'conv_'<format1>'2'<format2>'.phpt'. or 'gd_'<format1>'2'<format2>'.phpt'. regards marcus At 22:04 04.12.2002, Ilia Alshanetsky wrote:-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpiliaa Wed Dec 4 16:04:07 2002 EDTAdded files:/php4/ext/gd/tests conv_test.gif conv_test.jpeg conv_test.png conv_test.xpm gif2gd.phpt gif2jpg.phpt gif2png.phpt jpeg2png.phpt jpg2gd.phpt png2gd.phpt xpm2gd.phpt xpm2jpg.phpt xpm2png.phptLog: Added GD image conversion tests. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php