SWFDBLBitmapData newSWFDBLBitmapData_fromGifFile(const char *fileName) { GifFileType *file; SWFDBLBitmapData ret; struct dbl_data gifdata; if((file = DGifOpenFileName(fileName)) == NULL) return NULL; if(!readGif(file, &gifdata)) return NULL; ret = newSWFDBLBitmapData_fromData(&gifdata); /* ret->input = NULL; */ return ret; }
SWFDBLBitmapData newSWFDBLBitmapData_fromGifInput(SWFInput input) { GifFileType *file; SWFDBLBitmapData ret; struct dbl_data gifdata; #if GIFLIB_MAJOR >= 5 if((file = DGifOpen(input, (InputFunc) gifReadFunc, NULL)) == NULL) #else if((file = DGifOpen(input, (InputFunc) gifReadFunc)) == NULL) #endif return NULL; if(!readGif(file, &gifdata)) return NULL; ret = newSWFDBLBitmapData_fromData(&gifdata); // ret->input = NULL; return ret; }
SWFDBLBitmapData newSWFDBLBitmapData_fromGifFile(const char *fileName) { GifFileType *file; 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)) return NULL; ret = newSWFDBLBitmapData_fromData(&gifdata); // ret->input = NULL; return ret; }
Image* readGifData ( unsigned char* buf, long len ) { Image *img = 0; #if defined(INCLUDE_GIF) BufferSource bufSrc; GifFileType *gf; bufSrc.buf = bufSrc.p = buf; bufSrc.remain = len; if ( !(gf = DGifOpen( &bufSrc, readGifBuffer)) ) return 0; img = readGif( gf); DGifCloseFile( gf); #endif /* INCLUDE_GIF */ return img; }