Add FITS files indexing support to database
This commit is contained in:
+18
-1
@@ -127,7 +127,7 @@ bool loadRAW(QString path, ImageInfoData &info, RawImage **image)
|
||||
return true;
|
||||
}
|
||||
|
||||
void loadFITSHeader(fitsfile *file, ImageInfoData &info)
|
||||
int loadFITSHeader(fitsfile *file, ImageInfoData &info)
|
||||
{
|
||||
int nexist;
|
||||
int status = 0;
|
||||
@@ -159,7 +159,12 @@ void loadFITSHeader(fitsfile *file, ImageInfoData &info)
|
||||
status = 0;
|
||||
info.fitsHeader.append({key, var, comm});
|
||||
}
|
||||
else
|
||||
{
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
bool loadFITS(QString path, ImageInfoData &info, RawImage **image)
|
||||
@@ -350,3 +355,15 @@ void LoadRunable::run()
|
||||
|
||||
QMetaObject::invokeMethod(m_receiver, "imageLoaded", Qt::QueuedConnection, Q_ARG(void*, rawImage), Q_ARG(ImageInfoData, info));
|
||||
}
|
||||
|
||||
bool readFITSHeader(const QString &path, ImageInfoData &info)
|
||||
{
|
||||
fitsfile *fr;
|
||||
int status = 0;
|
||||
fits_open_diskfile(&fr, path.toLocal8Bit().data(), READONLY, &status);
|
||||
|
||||
status = loadFITSHeader(fr, info);
|
||||
|
||||
fits_close_file(fr, &status);
|
||||
return status == 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user