summaryrefslogtreecommitdiff
path: root/tests/gdimagetruecolortopalette/bug00307.c
blob: a01eb5ae9402ee0b9f57cf91e322d81f37415b58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
 * Regression test for <https://github.com/libgd/libgd/issues/307>
 *
 * We're testing that an image that has been converted to palette with
 * GD_QUANT_NEUQUANT has its trueColor flag unset.
 */


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


int main()
{
	gdImagePtr im;

	im = gdImageCreateTrueColor(100, 100);

	gdTestAssert(gdImageTrueColorToPaletteSetMethod(im, GD_QUANT_NEUQUANT, 0));
	gdImageTrueColorToPalette(im, 0, 256);
	gdTestAssert(!gdImageTrueColor(im));

	gdImageDestroy(im);

	return gdNumFailures();
}