[okular] [Bug 374133] Okular no longer opens comic book format

Wolfgang Bauer bugzilla_noreply at kde.org
Fri Jan 27 11:27:47 UTC 2017


https://bugs.kde.org/show_bug.cgi?id=374133

--- Comment #11 from Wolfgang Bauer <wbauer at tmo.at> ---
Actually I think this is a problem with karchive.

Okular opens the archive fine and sees all individual images. But opening them
with QImageReader fails.
OTOH, opening them with QImage::loadFromData(dev.data()->readAll()) works, i.e.
this patch "fixes" the problem:
diff --git a/generators/comicbook/document.cpp b/generators/comicbook/document
.cpp
index 34c4cb5..6798606 100644
--- a/generators/comicbook/document.cpp
+++ b/generators/comicbook/document.cpp
@@ -184,11 +184,12 @@ void Document::pages( QVector<Okular::Page*> *
pagesVector )

         if ( ! dev.isNull() ) {
             reader.setDevice( dev.data() );
-            if ( reader.canRead() )
+            if ( 1 )
             {
-                QSize pageSize = reader.size();
+                QSize pageSize;
                 if ( !pageSize.isValid() ) {
-                    const QImage i = reader.read();
+                    QImage i;
+                    i.loadFromData(dev.data()->readAll());
                     if ( !i.isNull() )
                         pageSize = i.size();
                 }


I suspect it's related to KCompressionDevice::seek(). readAll() does not use
seek() of course, but QImageReader does.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Okular-devel mailing list