Commit 87d2fe15 authored by Volker Krause's avatar Volker Krause
Browse files

Extract full page raster images in PDFs as well

This is expensive, but we only get documents here the user explicitly
opened, so there is a high chance those contain anything useful.

Fixes importing Danish COVID certificates.
parent 4f565eac
Pipeline #135790 passed with stage
in 1 minute and 15 seconds
......@@ -20,6 +20,7 @@
#include "tripgroupmanager.h"
#include <itinerary_version_detailed.h>
#include <kitinerary_version.h>
#include <KItinerary/CreativeWork>
#include <KItinerary/DocumentUtil>
#include <KItinerary/ExtractorCapabilities>
......@@ -379,6 +380,11 @@ void ApplicationController::importData(const QByteArray &data, const QString &fi
using namespace KItinerary;
ExtractorEngine engine;
#if KITINERARY_VERSION >= QT_VERSION_CHECK(5, 19, 41)
// user opened the file, so we can be reasonably sure they assume it contains
// relevant content, so try expensive extraction methods too
engine.setHints(ExtractorEngine::ExtractFullPageRasterImages);
#endif
engine.setContextDate(QDateTime(QDate::currentDate(), QTime(0, 0)));
engine.setData(data, fileName);
const auto resIds = m_resMgr->importReservations(JsonLdDocument::fromJson(engine.extract()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment