linuxmint / xreader

A generic Document Reader
GNU General Public License v2.0
217 stars 62 forks source link

broken navigation inside epub files #266

Open morton-f opened 5 years ago

morton-f commented 5 years ago

xreader 2.0.2 Cinnamon 4.0.6 Distro: Linux Mint 19.1 Tessa

When opening the epub file only the first page is displayed. It is impossible to turn pages with PgUp, PgDn, cursors or mouse.

To reproduce: Please try debian-handbook.epub freely available at https://debian-handbook.info/get/now/ This book has extensive menu for navigation which is not available in xreader. You can browse it continuously or navigate with index in FBReader and Bookworm. You can not browse or read any page by any means in xreader.

In context: Debian 9 blocks opening epub in the Document Viewer.

xreader fbreader bookworm

ghost commented 5 years ago

Navigation still works. Try Ctrl + PgUp/PgDn and look at the page counter. BUT...

RENDERING is broken. It doesn't display anything (displays only blank pages). I tried book from your link, and also several books from my library - it doesn't render anything.

Previous versions of Xreader worked properly (regarding rendering). If I try Xreader version 1.8.5 (from LM 19 Live disk) it displays book(s) properly, and navigation with mouse/keyboard works. Also 1.6.1 (from LM 18.3 Live disk) works. So, it's broken recently.

xreader

Now, about not displaying TOC (or "menu for navigation" as you call it):

In my experience, Xreader never was able to display anything but first level TOC entries. The book you provided (Debian Handbook) has only one FIRST level TOC entry, and Xreader can't display more than that - that's why you don't see the rest. If you try some other books (e.g. http://www.jutoh.com/bookv2/JutohBook.epub) you will see much more FIRST level entries and you can click on them. Of course, this version of Xreader (2.0.2) will display only blank pages.

So, my conclusion is:

  1. Navigation works.
  2. Rendering IS broken.
  3. Fact that it can display only first level TOC entries is not new, previous versions worked the same way. But it would be nice if that can be fixed, too.

Xreader 2.0.2 LM 19.1 Xfce

ghost commented 5 years ago

This is crazy...

First, I found out there are some EPUB books (in my library) that I can open with Xreader, and they are displayed correctly.

Second, for some of these books there are newer versions on the internet. If I download NEW version of the book and open it in Xreader, it displays only blank pages.

Third, even those new versions, if I opet as root, Xreader displays correctly! (So, even "Debian Handbook", if opened as root, is displayed correctly!)

Then I installed fresh LM 19.1 Xfce, in VirtualBox, and it displays "Debian Handbook" without problems!

So, it's (probably) not about Xreader, it's something with our computers.

tsjnachos117 commented 5 years ago

After playing with some alternate XDG_* variables (see here), I've discovered that xreader dislikes something with ~/.local/share/mime/mime.cache. IDK what exactly this file is for, but deleting it seemed to fix the bug. Do be warned: since I have no idea what this file does (hence me experimenting in an alternate XDG_DATA_HOME directory) I can't guarantee that this will have no negative effects. I plan on investigating this further.

tsjnachos117 commented 5 years ago

Update: I've discovered aformentioned the $XDG_DATA_HOME/mime/mime.cache file can be rebuilt with update-mime-database $XDG_DATA_HOME/mime, in case anyone deleted this file and needs to re-build it. That said, once I rebuilt it on my machine, the error returned. For now, I'm going to modify my *.desktop file, and simply load a non-default XDG_DATA_HOME variable. That won't fix the bug, but it should at least give me a usable workaround.

On that note, I'm guessing that the problem is with some third-party program setting some non-default mime type.

Since I have no idea these other files/directories are, I've decided to upload the entire directory, in hopes that someone who does know more will figure the bug out. See below.

mime.tar.gz

Piiit commented 5 years ago

I see the content correctly, just the TOC shows up only the two entries shown also in the screenshot of the OP. I use 2.0.2 on LM19.1 Cinnamon, btw....

brainchild0 commented 4 years ago

I also find that Xreader displays only top-level navigation entries in the TOC (index) pane, for open EPUB documents.

This issue is likely to affect many users, as nested navigation is not uncommon in ebooks.