[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [okular] [Bug 374133] Okular no longer  opens comic book format
From:       Wolfgang Bauer <bugzilla_noreply () kde ! org>
Date:       2017-01-27 11:27:47
Message-ID: bug-374133-17878-ef6lkkQmm3 () http ! bugs ! kde ! org/
[Download RAW message or body]

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

--- Comment #11 from Wolfgang Bauer <wbauer@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 watching all bug changes.=
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic