Here is a quick and dirty implementation of converting "GIF" files to the Windows packed DIB memory format (BITMAPINFO & RGBQUAD + Bits), and saving DIB's to GIF's. This DLL will decode interlaced GIF's, but only saves as non-interlaced. The LZW algorithms are from somewhere in the CompuServe GRAPHICS forum, and I've tried to preserve the original authors comments, and credits.

The implementation is "Wimpy" because it doesn't support local color maps, or graphic extensions (?yet?), BUT it does work, and it's free - so what the heck! I've also included the source code so you can add all that good stuff if you want.

The DLL has 2 exported functions:

	HANDLE 	FAR PASCAL _export Gif_File_To_DIB(const char *);
and
	BOOL 	FAR PASCAL _export GIFEncode(const char* FName,LPSTR lpDIB);

The "HANDLE Gif_File_To_DIB(const char *)" function takes a path/filename to a GIF, and returns a handle to a packed DIB. It will decode interlaced and non interlaced GIF's

WIMPY PARTS:
1.)	All resolutions (1-8 Bit per pixel) are turned into 8 bit per pixel 	DIB's. This gets really wasteful for 1-4 bit images. So you can fix 	it if you want.

2.)	No provisions for local color maps or graphic extensions.

3.)	doesn't check to see if the file is really a gif ( my application 	screens the files before they get here, so I didn't think about it).

BOOL GIFEncode(const char* FName,LPSTR lpDIB);
Give it a path/filename( extension .GIF), and a locked pointer to a DIB, and it will make the GIF file for you.

WIMPY PARTS:
1.)	No interlaced support.(but I'll bet you could use the interlaced 	table routine from the 	GIFDECOD.C file, and modify the "Get_Byte" 	routine to do it)

2.)	Again, no local color map or extensions

??IMPROVEMENTS??
One of you LZW wizards could probably get rid of some of those duplicate global variables and static functions

Add support for the 89A stuff

Pack the bits in 1-4 BPP images

Implement interlaced saves.

If anybody wants to share their improved code (or criticize mine), you can contact me here
John Walsh CompuServe ID 70612,1740

