From: Matthias Klose Subject: modification to source code --- a/src/gifSave.cpp +++ b/src/gifSave.cpp @@ -63,10 +63,10 @@ b[i]=data[j++]; } - outputPalette = MakeMapObject(paletteSize, NULL); + outputPalette = GifMakeMapObject(paletteSize, NULL); if (!outputPalette) return false; - if (QuantizeBuffer(sx, sy, &paletteSize, + if (GifQuantizeBuffer(sx, sy, &paletteSize, &(r[0]),&(g[0]),&(b[0]), &(output[0]), outputPalette->Colors) == GIF_ERROR) return false; @@ -114,7 +114,10 @@ unsigned char nsle[12] = "NETSCAPE2.0"; unsigned char subblock[3]; //if (EGifPutExtension(gf, 0xFF, 11, nsle) == GIF_ERROR) { - if (EGifPutExtensionFirst(gf, APPLICATION_EXT_FUNC_CODE, 11, nsle) == GIF_ERROR) { + if (EGifPutExtensionLeader(gf, APPLICATION_EXT_FUNC_CODE) == GIF_ERROR) { + return false; + } + if (EGifPutExtensionBlock(gf, 11, nsle) == GIF_ERROR) { //gif_push_error(); //i_push_error(0, "writing loop extension"); return false; @@ -123,7 +126,7 @@ subblock[2] = loop_count % 256; subblock[1] = loop_count / 256; //if (EGifPutExtension(gf, 0, 3, subblock) == GIF_ERROR) { - if (EGifPutExtensionLast(gf, APPLICATION_EXT_FUNC_CODE, 3, subblock) == GIF_ERROR) { + if (EGifPutExtensionTrailer(gf) == GIF_ERROR) { //gif_push_error(); //i_push_error(0, "writing loop extention sub-block"); return false; @@ -144,7 +147,7 @@ if (frames.size()==0) return false; - GifFileType *GifFile = EGifOpenFileName(filename, FALSE); + GifFileType *GifFile = EGifOpenFileName(filename, 0, NULL); if (!GifFile) return false; @@ -172,7 +175,7 @@ if (EGifPutImageDesc( GifFile, - 0, 0, gifsx, gifsy, FALSE, NULL + 0, 0, gifsx, gifsy, 0, NULL ) == GIF_ERROR) return false; @@ -181,7 +184,7 @@ } } - if (EGifCloseFile(GifFile) == GIF_ERROR) return false; + if (EGifCloseFile(GifFile, NULL) == GIF_ERROR) return false; mode_t mask = umask(0); umask(mask);