summaryrefslogtreecommitdiff
path: root/src/gd_topal.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2016-09-21 12:42:49 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2016-09-21 12:42:49 +0200
commit408ea5e5c3cceb0335c58aaf5ff98f7fc063fa4c (patch)
treeee10cf594f9aa0ee8412f8f39071c772e2e50ee6 /src/gd_topal.c
parent096f843e85dcc9e9adf16a588e024f730cbb70f0 (diff)
downloadlibgd-408ea5e5c3cceb0335c58aaf5ff98f7fc063fa4c.tar.gz
Fix #307: GD_QUANT_NEUQUANT fails to unset trueColor flag
Before we copy the quantized palette image onto the original image, we have to mark the latter as palette image. We also have to free the allocated truecolor pixels; free_truecolor_image_data() does all that for us.
Diffstat (limited to 'src/gd_topal.c')
-rw-r--r--src/gd_topal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gd_topal.c b/src/gd_topal.c
index 5b51512..e29f3d3 100644
--- a/src/gd_topal.c
+++ b/src/gd_topal.c
@@ -1549,6 +1549,7 @@ static int gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int colors
if (!nim) {
return FALSE;
} else {
+ free_truecolor_image_data(oim);
gdImageCopy(oim, nim, 0, 0, 0, 0, oim->sx, oim->sy);
gdImageDestroy(nim);
}