mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #25: MinGW compilation fix
This commit is contained in:
@@ -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)
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user