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 : 3.141.198.75


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

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

int main()
{
	gdImagePtr im;
	gdImagePtr tile;
	int red, green, blue, other;
	int i, r = 0;

	im = gdImageCreateTrueColor(100, 100);
	tile = gdImageCreate(10, 10);
	red   = gdImageColorAllocate(tile, 0xFF, 0, 0);
	green = gdImageColorAllocate(tile, 0, 0xFF, 0);
	blue  = gdImageColorAllocate(tile, 0, 0, 0xFF);
	other = gdImageColorAllocate(tile, 0, 0, 0x2);
	gdImageFilledRectangle(tile, 0, 0, 2, 10, red);
	gdImageFilledRectangle(tile, 3, 0, 4, 10, green);
	gdImageFilledRectangle(tile, 5, 0, 7, 10, blue);
	gdImageFilledRectangle(tile, 8, 0, 9, 10, other);
	gdImageColorTransparent(tile, blue);
	gdImageSetTile(im, tile);
	for (i=0; i<100; i++) {
		gdImageSetPixel(im, i, i, gdTiled);
	}
	if (gdTrueColorGetBlue(gdImageGetPixel(im, 9, 9)) != 0x2) {
		r = 1;
	}
	gdImageDestroy(tile);
	gdImageDestroy(im);
	return r;
}