fi
dnl Check for the gif or ungif libraries
AC_CHECK_LIB(gif, PrintGifError, GIFLIB="-lgif", GIFLIB="")
AC_CHECK_LIB(gif, DGifOpen, GIFLIB="-lgif", GIFLIB="")
dnl MinGW check for libungif
AC_CHECK_LIB(ungif, DGifOpen, GIFLIB="-lungif")
dnl Solaris needs -lX11 on the linker line for ungif to work
SWFDBLBitmapData ret;
struct dbl_data gifdata;
#if GIFLIB_MAJOR >= 5
if((file = DGifOpenFileName(fileName, NULL)) == NULL)
#else
if((file = DGifOpenFileName(fileName)) == NULL)
#endif
return NULL;
if(!readGif(file, &gifdata))
if((file = DGifOpen(input, (InputFunc) gifReadFunc, NULL)) == NULL)
if((file = DGifOpen(input, (InputFunc) gifReadFunc)) == NULL)
void error(char *msg)
{
printf("%s:\n\n", msg);
#if GIFLIB_MAJOR < 5
PrintGifError();
exit(-1);
}
unsigned char *p;
int i, nColors, size, alpha, bgColor, alignedWidth;
int errorCode = 0;
if((file = DGifOpenFileName(fileName, &errorCode)) == NULL)
error(GifErrorString(errorCode));
error("Error opening file");
if(DGifSlurp(file) != GIF_OK)
error("Error slurping file");
unsigned char *data;
int i, nColors, size;