Issue #25: MinGW compilation fix

This commit is contained in:
Jakub Melka
2022-09-11 17:54:11 +02:00
parent 825fe59420
commit 8ffc4f9189
35 changed files with 160 additions and 140 deletions

View File

@@ -48,4 +48,8 @@ add_executable(PdfTool
target_link_libraries(PdfTool PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Xml)
if(MINGW)
target_link_libraries(PdfTool PRIVATE ole32 sapi)
endif()
install(TARGETS PdfTool)

View File

@@ -258,7 +258,8 @@ PDFToolAbstractApplication::Options PDFToolFetchImages::getOptionsFlags() const
void PDFToolFetchImages::onImageExtracted(pdf::PDFInteger pageIndex, pdf::PDFInteger order, const QImage& image)
{
QCryptographicHash hasher(QCryptographicHash::Sha512);
hasher.addData(reinterpret_cast<const char*>(image.bits()), image.sizeInBytes());
QByteArrayView imageData(image.bits(), image.sizeInBytes());
hasher.addData(imageData);
QByteArray hash = hasher.result();
QMutexLocker lock(&m_mutex);

View File

@@ -155,7 +155,7 @@ int PDFToolInfoApplication::execute(const PDFToolOptions& options)
{
QString key = QString::fromLatin1(item.first);
QVariant valueVariant = item.second;
QString value = (valueVariant.type() == QVariant::DateTime) ? convertDateTimeToString(valueVariant.toDateTime().toLocalTime(), options.outputDateFormat) : valueVariant.toString();
QString value = (valueVariant.typeId() == QVariant::DateTime) ? convertDateTimeToString(valueVariant.toDateTime().toLocalTime(), options.outputDateFormat) : valueVariant.toString();
writeProperty("custom-property", key, value);
}
}

View File

@@ -19,6 +19,7 @@
#include "pdffont.h"
#include "pdfconstants.h"
#include <QColorSpace>
#include <QElapsedTimer>
namespace pdftool
@@ -185,7 +186,7 @@ int PDFToolRenderBase::execute(const PDFToolOptions& options)
surfaceFormat = QSurfaceFormat::defaultFormat();
surfaceFormat.setProfile(QSurfaceFormat::CoreProfile);
surfaceFormat.setSamples(options.renderMSAAsamples);
surfaceFormat.setColorSpace(QSurfaceFormat::sRGBColorSpace);
surfaceFormat.setColorSpace(QColorSpace(QColorSpace::SRgb));
surfaceFormat.setSwapBehavior(QSurfaceFormat::DefaultSwapBehavior);
}