Update LibXISF

This commit is contained in:
2023-03-09 18:35:38 +01:00
parent 1ce4f95f53
commit a9783f6030
3 changed files with 12 additions and 12 deletions
+6 -6
View File
@@ -20,10 +20,10 @@ FITSRecord::FITSRecord(const QByteArray &key, const QVariant &value, const QByte
FITSRecord::FITSRecord(const LibXISF::FITSKeyword &record) FITSRecord::FITSRecord(const LibXISF::FITSKeyword &record)
{ {
key = record.name.toUtf8(); key = record.name.c_str();
comment = record.comment.toUtf8(); comment = record.comment.c_str();
QString string = record.value; QString string = record.value.c_str();
if(string.startsWith('\'') && string.endsWith('\'')) if(string.startsWith('\'') && string.endsWith('\''))
{ {
string.chop(1); string.chop(1);
@@ -45,9 +45,9 @@ FITSRecord::FITSRecord(const LibXISF::FITSKeyword &record)
FITSRecord::FITSRecord(const LibXISF::Property &property) FITSRecord::FITSRecord(const LibXISF::Property &property)
{ {
key = property.id.toUtf8(); key = property.id.c_str();
value = property.value; value = QString::fromStdString(property.value.toString());
comment = property.comment.toUtf8(); comment = property.comment.c_str();
} }
QByteArray FITSRecord::valueToByteArray() const QByteArray FITSRecord::valueToByteArray() const
+1 -1
Submodule libXISF updated: 2107d68e71...e1fe893e2a
+5 -5
View File
@@ -290,7 +290,7 @@ bool loadXISF(const QString &path, ImageInfoData &info, RawImage **image)
try try
{ {
LibXISF::XISFReader xisf; LibXISF::XISFReader xisf;
xisf.open(path); xisf.open(path.toLocal8Bit().data());
const LibXISF::Image &xisfImage = xisf.getImage(0); const LibXISF::Image &xisfImage = xisf.getImage(0);
@@ -527,7 +527,7 @@ bool readXISFHeader(const QString &path, ImageInfoData &info)
try try
{ {
LibXISF::XISFReader xisf; LibXISF::XISFReader xisf;
xisf.open(path); xisf.open(path.toLocal8Bit().data());
const LibXISF::Image &image = xisf.getImage(0, false); const LibXISF::Image &image = xisf.getImage(0, false);
auto fitskeywords = image.fitsKeywords(); auto fitskeywords = image.fitsKeywords();
@@ -660,13 +660,13 @@ void ConvertRunable::run()
for(auto &record : imageinfo.fitsHeader) for(auto &record : imageinfo.fitsHeader)
{ {
if(record.value.type() == QVariant::Bool) if(record.value.type() == QVariant::Bool)
image.addFITSKeyword({record.key, record.value.toBool() ? "T" : "F", record.comment}); image.addFITSKeyword({record.key.toStdString(), record.value.toBool() ? "T" : "F", record.comment.toStdString()});
else else
image.addFITSKeyword({record.key, record.value.toString(), record.comment}); image.addFITSKeyword({record.key.toStdString(), record.value.toString().toStdString(), record.comment.toStdString()});
} }
xisf.writeImage(image); xisf.writeImage(image);
xisf.save(m_outfile); xisf.save(m_outfile.toLocal8Bit().data());
} }
catch(LibXISF::Error &err) catch(LibXISF::Error &err)
{ {