Skip to content

Error opening file /tmp/xreader-33417/Las_profecias_de_Nostradamus-Nostradamus.epubFNR2I3/Siglo%201.xhtml: No such file or directory #698

Closed

Description

@alfema-esp

Distribution

Linux Mint Cinnamon 22.1

Package version

4.2.6

Frequency

Always

Bug description

Error opening file /tmp/xreader-33417/Las_profecias_de_Nostradamus-Nostradamus.epubFNR2I3/Siglo%201.xhtml: No such file or directory
The file is called "Siglo 1.html" within the epub, although in the content.opf file it appears as "media-type="application/xhtml+xml"/>", perhaps the media-type is incorrect and should be different, or is xreader misinterpreting it?

However, Calibre's reader reads the epub file perfectly.

Steps to reproduce

Open the ebpub, advance to page 3.

Expected behavior

The page should display correctly.

Additional information

Renamo to epub, GitHub does not allow epub files.

Las_profecias_de_Nostradamus-Nostradamus.pdf

Activity

  1. casual-coffee commented on Jun 4, 2026

    @casual-coffee

    I tried reproducing your issue and had the same problem. The reason for this problem is the following:

    In the manifest tag of the content.opf file are items with the ids "Siglo_1.html" and "Siglo_2.html", which contain the content for the third and fourth page. The href attribute both contain an escaped space character (%20), which is required for it to be a valid uri, f.e. href="Siglo%201.html". The problem is, that currently escaped characters are not unescaped after reading them from the content.opf file and thus, as we can see in the error message, xreader tries to open the file at .../Siglo%201.xhtml. This file does not exist, because the file name is actually .../Siglo 1.xhtml.

    Proposal for solving the problem

    A quick fix for me was adding the following line in epub-document.c, which uses the function g_uri_unescape_string() from GLib:

    static GList*
    setup_document_content_list(const gchar* content_uri, GError** error,gchar *documentdir)
    {
        ...
                GString* absolutepath = g_string_new(documentdir);
                gchar *relativepath = (gchar*)xml_get_data_from_node(itemptr,XML_ATTRIBUTE,(xmlChar*)"href");
                
                // replace percent-encoded characters with unescaped characters
                relativepath = g_uri_unescape_string(relativepath, NULL);
    
                g_string_append_printf(absolutepath,"/%s",relativepath);
       ...
    }

    Maybe there is also a general better way to transform the href links to file path, because the current implementation seems a little strange to me, because the uri provided by href is interpreted as a relative path and later gets transformed from filename to uri again. I have no experience with GLib, but maybe there is a cleaner way for this.

  2. alfema-esp commented on Jun 6, 2026

    @alfema-esp
    Author

    @casual-coffee, thanks for your contribution, now we wait for them to accept your solution and update xreader in the repositories.

  3. clefebvre commented on Sep 4, 2026

    @clefebvre
    Member

    EPUB support was removed from Xreader and reimplemented in Xepub: https://github.com/xapp-project/xepub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions