0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.223.210.83


Current Path : /var/www/html/suk_discontinued/libgd-gd-2.2.3/tests/gdimagescatterex/
Upload File :
Current File : /var/www/html/suk_discontinued/libgd-gd-2.2.3/tests/gdimagescatterex/bug00208_1.c

#include "gd.h"
#include "gdtest.h"

int main()
{
	gdImagePtr im, ex;
	FILE *fp;
	gdScatter s;
	CuTestImageResult r;

	fp = gdTestFileOpen("gdimagescatterex/bug00208.png");
	im = gdImageCreateFromPng(fp);
	fclose(fp);
	if (!im) {
		gdTestErrorMsg("could not create image\n");
		return 1;
	}

	s.sub  = 1;
	s.plus = 3;
	s.seed = 0;
	s.num_colors = 0;
	if (!gdImageScatterEx(im, &s)) {
		gdImageDestroy(im);
		gdTestErrorMsg("could not scatter\n");
		return 1;
	}

	fp = gdTestFileOpen("gdimagescatterex/bug00208_1.png");
	ex = gdImageCreateFromPng(fp);
	fclose(fp);
	if (!ex) {
		gdTestErrorMsg("could not create image\n");
		gdImageDestroy(im);
		return 1;
	}
	r.pixels_changed = 0;
	gdTestImageDiff(im, ex, NULL, &r);
	gdImageDestroy(ex);
	gdImageDestroy(im);
	if (r.pixels_changed > 10000) {
		gdTestErrorMsg("too much diff: %d\n", r.pixels_changed);
		return 1;
	}
	return 0;
}