2014-10-11 19:52:04 +02:00
|
|
|
diff -wbBur xplanet-1.3.0/src/libimage/gif.c xplanet-1.3.0.my/src/libimage/gif.c
|
2013-12-07 12:12:31 +01:00
|
|
|
--- xplanet-1.3.0/src/libimage/gif.c 2006-03-26 01:50:51.000000000 +0300
|
2014-10-11 19:52:04 +02:00
|
|
|
+++ xplanet-1.3.0.my/src/libimage/gif.c 2014-05-29 18:59:14.830652716 +0400
|
2013-12-07 12:12:31 +01:00
|
|
|
@@ -20,7 +20,7 @@
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
-
|
|
|
|
+#define FALSE 0
|
|
|
|
#include <gif_lib.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
@@ -42,11 +42,11 @@
|
|
|
|
int color_index;
|
|
|
|
unsigned char *ptr = NULL;
|
|
|
|
|
|
|
|
- infile = DGifOpenFileName(filename);
|
|
|
|
+ infile = DGifOpenFileName(filename, NULL);
|
|
|
|
|
|
|
|
if (infile == NULL)
|
|
|
|
{
|
|
|
|
- PrintGifError();
|
|
|
|
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -54,7 +54,7 @@
|
|
|
|
{
|
|
|
|
if (DGifGetRecordType(infile, &record_type) == GIF_ERROR)
|
|
|
|
{
|
|
|
|
- PrintGifError();
|
|
|
|
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -63,7 +63,7 @@
|
|
|
|
case IMAGE_DESC_RECORD_TYPE:
|
|
|
|
if (DGifGetImageDesc(infile) == GIF_ERROR)
|
|
|
|
{
|
|
|
|
- PrintGifError();
|
|
|
|
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -107,14 +107,14 @@
|
|
|
|
GifByteType *ext;
|
|
|
|
if (DGifGetExtension(infile, &ext_code, &ext) == GIF_ERROR)
|
|
|
|
{
|
|
|
|
- PrintGifError();
|
|
|
|
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
while (ext != NULL)
|
|
|
|
{
|
|
|
|
if (DGifGetExtensionNext(infile, &ext) == GIF_ERROR)
|
|
|
|
{
|
|
|
|
- PrintGifError();
|
|
|
|
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
}
|
2014-10-11 19:52:04 +02:00
|
|
|
@@ -154,7 +154,7 @@
|
|
|
|
|
|
|
|
free(buffer);
|
|
|
|
|
|
|
|
- DGifCloseFile(infile);
|
|
|
|
+ DGifCloseFile(infile, NULL);
|
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
|
2013-12-07 12:12:31 +01:00
|
|
|
@@ -178,7 +178,7 @@
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
- colormap = MakeMapObject(colormap_size, NULL);
|
|
|
|
+ colormap = GifMakeMapObject(colormap_size, NULL);
|
|
|
|
|
|
|
|
for (i = 0; i < width * height; i++)
|
|
|
|
{
|
|
|
|
@@ -187,10 +187,10 @@
|
|
|
|
blue[i] = (GifByteType) rgb[3*i+2];
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (QuantizeBuffer(width, height, &colormap_size, red, green, blue,
|
|
|
|
+ if (GifQuantizeBuffer(width, height, &colormap_size, red, green, blue,
|
|
|
|
buffer, colormap->Colors) == GIF_ERROR)
|
|
|
|
{
|
|
|
|
- PrintGifError();
|
|
|
|
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -198,24 +198,24 @@
|
|
|
|
free(green);
|
|
|
|
free(blue);
|
|
|
|
|
|
|
|
- outfile = EGifOpenFileName((char *) filename, FALSE);
|
|
|
|
+ outfile = EGifOpenFileName((char *) filename, FALSE, NULL);
|
|
|
|
if (outfile == NULL)
|
|
|
|
{
|
|
|
|
- PrintGifError();
|
|
|
|
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (EGifPutScreenDesc(outfile, width, height, colormap_size, 0, colormap)
|
|
|
|
== GIF_ERROR)
|
|
|
|
{
|
|
|
|
- PrintGifError();
|
|
|
|
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (EGifPutImageDesc(outfile, 0, 0, width, height, FALSE, NULL)
|
|
|
|
== GIF_ERROR)
|
|
|
|
{
|
|
|
|
- PrintGifError();
|
|
|
|
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -224,7 +224,7 @@
|
|
|
|
{
|
|
|
|
if (EGifPutLine(outfile, ptr, width) == GIF_ERROR)
|
|
|
|
{
|
|
|
|
- PrintGifError();
|
|
|
|
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
ptr += width;
|
2014-10-11 19:52:04 +02:00
|
|
|
@@ -232,8 +232,8 @@
|
|
|
|
|
2013-12-07 12:12:31 +01:00
|
|
|
EGifSpew(outfile);
|
|
|
|
|
2014-10-11 19:52:04 +02:00
|
|
|
- if (EGifCloseFile(outfile) == GIF_ERROR)
|
2013-12-07 12:12:31 +01:00
|
|
|
- PrintGifError();
|
2014-10-11 19:52:04 +02:00
|
|
|
+ if (EGifCloseFile(outfile, NULL) == GIF_ERROR)
|
2013-12-07 12:12:31 +01:00
|
|
|
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
|
|
|
|
|
|
|
free(buffer);
|
|
|
|
|