MCPcopy Create free account
hub / github.com/DentonW/DevIL / ilIsValidFits

Function ilIsValidFits

DevIL/src-IL/src/il_fits.cpp:53–73  ·  view source on GitHub ↗

Checks if the file specified in FileName is a valid FITS file.

Source from the content-addressed store, hash-verified

51
52//! Checks if the file specified in FileName is a valid FITS file.
53ILboolean ilIsValidFits(ILconst_string FileName)
54{
55 ILHANDLE FitsFile;
56 ILboolean bFits = IL_FALSE;
57
58 if (!iCheckExtension(FileName, IL_TEXT("fits")) && !iCheckExtension(FileName, IL_TEXT("fit"))) {
59 ilSetError(IL_INVALID_EXTENSION);
60 return bFits;
61 }
62
63 FitsFile = iopenr(FileName);
64 if (FitsFile == NULL) {
65 ilSetError(IL_COULD_NOT_OPEN_FILE);
66 return bFits;
67 }
68
69 bFits = ilIsValidFitsF(FitsFile);
70 icloser(FitsFile);
71
72 return bFits;
73}
74
75
76//! Checks if the ILHANDLE contains a valid FITS file at the current position.

Callers

nothing calls this directly

Calls 3

iCheckExtensionFunction · 0.85
ilSetErrorFunction · 0.85
ilIsValidFitsFFunction · 0.85

Tested by

no test coverage detected