Bug 225937 - Okular Cannot Open Gutenberg.org ePub
Summary: Okular Cannot Open Gutenberg.org ePub
Status: RESOLVED WORKSFORME
Alias: None
Product: okular
Classification: Applications
Component: EPub backend (show other bugs)
Version: 0.9.3
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-08 18:33 UTC by pupp_e_dog
Modified: 2011-03-16 20:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Alice in wonderland epub (78.91 KB, application/epub+zip)
2010-03-22 20:10 UTC, Ely
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pupp_e_dog 2010-02-08 18:33:25 UTC
Version:           0.9.3 (using 4.3.3 (KDE 4.3.3), Gentoo)
Compiler:          i686-pc-linux-gnu-gcc
OS:                Linux (i686) release 2.6.30-gentoo-r8

Okular reports "Error while opening the EPub document" when attempting to open ePub files from gutenberg.org.

This was first submitted to Project Gutenberg's maintainers as a possible problem with the format, but the response suggests there is an issue with how libepub in Okular handles xml namespaces (and possibly utf-8 character encoding):

---

Original Message to Project Gutenberg (gutenberg.org):

Hi,

I have been unable to open ePub files from Project Gutenberg in KDE's
reader, Okular (Linux system). While this may also be related to the
application, I found that the files I was trying to open would not
validate at http://threepress.org/document/epub-validate/, which could
be part of the issue.

In particular, the books I tried were #11, #164, #1115, and #2009.

All exhibited this error:

ERROR: pg1115.epub/1115/content.opf(12): date value
'2009-12-28T08:08:44.005468+00:00' is not valid, YYYY[-MM[-DD]] expected

Thanks!

---

Reply:

The reason is: libepub in okular does not understand namespaces in container.xml

But okular does not display utf-8 correctly either, so you woudn't enjoy your book even if worked. 

---

In particular, here is a snippet of container.xml in an ePub that works in Okular (from ePubbooks.com):

<?xml version="1.0" encoding="UTF-8"?>
<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0">
   <rootfiles>
      <rootfile full-path="OPS/epb.opf" media-type="application/oebps-package+xml"/>
   </rootfiles>
</container>

And here is one that does not work (from gutenberg.org) - Okular reports "Error while opening the EPub document" and does not display anything:

<?xml version='1.0' encoding='utf-8'?>
<ns0:container xmlns:ns0="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0">
  <ns0:rootfiles>
    <ns0:rootfile media-type="application/oebps-package+xml" full-path="2251/content.opf"/>
  </ns0:rootfiles>
</ns0:container>

---

Thanks!
Comment 1 Albert Astals Cid 2010-02-09 09:38:16 UTC
Can you please attach any of the failing documents?
Comment 2 Albert Astals Cid 2010-02-19 20:36:41 UTC
Ely?
Comment 3 Ely 2010-02-26 11:58:02 UTC
This issue reports 3 bugs
1) libepub not supporting container ns (fixed now in trunk)
2) Weird date format, should probably make the backend ignore dates it can't parse.
3) Lack of UTF8 support, here I really need a non working example to solve it, so if you can please provide one or at least a screen shot of what not working.
Are they talking on the metadata? or the html itself?
Comment 4 pupp_e_dog 2010-03-22 01:33:36 UTC
Sorry this sat for so long.  Here's a file that fails.  Thanks for looking into it!

--- On Fri, 2/26/10, Ely <elylevy@cs.huji.ac.il> wrote:

> From: Ely <elylevy@cs.huji.ac.il>
> Subject: [Bug 225937] Okular Cannot Open Gutenberg.org ePub
> To: pupp_e_dog@yahoo.com
> Date: Friday, February 26, 2010, 5:58 AM
> https://bugs.kde.org/show_bug.cgi?id=225937
> 
> 
> 
> 
> 
> --- Comment #3 from Ely <elylevy cs huji ac il> 
> 2010-02-26 11:58:02 ---
> This issue reports 3 bugs
> 1) libepub not supporting container ns (fixed now in
> trunk)
> 2) Weird date format, should probably make the backend
> ignore dates it can't
> parse.
> 3) Lack of UTF8 support, here I really need a non working
> example to solve it,
> so if you can please provide one or at least a screen shot
> of what not working.
> Are they talking on the metadata? or the html itself?
> 
> -- 
> Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.
>
Comment 5 Albert Astals Cid 2010-03-22 20:00:06 UTC
You did not attach any document to the bug.
Comment 6 Ely 2010-03-22 20:10:52 UTC
Created attachment 42187 [details]
Alice in wonderland epub
Comment 7 Ely 2010-03-22 20:11:42 UTC
It seems ok to me though, do you still have problem with trunk from ebook-tools?
Comment 8 Albert Astals Cid 2010-03-26 21:41:00 UTC
@Ely, if it works for you with ebook-tools trunk i'd just close this bug and release a new version of ebook-tools

Tell me if you don't have bug closing rights
Comment 9 Pino Toscano 2010-10-05 01:28:06 UTC
@pupp_e_dog:
can you still reproduce the issues with ebook-tools 0.2.x?
Comment 10 Albert Astals Cid 2011-03-16 20:40:38 UTC
Reopen if it fails with okular >= 4.6.1 and ebook-tools 0.2.x