summaryrefslogtreecommitdiff
path: root/tests/gdimagetruecolortopalette/bug00307.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gdimagetruecolortopalette/bug00307.c')
-rw-r--r--tests/gdimagetruecolortopalette/bug00307.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/gdimagetruecolortopalette/bug00307.c b/tests/gdimagetruecolortopalette/bug00307.c
new file mode 100644
index 0000000..a5c6a04
--- /dev/null
+++ b/tests/gdimagetruecolortopalette/bug00307.c
@@ -0,0 +1,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();
+}