1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
From: Matthias Klose <doko@debian.org>
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);
|