From dc09f309335cf8df7d39adc03580ac8d4f0c78f5 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 19 Jun 2016 14:29:27 +0200 Subject: [PATCH] A picture is worth a thousand message digests The bundled GD test suites makes heavy use of md5() to verify the result of drawing operations. This leads to fragile tests (even a slight change in a PNG header would cause failure, and of course there is the possibility of collisions), and even worse, eventual test failures are rather unrevealing. Therefore we replace all md5() verification with a simplistic test_image_equals_file(), which is basically a simplified port of libgd's gdTestImageCompareToFile(), adapted to the needs of PHPTs. In the long run better tests helpers should be introduced (see also ), but for now this solution is preferable over the former. (cherry picked from commit 24f9e96792518ec2a75f26b1eb2471dd7694f2b7) --- .gitignore | 1 + ext/gd/tests/bug22544.phpt | 9 +-- ext/gd/tests/bug22544.png | Bin 0 -> 284 bytes ext/gd/tests/bug43828.phpt | 8 +-- ext/gd/tests/bug43828.png | Bin 0 -> 656 bytes ext/gd/tests/bug66005.phpt | 7 +- ext/gd/tests/bug66005.png | Bin 0 -> 430 bytes ext/gd/tests/bug72604.phpt | 9 ++- ext/gd/tests/bug72604.png | Bin 0 -> 700 bytes ext/gd/tests/bug72913.phpt | 7 +- ext/gd/tests/bug72913.png | Bin 0 -> 147 bytes ext/gd/tests/func.inc | 68 ++++++++++++++++++ ext/gd/tests/imagearc_basic.phpt | 10 +-- ext/gd/tests/imagearc_basic.png | Bin 0 -> 216 bytes ext/gd/tests/imagearc_error1.phpt | 10 +-- ext/gd/tests/imagearc_error1.png | Bin 0 -> 109 bytes ext/gd/tests/imagearc_variation1.phpt | 10 +-- ext/gd/tests/imagearc_variation1.png | Bin 0 -> 272 bytes ext/gd/tests/imagearc_variation2.phpt | 10 +-- ext/gd/tests/imagearc_variation2.png | Bin 0 -> 186 bytes ext/gd/tests/imagechar_basic.phpt | 10 +-- ext/gd/tests/imagechar_basic.png | Bin 0 -> 128 bytes ext/gd/tests/imagecharup_basic.phpt | 10 +-- ext/gd/tests/imagecharup_basic.png | Bin 0 -> 129 bytes .../tests/imagecolorallocatealpha_basic.phpt | 10 +-- .../tests/imagecolorallocatealpha_basic.png | Bin 0 -> 565 bytes ext/gd/tests/imagecolorset_basic.phpt | 10 +-- ext/gd/tests/imagecolorset_basic.png | Bin 0 -> 99 bytes ext/gd/tests/imageconvolution_basic.phpt | 10 +-- ext/gd/tests/imageconvolution_basic.png | Bin 0 -> 978 bytes ext/gd/tests/imagecreatetruecolor_basic.phpt | 10 +-- ext/gd/tests/imagecreatetruecolor_basic.png | Bin 0 -> 95 bytes ext/gd/tests/imageellipse_basic.phpt | 10 +-- ext/gd/tests/imageellipse_basic.png | Bin 0 -> 1474 bytes ext/gd/tests/imagefilledarc_basic.phpt | 10 +-- ext/gd/tests/imagefilledarc_basic.png | Bin 0 -> 200 bytes ext/gd/tests/imagefilledarc_error1.phpt | 10 +-- ext/gd/tests/imagefilledarc_error1.png | Bin 0 -> 109 bytes ext/gd/tests/imagefilledarc_variation1.phpt | 10 +-- ext/gd/tests/imagefilledarc_variation1.png | Bin 0 -> 281 bytes ext/gd/tests/imagefilledarc_variation2.phpt | 10 +-- ext/gd/tests/imagefilledarc_variation2.png | Bin 0 -> 197 bytes ext/gd/tests/imagefilledellipse_basic.phpt | 10 +-- ext/gd/tests/imagefilledellipse_basic.png | Bin 0 -> 274 bytes ext/gd/tests/imagefilltoborder_basic.phpt | 10 +-- ext/gd/tests/imagefilltoborder_basic.png | Bin 0 -> 530 bytes ext/gd/tests/imagegammacorrect_basic.phpt | 14 ++-- ext/gd/tests/imagegammacorrect_basic.png | Bin 0 -> 363 bytes .../tests/imagegammacorrect_variation1.phpt | 14 ++-- ext/gd/tests/imagegammacorrect_variation1.png | Bin 0 -> 199 bytes ext/gd/tests/imagelayereffect_basic.phpt | 14 ++-- ext/gd/tests/imagelayereffect_basic.png | Bin 0 -> 95 bytes ext/gd/tests/imagerectangle_basic.phpt | 11 +-- ext/gd/tests/imagerectangle_basic.png | Bin 0 -> 220 bytes ext/gd/tests/imagesetbrush_basic.phpt | 10 +-- ext/gd/tests/imagesetbrush_basic.png | Bin 0 -> 161 bytes ext/gd/tests/imagesetthickness_basic.phpt | 10 +-- ext/gd/tests/imagesetthickness_basic.png | Bin 0 -> 377 bytes ext/gd/tests/imagestring_basic.phpt | 10 +-- ext/gd/tests/imagestring_basic.png | Bin 0 -> 234 bytes ext/gd/tests/imagestringup_basic.phpt | 10 +-- ext/gd/tests/imagestringup_basic.png | Bin 0 -> 163 bytes .../tests/imagetruecolortopalette_basic.phpt | 10 +-- .../tests/imagetruecolortopalette_basic.png | Bin 0 -> 208 bytes ext/gd/tests/libgd00100.phpt | 10 +-- ext/gd/tests/libgd00100.png | Bin 0 -> 2103 bytes 66 files changed, 173 insertions(+), 219 deletions(-) create mode 100644 ext/gd/tests/bug22544.png create mode 100644 ext/gd/tests/bug43828.png create mode 100644 ext/gd/tests/bug66005.png create mode 100644 ext/gd/tests/bug72604.png create mode 100644 ext/gd/tests/bug72913.png create mode 100644 ext/gd/tests/imagearc_basic.png create mode 100644 ext/gd/tests/imagearc_error1.png create mode 100644 ext/gd/tests/imagearc_variation1.png create mode 100644 ext/gd/tests/imagearc_variation2.png create mode 100644 ext/gd/tests/imagechar_basic.png create mode 100644 ext/gd/tests/imagecharup_basic.png create mode 100644 ext/gd/tests/imagecolorallocatealpha_basic.png create mode 100644 ext/gd/tests/imagecolorset_basic.png create mode 100644 ext/gd/tests/imageconvolution_basic.png create mode 100644 ext/gd/tests/imagecreatetruecolor_basic.png create mode 100644 ext/gd/tests/imageellipse_basic.png create mode 100644 ext/gd/tests/imagefilledarc_basic.png create mode 100644 ext/gd/tests/imagefilledarc_error1.png create mode 100644 ext/gd/tests/imagefilledarc_variation1.png create mode 100644 ext/gd/tests/imagefilledarc_variation2.png create mode 100644 ext/gd/tests/imagefilledellipse_basic.png create mode 100644 ext/gd/tests/imagefilltoborder_basic.png create mode 100644 ext/gd/tests/imagegammacorrect_basic.png create mode 100644 ext/gd/tests/imagegammacorrect_variation1.png create mode 100644 ext/gd/tests/imagelayereffect_basic.png create mode 100644 ext/gd/tests/imagerectangle_basic.png create mode 100644 ext/gd/tests/imagesetbrush_basic.png create mode 100644 ext/gd/tests/imagesetthickness_basic.png create mode 100644 ext/gd/tests/imagestring_basic.png create mode 100644 ext/gd/tests/imagestringup_basic.png create mode 100644 ext/gd/tests/imagetruecolortopalette_basic.png create mode 100644 ext/gd/tests/libgd00100.png diff --git a/.gitignore b/.gitignore index 0a4efddeca..1ce1eabfe9 100644 --- a/.gitignore +++ b/.gitignore @@ -135,6 +135,7 @@ tests/*/*.sh */tests/*/*.sh */*/tests/*.diff */*/tests/*.out +*/*/tests/*.out.png */*/tests/*.php */*/tests/*.exp */*/tests/*.log diff --git a/ext/gd/tests/bug22544.phpt b/ext/gd/tests/bug22544.phpt index b18eef4332..3d4335d461 100644 --- a/ext/gd/tests/bug22544.phpt +++ b/ext/gd/tests/bug22544.phpt @@ -8,16 +8,13 @@ Bug #22544 (TrueColor transparency in PNG images). ?> --FILE-- --EXPECT-- -7643ef115f642a79c2de6e411f485ddd +The images are equal. diff --git a/ext/gd/tests/bug22544.png b/ext/gd/tests/bug22544.png new file mode 100644 index 0000000000000000000000000000000000000000..5e6251f440385856af629e122ddb0837cd9cdd0e GIT binary patch literal 284 zcmeAS@N?(olHy`uVBq!ia0y~yU}^xeQ#hD_FSZx0$W0(plPeD%-e --EXPECT-- -2400a58cd7570b5472c25264715321cd +The images are equal. diff --git a/ext/gd/tests/bug43828.png b/ext/gd/tests/bug43828.png new file mode 100644 index 0000000000000000000000000000000000000000..bb7fcd543e1ac75e290212beffca6ca565d6c3d5 GIT binary patch literal 656 zcmeAS@N?(olHy`uVBq!ia0vp^DImRXg8B&VT**ePOxiyX}9KuRpK) z7rcE(w#sV1fQRB{!sR=4N_}^_n*@|iUBlK_~&6>m-voPo4-(9zTE7z@X z(T)6@@o9y-k9wr+tWO%(%CsVFt+_7F`g_XwwAs{?QmVm%>dPa1H?f&MUAazvn&~dh zh3mL|rtts# zx!x#}VG8Snsis$@zPu@)JI!>tX5#X4J?Dm&H8Yb{pYR;nl;P!3^}vYb$E2eXtvR^{ zAmtw>9yQ&eT68FdaZjpYn5C1kj~GKLV}RI!M;06UKGe<7VK~LK07OJs-1QdlhRTAK zU=ljEbEaRgPwG4g(Xv3N;pp9xb*CLF>|v%xiyaT^yTCIUWN$%k=NyO|RJ*keQ?i>+ zGIgXH#yDMaR*L*G)%ZXv$AoF7#XHKX&Z}kn#oJtWtp_g(1Qz?gqB+*SX>`h~plrLk9XWZk}p#@0V| zywdzGyz)q;wV&*~_wgam1uxH%wmSK$vP<*Yva*Nn?ZG~OMYYbasZ%O*RsA(xo>(i8QTB= literal 0 HcmV?d00001 diff --git a/ext/gd/tests/bug66005.phpt b/ext/gd/tests/bug66005.phpt index a01c5c32b8..307b06855c 100644 --- a/ext/gd/tests/bug66005.phpt +++ b/ext/gd/tests/bug66005.phpt @@ -25,11 +25,10 @@ imagecopy($dest, $png_palette, 0, 0, 0, 0, 50, 50); imagecopy($dest, $png_24, 50, 0, 0, 0, 50, 50); imagecopy($dest, $png_full, 100, 0, 0, 0, 50, 50); -ob_start(); -imagegd($dest); -echo md5(ob_get_clean()), PHP_EOL; +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/bug66005.png', $dest); ?> ==DONE== --EXPECT-- -9b36049de01006b367efd433f1689043 +The images are equal. ==DONE== diff --git a/ext/gd/tests/bug66005.png b/ext/gd/tests/bug66005.png new file mode 100644 index 0000000000000000000000000000000000000000..f654b3d0cd4648444ddadd2c3d0e9c07895cdce9 GIT binary patch literal 430 zcmeAS@N?(olHy`uVBq!ia0vp^(}38BgAGXT>rs+oU|=luba4!+nDh3|#k@lX0<0Hz zy!!ut)9(t{7VbuC%A0-_{|iXixqoArp4-#HDQd-QTtX}FEcS`GD*jbReCbJ~;T6@G7u)j1?TN9uDVq^H9{m&NEYkj&^eQ)cT`wCOza0Uo0 b#C|Xt)mA08lxIu=#sh<=tDnm{r-UW|C= --EXPECT-- -4f5080080a774efe4fc8d55cd4a5849c +The images are equal. diff --git a/ext/gd/tests/bug72604.png b/ext/gd/tests/bug72604.png new file mode 100644 index 0000000000000000000000000000000000000000..a3daed2bc02929121d6baa0d29da0957bc4e3ca4 GIT binary patch literal 700 zcmV;t0z>_YP) z*>=Mq3`BAN|DW9la&o9^V@7CUnfu&=W-JIML8L?o*_-n`P5)k(Bd~9=^5cjJ+ppL2 zJdfj0PmSEBk9|&NISd~MzYIGtN~JociDqS1>`a_&5>3BF)Fw!kY2)v$DYli`#C!$F z#!LBMPPHRK$3NY_98O{BMQbD(ygRxRzT%%KVbDshCY9_`}k6*HPs8KbDW^o;3L z#v(Skq^D@YZ7R_XQYh>;h@osM(TY|gZ!V`YDltpeg#EpS&>uM_a$cu0o$+_QmrZ0- ziCBny1wW}%$zkbmc^dON^+lklDYL>iryOW{8yB>)Kw4!`Y4Du2j8jQ{oweRn^`CZ) zI{R6h0Bo2onO2!brH}geaVpcIm%|X?-mD!KR&{P2Xv(bR$6!)i!IR95ox4r#C3Wr0 zEP$(7oZ3q+ZoFjHR%0-!zew*4%>tlV0Dp$)&WnbUCm)zu05l7LW&zMF0Gb6rvjAuo z0L=oRSpYN(fMx;EEC8AXK(hd7768oxxNh%p|F7ZzGYf!b0njXf7qfQzg1WBvYSxA` zdIkP4M9zI4?YV$>Rn5!-;MtuIEgJ95+GN~S;7_}I;R%bB`cGIutxOFMI+*|;&Ri_H zAa!tNt+b4Q>%7StT_C>%qIh=aLyJav5saxFlxdNF8qPa;$;%Y?cQa9n`PHIP=`RrP zDo0wq`V&(>OR;Y^A}h01B9H}P#}GCD>Y=0oEE}tuWM)jiMyyks8O^V8E8u2cYb#sd zoX}FJzdrz0?FL{ycmVxJ&6@^b!e6s3hP>4tymi6+kba%Sta0y-)3-Zz58N|_BVS6U iyDKc1xo)8&#D-sSr&g|sS}peg0000 ==DONE== --EXPECT-- -f03c27f20710e21debd7090c660f1a1e +The images are equal. ==DONE== diff --git a/ext/gd/tests/bug72913.png b/ext/gd/tests/bug72913.png new file mode 100644 index 0000000000000000000000000000000000000000..83eeb81fb16acb3131c987d331ebeb53962ccb1b GIT binary patch literal 147 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_{3?x-PN__%SYymzYuK$66f#G%3^T|LF#*!ev zU --EXPECT-- -13149c3fd54a92a0d43cd5083a19b1d7 +The images are equal. diff --git a/ext/gd/tests/imagearc_basic.png b/ext/gd/tests/imagearc_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..42a4d68988a9af732c6e17cae2aa08bf2d54fd40 GIT binary patch literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^DImtiZ!^;KKj^ zH*FOPyMv^J3H zhOK+`=8_1``43lcndh(eil}{eedeT)TlYWsZS{Y-^4aV3Q`_Fp_Kuyp{CJ4a`E^l$ xm(GcMHrZ78NqcDQHlIA7`nL;%IpKCmyx>g=irg3HY|#o5^K|udS?83{1OO$&P{#lO literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagearc_error1.phpt b/ext/gd/tests/imagearc_error1.phpt index 05d1cd8186..1e63406832 100644 --- a/ext/gd/tests/imagearc_error1.phpt +++ b/ext/gd/tests/imagearc_error1.phpt @@ -17,13 +17,9 @@ $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); //create an arc with white color imagearc($image, 50, 50, 30, 30, 0, 180); -ob_start(); -imagegd($image); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagearc_error1.png', $image); ?> --EXPECTF-- Warning: imagearc() expects exactly 8 parameters, 7 given in %s on line %d -c5b7013900f5466aebfc42499a7ec8ec +The images are equal. diff --git a/ext/gd/tests/imagearc_error1.png b/ext/gd/tests/imagearc_error1.png new file mode 100644 index 0000000000000000000000000000000000000000..9cbff6e164f3c0765951215d47f5aa77cd61672a GIT binary patch literal 109 zcmeAS@N?(olHy`uVBq!ia0vp^DImIxsd50E!_s``s eUjSs{26a58Qy3Um1bngtsqu96b6Mw<&;$S~8x#Ei literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagearc_variation1.phpt b/ext/gd/tests/imagearc_variation1.phpt index aaf6103b43..1b36eedf29 100644 --- a/ext/gd/tests/imagearc_variation1.phpt +++ b/ext/gd/tests/imagearc_variation1.phpt @@ -17,12 +17,8 @@ $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); //create an arc with white color imagearc($image, 50, 50, 30, 30, 0, -90, $white); -ob_start(); -imagegd($image); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagearc_variation1.png', $image); ?> --EXPECT-- -fe662ebe7488057c43e38c5de43b1727 +The images are equal. diff --git a/ext/gd/tests/imagearc_variation1.png b/ext/gd/tests/imagearc_variation1.png new file mode 100644 index 0000000000000000000000000000000000000000..8bc15c423f4de3dcee2ec45622462e6ced9d5918 GIT binary patch literal 272 zcmeAS@N?(olHy`uVBq!ia0vp^DImz*!-Ar*7p-VEexG7xZZG`RQw z)K}-`&Wi`QN+M_MY`8l;=yHh!P$3k&SiW`I-WL6LH@Pb;)8_Ige`C5g^O#}1Vf(cx z?TyPPo!l}dh|xdBq_-srbH5pF zI38l_{ga3J2$z8Nf^T;}%yIv{q-0IY`GVD){`=O>JJJ;G!9JJsgh|B{QroG>>s+_=EZ%-Ou6C9UH+NX*mK K&t;ucLK6UXWpe-k literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagearc_variation2.phpt b/ext/gd/tests/imagearc_variation2.phpt index 0c1c6466e1..40227c3750 100644 --- a/ext/gd/tests/imagearc_variation2.phpt +++ b/ext/gd/tests/imagearc_variation2.phpt @@ -17,12 +17,8 @@ $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); //create an arc with white color imagearc($image, 50, 50, 30, 30, -90, 0, $white); -ob_start(); -imagegd($image); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagearc_variation2.png', $image); ?> --EXPECT-- -8bd78aa775b5f29e7227eaeebaa84889 +The images are equal. diff --git a/ext/gd/tests/imagearc_variation2.png b/ext/gd/tests/imagearc_variation2.png new file mode 100644 index 0000000000000000000000000000000000000000..40779ed457d3fe85217b71967b89abafbb992238 GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^DIm --EXPECT-- -f0291252e7ac2fadda25e63287e6860c +The images are equal. diff --git a/ext/gd/tests/imagechar_basic.png b/ext/gd/tests/imagechar_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..a01222aab84ce84f5304a13d3d2fc2a3b767e39a GIT binary patch literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^TYy-Og9%7-X)JyVq})AS978f1-(K6u%b>u+?0Dp# z_3S<-M_Gq*;T;vOnY;`P4+K3Yg{*&IXUtu@;Sx*mdbtC8`wA@-b1FO-f%?JV0YCHK Vo8oV`iQ5-|_@1tQF6*2UngC5sB!mC} literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagecharup_basic.phpt b/ext/gd/tests/imagecharup_basic.phpt index 194c32564d..50b0a59613 100644 --- a/ext/gd/tests/imagecharup_basic.phpt +++ b/ext/gd/tests/imagecharup_basic.phpt @@ -14,12 +14,8 @@ $white = imagecolorallocate($image, 255,255,255); $result = imagecharup($image, 1, 5, 5, 'C', $white); -ob_start(); -imagegd($image); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagecharup_basic.png', $image); ?> --EXPECT-- -c65aad5d78f934dee2a844e7978eabd5 +The images are equal. diff --git a/ext/gd/tests/imagecharup_basic.png b/ext/gd/tests/imagecharup_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..e9628658ff2fd3dc2d509731e03fe1b96d62f7e1 GIT binary patch literal 129 zcmeAS@N?(olHy`uVBq!ia0vp^TYy-Og9%7-X)JyVq&z%b978f1-(E4~YH;9TIdJyx z|MMHC8c*fmIv1jtGcn1N=|j)Edu$$htrz<5N9D^OD8IVHw!V9nB{NVn926X8Tzj7H T$FGFInIJJwS3j3^P6 --EXPECT-- -string(32) "0981ef94ee2209a8dccb59aa8ad07e18" +The images are equal. int(842163455) \ No newline at end of file diff --git a/ext/gd/tests/imagecolorallocatealpha_basic.png b/ext/gd/tests/imagecolorallocatealpha_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..ef975af392789aef483619060de53fa87d746acb GIT binary patch literal 565 zcmeAS@N?(olHy`uVBq!ia0vp^(?FPm2}o{Eezui?f$@*0i(^Q|oVT|Q_6j>nv|Ma+ z;Ak>_xPX^SkT1PSLC|7LO7D@(*5mb|pW~Qre=;|H99gLg)Qt)(PA=EKzpTGtJ^y9) zie=?je|>%YcHiVZLA8gL_pGr>FFdsTzM{8tnA)DNAH&2q={!8WZ?;J58c&N)M>i>@ zxF0$w-u$QQC8zVfSCgFU=GZa(*D7yS{Js0sourII2kN2|T+J_46>9g~y&rl-Z0&}) zYh2oDJD&0wY9t2k*IlwmI&<$7(QCd1-V%#MuXRTxzGT_{Q86lU?@!S%|AN`FKtbua zhm68^*xEB%zpAWJPuzPl{h=ZMq1;!6Pyt)c*PapnhpLkGMd$DTH}BWw?>~RmKKMMR zM&D-5Bai)0-KrR%Duk|0-f-^&zkXlk`WaP=Bf=`c68Zm@A7HoPW0!9^&Bbr9|4^vi zk(-=)+BObHxWeBG99Q45<^#iL@r%xP1%%Z=Y{Banoi7SFtL?ZXv~E(D<=<)2FBzNG zEn9s<*X?co=0jD5*RMD~5MWl{F-bU2QPKEuZr+lwMf&SjAJkQQpYLsd|FFl=KXt1$ z9)8<2LGi+-s?xL{t-}_ts6r;u% bkf(4&eu;D8`($awogg_+S3j3^P6 --EXPECT-- -85e406abd0a975c97b3403cad5d078c9 +The images are equal. diff --git a/ext/gd/tests/imagecolorset_basic.png b/ext/gd/tests/imagecolorset_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..b9e77d116932d30b8dc5866706b08701dab0b0b2 GIT binary patch literal 99 zcmeAS@N?(olHy`uVBq!ia0y~yVAKJ!Qy7_nB-{D<%|MDdz$e6&f#H8w#iei{SK8CX tF~p --EXPECT-- -20979b45f8772cdbd78262af4e332638 +The images are equal. diff --git a/ext/gd/tests/imageconvolution_basic.png b/ext/gd/tests/imageconvolution_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..0558a1bb36782657ee05073878ca9bffd2bd8aba GIT binary patch literal 978 zcmV;@115W3+!cq8kS`;^RNM`qq_YkckJn!nwonm zm9l*$-E;rd4GxFH;cz${4u`|xa5x+ehr{uw;>-0Vj}Rf~YlZ~p{U}{y!kz>s#xk?F zF4)x%a~g|ecE;aVOHZ4ytoQA9OMir*(wR7@O(QFi+k0|}&A+OL19ULJ z8P4J`C$MO8Z9m!M(^V#C6TG6U@L4o@;=l%tgHkPxm#v_g9AT!+l3trQS*7-(#Zd{{ ziz2eQ?ix&$OhhL*tELZ-V1RGiXar?*9G})k(N%UuX>62ioKqJt^%XM#2X+0zp;L|Bo*Z*d(Uf3Ko!S6vFp6iZFRHJTrc!TW*6Ez%iYPSud7DOr ztXw&a2SfvPxJ3DSXl@DXCKuJ6D4l@&M)PFWW4=y2faw!S+1Y7jJKcfLB}W+F#j?2~ z)df*4Ya_BuYKY4Di~YQ=T%(aqNPuTJLb^6_v)mU|i`}g^!EA_~pa;gI`Ll>{gidLP z@*YUC^r*g-pjR<`Q(+eZ_ue@su(cb3ak)gJdkqPa+#Sr`5{!OD)W9QjO&ZzE#AFt< zku~E>6rZ=H)YUU9lY7nyrhRt$F_{t?X4lwTA03*>k#!@B(ospo@qnk!1DOk zU3*|&7o~M?#_=!;8v?%v+9vOzD;ReLP0y@qiKY_PdftY|+GcVj=;3I(R;LdQvlAq< zD{JCbGvd;~Ylx~P-S|G0THNnKEy}1d+Dn~%Oo*mt`W2IZI+A8n7<)B|_7Q*=VCgwL znZoXL+DdZ#)#C9TKHvgR=I;Yu;SDl8K!7KBfD9Lny}|6lh~D4=QKD!L9N=MH6yPiT zqtgmLL~oJCyVktH|MKS3_?J0?I3pStcr|y}ClmM&mEFWqbCa*?UBjI7JSY)RQFZVD zukZ@*T84OD#_lS+-r@VQ@;hFiPad_iK2M|*5jVZ(*eJ5PCVbfTesKHi^M+{A --EXPECT-- -da884f488a851e0267a316ad232aee86 +The images are equal. diff --git a/ext/gd/tests/imagecreatetruecolor_basic.png b/ext/gd/tests/imagecreatetruecolor_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..1728cb4d80ebce1378b24a93213cd6e5904c0c6a GIT binary patch literal 95 zcmeAS@N?(olHy`uVBq!ia0vp^TYy-Og9%7-X)JyVq|`iJ978f1-yURS1oD~`{;$vT eZ~!rpz=3W?`!oi|eDy!+AW=_OKbLh*2~7Z6@e_dn literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imageellipse_basic.phpt b/ext/gd/tests/imageellipse_basic.phpt index 759e42ab72..f3b1e10bfe 100644 --- a/ext/gd/tests/imageellipse_basic.phpt +++ b/ext/gd/tests/imageellipse_basic.phpt @@ -16,12 +16,8 @@ $image = imagecreatetruecolor(400, 300); // Draw a white ellipse imageellipse($image, 200, 150, 300, 200, 16777215); -ob_start(); -imagegd($image); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imageellipse_basic.png', $image); ?> --EXPECT-- -49c1544b012c3460c74cd04f1332d4ad +The images are equal. diff --git a/ext/gd/tests/imageellipse_basic.png b/ext/gd/tests/imageellipse_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..7dda55a186986ff28c0c2c4fd54b86993c78ceed GIT binary patch literal 1474 zcmeAS@N?(olHy`uVBq!ia0y~yV4MKNIvh+uk)*3dQyCaoJ3U<-Ln`LHy%Sv|ZOy|H zp#A&)=R5tgH^oj%+S{fgWs}ah(Zz(JFZJnTW}qhWfWqC>uiOeJ3uTo5-8}8eSJ|=P z!_#**QYMjMe`6kR3uIZG=yo+o~Yt1I<%{n$ye7V-s z7c;p+7OEXx;naR*iQdu`2a|p&wt8*c`q+Z4cKVEkB6*6tlgzqzv6n8foV`;ub?(U` ziE~=_8nuMazq>nO(PZ~5b9IK42_bfz%%z^{=A3L>Jygm$IbVA!`U^^2n_v^CX5*up zyT`vv;#}Snmq$l5HXT)1boAtt&WkBM!Z+%ClymmDR?YB#RWU2}xYMKK!YQp>PbOIB zn0X0${PQ$g;c4{KQ*DKh-Otl&XLB@l9d(uHygU8YWRJY^C9j@Ly0>?Q`OB0F?z&=6 z=|gwsyt>pM@_os=64l#xS7_|@tdP$-$@gRrb7+eErFp)8Z}gs79%T7V3+w0g;!lnVwxX&9*47@XdQ)p~51eQ|{`(YLy|E&imf`jdFhr z!(o+mtSdCv&AzjN;aEpBM?g%N|IS24o(WsI6kG$+fy_C&8JrGtru-{9%w!RI>PLHw zVC=It)*}WR7|sb72Dh@k`aVlqOyKYVCJWEM)>+Dkc0jW0zTd*7r)r;r zRfC0YYuS4^=cn#I&&%DBn80YrqodH)2sZ0p@Hc0!8!l(%N)9t6NklmCFr%pe=?B?@ zDfwaBtpB@N-z>=a4sA^s`Xvm*%~~Jg_YfY>vKPal!3x zTrt>UhUKg3gIh}weiSQ=Zw=7=`?QVKz~PiogO1}|5Yz2~Rs%<*Er{uJ&8gwkqg^L? zxf7P`*vi1F`fZ}L*nx!3(~Pe!IBvEqgogYKrSiZ7TD#Izm-F{~zZVCFyzo+e-Wkrz zLlz2s*ez%KXre&EE;()%w+phOE4gAWiSk$c^5FLm6yr1GhJ>r zc<(gRQ~hvtV1AM3`@WF5E=9Zbx2ks^d3P>fuTx<~jUcPmWdFKJoLQ56@`_(C6KQ;6 zC%BNw@=2hXGaJ&! z%|97EOyoWJSd-~+RnUo8CnsH@lfF%kv6oJ&Cn_{A$@614p}bW(=*vRA)$tDX^FQv5 znNt?M%E!Dc-}{u+u~wd#Y2^em!_(EzWt~$(696`+Roegn literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagefilledarc_basic.phpt b/ext/gd/tests/imagefilledarc_basic.phpt index 8c76a83406..9969e6be95 100644 --- a/ext/gd/tests/imagefilledarc_basic.phpt +++ b/ext/gd/tests/imagefilledarc_basic.phpt @@ -20,12 +20,8 @@ $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); //create an arc and fill it with white color imagefilledarc($image, 50, 50, 30, 30, 0, 90, $white, IMG_ARC_PIE); -ob_start(); -imagegd($image); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagefilledarc_basic.png', $image); ?> --EXPECT-- -87637c60ac0ceea48dbcaa4d98319f90 +The images are equal. diff --git a/ext/gd/tests/imagefilledarc_basic.png b/ext/gd/tests/imagefilledarc_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..b6bfc610859373a3d34c0cc35cc9954ae7d2312e GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0vp^DIm)2&mD}-Cv!%4{!$QBF$^W@ndFH(~-)jehOfxo}OZ%05 eS6>Qlc7wmZ%p*2)9Y5AykeH{dpUXO@geCyT4?{5k literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagefilledarc_error1.phpt b/ext/gd/tests/imagefilledarc_error1.phpt index 46d51ba34b..81d04358fb 100644 --- a/ext/gd/tests/imagefilledarc_error1.phpt +++ b/ext/gd/tests/imagefilledarc_error1.phpt @@ -17,13 +17,9 @@ $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); //create an arc and fill it with white color imagefilledarc($image, 50, 50, 30, 30, 0, 90, $white); -ob_start(); -imagegd($image); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagefilledarc_error1.png', $image); ?> --EXPECTF-- Warning: imagefilledarc() expects exactly 9 parameters, 8 given in %s on line %d -c5b7013900f5466aebfc42499a7ec8ec +The images are equal. diff --git a/ext/gd/tests/imagefilledarc_error1.png b/ext/gd/tests/imagefilledarc_error1.png new file mode 100644 index 0000000000000000000000000000000000000000..9cbff6e164f3c0765951215d47f5aa77cd61672a GIT binary patch literal 109 zcmeAS@N?(olHy`uVBq!ia0vp^DImIxsd50E!_s``s eUjSs{26a58Qy3Um1bngtsqu96b6Mw<&;$S~8x#Ei literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagefilledarc_variation1.phpt b/ext/gd/tests/imagefilledarc_variation1.phpt index f4130a9c69..7eb2350cb3 100644 --- a/ext/gd/tests/imagefilledarc_variation1.phpt +++ b/ext/gd/tests/imagefilledarc_variation1.phpt @@ -20,12 +20,8 @@ $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); //create an arc and fill it with white color imagefilledarc($image, 50, 50, 30, 30, 0, -25, $white, IMG_ARC_PIE); -ob_start(); -imagegd($image); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagefilledarc_variation1.png', $image); ?> --EXPECT-- -f25f589b5c5fa7deead7242652919bcf +The images are equal. diff --git a/ext/gd/tests/imagefilledarc_variation1.png b/ext/gd/tests/imagefilledarc_variation1.png new file mode 100644 index 0000000000000000000000000000000000000000..802d22784c6fa7c920914045f9b6a4c0579cfaa7 GIT binary patch literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^DImu=J%OM) --EXPECT-- -43c2973eb4872903eb6f5464c7965a93 +The images are equal. diff --git a/ext/gd/tests/imagefilledarc_variation2.png b/ext/gd/tests/imagefilledarc_variation2.png new file mode 100644 index 0000000000000000000000000000000000000000..7f3930bbac76839bef01d4f7162367e6df9c9948 GIT binary patch literal 197 zcmeAS@N?(olHy`uVBq!ia0vp^DIm0E(>b%Gd$k&Gw?(1EosfL<348@ zHtsTyTG}^NJ$Uk$#{aW4pY{4nt*)G@^Tymqc6FtX+O^i*SxI-T)P-L=PUo%5xmm^y cHy6mbq0=)*olP`rb}C5J)78&qol`;+0Chq_k^lez literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagefilledellipse_basic.phpt b/ext/gd/tests/imagefilledellipse_basic.phpt index 8b3682bfa8..1dee961b13 100644 --- a/ext/gd/tests/imagefilledellipse_basic.phpt +++ b/ext/gd/tests/imagefilledellipse_basic.phpt @@ -14,12 +14,8 @@ $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); //create an ellipse and fill it with white color imagefilledellipse($image, 50, 50, 40, 30, $white); -ob_start(); -imagegd($image); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagefilledellipse_basic.png', $image); ?> --EXPECT-- -233beffe003a41d3c9e788039e3191dd +The images are equal. diff --git a/ext/gd/tests/imagefilledellipse_basic.png b/ext/gd/tests/imagefilledellipse_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..8a56bec57409f01df824135155dcb9adb27cf05d GIT binary patch literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^DIm{wd*jpg39Te@sF}fUAyy;zpy^d+gx2)c;pM#vE*YAsPUD`G;&Ud4iH!tsAt0dDYQmd+` z9?#M?o$_r}@70*B6|cW)NPVAngiA#4ux56FMpWm#H4PDr8<~<=_oTDhL;_j+cqbox z-B!2p^@NS{r)~_MwUK>(;jYPrc@o7+vY*!<_PqYTn+@hlh9Bzwr%YWn=K7nJgTy>t L{an^LB{Ts5>j`UB literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagefilltoborder_basic.phpt b/ext/gd/tests/imagefilltoborder_basic.phpt index 524022a15d..843eed473d 100644 --- a/ext/gd/tests/imagefilltoborder_basic.phpt +++ b/ext/gd/tests/imagefilltoborder_basic.phpt @@ -21,13 +21,9 @@ imageellipse( $image, 50, 50, 50, 50, imagecolorallocate( $image, 0, 0, 0 ) ); // Fill border imagefilltoborder( $image, 50, 50, imagecolorallocate( $image, 0, 0, 0 ), imagecolorallocate( $image, 255, 0, 0 ) ); -ob_start(); -imagegd( $image); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagefilltoborder_basic.png', $image); ?> --EXPECT-- -8185a06ccff03c2abeb99d5e3ed60e45 +The images are equal. diff --git a/ext/gd/tests/imagefilltoborder_basic.png b/ext/gd/tests/imagefilltoborder_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..7c163e3c49983bdb92362922fa82ddd7b29f8b5b GIT binary patch literal 530 zcmeAS@N?(olHy`uVBq!ia0vp^DImZFJ?ypwuf>b z|HfC^oKfVwxIuJxwc8piPA{{%Kax{YkIylF6D7a<{(*Qeoe2>N8y%7wk1%zz3URB5 zc@Plzvhz3Z9jW9$U)DOmW63|Zi@oaM#}CQB9~@hkz5f3H-faDCy7|@2*KYgp>kA3K zO}WedM)6vx4kshp z&ty%t)0+-4fg4jp3*BDr&cGlo_2bg zENisxOC*prH6d3%{OFoRd6Ck4yOtd4S6n5KeR{{MG|{W4v%YCf?P}{!oE^S39YgIHG`+CpUXO@geCxWOzDFF literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagegammacorrect_basic.phpt b/ext/gd/tests/imagegammacorrect_basic.phpt index b803e9517f..c315c4688e 100644 --- a/ext/gd/tests/imagegammacorrect_basic.phpt +++ b/ext/gd/tests/imagegammacorrect_basic.phpt @@ -21,15 +21,11 @@ $half = imagefilledarc ( $image, 75, 75, 70, 70, 0, 180, $grey, IMG_ARC_PIE ); $half2 = imagefilledarc ( $image, 75, 75, 70, 70, 0, -180, $gray, IMG_ARC_PIE ); $gamma = imagegammacorrect($image, 1, 5); +var_dump((bool) $gamma); -if ($gamma){ - ob_start(); - imagegd($image); - $img = ob_get_contents(); - ob_end_clean(); -} - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagegammacorrect_basic.png', $image); ?> --EXPECT-- -1f625723f9d27251a1f15b83a6a4bf55 \ No newline at end of file +bool(true) +The images are equal. diff --git a/ext/gd/tests/imagegammacorrect_basic.png b/ext/gd/tests/imagegammacorrect_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..9eeaf26cb23d65e74eeacf5af8b780f208dc2ecf GIT binary patch literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^(?FPm2}o{Eezui?fzim*#WAE}&f6Os3y&D^xCGwd zT`gAnhT)_tpUq@glyeaG$*zr?~hP5^Xpi^WJYQJyL2>AvjG`E}^bf z)b7YlP7w1bmv&jlV__X_n*-BC!yX8j`)pYAfuTDrBG5U;=-{ns8=SP>y$rWo!XB~x z(6+Mf)!(kKF}Qb0^x7#!y*UZFemADI+>u=WbHcIP`wp4yIC}PXwj^ivibwzIM5k=1 z)k$&LBQ|ZrUelC-Jz_IA*vc8{#c})HkmHn;T7Oi%=Iin~7jOQXu4>PY;pu5V7&oo3 UdM --EXPECT-- -32fdb7b3675e4a9fd601c6a0645c88b3 +bool(true) +The images are equal. diff --git a/ext/gd/tests/imagegammacorrect_variation1.png b/ext/gd/tests/imagegammacorrect_variation1.png new file mode 100644 index 0000000000000000000000000000000000000000..f9718890968a2eae8faad02ef6a536ddb3000ec5 GIT binary patch literal 199 zcmeAS@N?(olHy`uVBq!ia0vp^(?FP!8A!67f4mSx1^9%xR#a3>oH)^J&;0}aOF1G+;t%J1&Yj9Tj~zO(_vvH?c8SHAvzGnc z%>49J+KqpV+#BAie%=teL2w$2bV8s3do;^tgW%))SL8OvZqJ<;`(4tiEA3}R>I@&9 x4auju)sp)5Fqkd5eYgANrPZC2mzCb*+@ $image = imagecreatetruecolor(180, 30); $layer = imagelayereffect($image, IMG_EFFECT_REPLACE); +var_dump((bool) $layer); -if ($layer){ - ob_start(); - imagegd($image); - $img = ob_get_contents(); - ob_end_clean(); -} - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagelayereffect_basic.png', $image); ?> --EXPECT-- -da884f488a851e0267a316ad232aee86 +bool(true) +The images are equal. diff --git a/ext/gd/tests/imagelayereffect_basic.png b/ext/gd/tests/imagelayereffect_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..1728cb4d80ebce1378b24a93213cd6e5904c0c6a GIT binary patch literal 95 zcmeAS@N?(olHy`uVBq!ia0vp^TYy-Og9%7-X)JyVq|`iJ978f1-yURS1oD~`{;$vT eZ~!rpz=3W?`!oi|eDy!+AW=_OKbLh*2~7Z6@e_dn literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagerectangle_basic.phpt b/ext/gd/tests/imagerectangle_basic.phpt index eaa1566f7f..507d715326 100644 --- a/ext/gd/tests/imagerectangle_basic.phpt +++ b/ext/gd/tests/imagerectangle_basic.phpt @@ -15,13 +15,8 @@ $image = imagecreatetruecolor( 100, 100 ); // Draw a rectangle imagerectangle( $image, 0, 0, 50, 50, imagecolorallocate($image, 255, 255, 255) ); -ob_start(); -imagegd( $image ); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); - +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagerectangle_basic.png', $image); ?> --EXPECT-- -e7f8ca8c63fb08b248f3ed6435983aed \ No newline at end of file +The images are equal. diff --git a/ext/gd/tests/imagerectangle_basic.png b/ext/gd/tests/imagerectangle_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..dcb4d2e630453b8d8596013dad97b2341211b8a5 GIT binary patch literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^DIm --EXPECT-- -2bb294c388d826cc9bba6c6fd31f265a +The images are equal. diff --git a/ext/gd/tests/imagesetbrush_basic.png b/ext/gd/tests/imagesetbrush_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..0242634db54650f7bc8bc1edde92e257c76c44da GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^DImAwbI$wK`P-uV%u_ln|Ig0D(kO*$y~1#ra%aa!L>55Z-39IG113_8zkiE L>gTe~DWM4flU65` literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagesetthickness_basic.phpt b/ext/gd/tests/imagesetthickness_basic.phpt index 205fe7e59e..3c91a886df 100644 --- a/ext/gd/tests/imagesetthickness_basic.phpt +++ b/ext/gd/tests/imagesetthickness_basic.phpt @@ -23,12 +23,8 @@ imagesetthickness($image, 5); // Draw the rectangle imagerectangle($image, 14, 14, 185, 85, $black); -ob_start(); -imagegd($image); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagesetthickness_basic.png', $image); ?> --EXPECT-- -1a6bc882772310d2e9b32cca2574236c \ No newline at end of file +The images are equal. diff --git a/ext/gd/tests/imagesetthickness_basic.png b/ext/gd/tests/imagesetthickness_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..e38e7dbe00ff7aa5287dc3b5ed59c068bd30720c GIT binary patch literal 377 zcmeAS@N?(olHy`uVBq!ia0vp^CxAGGg9%9bJb4krz`*F>>EaktG3V_qN3LcE0fvJ< zAO6SRvr(AtnxnGp)t*B#vm6W4*M4nUz4yIbL%NU{XW~QwEQCcF-&r49cKej)|2Orz zIz_0ofQW5z_xA6U`(b~scGpd)5LkS05`D$}XU}Xc{$OAR_u!1J*X|mBa6kxP_`Q>V YX%5dR8J80mfI-UO>FVdQ&MBb@0F9A+;{X5v literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagestring_basic.phpt b/ext/gd/tests/imagestring_basic.phpt index f56a2d3226..311683f7af 100644 --- a/ext/gd/tests/imagestring_basic.phpt +++ b/ext/gd/tests/imagestring_basic.phpt @@ -14,12 +14,8 @@ $white = imagecolorallocate($image, 255,255,255); $result = imagestring($image, 1, 5, 5, 'String Text', $white); -ob_start(); -imagegd($image); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagestring_basic.png', $image); ?> --EXPECT-- -7f146e3cdcaf89c6b9d68ccbb44cf94e +The images are equal. diff --git a/ext/gd/tests/imagestring_basic.png b/ext/gd/tests/imagestring_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..7f9fd12c1268d8f02e87e557a2a3f847caf68521 GIT binary patch literal 234 zcmeAS@N?(olHy`uVBq!ia0vp^TYy-Og9%7-X)JyVq&9lGIEG|2zP)yvuUUbIAz=6a z|LNZkB*m~gKG%ypSNSN2+mqA67pQQ*#y02AHuleyytbP}?P6TJe%`l>rwj5#*Gg|6enkR#1T+w~|?oC4M_LV_?&maE|vRv)HP-;Tj_NnXEZOvQq`Qk0M z`GGqvm6Vi%3@`P2y#5*AKV79=u5Z(qx-$u8>%wa}%HB1U)@bKEc_!icH094!XLEL- d{SdJH4&!d+D-jAuC(Hl|c)I$ztaD0e0sw`kU=aWS literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagestringup_basic.phpt b/ext/gd/tests/imagestringup_basic.phpt index 144dfc0d8d..015d375ede 100644 --- a/ext/gd/tests/imagestringup_basic.phpt +++ b/ext/gd/tests/imagestringup_basic.phpt @@ -14,12 +14,8 @@ $white = imagecolorallocate($image, 255,255,255); $result = imagestringup($image, 1, 5, 25, 'Str', $white); -ob_start(); -imagegd($image); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagestringup_basic.png', $image); ?> --EXPECT-- -7c55836800702bdd43b4c25d8ebcfcd0 +The images are equal. diff --git a/ext/gd/tests/imagestringup_basic.png b/ext/gd/tests/imagestringup_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..875b5bae95549104283487c38d5770e99119ead4 GIT binary patch literal 163 zcmeAS@N?(olHy`uVBq!ia0vp^TYy-Og9%7-X)JyVq_R9+978f1-(EN5Yfuniarp4R z-p;z2Lrsm%|X7IQ0Mk literal 0 HcmV?d00001 diff --git a/ext/gd/tests/imagetruecolortopalette_basic.phpt b/ext/gd/tests/imagetruecolortopalette_basic.phpt index e7b327475b..9bc922a15b 100644 --- a/ext/gd/tests/imagetruecolortopalette_basic.phpt +++ b/ext/gd/tests/imagetruecolortopalette_basic.phpt @@ -22,13 +22,9 @@ $half2 = imagefilledarc ( $image, 75, 55, 80, 70, 0, -180, $b, IMG_ARC_PIE ); var_dump(imagetruecolortopalette($image, true, 2)); -ob_start(); -imagegd($image); -$img = ob_get_contents(); -ob_end_clean(); - -echo md5(base64_encode($img)); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/imagetruecolortopalette_basic.png', $image); ?> --EXPECT-- bool(true) -17c901cb2217eb7647deed1c79d445de \ No newline at end of file +The images are equal. diff --git a/ext/gd/tests/imagetruecolortopalette_basic.png b/ext/gd/tests/imagetruecolortopalette_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..7d042f2ac3da278c8ebeedd18665cdbae49e86d4 GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^(?FP!8A!67f4mSx1^9%x3Ns0_{QIL=vcniC((38r z7~;|S_JSc_g94AkMJYD-y^QV;GYU-l4+%=hc1S7ba>;UZcJlpwES;g*uq^YI_f28% z6z<4BchWZH-r$Lp*w)!2%l-1j4E<@=&$`~8$=P^>hhNybO`h}22jv5kwI4U_G*Z8I z_~1q(rOvm#FcD`Ah2~(G3&ib}k@6t@shyx5^B|rx;c)I$ztaD0e F0sx>~PUHXp literal 0 HcmV?d00001 diff --git a/ext/gd/tests/libgd00100.phpt b/ext/gd/tests/libgd00100.phpt index 49716d7107..84f8858a9a 100644 --- a/ext/gd/tests/libgd00100.phpt +++ b/ext/gd/tests/libgd00100.phpt @@ -106,14 +106,10 @@ $points = array( ); imagefilledpolygon($im, $points, 5, $black); -ob_start(); -imagegd($im); -$png = ob_get_contents(); -ob_end_clean(); - -echo md5($png); +include_once __DIR__ . '/func.inc'; +test_image_equals_file(__DIR__ . '/libgd00100.png', $im); imagedestroy($im); ?> --EXPECTF-- -df7253c765280396f303166f10ba9283 +The images are equal. diff --git a/ext/gd/tests/libgd00100.png b/ext/gd/tests/libgd00100.png new file mode 100644 index 0000000000000000000000000000000000000000..8d4f6a1be830e69e851bf43fa10bdc46b559eb92 GIT binary patch literal 2103 zcmb_edo+~m8h^iUzQz}(W;SQbbTDESTjvl(a+ygs*|kkqxz$W9PQu`X#;xW<;)G}& z$tIeR>0%GD-6AtlNpi__sD{!-%$X4~8jWV=eE;sX&L3y5b^dy8zxVfC)_R`x{$r27 zFG-)O4*($f?eyLU0EDX$Kw(@+$n;GB=xP1Dw;xElGBbYoq|}G}<57o6vpA!`YV&(L zqwm*xoiIo)G47w!gB>K27QvvZXse^^!Om<4Z@;#&m=?c5ch-z~T2Mf{p6^Cc$LhJK z32L#?HBjQI{wIpbx^v^fZi~(_n62J3K?aiS3qr`@^bMIYuC8CeQAMUivGUrWHK-}D zq3Vg1lwFOucU>fo^$k6UW4*c0zMTR50$#^zkhBg|`+%MKppXjDw!n-?1bdExn-s9m z>JJ30wHuO6zg6&3E#BtUP4+FL&8=|4=cY6gy(S0c+d1yp0aiU`=s~TPgcZm{o?#jV zLmcP4fY)O_9WLBK^q^oij?b~?zg%xp$!){YTb0Jh3ZNux8^ z+eJMLedz21Wr!ulE;$o|kcpBO2Ef~LLumQ35G$~Ew`et7*sV-m2P}7saDK7!9vO40 znau@b4yW<_m`qN?ge9F+c>1g?>h4&K%d8WKSvt4o|1gRFGP~}pt2_o9$1|lt#SfR! z>1?|{HrwAbc9qpxid4Y}^dMk_Nf1yN?1FYddOS+IHTqB@UWt&01;0wfdo2k|TJ0Cl z48hDLiP#di7N!bRlrhCi7m~un9{XHn5U&N@n!cL!azmbTL_D*~UPo1KD6EJ}kSrt~ z8OgIZ%0Al$r=|2VPugx(ogYY?@ZAKzIP!Il^juLwY+iw~2Rrp*_-F2KuHWu~Y5L3? z(gUQ|)0qje8BD{Jdg;67+mjVbe|cud=;*>;1@lOQi2RNc> zypm@PmP)P?g2-Nob>Y*%+?UnnvgFn~5Ctr`rO)S3rrQ*d~eg2$d zZ5*+D(Ij$8R>cMSeRgTg$~Ncz{lEO1iVdg@>K1HfcYlrkUcG|ftgY1DRGQTAy3VDH zAyNK1;S}fZMV!gD4bCDsr%osAcCD%v;qK~Sj!OywDcmdl*EyVZ_|A){F&t&mex1m{z;}0EM?ApITu-^-D1fSm z;xFI9AI&ea!uUj#9d{%oZx}#%Pq|r^xcjKBg89}^in4ca>yx?2(~y?M;#aOK*+}H=SL+jlVU!ukbTiwwkaq7? z`B~5vav8q?*)#O`Akkq0;*b$Y`txC(obKWcGINH-ZHqkhr4+kLz$&Dh$o>L>*wN(~v`QTBt1be6+JpBzXaAOuxF~VACH>Zdn zr>(6&!qd!_qwJ(3BxMj!V?`D(sa=NRHJ1u@09$1=U#E^T&j$_D5^Pk>q<@?|)n0z4 zQy#sPc@Gfy<4wQw;m6I%BAb|r`MlMxt`+##C1a5rzR*H==T_g!Y}A4Jp%2W^dY%@ z1vSoqAJ@wd0hg+{u8({Ogj!KjwAdA^j3?GWYx1>5xmNc$?2<(j710{Dxf{-=Fs8;u zi?XB*17Dtt*>d}z2wsq}nPbGCu&(JhktYXI2|I+Mz>$N0#kw|UmVz)}onQYibqnru b>RcWa+^bS@oySx04*~G|(cfF>#m@K-6lbi% literal 0 HcmV?d00001 -- 2.50.1