Use std::filesystem::path for XISF files
This commit is contained in:
+1
-1
Submodule libXISF updated: 7b70b6a081...de757840b3
+4
-2
@@ -253,7 +253,8 @@ bool loadXISF(const QString &path, ImageInfoData &info, std::shared_ptr<RawImage
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
LibXISF::XISFReader xisf;
|
LibXISF::XISFReader xisf;
|
||||||
xisf.open(path.toLocal8Bit().data());
|
QFileInfo fileInfo(path);
|
||||||
|
xisf.open(fileInfo.filesystemFilePath());
|
||||||
|
|
||||||
if(index >= (uint32_t)xisf.imagesCount())return false;
|
if(index >= (uint32_t)xisf.imagesCount())return false;
|
||||||
const LibXISF::Image &xisfImage = xisf.getImage(index);
|
const LibXISF::Image &xisfImage = xisf.getImage(index);
|
||||||
@@ -407,7 +408,8 @@ bool readXISFHeader(const QString &path, ImageInfoData &info)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
LibXISF::XISFReader xisf;
|
LibXISF::XISFReader xisf;
|
||||||
xisf.open(path2.toLocal8Bit().data());
|
QFileInfo fileInfo(path2);
|
||||||
|
xisf.open(fileInfo.filesystemFilePath());
|
||||||
const LibXISF::Image &image = xisf.getImage(0, false);
|
const LibXISF::Image &image = xisf.getImage(0, false);
|
||||||
|
|
||||||
auto fitskeywords = image.fitsKeywords();
|
auto fitskeywords = image.fitsKeywords();
|
||||||
|
|||||||
+2
-1
@@ -269,7 +269,8 @@ void ConvertRunable::run()
|
|||||||
image.setByteshuffling(true);
|
image.setByteshuffling(true);
|
||||||
|
|
||||||
xisf.writeImage(image);
|
xisf.writeImage(image);
|
||||||
xisf.save(m_outfile.toLocal8Bit().data());
|
QFileInfo fileInfo(makeUNCPath(m_outfile));
|
||||||
|
xisf.save(fileInfo.filesystemFilePath());
|
||||||
}
|
}
|
||||||
catch(LibXISF::Error &err)
|
catch(LibXISF::Error &err)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -825,9 +825,9 @@ bool File::modifyFITSRecords(const FITSRecordModify *modify)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
LibXISF::XISFModify modifyXISF;
|
LibXISF::XISFModify modifyXISF;
|
||||||
QString in = makeUNCPath(absoluteFilePath());
|
QFileInfo in(makeUNCPath(absoluteFilePath()));
|
||||||
QString out = in + "~";
|
QFileInfo out(in.absoluteFilePath() + "~");
|
||||||
modifyXISF.open(in.toLocal8Bit().data());
|
modifyXISF.open(in.filesystemFilePath());
|
||||||
qDebug() << "modify" << in << out;
|
qDebug() << "modify" << in << out;
|
||||||
|
|
||||||
for(auto &remove : modify->_remove)
|
for(auto &remove : modify->_remove)
|
||||||
@@ -842,9 +842,9 @@ bool File::modifyFITSRecords(const FITSRecordModify *modify)
|
|||||||
for(auto &property : modify->_property)
|
for(auto &property : modify->_property)
|
||||||
modifyXISF.updateProperty(modify->_imageIdx, property);
|
modifyXISF.updateProperty(modify->_imageIdx, property);
|
||||||
|
|
||||||
modifyXISF.save(out.toLocal8Bit().toStdString());
|
modifyXISF.save(out.filesystemFilePath());
|
||||||
modifyXISF.close();
|
modifyXISF.close();
|
||||||
std::filesystem::rename(out.toLocal8Bit().toStdString(), in.toLocal8Bit().toStdString());
|
std::filesystem::rename(out.filesystemFilePath(), in.filesystemFilePath());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch(std::filesystem::filesystem_error &err)
|
catch(std::filesystem::filesystem_error &err)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
#include "../src/rawimage.h"
|
#include "../src/rawimage.h"
|
||||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||||
#include "stb_image_write.h"
|
#include "stb_image_write.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user