From f35db9d1afcacc4325c3b28553359e361e05b37d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Poizl?= Date: Sun, 24 Mar 2024 18:39:46 +0100 Subject: [PATCH] Small fixes --- loadrunable.cpp | 8 +++++--- rawimage.cpp | 2 +- rawimage.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/loadrunable.cpp b/loadrunable.cpp index 91ce336..0eb0dbd 100644 --- a/loadrunable.cpp +++ b/loadrunable.cpp @@ -190,8 +190,10 @@ bool loadFITS(const QString path, ImageInfoData &info, std::shared_ptr { fitsfile *file; int status = 0; - int type; - fits_open_image(&file, path.toLocal8Bit().data(), READONLY, &status); + int type = -1; + fits_open_diskfile(&file, path.toLocal8Bit().data(), READONLY, &status); + int hudtype = IMAGE_HDU; + fits_movabs_hdu(file, 1, &hudtype, &status); fits_get_hdu_type(file, &type, &status); if(type == IMAGE_HDU) @@ -423,7 +425,7 @@ void LoadRunable::run() } catch(std::exception e) { - qDebug() << e.what(); + qDebug() << m_file << e.what(); } } diff --git a/rawimage.cpp b/rawimage.cpp index c35e08c..7af32aa 100644 --- a/rawimage.cpp +++ b/rawimage.cpp @@ -120,7 +120,7 @@ RawImage::RawImage(const QImage &img) m_stats.m_stats = false; } -const RawImage::Stats& RawImage::imageStats() +const RawImage::Stats& RawImage::imageStats() const { return m_stats; } diff --git a/rawimage.h b/rawimage.h index 518ec01..9707f76 100644 --- a/rawimage.h +++ b/rawimage.h @@ -78,7 +78,7 @@ public: RawImage(const RawImage &d); RawImage(RawImage &&d); RawImage(const QImage &img); - const RawImage::Stats& imageStats(); + const RawImage::Stats& imageStats() const; void calcStats(); void rect(int &x, int &y, int w, int h, std::vector &r) const; int findPeaks(double background, double distance, std::vector &peaks) const;