A file Importer plug-in enables you to write import filters for file formats not supported by SPIP. Images or curves read by file importer plug-ins will be handled in the same way as files read by SPIP's internal file importers and you will for example be able to browse the file in the ImageMet Explorer using thumbnail view.
To create a Microsoft Visual Studio 2005 C++ File Importer project click
Plug-ins > Programming Tools > Project Creator and select Visual Studio 2005 C++ File Importer as Project Type:
When the project has been generated you will be asked if you want to open it and you may find it convenient to do so. Otherwise, you may later open its solution file (e.g., MyFileImporter.sln) in Visual Studio.
The Project is now ready to be build: In Visual Studio click Build > Build Solution and the resulting .dll file will be put into the SPIP\UserDLL\FileImport\ folder where it is automatically found by SPIP next time SPIP is started. Note, that File Importers should always be placed in the SPIP\PLug-ins\FileImport\ folder of the personal Documents directory. When opening the solution using a newer version of Visual Studio you will have the possibility to convert the solution to the newer format.
The important functions to have in mind when constructing a file importer plug-in are:
bool ImFileImport( wchar_t* FileName), which is the function SPIP will be looking for and call in case none of SPIP's own file importers are able to read the file.
bool ImFileImportFirstPriority( wchar_t* FileName) If you want to give your file importer first priority above the internal SPIP file importers you should call it ImFileImportFirstPriority instead of ImFileImport. If the file importer reads the file successfully no other file importers will be called.
void CSpipExchange::Add_ImageDataToInputList(char* pVal)
This function will add images to SPIP's internal list of images and curves found in the file. SPIP will check this list when the plug-in returns, so that they can be displayed in the SPIP program window or the ImageMet Explorer. Note, that an importer plug-in can this way return more images or curves from the same input file.