Commit 5d0bc126 authored by Stefan Brüns's avatar Stefan Brüns
Browse files

[EBook Thumb] Add support for EPUB 3 compliant cover images

While EPUB 2 references the cover image id from the metadata element,
EPUB 3 just marks the cover-image item with a property.
parent e5b7ba0c
......@@ -168,6 +168,13 @@ bool EbookCreator::createEpub(const QString &path, QImage &image)
const QString href = attributes.value(QStringLiteral("href")).toString();
const QString id = attributes.value(QStringLiteral("id")).toString();
if (!id.isEmpty() && !href.isEmpty()) {
// EPUB 3 has the "cover-image" property set
const auto properties = attributes.value(QStringLiteral("properties")).toString();
const auto propertyList = properties.split(QChar(' '), Qt::SkipEmptyParts);
if (propertyList.contains(QLatin1String("cover-image"))) {
coverHref = href;
itemHrefs[id] = href;
} else {
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