epubx.dart icon indicating copy to clipboard operation
epubx.dart copied to clipboard

Exception thrown reading certain epub files

Open getBoolean opened this issue 4 years ago • 4 comments

This is different from #3. I have tested the file they linked and it does not throw an exception.

Describe the bug The method ChapterReader.getChaptersImpl is throwing an exception because it can't find the key in the html map

I have identified the cause in ChapterReader.getChaptersImpl (line 34)

if (!bookRef.Content!.Html!.containsKey(contentFileName))

Where: contentFileName is "../Text/Section00001.xhtml" but the actual key in bookRef.Content!.Html! is "Text/Section00001.xhtml"

So it throws the exception

To Reproduce Steps to reproduce the behavior:

  1. Open this epub
  2. See error thrown when trying to get chapters with the chapter reader (specifically with epub_view's EpubView widget)

Screenshots

getBoolean avatar Nov 29 '21 17:11 getBoolean

I made an issue at https://github.com/rbcprolabs/packages.flutter/issues/237, but that was before I found the core cause.

getBoolean avatar Nov 29 '21 17:11 getBoolean

What solution did you find?

petersephrin avatar Jul 04 '22 07:07 petersephrin

Did you get solution?

shinkhantmaung avatar Sep 03 '22 17:09 shinkhantmaung

@petersephrin @shinkhantmaung no i haven’t. The only solution right now is to write your own library or fork it and fix the bugs yourself.

I’m working on my own library but its a long way from completion, and I’ve been too busy to work on it recently.

getBoolean avatar Sep 03 '22 22:09 getBoolean