summaryrefslogtreecommitdiff
path: root/src/gd_topal.c
diff options
context:
space:
mode:
authorpierre <none@none>2006-04-05 15:44:56 +0000
committerpierre <none@none>2006-04-05 15:44:56 +0000
commitb0243fe7b15d4175ca382dbfdcab37bd63f9cc44 (patch)
tree4c79a5a37b800d6734ede320979856861c4bc394 /src/gd_topal.c
parentd1d7cd42aeb5458c3971841077cffc893abf97eb (diff)
downloadlibgd-b0243fe7b15d4175ca382dbfdcab37bd63f9cc44.tar.gz
- sync to 2.0.5GD_2_0_5
Diffstat (limited to 'src/gd_topal.c')
-rw-r--r--src/gd_topal.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/src/gd_topal.c b/src/gd_topal.c
index 9a2dad5..3cb0f53 100644
--- a/src/gd_topal.c
+++ b/src/gd_topal.c
@@ -24,6 +24,10 @@
* may not have done a great job of either. It's not Thomas G. Lane's fault.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <string.h>
#include "gd.h"
#include "gdhelpers.h"
@@ -1560,27 +1564,8 @@ gdImageTrueColorToPalette (gdImagePtr im, int dither, int colorsWanted)
/* Do the work! */
zeroHistogram (cquantize->histogram);
prescan_quantize (im, cquantize);
- select_colors (im, cquantize, 256);
- /* TBB HACK REMOVE */
- {
- FILE *out = fopen ("palettemap.png", "wb");
- int i;
- gdImagePtr im2 = gdImageCreateTrueColor (256, 256);
- for (i = 0; (i < 256); i++)
- {
- gdImageFilledRectangle (im2, (i % 16) * 16, (i / 16) * 16,
- (i % 16) * 16 + 15, (i / 16) * 16 + 15,
- gdTrueColorAlpha (im->red[i], im->green[i],
- im->blue[i], im->alpha[i]));
- }
-#ifdef HAVE_LIBPNG
- gdImagePng (im2, out);
-#else
- fprintf(stderr, "No PNG library support.\n");
-#endif
- fclose (out);
- gdImageDestroy (im2);
- }
+ /* TBB 2.0.5: pass colorsWanted, not 256! */
+ select_colors (im, cquantize, colorsWanted);
zeroHistogram (cquantize->histogram);
if (dither)
{