Make it combilable with Qt 5.13 and older
This commit is contained in:
+7
-1
@@ -5,7 +5,6 @@
|
||||
#include <QFileInfo>
|
||||
#include <QPainter>
|
||||
#include <QElapsedTimer>
|
||||
#include <QColorSpace>
|
||||
#include <QDebug>
|
||||
#include <iostream>
|
||||
#include <libexif/exif-data.h>
|
||||
@@ -15,7 +14,10 @@
|
||||
#include "starfit.h"
|
||||
#include "wcslib/wcshdr.h"
|
||||
|
||||
#ifdef COLOR_MANAGMENT
|
||||
#include <QColorSpace>
|
||||
static pcl::ICCProfile sRgbIccProfile((void*)QColorSpace(QColorSpace::SRgb).iccProfile().data());
|
||||
#endif
|
||||
|
||||
LoadRunable::LoadRunable(const QString &file, Image *receiver, AnalyzeLevel level, bool thumbnail) :
|
||||
m_file(file),
|
||||
@@ -293,6 +295,7 @@ bool loadPCLImage(pcl::XISFReader &xisf, RawImage **image)
|
||||
xisf.ReadImage(pclImage);
|
||||
pclImage.Status().DisableInitialization();
|
||||
|
||||
#ifdef COLOR_MANAGMENT
|
||||
pcl::ICCProfile iccProfile = xisf.ReadICCProfile();
|
||||
if(iccProfile.IsProfile())
|
||||
{
|
||||
@@ -302,6 +305,7 @@ bool loadPCLImage(pcl::XISFReader &xisf, RawImage **image)
|
||||
iccTran.Add(sRgbIccProfile);
|
||||
iccTran >> pclImage;
|
||||
}
|
||||
#endif
|
||||
|
||||
int numChannels = pclImage.NumberOfChannels();
|
||||
cv::Mat cvImg[numChannels];
|
||||
@@ -401,8 +405,10 @@ void LoadRunable::run()
|
||||
else
|
||||
{
|
||||
QImage img(m_file);
|
||||
#ifdef COLOR_MANAGMENT
|
||||
if(img.colorSpace().isValid())
|
||||
img.convertToColorSpace(QColorSpace::SRgb);
|
||||
#endif
|
||||
|
||||
ExifData *exif = exif_data_new_from_file(m_file.toLocal8Bit().constData());
|
||||
info.info.append({QObject::tr("Width"), QString::number(img.width())});
|
||||
|
||||
Reference in New Issue
Block a user