Updating FITS header
This commit is contained in:
+7
-2
@@ -350,7 +350,7 @@ bool File::modifyFITSRecords(const FITSRecordModify *modify)
|
||||
_fitsKeywordsLoaded = false;
|
||||
_fitsKeywords.clear();
|
||||
|
||||
if(QRegularExpression("fits?", QRegularExpression::CaseInsensitiveOption).match(suffix()).hasMatch())
|
||||
if(QRegularExpression("(fits?|fz|fts)", QRegularExpression::CaseInsensitiveOption).match(suffix()).hasMatch())
|
||||
{
|
||||
fitsfile *file;
|
||||
int status = 0;
|
||||
@@ -472,7 +472,7 @@ bool File::modifyFITSRecords(const FITSRecordModify *modify)
|
||||
|
||||
return status == 0;
|
||||
}
|
||||
else if(suffix() == "xisf")
|
||||
else if(suffix().toLower() == "xisf")
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -493,6 +493,11 @@ bool File::modifyFITSRecords(const FITSRecordModify *modify)
|
||||
modifyXISF.save(out.absoluteFilePath().toLocal8Bit().toStdString());
|
||||
modifyXISF.close();
|
||||
std::filesystem::rename(out.filesystemAbsoluteFilePath(), in.filesystemAbsoluteFilePath());
|
||||
return true;
|
||||
}
|
||||
catch(std::filesystem::filesystem_error &err)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
catch(LibXISF::Error &err)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user