void
quant_makemap(i_quantize *quant, i_img **imgs, int count) {
- i_color temp;
#ifdef HAVE_LIBGIF
/* giflib does it's own color table generation */
if (quant->translate == pt_giflib)
The giflib quantizer ignores the palette.
*/
i_palidx *quant_translate(i_quantize *quant, i_img *img) {
- i_palidx *result = mymalloc(img->xsize * img->ysize);
+ i_palidx *result;
+ mm_log((1, "quant_translate(quant %p, img %p)\n", quant, img));
+
+ result = mymalloc(img->xsize * img->ysize);
+
switch (quant->translate) {
#ifdef HAVE_LIBGIF
case pt_giflib:
i_color col;
- /*mm_log((1,"i_writegif(0x%x, fd %d, colors %dbpp)\n",im,fd,colors));*/
+ mm_log((1,"i_writegif(quant %p, img %p, out %p)\n", quant, img, out));
/*if (!(im->channels==1 || im->channels==3)) { fprintf(stderr,"Unable to write gif, improper colorspace.\n"); exit(3); }*/
}
if ((GreenBuffer = (GifByteType *) mymalloc((unsigned int) Size)) == NULL) {
m_fatal(0,"Failed to allocate memory required, aborted.");
- free(RedBuffer);
+ myfree(RedBuffer);
return;
}
if ((BlueBuffer = (GifByteType *) mymalloc((unsigned int) Size)) == NULL) {
m_fatal(0,"Failed to allocate memory required, aborted.");
- free(RedBuffer);
- free(GreenBuffer);
+ myfree(RedBuffer);
+ myfree(GreenBuffer);
return;
}
}
}
- free(RedBuffer);
- if (img->channels == 3) { free(GreenBuffer); free(BlueBuffer); }
+ myfree(RedBuffer);
+ if (img->channels == 3) { myfree(GreenBuffer); myfree(BlueBuffer); }
/* copy over the color map */
for (i = 0; i < ColorMapSize; ++i) {
#endif
}
}
- }
+ }
#ifdef HB_SORT
myfree(indices);
#endif