BOOL val = FALSE; CString theFormat = "image/"; if(!extension) return val; theFormat += &extension[1]; if (theFormat.CompareNoCase(IMAGE_GIF) == 0) val = TRUE; else if (theFormat.CompareNoCase(IMAGE_JPG) == 0) val = TRUE; else if (theFormat.CompareNoCase(IMAGE_PJPG) == 0) val = TRUE; else if (theFormat.CompareNoCase(IMAGE_PPM) == 0) val = TRUE; else if (theFormat.CompareNoCase(IMAGE_PNG) == 0) val = TRUE; else if (theFormat.CompareNoCase(IMAGE_XBM) == 0) val = TRUE; else if (theFormat.CompareNoCase(IMAGE_XBM2) == 0) val = TRUE; else if (theFormat.CompareNoCase(IMAGE_XBM3) == 0) val = TRUE; return val;
CPtrList* allHelpers = &(CHelperApp::m_cplHelpers);  for (POSITION pos = allHelpers->GetHeadPosition(); pos != NULL;) { CHelperApp* app = (CHelperApp*)allHelpers->GetNext(pos); CString helperMime(app->cd_item->ci.type);  if (IsImageMimeType(helperMime)) { if (app->cd_item->num_exts > 0) { for (int i = 0; i < app->cd_item->num_exts; i++) { CString extString(app->cd_item->exts[i]); if (extString == &extension[1]) return TRUE; } } } } return FALSE;
static BOOL ValidNSBitmapFormat(char* extension){	BOOL val = FALSE;	CString theFormat = "image/";	if(!extension)		return val;	theFormat += &extension[1];	if (theFormat.CompareNoCase(IMAGE_GIF) == 0)		val = TRUE;	else if (theFormat.CompareNoCase(IMAGE_JPG) == 0)		val = TRUE;	else if (theFormat.CompareNoCase(IMAGE_PJPG) == 0)		val = TRUE;	else if (theFormat.CompareNoCase(IMAGE_PPM) == 0)		val = TRUE;	else if (theFormat.CompareNoCase(IMAGE_PNG) == 0)		val = TRUE;	else if (theFormat.CompareNoCase(IMAGE_XBM) == 0)		val = TRUE;	else if (theFormat.CompareNoCase(IMAGE_XBM2) == 0)		val = TRUE;	else if (theFormat.CompareNoCase(IMAGE_XBM3) == 0)		val = TRUE;	return val;}