char ext[5]; if (strlen(filename) != 0) { char *p = strrchr(filename, '.'); if (p != NULL) strcpy (ext, p+1); } strlwr(ext);  if ((strcmp(ext, "jpg") == 0) || (strcmp (ext, "jpeg") == 0)) return ResizeImage(OpenJPG(filename)); if (strcmp(ext, "bmp") == 0) return ResizeImage(OpenBMP(filename)); if (strcmp(ext, "png") == 0) return ResizeImage(OpenPNG(filename)); if ((strcmp (ext, "gif") == 0) || (strcmp (ext, "tmp") == 0)) { FileDisk file; if (!file.Open(filename, "rb")) return NULL; LC_IMAGE* image = ResizeImage(OpenGIF(&file)); file.Close(); return image; }    return NULL;
if (format != LC_IMAGE_GIF) return NULL; return OpenGIF(file);
LC_IMAGE* OpenImage(char* filename){	char ext[5];	if (strlen(filename) != 0)	{		char *p = strrchr(filename, '.');		if (p != NULL)			strcpy (ext, p+1);	}	strlwr(ext);	if ((strcmp(ext, "jpg") == 0) || (strcmp (ext, "jpeg") == 0))		return ResizeImage(OpenJPG(filename));	if (strcmp(ext, "bmp") == 0)		return ResizeImage(OpenBMP(filename));	if (strcmp(ext, "png") == 0)		return ResizeImage(OpenPNG(filename));	if ((strcmp (ext, "gif") == 0) || (strcmp (ext, "tmp") == 0))	{		FileDisk file;		if (!file.Open(filename, "rb"))			return NULL;		LC_IMAGE* image = ResizeImage(OpenGIF(&file));		file.Close();		return image;	}//	MessageBox (NULL, "Unknown File Format", "Error", MB_ICONSTOP);	return NULL;}