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

[EBook Thumb] Percent-decode image href URL

The href may contain percent-encoded characters (e.g. spaces),
decode these properly.
parent 8df88175
......@@ -24,6 +24,7 @@
#include <QImage>
#include <QMap>
#include <QMimeDatabase>
#include <QUrl>
#include <QXmlStreamReader>
#include <KZip>
......@@ -207,6 +208,10 @@ bool EbookCreator::createEpub(const QString &path, QImage &image)
return false;
}
// Decode percent encoded URL
QByteArray encoded = itemHrefs[coverId].toUtf8();
coverHref = QUrl::fromPercentEncoding(encoded);
// Make coverHref relative to OPF location
const int lastOpfSlash = opfPath.lastIndexOf(QLatin1Char('/'));
if (lastOpfSlash > -1) {
......
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