From 0f08bfbcf090c03d4d246eb251be59bcde62b6cd Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 5 Oct 2010 22:41:06 +0000 Subject: [PATCH] check for the data pointer, not for the size this way we can load resources of 0 bytes (not much useful per-se, but at least we know they are actually existing in the epub archive) svn path=/trunk/KDE/kdegraphics/okular/; revision=1182899 --- generators/epub/converter.cpp | 2 +- generators/epub/epubdocument.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/epub/converter.cpp b/generators/epub/converter.cpp index a276db75d..7d5094558 100644 --- a/generators/epub/converter.cpp +++ b/generators/epub/converter.cpp @@ -190,7 +190,7 @@ QTextDocument* Converter::convert( const QString &fileName ) } else { // load missing resource char *data; int size = epub_get_data(mTextDocument->getEpub(), clink, &data); - if (size > 0) { + if (data) { _cursor->insertBlock(); // try to load as image and if not load as html diff --git a/generators/epub/epubdocument.cpp b/generators/epub/epubdocument.cpp index 8c85e4097..ae19f8aee 100644 --- a/generators/epub/epubdocument.cpp +++ b/generators/epub/epubdocument.cpp @@ -61,7 +61,7 @@ QVariant EpubDocument::loadResource(int type, const QUrl &name) QVariant resource; - if (size > 0) { + if (data) { switch(type) { case QTextDocument::ImageResource: resource.setValue(QImage::fromData((unsigned char *)data, size));